using SHNDecrypt; using System; using System.Collections.Generic; using System.Data; using System.IO; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace EncryptionChange { class Program { static void Main(string[] args) { SHNFile SHN = new SHNFile(); Byte[] test = SHN.test11(String.Format("{0}/ItemInfo.shn", Environment.CurrentDirectory)); for (int i = 0; i < 255; i++) { for (int i1 = 0; i1 < 255; i1++) { for (int i2 = 0; i2 < 255; i2++) { for (int i3 = 0; i3 < 255; i3++) { byte[] test1 = (Byte[])test.Clone(); Decrypt(test1, 0, test1.Length, i, i1, i2, i3); if (Encoding.UTF8.GetString(test1, 3492, 12) != "LeatherBoots") { Console.WriteLine(i + " " + i1 + " " + i2 + " " + i3 + " - Nope"); } else { StreamWriter Writer = new StreamWriter(String.Format("{0}/Yes.txt", Environment.CurrentDirectory)); Writer.WriteLine(i + " " + i1 + " " + i2 + " " + i3); Writer.Close(); Console.WriteLine("Yep"); } } } } } Console.ReadLine(); } private static void Decrypt(byte[] data, int index, int length) { if (((index < 0) | (length < 1)) | ((index + length) > data.Length)) { throw new IndexOutOfRangeException(); } byte num = (byte)length; for (int i = length - 1; i >= 0; i--) { data[i] = (byte)(data[i] ^ num); byte num3 = (byte)i; num3 = (byte)(num3 & 15); num3 = (byte)(num3 + 0x55); num3 = (byte)(num3 ^ ((byte)(((byte)i) * 11))); num3 = (byte)(num3 ^ num); num3 = (byte)(num3 ^ 170); num = num3; } } private static void Decrypt(byte[] data, int index, int length, Int32 Value1, Int32 Value2, Int32 Value3, Int32 Value4) { if (((index < 0) | (length < 1)) | ((index + length) > data.Length)) { throw new IndexOutOfRangeException(); } byte num = (byte)length; for (int i = length - 1; i >= 0; i--) { data[i] = (byte)(data[i] ^ num); byte num3 = (byte)i; num3 = (byte)(num3 & Value1); num3 = (byte)(num3 + Value2); num3 = (byte)(num3 ^ ((byte)(((byte)i) * Value3))); num3 = (byte)(num3 ^ num); num3 = (byte)(num3 ^ Value4); num = num3; } } } }