/[RomCheater]/trunk/RomCheater/Docking/MemorySearch/SearchPatcher.cs
ViewVC logotype

Diff of /trunk/RomCheater/Docking/MemorySearch/SearchPatcher.cs

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

revision 230 by william, Sat Jun 2 19:12:20 2012 UTC revision 239 by william, Sun Jun 3 12:51:40 2012 UTC
# Line 8  using System.Windows.Forms; Line 8  using System.Windows.Forms;
8  using RomCheater.Docking.MemorySearch;  using RomCheater.Docking.MemorySearch;
9  using System.Diagnostics;  using System.Diagnostics;
10  using RomCheater.Logging;  using RomCheater.Logging;
11    using Sojaner.MemoryScanner.MemoryProviers;
12    
13    
14  namespace RomCheater.Docking.MemorySearch  namespace RomCheater.Docking.MemorySearch
# Line 97  namespace RomCheater.Docking.MemorySearc Line 98  namespace RomCheater.Docking.MemorySearc
98          {          {
99              uint Address = txtAddress.ToUInt32();              uint Address = txtAddress.ToUInt32();
100    
101              Sojaner.MemoryScanner.ProcessMemoryReader reader = new Sojaner.MemoryScanner.ProcessMemoryReader();              GenericMemoryProvider provider = new GenericMemoryProvider(null, Process.GetProcessById(pid));
             reader.ReadProcess = Process.GetProcessById(pid);  
             if (reader.ReadProcess == null) { logger.Error.WriteLine("Could not attach to process: {0}", pid); return; }  
102              switch (DataType)              switch (DataType)
103              {              {
104                  case SearchDataTypes._8bits:                  case SearchDataTypes._8bits:
105                      if (Unsigned) { reader.PatchMemory(Address, txtValue.ToByte()); }                      if (Unsigned) { provider.PatchMemory(Address, txtValue.ToByte()); }
106                      else { reader.PatchMemory(Address, txtValue.ToSByte()); }                      else { provider.PatchMemory(Address, txtValue.ToSByte()); }
107                      break;                      break;
108                  case SearchDataTypes._16bits:                  case SearchDataTypes._16bits:
109                      if (Unsigned) { reader.PatchMemory(Address, txtValue.ToUInt16()); }                      if (Unsigned) { provider.PatchMemory(Address, txtValue.ToUInt16()); }
110                      else { reader.PatchMemory(Address, txtValue.ToInt16()); }                      else { provider.PatchMemory(Address, txtValue.ToInt16()); }
111                      break;                      break;
112                  case SearchDataTypes._32bits:                  case SearchDataTypes._32bits:
113                      if (Unsigned) { reader.PatchMemory(Address, txtValue.ToUInt32()); }                      if (Unsigned) { provider.PatchMemory(Address, txtValue.ToUInt32()); }
114                      else { reader.PatchMemory(Address, txtValue.ToInt32()); }                      else { provider.PatchMemory(Address, txtValue.ToInt32()); }
115                      break;                      break;
116                  case SearchDataTypes._64bits:                  case SearchDataTypes._64bits:
117                      if (Unsigned) { reader.PatchMemory(Address, txtValue.ToUInt64()); }                      if (Unsigned) { provider.PatchMemory(Address, txtValue.ToUInt64()); }
118                      else { reader.PatchMemory(Address, txtValue.ToInt64()); }                      else { provider.PatchMemory(Address, txtValue.ToInt64()); }
119                      break;                      break;
120              }              }
121              this.Close();              this.Close();

Legend:
Removed from v.230  
changed lines
  Added in v.239

  ViewVC Help
Powered by ViewVC 1.1.22