nero1232 Advanced Cheater Reputation: 0
Joined: 08 Mar 2017 Posts: 65
|
Posted: Mon Mar 13, 2017 10:46 am Post subject: Memory Access Violation |
|
|
Hi,
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:
Code: |
IntPtr processHandle = OpenProcess(PROCESS_WM_READ, false, pro.Id);
int bytesRead = 0;
byte[] buffer = new byte[8]; //may need to increase
// 0x7FF7EEE60000 is the address
ReadProcessMemory((int)processHandle, 0x7FF7FC8A0000, buffer, buffer.Length, ref bytesRead);
Console.WriteLine(Encoding.Unicode.GetString(buffer) +
" (" + bytesRead.ToString() + "bytes)");
Console.ReadLine();
|
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?
Thanks
|
|