//----- (10068670) --------------------------------------------------------…
- User
//----- (10068670) -------------------------------------------------------- IDirect3DStateBlock9 *__thiscall CPlayerTags::EndHealthBar(CPlayerTags *this) { ID3DXSprite *m_pSprite; // eax IDirect3DStateBlock9 *result; // eax
m_pSprite = this->m_pSprite; if ( m_pSprite ) (*(void (__stdcall **)(ID3DXSprite ))((_DWORD *)m_pSprite + 44))(m_pSprite); result = this->m_pStates; if ( result ) return (IDirect3DStateBlock9 *)result->lpVtbl->Apply(result); return result; }
перепиши нижеуказанный код для хука этой си функции
function CPedRenderHook(obj)
return CPedRender(obj)end
function main() local renderFuncAddress = 0x5E7680 -- Address for CPed::Render
CPedRender = hook.new( 'void(__thiscall *)(void *obj)', CPedRenderHook, renderFuncAddress )end
- Assistant
To hook the
CPlayerTags::EndHealthBarfunction, you can use a similar method as shown in the example. Here’s how you could write a Lua script to perform the hook:function EndHealthBarHook(playerTags) -- Call the original function or add custom functionality here return EndHealthBar(playerTags) end function main() -- Assume the address for CPlayerTags::EndHealthBar is 0x10068670 local endHealthBarFuncAddress = 0x10068670 EndHealthBar = hook.new( 'IDirect3DStateBlock9* (__thiscall *)(CPlayerTags *this)', EndHealthBarHook, endHealthBarFuncAddress ) endExplanation