#include <Windows.h>
#include <iostream>
int main()
{
HWND hwnd = FindWindowA(NULL, "AssaultCube");
DWORD processID;
GetWindowThreadProcessId(hwnd, &processID);
HANDLE handle = OpenProcess(PROCESS_VM_READ, FALSE, processID);
DWORD baseAddress = 0x400000;
DWORD healthOffset = 0x6200D4;
DWORD healthAddress = baseAddress + healthOffset;
int health = 0;
while(true)
{
ReadProcessMemory(handle, (LPVOID)healthAddress, &health, sizeof(health), nullptr);
std::cout << "HP: " << health << std::endl;
Sleep(100);
}
CloseHandle(handle);
return 0;
}