/[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/09 21:46:37	354
+++ trunk/RomCheater/Docking/FloatingMemorySearcher.cs	2012/06/09 21:52:44	355
@@ -994,8 +994,9 @@
             e.Result = st;
             //List<ResultType<object>> tmp_Results = new List<ResultType<object>>();
             List<ResultType<object>> second_tmp_Results = new List<ResultType<object>>();
-            const double _UPDATE_DELAY = 1024.0;
-            int UPDATE_DELAY = (int)(_UPDATE_DELAY / 1000);
+            //const double _UPDATE_DELAY = 1024.0;
+            ////int UPDATE_DELAY = (int)(_UPDATE_DELAY / 1000);
+            //int UPDATE_DELAY = 1;
             //tmp_Results = SearchArgs.Results.GetRange(0,SearchArgs.Results.Count);
             //SearchArgs.Results = null;
             //SearchArgs.Results.Clear();
@@ -1008,23 +1009,7 @@
             int bytes_read = 0;
 
             byte[] buffered_mem = new byte[MemoryRangeSize]; // throws OutOfMemoryException if size is over 2G
-
-
-            provider.ReadProcessMemoryAtOnce(MemoryRangeStart, MemoryRangeSize, out bytes_read, out buffered_mem);
-            //uint buffer_size = 1024;
-            //List<byte> buffer_bytes = new List<byte>();
-            //for (uint i = (uint)MemoryRangeStart; i < MemoryRangeSize; )
-            //{
-            //    byte[] _buffer = new byte[buffer_size];
-            //    provider.ReadProcessMemory((int)i, buffer_size, out bytes_read, out _buffer);
-            //    foreach (byte b in _buffer)
-            //    {
-            //        buffer_bytes.Add(b);
-            //    }
-            //    i += buffer_size;
-            //}
-            //buffered_mem = buffer_bytes.ToArray();
-          
+            provider.ReadProcessMemoryAtOnce(MemoryRangeStart, MemoryRangeSize, out bytes_read, out buffered_mem);         
             provider.CloseProvider();
        
             if (buffered_mem.Length == 0) { logger.Warn.WriteLine("Buffered Memory is Zero Length."); return; }
@@ -1061,13 +1046,13 @@
                     SearchArgs.Results.Add(_tmp_result);
                     double double_percent_done = 100.0 * (double)((double)i / (double)r_ms.BaseStream.Length);
                     int int_percent_done = (int)double_percent_done;
-                    if ((i / UPDATE_DELAY) == (int)(i / UPDATE_DELAY) && int_percent_done != Last_Whole_Percent_Done)
-                    {
-                        resultsprogress.Value = int_percent_done;
-                        resultsprogress.Message = string.Format(" -> Reading Address: 0x{0:x8}", i);
-                        Last_Whole_Percent_Done = int_percent_done;
-                        Application.DoEvents();
-                    }
+                    //if ((i / UPDATE_DELAY) == (int)(i / UPDATE_DELAY) && int_percent_done != Last_Whole_Percent_Done)
+                    //{
+                    resultsprogress.Value = int_percent_done;
+                    resultsprogress.Message = string.Format(" -> Reading Address: 0x{0:x8}", i);
+                    Last_Whole_Percent_Done = int_percent_done;
+                    Application.DoEvents();
+                    //}
 
                     if (SearchWorkerThread.CancellationPending == true)
                     {
@@ -1324,13 +1309,13 @@
 
                         double double_percent_done = 100.0 * (double)((double)i / (double)SearchArgs.Results.Count);
                         int int_percent_done = (int)double_percent_done;
-                        if ((i / UPDATE_DELAY) == (int)(i / UPDATE_DELAY) && int_percent_done != Last_Whole_Percent_Done)
-                        {
-                            resultsprogress.Value = int_percent_done;
-                            resultsprogress.Message = string.Format(" -> Reading Address: 0x{0:x8}", i);
-                            Last_Whole_Percent_Done = int_percent_done;
-                            Application.DoEvents();
-                        }
+                        //if ((i / UPDATE_DELAY) == (int)(i / UPDATE_DELAY) && int_percent_done != Last_Whole_Percent_Done)
+                        //{
+                        resultsprogress.Value = int_percent_done;
+                        resultsprogress.Message = string.Format(" -> Reading Address: 0x{0:x8}", i);
+                        Last_Whole_Percent_Done = int_percent_done;
+                        Application.DoEvents();
+                        //}
 
                     }
                     #endregion
@@ -1372,13 +1357,13 @@
                         }
                         double double_percent_done = 100.0 * (double)((double)i / (double)SearchArgs.Results.Count);
                         int int_percent_done = (int)double_percent_done;
-                        if ((i / UPDATE_DELAY) == (int)(i / UPDATE_DELAY) && int_percent_done != Last_Whole_Percent_Done)
-                        {
-                            resultsprogress.Value = int_percent_done;
-                            resultsprogress.Message = string.Format(" -> Reading Address: 0x{0:x8}", i);
-                            Last_Whole_Percent_Done = int_percent_done;
-                            Application.DoEvents();
-                        }
+                        //if ((i / UPDATE_DELAY) == (int)(i / UPDATE_DELAY) && int_percent_done != Last_Whole_Percent_Done)
+                        //{
+                        resultsprogress.Value = int_percent_done;
+                        resultsprogress.Message = string.Format(" -> Reading Address: 0x{0:x8}", i);
+                        Last_Whole_Percent_Done = int_percent_done;
+                        Application.DoEvents();
+                        //}
                     }
                 }
 #endif

 

  ViewVC Help
Powered by ViewVC 1.1.22