ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/RomCheater/Docking/FloatingMemorySearcher.cs
(Generate patch)

Comparing trunk/RomCheater/Docking/FloatingMemorySearcher.cs (file contents):
Revision 241 by william, Sun Jun 3 12:48:09 2012 UTC vs.
Revision 242 by william, Sun Jun 3 13:04:02 2012 UTC

# Line 15 | Line 15 | using libWin32.Win32.Threading;
15   using System.Threading;
16   using RomCheater.Logging;
17   using System.IO;
18 + using Sojaner.MemoryScanner.MemoryProviers;
19  
20   namespace RomCheater.Docking
21   {
# Line 316 | Line 317 | namespace RomCheater.Docking
317                  ResultDataType _result = (ResultDataType)ResultItems[i].Tag;
318                  
319                  Address = Convert.ToUInt32(ResultItems[i].SubItems[col_Found_Address].Text, 16);
320 <                //r_ms.BaseStream.Seek(Address, SeekOrigin.Begin);
321 <                Sojaner.MemoryScanner.ProcessMemoryReader reader = new Sojaner.MemoryScanner.ProcessMemoryReader();
321 <                reader.ReadProcess = Process.GetProcessById(this.AcceptedProcess.Id);
322 <                if (reader.ReadProcess == null) { logger.Error.WriteLine("Could not attach to process: {0}", this.AcceptedProcess.Id); return; }
323 <                reader.OpenProcess();
320 >                //r_ms.BaseStream.Seek(Address, SeekOrigin.Begin);                
321 >                GenericMemoryProvider provider = new GenericMemoryProvider((IAcceptsProcessAndConfig)this);
322                  int bytesReadSize;
323 <                byte[] data;
323 >                byte[] data;    
324                  uint bytesToRead = 0;
325                  switch (_result.ValueType)
326                  {
# Line 339 | Line 337 | namespace RomCheater.Docking
337                          bytesToRead = 8;
338                          break;
339                  }
340 <                reader.ReadProcessMemory(Address, bytesToRead, out bytesReadSize, out data);
340 >                provider.ReadProcessMemory(Address, bytesToRead, out bytesReadSize, out data);
341                  MemoryStream ms = new MemoryStream(data);
342                  BinaryReader r_ms = new BinaryReader(ms);
343                  switch (_result.ValueType)
# Line 362 | Line 360 | namespace RomCheater.Docking
360                          break;
361                  }
362                  r_ms.Close();
365                reader.CloseHandle();
363                  Application.DoEvents();
364              }
365              #endregion
# Line 395 | Line 392 | namespace RomCheater.Docking
392                  uint Address = 0;
393                  ResultDataType _result = (ResultDataType)AddedItems[i].Tag;
394                  Address = Convert.ToUInt32(AddedItems[i].SubItems[col_Added_Address].Text, 16);
395 <                Sojaner.MemoryScanner.ProcessMemoryReader reader = new Sojaner.MemoryScanner.ProcessMemoryReader();
399 <                reader.ReadProcess = Process.GetProcessById(this.AcceptedProcess.Id);
400 <                if (reader.ReadProcess == null) { logger.Error.WriteLine("Could not attach to process: {0}", this.AcceptedProcess.Id); return; }
401 <                reader.OpenProcess();
395 >                GenericMemoryProvider provider = new GenericMemoryProvider((IAcceptsProcessAndConfig)this);
396                  int bytesReadSize;
397                  byte[] data;
398                  uint bytesToRead = 0;
# Line 417 | Line 411 | namespace RomCheater.Docking
411                          bytesToRead = 8;
412                          break;
413                  }
414 <                reader.ReadProcessMemory(Address, bytesToRead, out bytesReadSize, out data);
414 >                provider.ReadProcessMemory(Address, bytesToRead, out bytesReadSize, out data);
415                  MemoryStream ms = new MemoryStream(data);
416                  BinaryReader r_ms = new BinaryReader(ms);
417                  switch (_result.ValueType)
# Line 440 | Line 434 | namespace RomCheater.Docking
434                          break;
435                  }
436                  r_ms.Close();
443                reader.CloseHandle();
437                  Application.DoEvents();
438              }
439              #endregion

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines