Invalid access to memory location.

  • Thread starter Thread starter Beggginer
  • Start date Start date
B

Beggginer

Guest
How to fix this error: "Invalid access to memory location."

Error code: 998.

This error appears when I using WriteProcessMemory. May be with other functions like ReadProcessMemory appear too.

I dont know.

My Code C++:

#include <Windows.h>

__int64 Base = 0x7FF71F9AD418;
__int64 Score = Base + 0x30 + 0x120;
int hundred = 1000;

int main() {
HWND hwnd = FindWindow(0, L"Purble Place");
DWORD pID;
HANDLE h;
if (!hwnd) { MessageBox(0, L"Start game", 0, 0); return 0; }
GetWindowThreadProcessId(hwnd, &pID);
h = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pID);
if (!h) { MessageBox(0, L"Handle not found.", 0, 0); return 0; }
//If all good
WriteProcessMemory(h, (LPVOID)Score, &hundred, sizeof(hundred), NULL);

return 0;
}


How to fix?

Continue reading...
 
Back
Top