-
-
Save Pldare/ebf704c752a8d77ff9603d4adfe54083 to your computer and use it in GitHub Desktop.
using System; | |
using System.Security.Cryptography; | |
using System.IO; | |
using System.IO.Compression; | |
namespace Vroid | |
{ | |
class Vroiddec | |
{ | |
static void Main(string[] args) | |
{ | |
using (FileStream fs = new FileStream(args[0],FileMode.Open)) { | |
using (BinaryReader bs = new BinaryReader(fs)) { | |
int buff_size=(int)(fs.Length)-48; | |
RijndaelManaged rDel=new RijndaelManaged(); | |
rDel.IV=bs.ReadBytes(16); | |
rDel.Key=bs.ReadBytes(32); | |
rDel.Mode=CipherMode.CBC; | |
byte[] resultarray=rDel.CreateDecryptor().TransformFinalBlock(bs.ReadBytes(buff_size),0,buff_size); | |
using(MemoryStream ms =new MemoryStream(resultarray)){ | |
using(GZipStream gzs=new GZipStream(ms,CompressionMode.Decompress)){ | |
using(FileStream df=new FileStream(args[0]+".dec",FileMode.OpenOrCreate,FileAccess.Write)) | |
{ | |
int data; | |
while((data=gzs.ReadByte())!=-1) | |
{ | |
df.WriteByte((byte)data); | |
} | |
} | |
} | |
} | |
} | |
} | |
log_msg("Done!"); | |
} | |
static void log_msg(string msg) | |
{ | |
Console.WriteLine(msg); | |
} | |
} | |
} |
Just think this will be helpful? https://inside.pixiv.blog/2024/02/05/120000
now i get a decrypted .bin file. it seems that this .bin file contains a pmx model and its textures and meshes. but i cannnot read this file. hope somebody could give me some suggestions. https://github.com/TenjoinWai/symphony-miku
Just think this will be helpful? https://inside.pixiv.blog/2024/02/05/120000
now i get a decrypted .bin file. it seems that this .bin file contains a pmx model and its textures and meshes. but i cannnot read this file. hope somebody could give me some suggestions. https://github.com/TenjoinWai/symphony-miku
Have you ever found a way to use these models?
VRoid is now using ZSTD in place of GZIP. I wrote a Python script which handles the new decompression along with the decryption https://github.com/CetaceanNation/misc-scripts/blob/main/vroid-hub-downloader/vroid-hub-downloader.py#L52. If @Pldare completes their extraction code it would be nice to incorporate or at least add to my workflow.
Hi excuse me to reply to you too, but i wanted to know if there's a way to import the glb models downloaded with your script to Blender, or any program at all... With blender i keep getting that PIXIV texture error
hihihi Everyone I’m glad that everyone pays attention to this code of mine I share some json parsing methods of gltf models for everyone to facilitate extraction and error correction. get block info
import json import sys with open(sys.argv[1],encoding='utf-8') as f: data = json.load(f) for i in data.keys(): a=data[i] #print(type(a)) accessors = data["accessors"] buffer_views = data["bufferViews"] type_num_dict = {"SCALAR": 1, "VEC2": 2, "VEC3": 3, "VEC4": 4, "MAT4": 16} type_dict={ 5120: "BYTE", 5121: "UNSIGNED_BYTE", 5122: "SHORT", 5123: "UNSIGNED_SHORT", 5124: "INT", 5125: "UNSIGNED_INT", 5126: "FLOAT" } for accessor_index, accessor in enumerate(accessors): type_count = type_num_dict[accessor["type"]] #ct=accessor["componentType"] pos=buffer_views[accessor["bufferView"]]["byteOffset"] count=accessor["count"] ac=accessor["componentType"] print(accessor_index,count,type_dict[ac],type_count==1,pos)
get mesh info
print("mesh") for n, mesh in enumerate(data["meshes"]): #print(n,mesh.keys()) for j,primive in enumerate(mesh["primitives"]): #print(primive) if primive["mode"] != 4: raise "1" dbb=primive["indices"] print(dbb) va=primive["attributes"] print(va)
The id in meshinfo corresponds to the id in blockinfo I will provide the complete model extraction code later
Hi, is there any update about the complete model extraction code?
I checked the differences between the downloaded VRM and the VRM in the browser, and found that the vertex coordinate data had undergone some transformations
VRoid Hub obfuscates the mesh of the preview models. You can read more on this here: https://toon.link/blog/1740863435/borrowing-intellectual-property.
Nice post!
I checked the differences between the downloaded VRM and the VRM in the browser, and found that the vertex coordinate data had undergone some transformations
true dude, I hope this will shows how it works:
https://toon.link/blog/1740863435/borrowing-intellectual-property
Just think this will be helpful?
https://inside.pixiv.blog/2024/02/05/120000