/[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

revision 471 by william, Mon Jun 3 07:13:44 2013 UTC revision 477 by william, Mon Jun 3 18:35:45 2013 UTC
# Line 20  namespace RomCheater.Docking Line 20  namespace RomCheater.Docking
20  {  {
21      public partial class FloatingPEViewer : DockContent,      public partial class FloatingPEViewer : DockContent,
22          IAcceptsPlugin<IConfigPlugin>,          IAcceptsPlugin<IConfigPlugin>,
23          IAcceptsProcess,          IAcceptsProcess<Process>,
24          IAcceptsProcessAndConfig,          IAcceptsProcessAndConfig,
25          IAcceptsPEData          IAcceptsPEData
26      {      {
27          public FloatingPEViewer() { InitializeComponent(); this.AcceptedPlugin = null; this.ProcessPID = 0; OnPEDataUpdated = null; }          public FloatingPEViewer() { InitializeComponent(); this.AcceptedPlugin = null; this.AcceptedProcess = null; OnPEDataUpdated = null; }
28          public FloatingPEViewer(IConfigPlugin config) : this() { this.AcceptedPlugin = config; }          public FloatingPEViewer(IConfigPlugin config) : this() { this.AcceptedPlugin = config; }
29          public FloatingPEViewer(IConfigPlugin config, int pid) : this() { this.AcceptedPlugin = config; this.ProcessPID = pid; }          public FloatingPEViewer(IConfigPlugin config, Process process) : this() { this.AcceptedPlugin = config; this.AcceptedProcess = process; }
30          #region IAcceptsProcess<Process> Members          #region IAcceptsProcess<Process> Members
31          private int _ProcessPID;          private Process _AcceptedProcess;
32          public int ProcessPID { get { return _ProcessPID; } set { _ProcessPID = value; UpdateProcessPID(value); } }          public Process AcceptedProcess { get { return _AcceptedProcess; } set { _AcceptedProcess = value; UpdateAcceptedProcess(value); } }
33          #endregion          #endregion
34          #region IAcceptsPlugin<IConfigPlugin> Members          #region IAcceptsPlugin<IConfigPlugin> Members
35          private IConfigPlugin _AcceptedPlugin;          private IConfigPlugin _AcceptedPlugin;
# Line 44  namespace RomCheater.Docking Line 44  namespace RomCheater.Docking
44          private void UpdateAcceptedPlugin(IConfigPlugin config)          private void UpdateAcceptedPlugin(IConfigPlugin config)
45          {          {
46          }          }
47          private void UpdateProcessPID(int pid)          private void UpdateAcceptedProcess(Process process)
48          {          {
49  #if USE_AUTOMATIC_MEMORY_SEARCH_RANGE && FORCE_USE_OF_MEMORYSIZECONSTANTS  #if USE_AUTOMATIC_MEMORY_SEARCH_RANGE && FORCE_USE_OF_MEMORYSIZECONSTANTS
50              logger.Warn.WriteLine("FloatingMemorySearcher.UpdateAcceptedProcessAndConfig(IConfigPlugin config, Process process):");              logger.Warn.WriteLine("FloatingMemorySearcher.UpdateAcceptedProcessAndConfig(IConfigPlugin config, Process process):");
# Line 58  namespace RomCheater.Docking Line 58  namespace RomCheater.Docking
58  #endif  #endif
59  #if USE_AUTOMATIC_MEMORY_SEARCH_RANGE && !FORCE_USE_OF_MEMORYSIZECONSTANTS  #if USE_AUTOMATIC_MEMORY_SEARCH_RANGE && !FORCE_USE_OF_MEMORYSIZECONSTANTS
60              //// code to automatically choose the best starting memory address and size              //// code to automatically choose the best starting memory address and size
61              if (ProcessPID != 0)              if (process != null)
62              {              {
63                  using (Process p = Process.GetProcessById(ProcessPID))                  string filename = process.MainModule.FileName;
64                  {                  //string filename = @"c:\Windows\notepad.exe";                
65                      string filename = p.MainModule.FileName;                  IPEDData peData = PEDataWrapper.GetPEData((IAcceptsProcessAndConfig)this);
66                      //string filename = @"c:\Windows\notepad.exe";                                  peprops.SelectedObject = peData;
67                      IPEDData peData = PEDataWrapper.GetPEData((IAcceptsProcessAndConfig)this);                  peprops.PropertySort = PropertySort.NoSort;
68                      peprops.SelectedObject = peData;                  if (OnPEDataUpdated != null)
69                      peprops.PropertySort = PropertySort.NoSort;                      if (peData != null)
70                      if (OnPEDataUpdated != null)                          OnPEDataUpdated(new PEViewerDataUpdatedEventArgs(this, peData));
                         if (peData != null)  
                             OnPEDataUpdated(new PEViewerDataUpdatedEventArgs(this, peData));  
                 }  
71              }              }
72              else              else
73              {              {

Legend:
Removed from v.471  
changed lines
  Added in v.477

  ViewVC Help
Powered by ViewVC 1.1.22