/[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 287 by william, Tue Jun 5 08:52:07 2012 UTC revision 288 by william, Tue Jun 5 09:01:43 2012 UTC
# Line 68  namespace RomCheater.Docking Line 68  namespace RomCheater.Docking
68              logger.Warn.WriteLine("FloatingMemorySearcher.UpdateAcceptedProcessAndConfig(IConfigPlugin config, Process process):");              logger.Warn.WriteLine("FloatingMemorySearcher.UpdateAcceptedProcessAndConfig(IConfigPlugin config, Process process):");
69              logger.Warn.WriteLine("Both USE_AUTOMATIC_MEMORY_SEARCH_RANGE and FORCE_USE_OF_MEMORYSIZECONSTANTS are defined");              logger.Warn.WriteLine("Both USE_AUTOMATIC_MEMORY_SEARCH_RANGE and FORCE_USE_OF_MEMORYSIZECONSTANTS are defined");
70              logger.Warn.WriteLine("FORCE_USE_OF_MEMORYSIZECONSTANTS will take precedence and will ignore the values supplied in the memeory search range");              logger.Warn.WriteLine("FORCE_USE_OF_MEMORYSIZECONSTANTS will take precedence and will ignore the values supplied in the memeory search range");
71                txtMemoryRangeStart.Value = MemorySizeConstants.MinimumAddress;
72                txtMemoryRangeSize.Value = (MemorySizeConstants.MinimumAddress > 0) ? (uint)(MemorySizeConstants.MaximumAddress - MemorySizeConstants.MinimumAddress) : MemorySizeConstants.MaximumAddress;
73  #endif  #endif
74  #if USE_AUTOMATIC_MEMORY_SEARCH_RANGE && !FORCE_USE_OF_MEMORYSIZECONSTANTS  #if USE_AUTOMATIC_MEMORY_SEARCH_RANGE && !FORCE_USE_OF_MEMORYSIZECONSTANTS
75              // code to automatically choose the best starting memory address and size              // code to automatically choose the best starting memory address and size
# Line 987  namespace RomCheater.Docking Line 989  namespace RomCheater.Docking
989              provider.OpenProvider();              provider.OpenProvider();
990              int bytes_read = 0;              int bytes_read = 0;
991    
992              byte[] buffered_mem = new byte[txtMemorySize.Value]; // throws OutOfMemoryException if size is over 2G              byte[] buffered_mem = new byte[MemoryRangeSize]; // throws OutOfMemoryException if size is over 2G
993              provider.ReadProcessMemory((int)txtMemoryStart.Value, (uint)txtMemorySize.Value, out bytes_read, out buffered_mem);              provider.ReadProcessMemory((int)MemoryRangeStart, MemoryRangeSize, out bytes_read, out buffered_mem);
994              provider.CloseProvider();              provider.CloseProvider();
995                
996              if (buffered_mem.Length == 0) { logger.Warn.WriteLine("Buffered Memory is Zero Length."); return; }              if (buffered_mem.Length == 0) { logger.Warn.WriteLine("Buffered Memory is Zero Length."); return; }
# Line 1688  namespace RomCheater.Docking Line 1690  namespace RomCheater.Docking
1690    
1691          private void chkMemoryRangeExpertMode_CheckedChanged(object sender, EventArgs e)          private void chkMemoryRangeExpertMode_CheckedChanged(object sender, EventArgs e)
1692          {          {
1693              txtMemoryStart.ReadOnly = !chkMemoryRangeExpertMode.Checked;              txtMemoryRangeStart.ReadOnly = !chkMemoryRangeExpertMode.Checked;
1694              txtMemorySize.ReadOnly = !chkMemoryRangeExpertMode.Checked;              txtMemoryRangeSize.ReadOnly = !chkMemoryRangeExpertMode.Checked;
1695          }          }
1696    
1697          private void txtMemoryStart_ValueChanged(object sender, ValueChangedEventArgs e) { this.MemoryRangeStart = Convert.ToInt32(e.NewValue); }          private void txtMemoryRangeStart_ValueChanged(object sender, ValueChangedEventArgs e) { this.MemoryRangeStart = Convert.ToInt32(e.NewValue); }
1698          private void txtMemorySize_ValueChanged(object sender, ValueChangedEventArgs e) { this.MemoryRangeSize = Convert.ToUInt32(e.NewValue); }          private void txtMemoryRangeSize_ValueChanged(object sender, ValueChangedEventArgs e) { this.MemoryRangeSize = Convert.ToUInt32(e.NewValue); }
1699                                
1700      }      }
1701  }  }

Legend:
Removed from v.287  
changed lines
  Added in v.288

  ViewVC Help
Powered by ViewVC 1.1.22