Hey,
i know now how to Read the Hit Points out of the memory and I can show it to the console in an extra application.
Now I want to Show the value of the Hit Points in my Text Label, but it dont work.
Here I want to show the Value of my Hit Points :
this->zPlayerHitPoints->Text = "here should be my hit points
";
my code to find HP :
Code:
#include <iostream>
#include <Windows.h>
bool EnableDebugPrivilege();
using namespace std;
HWND hwnd;
DWORD ID;
DWORD rw=0;
HANDLE handle;
unsigned int playerbase;
unsigned int base;
int mainzwei(void){
unsigned int puffer;
unsigned int buffer;
unsigned adress = 0x010B65F4;
hwnd = 0;
EnableDebugPrivilege();
hwnd = FindWindow(0,"World of Warcraft");
GetWindowThreadProcessId(hwnd, &ID); // Funktion
handle = OpenProcess(PROCESS_ALL_ACCESS, 0, ID);
ReadProcessMemory(handle, (LPCVOID)adress, &puffer, sizeof(puffer), &rw);
puffer = puffer + 0x34;
ReadProcessMemory(handle, (LPCVOID)puffer, &puffer, sizeof(puffer), &rw);
puffer = puffer + 0x24;
ReadProcessMemory(handle, (LPCVOID)puffer, &playerbase, sizeof(puffer), &rw);
base = playerbase + 0x8;
ReadProcessMemory(handle, (LPCVOID)base, &base, sizeof(buffer), &rw);
base = base + 0x17 * 4;
ReadProcessMemory(handle, (LPCVOID)base, &buffer, sizeof(buffer), &rw);
cout <<"\n------------------\n\nHP: " << buffer << "\n\n\n";
system("Pause");
}
bool EnableDebugPrivilege()
{
TOKEN_PRIVILEGES priv;
HANDLE hThis, hToken;
LUID luid;
hThis = GetCurrentProcess();
OpenProcessToken(hThis, TOKEN_ADJUST_PRIVILEGES, &hToken);
LookupPrivilegeValue(0, TEXT("seDebugPrivilege"), &luid);
priv.PrivilegeCount = 1;
priv.Privileges[0].Luid = luid;
priv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
AdjustTokenPrivileges(hToken, false, &priv, 0, 0, 0);
CloseHandle(hToken);
CloseHandle(hThis);
return true;
}
int main(void){
mainzwei();
}
Anyone can help me? I would be happy. =)