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

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

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

--- trunk/RomCheater/Docking/MemorySearch/ResultItemState.cs	2012/06/02 18:31:40	229
+++ trunk/RomCheater/Docking/MemorySearch/ResultItemState.cs	2012/06/03 12:54:18	240
@@ -6,6 +6,7 @@
 using System.IO;
 using System.Diagnostics;
 using RomCheater.Logging;
+using Sojaner.MemoryScanner.MemoryProviers;
 
 namespace RomCheater.Docking.MemorySearch
 {
@@ -61,10 +62,7 @@
         {
             uint Address = 0;
             Address = Convert.ToUInt32(this.Address, 16);
-            Sojaner.MemoryScanner.ProcessMemoryReader reader = new Sojaner.MemoryScanner.ProcessMemoryReader();
-            reader.ReadProcess = Process.GetProcessById(pid);
-            if (reader.ReadProcess == null) { logger.Error.WriteLine("Could not attach to process: {0}", pid); return; }
-            reader.OpenProcess();
+            GenericMemoryProvider provider = new GenericMemoryProvider(null, Process.GetProcessById(pid));
             int bytesReadSize;
             byte[] data;
             uint bytesToRead=0;
@@ -84,7 +82,7 @@
                     break;
             }
 
-            reader.ReadProcessMemory(Address, bytesToRead, out bytesReadSize, out data);
+            provider.ReadProcessMemory(Address, bytesToRead, out bytesReadSize, out data);
             MemoryStream ms = new MemoryStream(data);
             BinaryReader r_ms = new BinaryReader(ms);
            

 

  ViewVC Help
Powered by ViewVC 1.1.22