--- trunk/RomCheater/Docking/FloatingPEViewer.cs 2012/06/07 17:44:20 325 +++ trunk/RomCheater/Docking/FloatingPEViewer.cs 2013/06/06 09:12:35 587 @@ -22,6 +22,7 @@ IAcceptsPlugin, IAcceptsProcess, IAcceptsProcessAndConfig, + IAcceptPEData, IAcceptsPEData { public FloatingPEViewer() { InitializeComponent(); this.AcceptedPlugin = null; this.AcceptedProcess = null; OnPEDataUpdated = null; } @@ -36,10 +37,10 @@ public IConfigPlugin AcceptedPlugin { get { return _AcceptedPlugin; } set { _AcceptedPlugin = value; UpdateAcceptedPlugin(value); } } #endregion #region IAcceptsPEData Members - public event BaseEventHandler OnPEDataUpdated; + public event BaseEventHandler OnPEDataUpdated; #endregion - int MemoryRangeStart { get; set; } - uint MemoryRangeSize { get; set; } + ulong MemoryRangeStart { get; set; } + ulong MemoryRangeSize { get; set; } private void UpdateAcceptedPlugin(IConfigPlugin config) { @@ -54,26 +55,25 @@ #if FORCE_USE_OF_MEMORYSIZECONSTANTS // force use of MemorySizeConstants MemoryRangeStart = MemorySizeConstants.MinimumAddress; - MemoryRangeSizee = (MemorySizeConstants.MinimumAddress > 0) ? (uint)(MemorySizeConstants.MaximumAddress - MemorySizeConstants.MinimumAddress) : MemorySizeConstants.MaximumAddress; + MemoryRangeSize = MemoryRangeStart + MemorySizeConstants.MaximumAddressSize; #endif #if USE_AUTOMATIC_MEMORY_SEARCH_RANGE && !FORCE_USE_OF_MEMORYSIZECONSTANTS //// code to automatically choose the best starting memory address and size if (process != null) { string filename = process.MainModule.FileName; - //string filename = @"c:\Windows\notepad.exe"; - PEReader peReader = new PEReader(filename); - PEReader.PEData peData = peReader.GetPEData; + //string filename = @"c:\Windows\notepad.exe"; + IPEDData peData = PEDataWrapper.GetPEData((IAcceptsProcessAndConfig)this); peprops.SelectedObject = peData; peprops.PropertySort = PropertySort.NoSort; if (OnPEDataUpdated != null) if (peData != null) - OnPEDataUpdated(new PEViewerDataUpdatedEvent(this, peData)); + OnPEDataUpdated(new PEViewerDataUpdatedEventArgs(this, peData)); } else { MemoryRangeStart = MemorySizeConstants.MinimumAddress; - MemoryRangeSize = (MemorySizeConstants.MinimumAddress > 0) ? (uint)(MemorySizeConstants.MaximumAddress - MemorySizeConstants.MinimumAddress) : MemorySizeConstants.MaximumAddress; + MemoryRangeSize = MemorySizeConstants.MaximumAddressSize; } #endif