Joined: 08 Mar 2017
|Posted: Mon Mar 13, 2017 10:46 am Post subject: Memory Access Violation
I created a memory location and am trying to access it through my c# prog but I am getting an error:
"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Here is my code:
IntPtr processHandle = OpenProcess(PROCESS_WM_READ, false, pro.Id);
int bytesRead = 0;
byte buffer = new byte; //may need to increase
// 0x7FF7EEE60000 is the address
ReadProcessMemory((int)processHandle, 0x7FF7FC8A0000, buffer, buffer.Length, ref bytesRead);
" (" + bytesRead.ToString() + "bytes)");
The process opens fine and crashes on the ReadProcessMemory line. The address 7FF7FC8A0000 I have showing in Cheat engine and it is definitely populated with the data that I want (pointer address).
Any ideas why I can't access it?