/[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 249 by william, Sun Jun 3 16:09:05 2012 UTC revision 252 by william, Sun Jun 3 16:35:25 2012 UTC
# Line 13  using System.IO; Line 13  using System.IO;
13  using RomCheater.Logging;  using RomCheater.Logging;
14  using System.Reflection;  using System.Reflection;
15  using Sojaner.MemoryScanner.MemoryProviers;  using Sojaner.MemoryScanner.MemoryProviers;
16    using Sojaner.MemoryScanner;
17    
18  namespace RomCheater.Docking  namespace RomCheater.Docking
19  {  {
# Line 180  namespace RomCheater.Docking Line 181  namespace RomCheater.Docking
181          }          }
182          private void DumpRam(long start, uint count, string filename)          private void DumpRam(long start, uint count, string filename)
183          {          {
184              if (this.AcceptedProcess == null) return;                          if (this.AcceptedProcess == null) return;    
             GenericMemoryProvider provider = new GenericMemoryProvider((IAcceptsProcessAndConfig)this);  
             provider.OpenProvider();  
185              int bytesReadSize;              int bytesReadSize;
186                Sojaner.MemoryScanner.MemoryProviers.GenericMemoryProvider provider = new Sojaner.MemoryScanner.MemoryProviers.GenericMemoryProvider((IAcceptsProcessAndConfig)this);
187                provider.OpenProvider();
188              if (provider.WriteProcessMemoryToFile(filename, (int)start, count, out bytesReadSize))              if (provider.WriteProcessMemoryToFile(filename, (int)start, count, out bytesReadSize))
189              {              {
190                  MessageBox.Show(string.Format("Succefully dumped memory (0x{0:x8}-0x{1:x8}) from pid=({3}) to file {2}", start, start + count, filename, string.Format("0x{0:x4} {1}.exe", this.AcceptedProcess.Id, AcceptedProcess.ProcessName)), "", MessageBoxButtons.OK, MessageBoxIcon.Information);                  MessageBox.Show(string.Format("Succefully dumped memory (0x{0:x8}-0x{1:x8}) from pid=({3}) to file {2}", start, start + count, filename, string.Format("0x{0:x4} {1}.exe", this.AcceptedProcess.Id, AcceptedProcess.ProcessName)), "", MessageBoxButtons.OK, MessageBoxIcon.Information);
# Line 193  namespace RomCheater.Docking Line 194  namespace RomCheater.Docking
194                  MessageBox.Show(string.Format("Failed to dump memory (0x{0:x8}-0x{1:x8}) from pid=({3}) to file {2}", start, start + count, filename, string.Format("0x{0:x4} {1}.exe", this.AcceptedProcess.Id, AcceptedProcess.ProcessName)), "", MessageBoxButtons.OK, MessageBoxIcon.Error);                  MessageBox.Show(string.Format("Failed to dump memory (0x{0:x8}-0x{1:x8}) from pid=({3}) to file {2}", start, start + count, filename, string.Format("0x{0:x4} {1}.exe", this.AcceptedProcess.Id, AcceptedProcess.ProcessName)), "", MessageBoxButtons.OK, MessageBoxIcon.Error);
195              }              }
196              provider.CloseProvider();              provider.CloseProvider();
197    
198                //ProcessMemoryReader provider = new ProcessMemoryReader();
199                //provider.ReadProcess = this.AcceptedProcess;
200                //provider.OpenProcess();
201                //provider.WriteProcessMemoryToFile(filename, (int)start, count, out bytesReadSize);
202                //provider.CloseHandle();
203    
204          }          }
205          #endregion          #endregion
206      }      }

Legend:
Removed from v.249  
changed lines
  Added in v.252

  ViewVC Help
Powered by ViewVC 1.1.22