using System; using System.IO; using System.Security.Cryptography; namespace Decode { class Program { static byte[] cryptoKey = new byte[] { 235, 7, 236, 58, 24, 225, 97, 102, 231, 1, 121, 12, 177, 145, 87, 200, 102, 85, 152, 73, 230, 203, 101, 169, 242, 213, 228, 219, 239, 157, 245, 156 }; static byte[] cryptoIV = new byte[] { 189, 23, 137, 56, 204, 241, 242, 118, 28, 89, 9, 198, 224, 111, 186, 125 }; static void Main(string[] args) { if ((args.Length < 1) || !File.Exists(args[0])) { Console.WriteLine("Usage: Decode "); Console.ReadKey(); return; } string fileName = args[0]; try { using (StreamReader reader = new StreamReader(fileName)) { if (reader.ReadLine().StartsWith(" rotate files if (File.Exists(fileName + ".bak")) File.Delete(fileName + ".bak"); File.Move(fileName, fileName + ".bak"); File.Move(fileName + ".plain", fileName); return; } else { Failed(fileName); return; } } catch (Exception) { Failed(fileName); return; } } static void Failed(string fileName) { if (File.Exists(fileName + ".plain")) { File.Delete(fileName + ".plain"); } Console.WriteLine(string.Format("Decoding file {0} failed.", fileName)); Console.ReadKey(); } } }