Пример #1
0
        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);
        }
Пример #2
0
 private byte[] Decrypt(byte[] data)
 {
     S4Crypto.Decrypt(data);
     return(S4Crypto.DecryptAES(data));
 }