I'm trying to read a process's memory, but the address I would like to start reading from exceeds the IntPtr and UIntPtr limit.
[DllImport("kernel32.dll", EntryPoint = "ReadProcessMemory")]
private static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [Out] byte[] lpBuffer, int dwSize, [Out] int lpNumberOfBytesRead);
ReadProcessMemory(ProcessHandle, (IntPtr)0x14EC7B38A, buffer, buffer.Length, bytesused);
Doing this produces a OverflowException exception even if I use a UIntPtr
. I have tried using a ulong
, but this produces an AccessViolationException exception. What other data type should I use?