#define MYOFFSETADDRESS 0x00000 /* define here the address you want to read */
HWND WndW = FindWindow(lpClassName, lpWindowName); /* lpClassName = the class of the target window - lpWindowName = the name to the target window - change these values! */
DWORD processID = GetWindowThreadProcessId(WndW, &processID); /* processID = the process Id of the target window. necessary to get the handle of the process */
HANDLE trgtHandle = OpenProcess(PROCESS_ALL_ACCESS, false, processID); /* the handle of the process */
if (trgtHandle == 0){return;} /* could not get the handle... */
int theValue;
ReadProcessMemory(trgtHandle , (LPCVOID)MYOFFSETADDRESS , &theValue, sizeof(theValue), NULL); /* Read "MYOFFSETADDRESS" address value - "theValue" will store the value */
CloseHandle(trgtHandle); /* closes the handle when you're done with it */
~Henri
|