/[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 587 by william, Thu Jun 6 09:12:35 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            IAcceptPEData,
26          IAcceptsPEData          IAcceptsPEData
27      {      {
28          public FloatingPEViewer() { InitializeComponent(); this.AcceptedPlugin = null; this.ProcessPID = 0; OnPEDataUpdated = null; }          public FloatingPEViewer() { InitializeComponent(); this.AcceptedPlugin = null; this.AcceptedProcess = null; OnPEDataUpdated = null; }
29          public FloatingPEViewer(IConfigPlugin config) : this() { this.AcceptedPlugin = config; }          public FloatingPEViewer(IConfigPlugin config) : this() { this.AcceptedPlugin = config; }
30          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; }
31          #region IAcceptsProcess<Process> Members          #region IAcceptsProcess<Process> Members
32          private int _ProcessPID;          private Process _AcceptedProcess;
33          public int ProcessPID { get { return _ProcessPID; } set { _ProcessPID = value; UpdateProcessPID(value); } }          public Process AcceptedProcess { get { return _AcceptedProcess; } set { _AcceptedProcess = value; UpdateAcceptedProcess(value); } }
34          #endregion          #endregion
35          #region IAcceptsPlugin<IConfigPlugin> Members          #region IAcceptsPlugin<IConfigPlugin> Members
36          private IConfigPlugin _AcceptedPlugin;          private IConfigPlugin _AcceptedPlugin;
# Line 38  namespace RomCheater.Docking Line 39  namespace RomCheater.Docking
39          #region IAcceptsPEData Members          #region IAcceptsPEData Members
40          public event BaseEventHandler<PEViewerDataUpdatedEventArgs> OnPEDataUpdated;          public event BaseEventHandler<PEViewerDataUpdatedEventArgs> OnPEDataUpdated;
41          #endregion          #endregion
42          uint MemoryRangeStart { get; set; }          ulong MemoryRangeStart { get; set; }
43          uint MemoryRangeSize { get; set; }          ulong MemoryRangeSize { get; set; }
44    
45          private void UpdateAcceptedPlugin(IConfigPlugin config)          private void UpdateAcceptedPlugin(IConfigPlugin config)
46          {          {
47          }          }
48          private void UpdateProcessPID(int pid)          private void UpdateAcceptedProcess(Process process)
49          {          {
50  #if USE_AUTOMATIC_MEMORY_SEARCH_RANGE && FORCE_USE_OF_MEMORYSIZECONSTANTS  #if USE_AUTOMATIC_MEMORY_SEARCH_RANGE && FORCE_USE_OF_MEMORYSIZECONSTANTS
51              logger.Warn.WriteLine("FloatingMemorySearcher.UpdateAcceptedProcessAndConfig(IConfigPlugin config, Process process):");              logger.Warn.WriteLine("FloatingMemorySearcher.UpdateAcceptedProcessAndConfig(IConfigPlugin config, Process process):");
# Line 58  namespace RomCheater.Docking Line 59  namespace RomCheater.Docking
59  #endif  #endif
60  #if USE_AUTOMATIC_MEMORY_SEARCH_RANGE && !FORCE_USE_OF_MEMORYSIZECONSTANTS  #if USE_AUTOMATIC_MEMORY_SEARCH_RANGE && !FORCE_USE_OF_MEMORYSIZECONSTANTS
61              //// code to automatically choose the best starting memory address and size              //// code to automatically choose the best starting memory address and size
62              if (ProcessPID != 0)              if (process != null)
63              {              {
64                  using (Process p = Process.GetProcessById(ProcessPID))                  string filename = process.MainModule.FileName;
65                  {                  //string filename = @"c:\Windows\notepad.exe";                
66                      string filename = p.MainModule.FileName;                  IPEDData peData = PEDataWrapper.GetPEData((IAcceptsProcessAndConfig)this);
67                      //string filename = @"c:\Windows\notepad.exe";                                  peprops.SelectedObject = peData;
68                      IPEDData peData = PEDataWrapper.GetPEData((IAcceptsProcessAndConfig)this);                  peprops.PropertySort = PropertySort.NoSort;
69                      peprops.SelectedObject = peData;                  if (OnPEDataUpdated != null)
70                      peprops.PropertySort = PropertySort.NoSort;                      if (peData != null)
71                      if (OnPEDataUpdated != null)                          OnPEDataUpdated(new PEViewerDataUpdatedEventArgs(this, peData));
                         if (peData != null)  
                             OnPEDataUpdated(new PEViewerDataUpdatedEventArgs(this, peData));  
                 }  
72              }              }
73              else              else
74              {              {

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

  ViewVC Help
Powered by ViewVC 1.1.22