public static byte[] EncryptSNA(byte[] levelFile) { var stream = new EncodedStream(levelFile); stream.Seek(4, SeekOrigin.Current); byte[] buff = new byte[stream.Length]; buff[0] = 0x79; buff[1] = 0xCC; buff[2] = 0xB5; buff[3] = 0x6A; stream.Read(buff, 4, (int)stream.Length - 4); return(buff); }
public static byte[] DecryptSNA(FileInfo levelFile, string suffix = "") { var stream = new EncodedStream(File.ReadAllBytes(levelFile.FullName + suffix)); stream.Seek(4, SeekOrigin.Current); byte[] buff = new byte[stream.Length]; buff[0] = 0x79; buff[1] = 0xCC; buff[2] = 0xB5; buff[3] = 0x6A; stream.Read(buff, 4, (int)stream.Length - 4); return(buff); }