Parent Directory
|
Revision Log
|
Patch
--- trunk/Win32/Sojaner.MemoryScanner/MemoryScanner.cs 2012/06/09 21:19:35 353 +++ trunk/Win32/Sojaner.MemoryScanner/MemoryScanner.cs 2012/06/09 21:46:37 354 @@ -253,10 +253,34 @@ } #endregion #region public void ReadProcessMemory(int MemoryAddress, uint bytesToRead, out int bytesRead, out byte[] data) + public void ReadProcessMemoryAtOnce(int MemoryAddress, uint bytesToRead, out int bytesRead, out byte[] data) + { + ReadProcessMemoryAtOnce((uint)MemoryAddress, bytesToRead, out bytesRead, out data); + } public void ReadProcessMemory(int MemoryAddress, uint bytesToRead, out int bytesRead, out byte[] data) { ReadProcessMemory((uint)MemoryAddress, bytesToRead, out bytesRead, out data); } + public void ReadProcessMemoryAtOnce(uint MemoryAddress, uint bytesToRead, out int bytesRead, out byte[] data) + { + try + { + data = new byte[bytesToRead]; + ProcessMemoryReader.ProcessMemoryReaderApi.ReadProcessMemory(m_hProcess, (IntPtr)MemoryAddress, data, bytesToRead, out bytesRead); + } + catch (SEHException ex) + { + logger.Error.WriteLine("ReadProcessMemory() SEHException was thrown: (0x{0:x8}) - {1}", ex.ErrorCode, ex.Message); + logger.Error.WriteLine(ex.ToString()); + throw ex; + } + catch (Exception ex) + { + logger.Error.WriteLine("ReadProcessMemory(): Exception"); + logger.Error.WriteLine(ex.ToString()); + throw ex; + } + } public void ReadProcessMemory(uint MemoryAddress, uint bytesToRead, out int bytesRead, out byte[] data) { try
ViewVC Help | |
Powered by ViewVC 1.1.22 |