--- trunk/RomCheater/Docking/UI/UIMemoryViewer.cs 2012/06/10 01:09:58 359 +++ trunk/RomCheater/Docking/UI/UIMemoryViewer.cs 2012/06/10 01:24:25 360 @@ -1,5 +1,5 @@ //#define DISABLE_GETFIRSTNONZEROBYTE_ONUPDATE_ACCEPTEDPROCESS // when defined will not call GetFirstNonZeroByte() when AcceptedProcess is updated and is not null -//#define DISABLE_GETFIRSTNONZERO_BYTE // when defined will make GetFirstNonZeroByte() an empty void method +#define DISABLE_GETFIRSTNONZERO_BYTE // when defined will make GetFirstNonZeroByte() an empty void method using System; using System.Collections.Generic; using System.ComponentModel; @@ -69,6 +69,8 @@ namespace RomCheater.Docking.UI provider.CloseProvider(); GotoAddress(addr); } +#else + this.GotoImageBase(); #endif } #region IBrowseMemoryRegion @@ -557,32 +559,32 @@ namespace RomCheater.Docking.UI //this.UpdateEnabled = reenable; //isScrolling = false; } - - private void btnGotoImageBase_Click(object sender, EventArgs e) - { + private void GotoImageBase() + { if (this.peData == null) return; object ImageBase = 0; - bool x86 = this.peData.Is32bitAssembly(); - logger.VerboseDebug.WriteLine("UIMemoryViewer::btnGotoImageBase_Click(0x{0:x8})", ImageBase); + bool x86 = this.peData.Is32bitAssembly(); if (x86) { ImageBase = this.peData.NTHeader.OptionalHeader32._ImageBase; uint ib = Convert.ToUInt32(ImageBase); - //logger.Debug.WriteLine("UIMemoryViewer::btnGotoImageBase_Click(0x{0:x8})", ib); + logger.VerboseDebug.WriteLine("UIMemoryViewer::GotoImageBase(0x{0:x8})", ib); txthexGoto.Value = ib; - btnGotoAddress.PerformClick(); } else { ImageBase = this.peData.NTHeader.OptionalHeader64._ImageBase; ulong ib = Convert.ToUInt64(ImageBase); + logger.VerboseDebug.WriteLine("UIMemoryViewer::GotoImageBase(0x{0:x16})", ib); txthexGoto.Value = (long)ib; - btnGotoAddress.PerformClick(); } - IntPtr lpBaseAddress = this.AcceptedProcess.MainModule.BaseAddress; - int BaseAddress = lpBaseAddress.ToInt32(); - txthexGoto.Value = BaseAddress; - btnGotoAddress.PerformClick(); + + this.GotoAddress(txthexGoto.ToInt32()); + } + private void btnGotoImageBase_Click(object sender, EventArgs e) + { + + this.GotoImageBase(); } } |