Code:
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
HWND hwnd;
DWORD id;
hwnd = FindWindow(NULL,"Hey");
GetWindowThreadProcessId(hwnd, &id);
HANDLE client = OpenProcess(PROCESS_ALL_ACCESS, false, id);
int theadress = 0x0020F770;
DWORD bytesread = 5;
int buffer = 4;
ReadProcessMemory(client,(int*)theadress, &buffer, sizeof(int), &bytesread);
cout<<buffer;
}
I tryed this, i have set my console title to Hey. It actually found the process id.
Trying to read from it...Not sure how to print the value of the adress.