/[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 280 by william, Tue Jun 5 00:13:29 2012 UTC revision 281 by william, Tue Jun 5 00:19:36 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              provider.OpenProvider();              byte[] buffered_mem = new byte[0];
933              int bytes_read = 0;              try
934              byte[] buffered_mem = new byte[int.MaxValue];              {
935              provider.ReadProcessMemory(0, int.MaxValue, out bytes_read, out buffered_mem);                  provider.OpenProvider();
936              provider.CloseProvider();                  int bytes_read = 0;
937                    buffered_mem = new byte[int.MaxValue]; // throws OutOfMemoryException if size is over 2G
938                    provider.ReadProcessMemory(0, int.MaxValue, out bytes_read, out buffered_mem);
939                    provider.CloseProvider();
940                }
941                catch (OutOfMemoryException ex)
942                {
943                    throw ex;
944                }
945                catch (Exception ex)
946                {
947                    throw ex;
948                }
949              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; }
950              MemoryStream ms = new MemoryStream(buffered_mem);              MemoryStream ms = new MemoryStream(buffered_mem);
951              BinaryReader r_ms = new BinaryReader(ms);              BinaryReader r_ms = new BinaryReader(ms);

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

  ViewVC Help
Powered by ViewVC 1.1.22