byte[] bytes = LoadFileToMemory(file_to_load);
byte[] buffer = new byte[bytes.Length - 0x38];
byte[] keyBytes = new byte[] {
0x2a, 0x5f, 0xcb, 0x17, 0x91, 210, 0x2f, 0xb6, 2, 0x45, 0xb3, 0xd8, 0x36, 0x9e, 0xd0, 0xb2,
0xc2, 0x73, 0x71, 0x56, 0x3f, 0xbf, 0x1f, 60, 0x9e, 0xdf, 0x6b, 0x11, 130, 90, 0x5d, 10
};
byte[] destinationArray = new byte[0x10];
Array.Copy(bytes, 0x38, buffer, 0, buffer.Length);
Array.Copy(bytes, 0x24, destinationArray, 0, destinationArray.Length);
byte[] bytebuffer = AESDecrypt(buffer, keyBytes, destinationArray);
string input = "";
using (MemoryStream stream = new MemoryStream(bytebuffer))
{
using (InflaterInputStream stream2 = new InflaterInputStream(stream))
{
using (StreamReader reader = new StreamReader(stream2))
{
input = reader.ReadToEnd();
}
}
}
private static byte[] AESDecrypt(byte[] _encryptedData, byte[] _keyBytes, byte[] _iv)
{
RijndaelManaged managed = new RijndaelManaged
{
Mode = CipherMode.CBC,
Padding = PaddingMode.None,
IV = _iv,
KeySize = 0x80,
BlockSize = 0x80,
Key = _keyBytes
};
return managed.CreateDecryptor().TransformFinalBlock(_encryptedData, 0, _encryptedData.Length);
}