/[RomCheater]/trunk/RomCheater/Docking/FloatingPEViewer.cs
ViewVC logotype

Diff of /trunk/RomCheater/Docking/FloatingPEViewer.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/RomCheater/Docking/FloatingPEViewer.cs	2012/06/05 17:57:37	318
+++ trunk/RomCheater/Docking/FloatingPEViewer.cs	2012/06/19 07:56:36	378
@@ -14,15 +14,17 @@
 using RomCheater.PluginFramework.Interfaces;
 using System.Diagnostics;
 using Sojaner.MemoryScanner;
+using RomCheater.PluginFramework.Events;
 
 namespace RomCheater.Docking
 {
     public partial class FloatingPEViewer : DockContent,
         IAcceptsPlugin<IConfigPlugin>,
         IAcceptsProcess<Process>,
-        IAcceptsProcessAndConfig
+        IAcceptsProcessAndConfig,
+        IAcceptsPEData
     {
-        public FloatingPEViewer() { InitializeComponent(); this.AcceptedPlugin = null; this.AcceptedProcess = null; }
+        public FloatingPEViewer() { InitializeComponent(); this.AcceptedPlugin = null; this.AcceptedProcess = null; OnPEDataUpdated = null; }
         public FloatingPEViewer(IConfigPlugin config) : this() { this.AcceptedPlugin = config; }
         public FloatingPEViewer(IConfigPlugin config, Process process) : this() { this.AcceptedPlugin = config; this.AcceptedProcess = process; }
         #region IAcceptsProcess<Process> Members
@@ -33,8 +35,10 @@
         private IConfigPlugin _AcceptedPlugin;
         public IConfigPlugin AcceptedPlugin { get { return _AcceptedPlugin; } set { _AcceptedPlugin = value; UpdateAcceptedPlugin(value); } }
         #endregion
-
-        int MemoryRangeStart { get; set; }
+        #region IAcceptsPEData Members
+        public event BaseEventHandler<PEViewerDataUpdatedEvent> OnPEDataUpdated;
+        #endregion
+        uint MemoryRangeStart { get; set; }
         uint MemoryRangeSize { get; set; }
 
         private void UpdateAcceptedPlugin(IConfigPlugin config)
@@ -57,10 +61,13 @@
             if (process != null)
             {
                 string filename = process.MainModule.FileName;
-                //string filename = @"c:\Windows\notepad.exe";
-                PEReader peReader = new PEReader(filename);
-                peprops.SelectedObject = peReader.GetData;
+                //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));
             }
             else
             {

 

  ViewVC Help
Powered by ViewVC 1.1.22