private void Decompile(object sender, RoutedEventArgs e) { decompileMode = 1; string msgLine = ""; string movementLine = ""; string romCode = GetROMCode(); //逆コンパイル実行 List <int> list = new List <int>(); List <int> msg = new List <int>(); List <int> movement = new List <int>(); location = CheckOffset.Listing(location, txtDecompileOffset.Text); textEditor.Text = string.Join(Environment.NewLine, DecompileScript.DecompileCommand(selectedROMPath, location, list, msg, movement)); msg = msg.Distinct().ToList(); foreach (int locationChar in msg) { msgLine += "\n" + string.Join(Environment.NewLine, DecompileChar.DecompileMSG(selectedROMPath, locationChar)); } movement = movement.Distinct().ToList(); foreach (int locationMovement in movement) { movementLine += "\n" + string.Join(Environment.NewLine, DecompileMovement.DecompileCommand(selectedROMPath, locationMovement, romCode)); } textEditor.Text += msgLine + movementLine; }
public MainWindow() { InitializeComponent(); //外部プロセスから引数を受け取る string[] Commands = Environment.GetCommandLineArgs(); for (int i = 1; i < Commands.Length; i++) { string msgLine = ""; string movementLine = ""; if (i == 1) { //ファイル取得 selectedROMPath = string.Format("{1}", i, Commands[i]); FilePath.Text = selectedROMPath; txtDecompileOffset.IsEnabled = true; Decompilebtn.IsEnabled = true; CMDbtn.IsEnabled = true; BINbtn.IsEnabled = true; ASMbtn.IsEnabled = true; Compilebtn.IsEnabled = true; } else if (i == 2) { txtDecompileOffset.Text = string.Format("0x{1}", i, Commands[i]); decompileMode = 1; string romCode = GetROMCode(); //逆コンパイル実行 List <int> list = new List <int>(); List <int> msg = new List <int>(); List <int> movement = new List <int>(); location = CheckOffset.Listing(location, txtDecompileOffset.Text); textEditor.Text = string.Join(Environment.NewLine, DecompileScript.DecompileCommand(selectedROMPath, location, list, msg, movement)); msg = msg.Distinct().ToList(); foreach (int locationChar in msg) { msgLine += "\n" + string.Join(Environment.NewLine, DecompileChar.DecompileMSG(selectedROMPath, locationChar)); } movement = movement.Distinct().ToList(); foreach (int locationMovement in movement) { movementLine += "\n" + string.Join(Environment.NewLine, DecompileMovement.DecompileCommand(selectedROMPath, locationMovement, romCode)); } textEditor.Text += msgLine + movementLine; } } }