ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/RomCheater/Docking/UI/UIMemoryViewer.cs
(Generate patch)

Comparing trunk/RomCheater/Docking/UI/UIMemoryViewer.cs (file contents):
Revision 199 by william, Thu May 31 07:20:43 2012 UTC vs.
Revision 200 by william, Thu May 31 07:29:44 2012 UTC

# Line 13 | Line 13 | using System.Diagnostics;
13  
14   namespace RomCheater.Docking.UI
15   {
16 <    public partial class UIMemoryViewer : UserControl, IProcessConfig, IAcceptsPlugin<IConfigPlugin>, IAcceptsMemoryRange
16 >    public partial class UIMemoryViewer : UserControl, IProcessConfig, IAcceptsPlugin<IConfigPlugin>//, IAcceptsMemoryRange
17      {
18          public UIMemoryViewer()
19          {
# Line 57 | Line 57 | namespace RomCheater.Docking.UI
57          #region IAcceptsPlugin<IConfigPlugin> Members
58          public IConfigPlugin AcceptedPlugin { get; set; }
59          #endregion
60 +        #region IAcceptsMemoryRange members
61 +        public uint MemoryStart { get; set; }
62 +        public uint MemorySize { get; set; }
63 +        #endregion
64          public void GotoTop() { this.CURRENT_TOP_ADDR = 0; }
65          public void GotoBottom() { uint size = MemorySize; this.CURRENT_TOP_ADDR = (uint)((size - 1) - max_ram_view); }
66          public void GotoAddress(uint addr) { this.CURRENT_TOP_ADDR = (uint)addr & 0xFFFFFFF0; }
# Line 93 | Line 97 | namespace RomCheater.Docking.UI
97          static uint small_scroll_change = max_address_width * 1; // scrolls one line (when you clikc the up or down arrows)
98          static uint medium_scroll_change = max_ram_view / 2; // scrolls half a page
99          static uint large_scroll_change = max_ram_view; // scrolls a full page
96
97        #region IAcceptsMemoryRange members
98        public uint MemoryStart { get; set; }
99        public uint MemorySize { get; set; }
100        #endregion
100          private uint _CURRENT_TOP_ADDR;
101          uint CURRENT_TOP_ADDR
102          {
# Line 176 | Line 175 | namespace RomCheater.Docking.UI
175                  reader.ReadProcess = this.AcceptedProcess;
176                  reader.OpenProcess();
177                  int bytesReadSize;
178 <                byte[] data = reader.ReadProcessMemory(MemoryStart, MemorySize, out bytesReadSize);
178 >                byte[] data = reader.ReadProcessMemory(CURRENT_TOP_ADDR, max_ram_view, out bytesReadSize);
179                  //this.Logger.LogDebugMessage(string.Format("GetMemory() -> Memory Size: {0}0x{2:X8}{1}", "{", "}", data.Length));
180                  return data;
181              }
182              catch (Exception ex)
183              {
184                  logger.Error.WriteLine("{0}.GetMemory():{1}{2}", this.GetType().Name, System.Environment.NewLine, ex.ToString());
185 <                byte[] data = new byte[MemorySize];
185 >                byte[] data = new byte[max_ram_view];
186                  for (int i = 0; i < data.Length; i++) { data[i] = 0x0; }
187                  return data;
188              }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines