Compare commits

..

No commits in common. "master" and "dev3" have entirely different histories.
master ... dev3

4 changed files with 15 additions and 15 deletions

View File

@ -21,9 +21,8 @@
- minitool3 - minitool3
这个程序是设计来解密DMM/FANZA游戏 あいりすミスティリア(R)的加密封包,只需要拖拽*.encrypted文件到程序上运行即可解密的文件会保存在dec文件夹下 这个程序是设计来解密DMM游戏 あいりすミスティリアR的加密封包只需要拖拽*.encrypted文件到程序上运行即可解密的文件会保存在dec文件夹下
提取出的assets文件... 看上面两条吧 提取出的assets文件... 看上面两条吧
注: 只简单测试了Windows、Android、Web R18版本与Android 全年龄版本的.encrypted封包文件 注: 我只测试了PC和Android平台R18版本的封包文件网页版没测试看到wasm就丢进回收站了
web版wasm有点感人我是从Android版开搞的😂

View File

@ -28,29 +28,30 @@ namespace minitool3
{ {
byte[] fileData = File.ReadAllBytes(filePath); byte[] fileData = File.ReadAllBytes(filePath);
if (fileData.Length < 16) if (fileData.Length < 20) // 4 bytes (size) + 16 bytes (IV)
{ {
Console.WriteLine("The file does not contain enough data."); Console.WriteLine("The file does not contain enough data for size and IV.");
continue; continue;
} }
// Read the encrypted data & iv size (4 bytes)* // Read the encrypted data & iv size (4 bytes)
int encryptedSize = BitConverter.ToInt32(fileData, 0); int encryptedSize = BitConverter.ToInt32(fileData, 0);
int sp = 4;
if (fileData.Length - 4 != encryptedSize) //*某些情况下头部不带长度 if (encryptedSize <= 0 || encryptedSize > fileData.Length - 4)
{ {
sp = 0; Console.WriteLine("Invalid encrypted data size.");
encryptedSize = fileData.Length; continue;
} }
encryptedSize -= 16; encryptedSize -= 16;
// Read the IV (16 bytes) // Read the IV (16 bytes)
byte[] iv = new byte[16]; byte[] iv = new byte[16];
Array.Copy(fileData, sp, iv, 0, 16); Array.Copy(fileData, 4, iv, 0, 16);
// Read the ciphertext based on the size // Read the ciphertext based on the size
byte[] cipherText = new byte[encryptedSize]; byte[] cipherText = new byte[encryptedSize];
Array.Copy(fileData, 16 + sp, cipherText, 0, encryptedSize); Array.Copy(fileData, 20, cipherText, 0, encryptedSize);
byte[] decryptedData = Decrypt(cipherText, SHA256Byte, iv); byte[] decryptedData = Decrypt(cipherText, SHA256Byte, iv);
@ -87,7 +88,7 @@ namespace minitool3
aes.Key = sha256Key; aes.Key = sha256Key;
aes.IV = iv; aes.IV = iv;
aes.Mode = CipherMode.CBC; aes.Mode = CipherMode.CBC;
aes.Padding = PaddingMode.None; aes.Padding = PaddingMode.PKCS7;
using var decryptor = aes.CreateDecryptor(); using var decryptor = aes.CreateDecryptor();
using var memoryStream = new MemoryStream(cipherText); using var memoryStream = new MemoryStream(cipherText);

View File

@ -2,7 +2,7 @@
"profiles": { "profiles": {
"minitool3": { "minitool3": {
"commandName": "Project", "commandName": "Project",
"commandLineArgs": "\"G:\\source\\minitool1\\minitool3\\bin\\Release\\net8.0\\publish\\win-x64\\jp.co.dmm.dmmgames.imys_r\\files\\assetbundles\\characters\\tati\\020g2.encrypted\"" "commandLineArgs": "\"G:\\source\\minitool1\\minitool3\\bin\\Debug\\net8.0\\bg_avg_003.jp.encrypted\""
} }
} }
} }

View File

@ -1,6 +1,6 @@
*.encrypted文件结构 *.encrypted文件结构
(D) (D)
4B: enc data + iv size 这4B可能没有 4B: enc data + iv size
16B: iv 16B: iv
{data size}B: enc data(AES256 encryption) {data size}B: enc data(AES256 encryption)