Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ENTITY::tIS_ENTITY_DEAD OG_IS_ENTITY_DEAD = nullptr;
- BOOL __cdecl HK_IS_ENTITY_DEAD(Entity entity)
- {
- static uint64_t last = 0;
- uint64_t cur = *Hooking::m_frameCount;
- if (last != cur)
- {
- last = cur;
- Hooking::onTickInit();
- }
- return OG_IS_ENTITY_DEAD(entity);
- }
- bool Hooking::HookNatives()
- {
- MH_STATUS status = MH_CreateHook(ENTITY::IS_ENTITY_DEAD, HK_IS_ENTITY_DEAD, (void**)&OG_IS_ENTITY_DEAD);
- if ((status != MH_OK && status != MH_ERROR_ALREADY_CREATED) || MH_EnableHook(ENTITY::IS_ENTITY_DEAD) != MH_OK)
- return true;
- Hooking::m_hooks.push_back(ENTITY::IS_ENTITY_DEAD);
- return false;
- }
- BTW ENTITY::IS_ENTITY_DEAD is:
- static bool IS_ENTITY_DEAD(Entity entity) { static tIS_ENTITY_DEAD oIS_ENTITY_DEAD = (tIS_ENTITY_DEAD)(Memory::pattern("48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 20 40 8A FA E8 ? ? ? ? 33 DB").count(1).get(0).get<void>()); return oIS_ENTITY_DEAD(entity); }
- and
- ENTITY::tIS_ENTITY_DEAD is:
- typedef bool(__cdecl* tIS_ENTITY_DEAD)(Entity entity);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement