public static byte[] DecryptS4(byte[] data) { int realSize; byte[] buffer; using (var r = data.ToBinaryReader()) { realSize = r.ReadInt32(); buffer = r.ReadToEnd(); } S4Crypto.Decrypt(buffer, 0, 0); return(miniLzo.Decompress(buffer, realSize)); }
private byte[] Decrypt(byte[] data) { S4Crypto.SwapBytes(data); if (data.Length < 1048576) { data = miniLzo.Decompress(data, Length); } S4Crypto.DecryptCapped(data); var isX7 = Name.EndsWith(".x7", StringComparison.InvariantCultureIgnoreCase); if (Name.EndsWith(".lua", StringComparison.InvariantCultureIgnoreCase) || isX7) { S4Crypto.Decrypt(data); data = S4Crypto.DecryptAES(data); if (isX7) { data = S4Crypto.DecryptX7(data); } } return(data); }
private byte[] Decrypt(byte[] data) { S4Crypto.Decrypt(data); return(S4Crypto.DecryptAES(data)); }