/[RomCheater]/trunk/Win32/Sojaner.MemoryScanner/MemoryProviers/BaseMemoryProvider.cs
ViewVC logotype

Diff of /trunk/Win32/Sojaner.MemoryScanner/MemoryProviers/BaseMemoryProvider.cs

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

revision 470 by william, Tue May 28 15:16:05 2013 UTC revision 471 by william, Mon Jun 3 07:13:44 2013 UTC
# Line 27  namespace Sojaner.MemoryScanner.MemoryPr Line 27  namespace Sojaner.MemoryScanner.MemoryPr
27      public abstract class BaseMemoryProvider :      public abstract class BaseMemoryProvider :
28          IPatchMemory,          IPatchMemory,
29          IReadMemory,          IReadMemory,
30          IAcceptsProcess<Process>,          IAcceptsProcess,
31          IAcceptsPlugin<IConfigPlugin>,          IAcceptsPlugin<IConfigPlugin>,
32          IMemoryReader,          IMemoryReader,
33          IMemoryWriter,          IMemoryWriter,
# Line 36  namespace Sojaner.MemoryScanner.MemoryPr Line 36  namespace Sojaner.MemoryScanner.MemoryPr
36          IAcceptsBytesReadEvent          IAcceptsBytesReadEvent
37      {      {
38          private ProcessMemoryReader provider;          private ProcessMemoryReader provider;
39          public BaseMemoryProvider() { this.AcceptedPlugin = null; this.AcceptedProcess = null; isClosed = true; isOpen = false; }          public BaseMemoryProvider() { this.AcceptedPlugin = null; this.ProcessPID = 0; isClosed = true; isOpen = false; }
40          public BaseMemoryProvider(IConfigPlugin config) : this() { this.AcceptedPlugin = config; }          public BaseMemoryProvider(IConfigPlugin config) : this() { this.AcceptedPlugin = config; }
41          public BaseMemoryProvider(IConfigPlugin config, Process process) : this() { this.AcceptedPlugin = config; this.AcceptedProcess = process; }          public BaseMemoryProvider(IConfigPlugin config, int pid) : this() { this.AcceptedPlugin = config; this.ProcessPID = pid; }
42          public BaseMemoryProvider(IAcceptsProcessAndConfig pconfig) : this() { this.AcceptedPlugin = pconfig.AcceptedPlugin; this.AcceptedProcess = pconfig.AcceptedProcess; }          public BaseMemoryProvider(IAcceptsProcessAndConfig pconfig) : this() { this.AcceptedPlugin = pconfig.AcceptedPlugin; this.ProcessPID = pconfig.ProcessPID; }
43    
44    
45          public event BaseEventHandler<OnBytesReadEventArgs> OnBytesRead;          public event BaseEventHandler<OnBytesReadEventArgs> OnBytesRead;
# Line 65  namespace Sojaner.MemoryScanner.MemoryPr Line 65  namespace Sojaner.MemoryScanner.MemoryPr
65              try              try
66              {              {
67                  provider = new ProcessMemoryReader();                  provider = new ProcessMemoryReader();
68                  provider.ReadProcess = this.AcceptedProcess;                  provider.ProcessPID = this.ProcessPID;
69                  provider.OnBytesRead += new BaseEventHandler<OnBytesReadEventArgs>(provider_OnBytesRead);                  provider.OnBytesRead += new BaseEventHandler<OnBytesReadEventArgs>(provider_OnBytesRead);
70                  if (provider.ReadProcess == null) { logger.Error.WriteLine("{0}.OpenProvider() Could not attach to process: {1}", "", this.GetType().Name, this.AcceptedProcess.ToString()); return; }                  if (provider.ProcessPID == 0) { logger.Error.WriteLine("{0}.OpenProvider() Could not attach to process: {1}", "", this.GetType().Name, this.ProcessPID.ToString()); return; }
71                  //provider.OpenProcess();                  //provider.OpenProcess();
72                  isOpen = true;                  isOpen = true;
73                  isClosed = false;                  isClosed = false;
# Line 121  namespace Sojaner.MemoryScanner.MemoryPr Line 121  namespace Sojaner.MemoryScanner.MemoryPr
121          #endregion          #endregion
122    
123          #region  IAcceptsProcess<Process> Members          #region  IAcceptsProcess<Process> Members
124          public Process AcceptedProcess { get; set; }          public int ProcessPID { get; set; }
125          #endregion          #endregion
126          #region IAcceptsPlugin<IConfigPlugin> Members          #region IAcceptsPlugin<IConfigPlugin> Members
127          public IConfigPlugin AcceptedPlugin { get; set; }          public IConfigPlugin AcceptedPlugin { get; set; }

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

  ViewVC Help
Powered by ViewVC 1.1.22