public int ReadRawMemory(uint dwAddress, IntPtr lpBuffer, int nSize) { try { var lpBytesRead = 0; if (!Win32Imports.ReadProcessMemory(_processPtr, dwAddress, lpBuffer, nSize, out lpBytesRead)) { throw new Exception("ReadProcessMemory failed"); } return(lpBytesRead); } catch { return(0); } }
public ProcessMemoryReader(IWowProcess process) { _processPtr = Win32Imports.OpenProcess(ProcessAllAccess, false, process.Id); }