private void MIBack_Click(object sender, RoutedEventArgs e) { StartAddress = privousAddress.Pop(); AddDisasmItem(); LVMain.SelectedIndex = 0; LVMain.ScrollIntoView(List[0]); }
private void MenuItem_Click_9(object sender, RoutedEventArgs e) { int address = (int)MIFollow.Tag; privousAddress.Push(StartAddress); StartAddress = address; AddDisasmItem(); LVMain.SelectedIndex = 0; LVMain.ScrollIntoView(List[0]); }
private void MenuItem_Click_8(object sender, RoutedEventArgs e) { if (PVZ.Game != null) { string symbol = DarkStyle.InputDialog.ShowInputDialog( Lang.IsChinese ? "定义符号" : "Define symbols", Lang.IsChinese ? "输入一个符号用于定位地址" : "Enter a symbol to locate the address", null, !Lang.IsChinese); if (symbol == null) { return; } if (!string.IsNullOrWhiteSpace(symbol)) { symbol = symbol.Trim(); if (symbols.ContainsKey(symbol)) { if (MessageBox.Show( Lang.IsChinese ? $"符号{symbol}已经定义,确认要覆盖地址吗" : $"{symbol} already defined,Are you sure you want to overwrite the address", Lang.IsChinese ? "提问" : "Question", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes) { symbols[symbol] = PVZ.Memory.AllocMemory(); privousAddress.Push(StartAddress); StartAddress = symbols[symbol]; AddDisasmItem(); LVMain.SelectedIndex = 0; LVMain.ScrollIntoView(_list[0]); } } else { symbols.Add(symbol, PVZ.Memory.AllocMemory()); privousAddress.Push(StartAddress); StartAddress = symbols[symbol]; AddDisasmItem(); LVMain.SelectedIndex = 0; LVMain.ScrollIntoView(_list[0]); } } else { if (Lang.IsChinese) { MessageBox.Show("符号无效", "错误", MessageBoxButton.OK, MessageBoxImage.Error); } else { MessageBox.Show("Invalid symbol", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } } } }
private void MenuItem_Click(object sender, RoutedEventArgs e) { if (_list.Count > 0) { string result = DarkStyle.InputDialog.ShowInputDialog( Lang.IsChinese ? "转到地址" : "Go to address", Lang.IsChinese ? "输入要跳转到的地址" : "Enter the address to jump to", _list[0].Address, !Lang.IsChinese); if (result == null) { return; } if (symbols.ContainsKey(result)) { privousAddress.Push(StartAddress); StartAddress = symbols[result]; AddDisasmItem(); LVMain.SelectedIndex = 0; LVMain.ScrollIntoView(_list[0]); } else { try { privousAddress.Push(StartAddress); if (result.StartsWith("0x") || result.StartsWith("0X")) { StartAddress = Convert.ToInt32(result.Substring(2), 16); } else { StartAddress = Convert.ToInt32(result, 16); } AddDisasmItem(); LVMain.SelectedIndex = 0; LVMain.ScrollIntoView(_list[0]); } catch { if (Lang.IsChinese) { MessageBox.Show("地址不合法", "错误", MessageBoxButton.OK, MessageBoxImage.Error); } else { MessageBox.Show("Invaild address", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } } } } }
private void MenuItem_Click_8(object sender, RoutedEventArgs e) { if (PVZ.Game != null) { string symbol = DarkStyle.InputDialog.ShowInputDialog("定义符号", "输入一个符号用于定位地址"); if (symbol == null) { return; } if (!string.IsNullOrWhiteSpace(symbol)) { symbol = symbol.Trim(); if (symbols.ContainsKey(symbol)) { if (MessageBox.Show($"符号{symbol}已经定义,确认要覆盖地址吗", "提问", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes) { symbols[symbol] = PVZ.Memory.AllocMemory(); privousAddress.Push(StartAddress); StartAddress = symbols[symbol]; AddDisasmItem(); LVMain.SelectedIndex = 0; LVMain.ScrollIntoView(List[0]); } } else { symbols.Add(symbol, PVZ.Memory.AllocMemory()); privousAddress.Push(StartAddress); StartAddress = symbols[symbol]; AddDisasmItem(); LVMain.SelectedIndex = 0; LVMain.ScrollIntoView(List[0]); } } else { MessageBox.Show("符号无效", "错误", MessageBoxButton.OK, MessageBoxImage.Error); } } }