private static void Main(string[] args) { if (args.Length > 0) { int lpdwProcessId; int windowThreadProcessId = (int)Program.GetWindowThreadProcessId(Program.GetForegroundWindow(), out lpdwProcessId); Process processById = Process.GetProcessById(lpdwProcessId); if (processById.ProcessName == "cmd") { Program.AttachConsole(processById.Id); } else { Program.AllocConsole(); } DXParser dxParser = new DXParser(args[0]); if (dxParser.checkForKey() != "") { dxParser.parseFile(); dxParser.exportArchive(); } Program.FreeConsole(); } else { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run((Form) new Form1()); } }
private void processFile(string filename) { this.statusLabel.Text = "Parsing..."; this.parser = new DXParser(filename); string str = this.parser.checkForKey(); if (!(str != "")) { return; } this.decryptKeyBox.Text = "0x" + str; this.entries = this.parser.parseFile(); if (this.entries != null) { this.buildFileList(this.entries); } this.statusLabel.Text = "Ready"; }