ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/Win32/Sojaner.MemoryScanner/MemoryScanner.cs
(Generate patch)

Comparing trunk/Win32/Sojaner.MemoryScanner/MemoryScanner.cs (file contents):
Revision 168 by william, Mon May 28 08:31:56 2012 UTC vs.
Revision 169 by william, Mon May 28 08:49:42 2012 UTC

# Line 69 | Line 69 | namespace Sojaner.MemoryScanner
69          }
70  
71  
72 <        public bool DumpMemory(string filename, uint MemoryAddress, uint bytesToRead, out int bytesRead)
72 >        public bool DumpMemory(Process ppid, string filename, uint MemoryAddress, uint bytesToRead, out int bytesRead)
73          {
74 +            logger.Info.WriteLine("Dumping memory (0x{0:x8}-0x{1:x8}) from pid=({3}) to file {2}", MemoryAddress, MemoryAddress + bytesToRead, filename, string.Format("0x{0:x4} {1}.exe", ppid.Id, ppid.ProcessName));
75              bytesRead = 0;
76              uint byte_alignment = 102400; // write to file in 100mb chunks
77              uint address = MemoryAddress;
# Line 119 | Line 120 | namespace Sojaner.MemoryScanner
120                      }
121                      bw.Close();
122                  }
123 +                logger.Info.WriteLine("Succefully dumped memory (0x{0:x8}-0x{1:x8}) from pid=({3}) to file {2}", MemoryAddress, MemoryAddress + bytesToRead, filename, string.Format("0x{0:x4} {1}.exe", ppid.Id, ppid.ProcessName));
124                  return true;
125              }
126              catch (OutOfMemoryException ex)
127              {
128 +                logger.Error.WriteLine("Failed to dump memory (0x{0:x8}-0x{1:x8}) from pid=({3}) to file {2}", MemoryAddress, MemoryAddress + bytesToRead, filename, string.Format("0x{0:x4} {1}.exe", ppid.Id, ppid.ProcessName));
129                  logger.Error.WriteLine("DumpMemory(): OutOfMemoryException");
130                  logger.Error.WriteLine(ex.ToString());
131              }
132              catch (Exception ex)
133              {
134 +                logger.Error.WriteLine("Failed to dump memory (0x{0:x8}-0x{1:x8}) from pid=({3}) to file {2}", MemoryAddress, MemoryAddress + bytesToRead, filename, string.Format("0x{0:x4} {1}.exe", ppid.Id, ppid.ProcessName));
135                  logger.Error.WriteLine("DumpMemory(): Exception");
136                  logger.Error.WriteLine(ex.ToString());
137              }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines