Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
922
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. ENTITY::tIS_ENTITY_DEAD OG_IS_ENTITY_DEAD = nullptr;
  2. BOOL __cdecl HK_IS_ENTITY_DEAD(Entity entity)
  3. {
  4. static uint64_t last = 0;
  5. uint64_t cur = *Hooking::m_frameCount;
  6. if (last != cur)
  7. {
  8. last = cur;
  9. Hooking::onTickInit();
  10. }
  11. return OG_IS_ENTITY_DEAD(entity);
  12. }
  13. bool Hooking::HookNatives()
  14. {
  15. MH_STATUS status = MH_CreateHook(ENTITY::IS_ENTITY_DEAD, HK_IS_ENTITY_DEAD, (void**)&OG_IS_ENTITY_DEAD);
  16. if ((status != MH_OK && status != MH_ERROR_ALREADY_CREATED) || MH_EnableHook(ENTITY::IS_ENTITY_DEAD) != MH_OK)
  17. return true;
  18. Hooking::m_hooks.push_back(ENTITY::IS_ENTITY_DEAD);
  19. return false;
  20. }
  21.  
  22.  
  23.  
  24. BTW ENTITY::IS_ENTITY_DEAD is:
  25. 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); }
  26.  
  27. and
  28.  
  29. ENTITY::tIS_ENTITY_DEAD is:
  30. typedef bool(__cdecl* tIS_ENTITY_DEAD)(Entity entity);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement