/[RomCheater]/trunk/RomCheater/Docking/FloatingRamDumperDialog.cs
ViewVC logotype

Diff of /trunk/RomCheater/Docking/FloatingRamDumperDialog.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 156 by william, Mon May 28 04:14:03 2012 UTC revision 164 by william, Mon May 28 07:49:48 2012 UTC
# Line 9  using System.Windows.Forms; Line 9  using System.Windows.Forms;
9  using WeifenLuo.WinFormsUI.Docking;  using WeifenLuo.WinFormsUI.Docking;
10  using RomCheater.PluginFramework.Interfaces;  using RomCheater.PluginFramework.Interfaces;
11  using System.Diagnostics;  using System.Diagnostics;
12    using System.IO;
13    using RomCheater.Logging;
14    using System.Reflection;
15    
16  namespace RomCheater.Docking  namespace RomCheater.Docking
17  {  {
# Line 155  namespace RomCheater.Docking Line 158  namespace RomCheater.Docking
158          private void DumpRam(ulong start, ulong end, string filename)          private void DumpRam(ulong start, ulong end, string filename)
159          {          {
160              uint byte_count = (uint)(end - start);              uint byte_count = (uint)(end - start);
161    
162                //string arch = ProcessorAssemblyArchitecture.GetProcessorArchitecture(typeof(FloatingRamDumperDialog).Assembly);
163                //if (arch == ProcessorAssemblyArchitecture.x86)
164                //{
165                    if (end > int.MaxValue)
166                        logger.Warn.WriteLine("Warning: DumpRam(): ending address is greater than 0x{0:x8} and we are running x86, this will exceed the ", int.MaxValue);                
167                //}
168                //else if (arch == ProcessorAssemblyArchitecture.x64)
169                //{
170                //}
171                //else
172                //{
173                //    // don't know
174                //}
175    
176              DumpRam(start, byte_count, filename);              DumpRam(start, byte_count, filename);
177          }          }
178          private void DumpRam(ulong start, uint count, string filename)          private void DumpRam(ulong start, uint count, string filename)
# Line 164  namespace RomCheater.Docking Line 182  namespace RomCheater.Docking
182              reader.ReadProcess = this.AcceptedProcess;              reader.ReadProcess = this.AcceptedProcess;
183              reader.OpenProcess();              reader.OpenProcess();
184              int bytesReadSize;              int bytesReadSize;
185              byte[] data = reader.ReadProcessMemory((IntPtr)(uint)start, count, out bytesReadSize);              reader.DumpMemory(filename, (uint)start, count, out bytesReadSize);
186              reader.CloseHandle();              reader.CloseHandle();            
187          }          }
188          #endregion          #endregion
189      }      }

Legend:
Removed from v.156  
changed lines
  Added in v.164

  ViewVC Help
Powered by ViewVC 1.1.22