Working code to display HP (using invidual chatoutput function)
if you want it to permanently be up on screen just modify this
(2008 adresses, also works for 2007 changing only the adresses because the pointers and assembly are the same)
Code:
#include <windows.h>
#include <stdio.h>
#define ZCHARACTER_GETAP 0x00476DA0
#define ZCHARACTER_GETHP 0x00476D90
#define CHATMSG 0x0042B860
#define ZGETGAMECLIENT 0x004AD770
#define ZGETGAME 0x004AD880
#define ZGAME 0x006B0A28
char cBuf[2048];
typedef void (*ChatMsgFunction)(char *, int, int, unsigned int);
ChatMsgFunction ChatMsg = (ChatMsgFunction)CHATMSG;
typedef unsigned long (*ZGetGameClientFunction)();
ZGetGameClientFunction ZGetGameClient = (ZGetGameClientFunction)ZGETGAMECLIENT;
typedef unsigned long (*ZGetGameFunction)();
ZGetGameFunction ZGetGame = (ZGetGameFunction)ZGETGAME;
unsigned long MyChar()
{
return *(unsigned long *)(*(unsigned long *)ZGAME + 0x50);
}
int GetAP(unsigned long ulZChar)
{
_asm
{
mov ecx, ulZChar
mov eax, ZCHARACTER_GETAP
call eax
mov ulZChar, eax
}
return (int)ulZChar;
}
int GetHP(unsigned long ulZChar)
{
_asm
{
mov ecx, ulZChar
mov eax, ZCHARACTER_GETHP
call eax
mov ulZChar, eax
}
return (int)ulZChar;
}
void Brahms() {
for(;;Sleep(10))
{
if(GetAsyncKeyState(VK_MENU) & 0x8000 && GetAsyncKeyState('Y') & 0x8000)
{
if(MyChar())
{
/* uidLastAttacker.HighID = GetLastAttackerID(MyChar());
sprintf(cBuf,"Last attacker id is: %u",uidLastAttacker.HighID); */
sprintf(cBuf,"Your current HP: %u , Current AP: %u",GetHP(MyChar()), GetAP(MyChar()));
ChatMsg(cBuf,2,0,0xFFFFFFFF);
Sleep(1000);
}
else
{
ChatMsg("You're not in a room sorry!^^",2,0,0xFFFFFFFF);
Sleep(300);
}
}
}
}
extern "C" {
__declspec(dllexport) BOOL __stdcall DllMain (HINSTANCE hInst,DWORD reason,LPVOID reserved)
{
DisableThreadLibraryCalls(hInst);
if (reason == DLL_PROCESS_ATTACH)
{
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&Brahms, NULL, 0, NULL);
}
return TRUE;
}
}