/[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	2013/06/03 07:13:44	471
+++ trunk/RomCheater/Docking/FloatingMemorySearcher.cs	2013/06/03 07:39:39	472
@@ -1457,20 +1457,23 @@
                     {
                         // need to get the address list
                         using (SearchResultReader reader = new SearchResultReader(SearchGuid))
-                        {                        
+                        {
                             byte[] guid = SearchGuid.ToByteArray();
-                            guid[guid.Length-1]++; // increment the search guid by 1
-                            Guid new_SearchGuid = new Guid(guid);                           
+                            guid[guid.Length - 1]++; // increment the search guid by 1
+                            Guid new_SearchGuid = new Guid(guid);
                             //provider.OnBytesRead += new BaseEventHandler<OnBytesReadEventArgs>(search_provider_OnBytesRead);
                             int count = 0;
                             //int Last_Whole_Percent_Done = 0;
-                            var results = reader.GetResults(SearchArgs.IsUnsignedDataType, SearchArgs.DataType, new Action<int, string>(UpdateProgress));
+                            //var results = reader.GetResults(SearchArgs.IsUnsignedDataType, SearchArgs.DataType, new Action<int, string>(UpdateProgress));
 
-                            using (SearchResultWriter writer = new SearchResultWriter((int)(results.Count()), new_SearchGuid))
+                            //reader.WriteUpdatedEntries(new_SearchGuid, SearchArgs.IsUnsignedDataType, SearchArgs.DataType, new Action<int, string>(UpdateProgress));
+
+                            using (SearchResultWriter writer = new SearchResultWriter((int)(reader.ResultCount), new_SearchGuid))
                             {
-                                foreach (var item in results)
+                                for (int i = 0; i < reader.ResultCount; i++)
                                 {
-                                     provider.OpenProvider();
+                                    var item = reader.GetResultAtIndex(i, SearchArgs.IsUnsignedDataType, SearchArgs.DataType, new Action<int, string>(UpdateProgress));
+                                    provider.OpenProvider();
                                     int bytesRead = 0;
                                     byte[] data = new byte[STEP_SIZE];
                                     provider.ReadProcessMemory(item.Address, STEP_SIZE, out bytesRead, out data);
@@ -1478,14 +1481,14 @@
                                     OnBytesReadEventArgs t_args = new OnBytesReadEventArgs(this, writer, data, item.Address, (uint)reader.ResultCount);
                                     t.Invoke(t_args);
                                     t = null;
-                                    t_args=null;
+                                    t_args = null;
                                     double percent_done = 100.0 * ((double)count / (double)reader.ResultCount);
                                     new Action<int, string>(UpdateProgress).Invoke((int)percent_done, string.Format(" -> Reading Address: 0x{0:x8}", item.Address));
                                     count++;
                                     data = null;
                                     provider.CloseProvider();
                                 }
-                            }                            
+                            }
                             SearchGuid = new_SearchGuid;
                         }
                     }

 

  ViewVC Help
Powered by ViewVC 1.1.22