Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
 public ProcessMemoryReader(Process process)
 {
     _processPtr = Win32Imports.OpenProcess(ProcessAllAccess, false, process.Id);
 }