Compare commits

...

5 Commits
dev3 ... master

4 changed files with 15 additions and 15 deletions

View File

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

View File

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

View File

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

View File

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