/[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 09:06:27	289
+++ trunk/RomCheater/Docking/FloatingMemorySearcher.cs	2012/06/05 10:26:59	292
@@ -1,4 +1,4 @@
-//#define USE_AUTOMATIC_MEMORY_SEARCH_RANGE // when defined will automatically choose the best starting address and size for memory search otherwise it will use the constants defined in MemorySizeConstants
+#define USE_AUTOMATIC_MEMORY_SEARCH_RANGE // when defined will automatically choose the best starting address and size for memory search otherwise it will use the constants defined in MemorySizeConstants
 #if !USE_AUTOMATIC_MEMORY_SEARCH_RANGE
 #define FORCE_USE_OF_MEMORYSIZECONSTANTS // when defined wil force the use of the constants defined in MemorySizeConstants for memory search range
 #endif
@@ -24,6 +24,7 @@
 using Sojaner.MemoryScanner.MemoryProviers;
 using RomCheater.PluginFramework.Events;
 using System.Reflection;
+using Sojaner.MemoryScanner;
 
 namespace RomCheater.Docking
 {
@@ -76,7 +77,18 @@
             txtMemoryRangeSize.Value = (MemorySizeConstants.MinimumAddress > 0) ? (uint)(MemorySizeConstants.MaximumAddress - MemorySizeConstants.MinimumAddress) : MemorySizeConstants.MaximumAddress;
 #endif
 #if USE_AUTOMATIC_MEMORY_SEARCH_RANGE && !FORCE_USE_OF_MEMORYSIZECONSTANTS
-            // code to automatically choose the best starting memory address and size
+            //// code to automatically choose the best starting memory address and size
+            if (process != null)
+            {
+                string filename = process.MainModule.FileName;
+                //string filename = @"c:\Windows\notepad.exe";
+                PEReader peReader = new PEReader(filename);
+            }
+            else
+            {
+                txtMemoryRangeStart.Value = MemorySizeConstants.MinimumAddress;
+                txtMemoryRangeSize.Value = (MemorySizeConstants.MinimumAddress > 0) ? (uint)(MemorySizeConstants.MaximumAddress - MemorySizeConstants.MinimumAddress) : MemorySizeConstants.MaximumAddress;
+            }
 #endif
 
         }

 

  ViewVC Help
Powered by ViewVC 1.1.22