/[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

--- trunk/RomCheater/Docking/FloatingMemorySearcher.cs	2012/06/05 00:19:36	281
+++ trunk/RomCheater/Docking/FloatingMemorySearcher.cs	2012/06/05 01:19:54	282
@@ -929,23 +929,13 @@
             int STEP_SIZE = (int)SearchArgs.DataType / 8;
 
             GenericMemoryProvider provider = new GenericMemoryProvider((IAcceptsProcessAndConfig)this);
-            byte[] buffered_mem = new byte[0];
-            try
-            {
-                provider.OpenProvider();
-                int bytes_read = 0;
-                buffered_mem = new byte[int.MaxValue]; // throws OutOfMemoryException if size is over 2G
-                provider.ReadProcessMemory(0, int.MaxValue, out bytes_read, out buffered_mem);
-                provider.CloseProvider();
-            }
-            catch (OutOfMemoryException ex)
-            {
-                throw ex;
-            }
-            catch (Exception ex)
-            {
-                throw ex;
-            }
+            provider.OpenProvider();
+            int bytes_read = 0;
+
+            byte[] buffered_mem = new byte[MemorySizeConstants.MaximumAddress]; // throws OutOfMemoryException if size is over 2G
+            provider.ReadProcessMemory(MemorySizeConstants.MinimumAddress, MemorySizeConstants.MaximumAddress, out bytes_read, out buffered_mem);
+            provider.CloseProvider();
+       
             if (buffered_mem.Length == 0) { logger.Warn.WriteLine("Buffered Memory is Zero Length."); return; }
             MemoryStream ms = new MemoryStream(buffered_mem);
             BinaryReader r_ms = new BinaryReader(ms);

 

  ViewVC Help
Powered by ViewVC 1.1.22