/[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 589 by william, Thu Jun 6 09:24:18 2013 UTC revision 590 by william, Thu Jun 6 10:08:17 2013 UTC
# Line 13  Line 13 
13  #endregion  #endregion
14  //#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
15  #if !USE_AUTOMATIC_MEMORY_SEARCH_RANGE  #if !USE_AUTOMATIC_MEMORY_SEARCH_RANGE
16  #define FORCE_USE_OF_MEMORYSIZECONSTANTS // when defined wil force the use of the constants defined in MemorySizeConstants for memory search range  //#define FORCE_USE_OF_MEMORYSIZECONSTANTS // when defined wil force the use of the constants defined in MemorySizeConstants for memory search range
17  #endif  #endif
18  #define DONOT_HAVE_RANGED_SEARCH_SUPPORT // when defined, indicates that ranged searches have not been implemented  #define DONOT_HAVE_RANGED_SEARCH_SUPPORT // when defined, indicates that ranged searches have not been implemented
19  #define INCREASE_NUMBER_OF_RESULTS_BEFORE_DISPLAY // when defined will set MIN RESULTS to 0x2701 otherwise 0x03e8  #define INCREASE_NUMBER_OF_RESULTS_BEFORE_DISPLAY // when defined will set MIN RESULTS to 0x2701 otherwise 0x03e8
# Line 41  using Sojaner.MemoryScanner; Line 41  using Sojaner.MemoryScanner;
41  using System.Collections;  using System.Collections;
42  using RomCheater.Serialization;  using RomCheater.Serialization;
43  using RomCheater.Core;  using RomCheater.Core;
44    using RomCheater.PluginFramework.Core;
45    
46  namespace RomCheater.Docking  namespace RomCheater.Docking
47  {  {
# Line 73  namespace RomCheater.Docking Line 74  namespace RomCheater.Docking
74          const bool USE_OLD_SEARCH_RESULTS_COMPRATOR_CODE = false;          const bool USE_OLD_SEARCH_RESULTS_COMPRATOR_CODE = false;
75          const bool USE_NONRANGE_SEARCH_RESULT_READER = false;          const bool USE_NONRANGE_SEARCH_RESULT_READER = false;
76          private bool DefaultUnsignedState = true; // set unsigned to true          private bool DefaultUnsignedState = true; // set unsigned to true
77          public FloatingMemorySearcher() { InitializeComponent(); this.AcceptedPlugin = null; OnBrowseMemoryRegion = null; this.AcceptedProcess = null; SearchInProgess = false; Reload(); }          public FloatingMemorySearcher()
78            {
79                InitializeComponent();
80                this.AcceptedPlugin = null;
81                OnBrowseMemoryRegion = null;
82                this.AcceptedProcess = null;
83                SearchInProgess = false;
84                MemoryRangeStart = MemorySizeConstants.MinimumSearchAddress;
85                if (this.PEData != null)
86                {
87                    if (this.PEData.Is32bitAssembly())
88                    {
89                        MemoryRangeSize = MemorySizeConstants.MinimumSearchAddress + MemorySizeConstants.MaximumSearchSize_x86;
90                    }
91                    else
92                    {
93                        MemoryRangeSize = MemorySizeConstants.MinimumSearchAddress + MemorySizeConstants.MaximumSearchSize_x64;
94                    }
95                }
96                else
97                {
98                    MemoryRangeSize = MemorySizeConstants.MinimumSearchAddress + MemorySizeConstants.MaximumSearchSize_x86;
99                }            
100                Reload();
101            }
102          public FloatingMemorySearcher(IConfigPlugin config) : this() { this.AcceptedPlugin = config; }          public FloatingMemorySearcher(IConfigPlugin config) : this() { this.AcceptedPlugin = config; }
103          public FloatingMemorySearcher(IConfigPlugin config, Process process) : this() { this.AcceptedPlugin = config; this.AcceptedProcess = process; }          public FloatingMemorySearcher(IConfigPlugin config, Process process) : this() { this.AcceptedPlugin = config; this.AcceptedProcess = process; }
104    
# Line 120  namespace RomCheater.Docking Line 145  namespace RomCheater.Docking
145              {              {
146                  MemoryRangeStart = AcceptedPlugin.MemoryRangeStart;                  MemoryRangeStart = AcceptedPlugin.MemoryRangeStart;
147                  MemoryRangeSize = AcceptedPlugin.MemoryRangeStart + AcceptedPlugin.MemoryRangeSize;                  MemoryRangeSize = AcceptedPlugin.MemoryRangeStart + AcceptedPlugin.MemoryRangeSize;
148              }  
149                    /* check for generic config and override the MemoryStart/Size parameters
150                       the purpose of a config plugin supplying this data was incase a plugin was created and the memory start address and size were known ahead of time
151                       however, for generic purposes use x86/x64 defaults...
152                    */
153                    if (config.IsGenericConfig)
154                    {                    
155                        if (this.PEData != null)
156                        {
157                            if (this.PEData.Is32bitAssembly())
158                            {
159                                this.MemoryRangeSize = MemorySizeConstants.MinimumAddress + MemorySizeConstants.MaximumAddressSize_x86;
160                            }
161                            else
162                            {
163                                this.MemoryRangeSize = MemorySizeConstants.MinimumAddress + MemorySizeConstants.MaximumAddressSize_x64;
164                            }
165                        }
166                        else
167                        {
168                            this.MemoryRangeSize = MemorySizeConstants.MinimumAddress + MemorySizeConstants.MaximumAddressSize_x86;
169                        }
170                    }
171                }        
172          }          }
173          private void UpdateAcceptedProcess(Process process)          private void UpdateAcceptedProcess(Process process)
174          {                      {            
# Line 195  namespace RomCheater.Docking Line 243  namespace RomCheater.Docking
243    
244          #region IAcceptsMemoryRange          #region IAcceptsMemoryRange
245  #if !FORCE_USE_OF_MEMORYSIZECONSTANTS  #if !FORCE_USE_OF_MEMORYSIZECONSTANTS
246          private uint _MemoryRangeStart;          private ulong _MemoryRangeStart;
247          private uint _MemoryRangeSize;          private ulong _MemoryRangeSize;
248  #endif  #endif
249          public ulong MemoryRangeStart          public ulong MemoryRangeStart
250          {          {
# Line 2679  namespace RomCheater.Docking Line 2727  namespace RomCheater.Docking
2727          public void SetPEViewerData(IPEDData peData)          public void SetPEViewerData(IPEDData peData)
2728          {          {
2729              this.PEData = peData;              this.PEData = peData;
2730                this.MemoryRangeStart = MemorySizeConstants.MinimumAddress;
2731                if (this.PEData != null)
2732                {
2733                    if (this.PEData.Is32bitAssembly())
2734                    {
2735                        this.MemoryRangeSize= MemorySizeConstants.MinimumAddress + MemorySizeConstants.MaximumAddressSize_x86;
2736                    }
2737                    else
2738                    {
2739                        this.MemoryRangeSize = MemorySizeConstants.MinimumAddress + MemorySizeConstants.MaximumAddressSize_x64;
2740                    }
2741                }
2742                else
2743                {
2744                  this.MemoryRangeSize = MemorySizeConstants.MinimumAddress + MemorySizeConstants.MaximumAddressSize_x86;
2745                }
2746          }          }
2747      }      }
2748  }  }

Legend:
Removed from v.589  
changed lines
  Added in v.590

  ViewVC Help
Powered by ViewVC 1.1.22