/[RomCheater]/trunk/RomCheater/Docking/FloatingMemorySearcher.cs
ViewVC logotype

Diff of /trunk/RomCheater/Docking/FloatingMemorySearcher.cs

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

revision 281 by william, Tue Jun 5 00:19:36 2012 UTC revision 282 by william, Tue Jun 5 01:19:54 2012 UTC
# Line 929  namespace RomCheater.Docking Line 929  namespace RomCheater.Docking
929              int STEP_SIZE = (int)SearchArgs.DataType / 8;              int STEP_SIZE = (int)SearchArgs.DataType / 8;
930    
931              GenericMemoryProvider provider = new GenericMemoryProvider((IAcceptsProcessAndConfig)this);              GenericMemoryProvider provider = new GenericMemoryProvider((IAcceptsProcessAndConfig)this);
932              byte[] buffered_mem = new byte[0];              provider.OpenProvider();
933              try              int bytes_read = 0;
934              {  
935                  provider.OpenProvider();              byte[] buffered_mem = new byte[MemorySizeConstants.MaximumAddress]; // throws OutOfMemoryException if size is over 2G
936                  int bytes_read = 0;              provider.ReadProcessMemory(MemorySizeConstants.MinimumAddress, MemorySizeConstants.MaximumAddress, out bytes_read, out buffered_mem);
937                  buffered_mem = new byte[int.MaxValue]; // throws OutOfMemoryException if size is over 2G              provider.CloseProvider();
938                  provider.ReadProcessMemory(0, int.MaxValue, out bytes_read, out buffered_mem);        
                 provider.CloseProvider();  
             }  
             catch (OutOfMemoryException ex)  
             {  
                 throw ex;  
             }  
             catch (Exception ex)  
             {  
                 throw ex;  
             }  
939              if (buffered_mem.Length == 0) { logger.Warn.WriteLine("Buffered Memory is Zero Length."); return; }              if (buffered_mem.Length == 0) { logger.Warn.WriteLine("Buffered Memory is Zero Length."); return; }
940              MemoryStream ms = new MemoryStream(buffered_mem);              MemoryStream ms = new MemoryStream(buffered_mem);
941              BinaryReader r_ms = new BinaryReader(ms);              BinaryReader r_ms = new BinaryReader(ms);

Legend:
Removed from v.281  
changed lines
  Added in v.282

  ViewVC Help
Powered by ViewVC 1.1.22