1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Stat Hook

Discussion in 'Programming' started by GroundZero, Aug 26, 2010.

  1. GroundZero

    GroundZero LOL Banned Coder Donor

  2. GroundZero

    GroundZero LOL Banned Coder Donor

    found a function Credits to Waffle
    #define StatAddy 0x0094C613 //E8 ? ? ? ? 8B 4D ? E8 ? ? ? ? 85 C0 75 ? 8B 4D ? E8 ? ? ? ?
    unsigned long ulStatCall = GetCall(StatAddy);

    int iHP = 0, iMaxHP = 0, iMP = 0, iMaxMP = 0, iEXP = 0, iMaxEXP = 0;

    void __declspec(naked) StatHookAsm()
    {
    __asm
    {
    mov eax,[esp+0x04]
    mov [iHP],eax
    mov eax,[esp+0x08]
    mov [iMaxHP],eax
    mov eax,[esp+0x0C]
    mov [iMP],eax
    mov eax,[esp+0x10]
    mov [iMaxMP],eax
    mov eax,[esp+0x14]
    mov [iEXP],eax
    mov eax,[esp+0x18]
    mov [iMaxEXP],eax
    jmp dword ptr [ulStatCall]
    }
    }


    Call(StatAddy, StatHookAsm, 0);


    unsigned long GetCall(unsigned long ulAddress)
    {
    if (*(unsigned char*)ulAddress == 0xE8) return (unsigned long)(ulAddress + 5 + *(int*)(ulAddress + 1));
    return NULL;
    }
     
  3. wh0re

    wh0re Nostalgia Overload Donor

    this is offtopic, why did he write iHP,iMP

    Instead of MP HP
     
  4. GroundZero

    GroundZero LOL Banned Coder Donor

    cause he define them as an integer
    you can better remember to this words
     

Share This Page