#include <iostream>
#include <Windows.h>
#define GAMENAME "World of Warcraft"
void PlayerXYZ();
DWORD_PTR dwGetModuleBaseAddress(DWORD dwProcessIdentifier, TCHAR *szModuleName);
static DWORD mana_a = 0x34A49498;
static DWORD health_a = 0x34A49494;
int main(int argc, _TCHAR* argv[])
{
PlayerXYZ();
std::cout << "World of Warcraft memory could not be read." << std::endl;
system("PAUSE");
return 0;
}
void PlayerXYZ(){
HWND hWnd = FindWindow(0, GAMENAME);
HDC hDC_Desktop = GetDC(hWnd);
DWORD dwProcId;
GetWindowThreadProcessId( hWnd, &dwProcId );
HANDLE hProcHandle;
if( dwProcId != 0 )
{
hProcHandle = OpenProcess( PROCESS_VM_READ, FALSE, dwProcId );
if( hProcHandle == INVALID_HANDLE_VALUE || hProcHandle == NULL )
{
std::cout << GAMENAME << " memory could not be read -> FAILED" << std::endl;
}
else
{
std::cout << GAMENAME << " memory can be read! -> SUCCESS " << std::endl;
}
}
int health ;
int mana ;
while(GetWindowThreadProcessId( hWnd, &dwProcId )){
Sleep(500);
system("CLS");
ReadProcessMemory(hProcHandle,(void*)(health_a),&health,sizeof(health),0);
std::cout << "hp: " << health << std::endl;
ReadProcessMemory(hProcHandle,(void*)(mana_a),&mana,sizeof(mana),0);
std::cout << "mana: " << mana << std::endl;
}
}