-
Автор темы
- #1
сам хук:
в main cpp
C++:
#include "..\hooks.hpp"
using FnIsPlayingDemo = bool(__thiscall*)(void*);
bool __fastcall hooks::hooked_isplaingdemo(void* ecx, void* edx)
{
static auto original_fn = engine_hook->get_func_address <FnIsPlayingDemo>(82);
if (!ecx)
return original_fn(ecx);
if (!m_engine()->IsInGame() || !m_engine()->IsConnected())
return original_fn(ecx);
if (g_cfg.misc.money_reveal) {
if (*static_cast<uintptr_t*>(_ReturnAddress()) == 0x0975C084
&& **reinterpret_cast<uintptr_t**>(uintptr_t(_AddressOfReturnAddress()) + 4) == 0x0C75C084)
return true;
}
return original_fn(ecx);
}
C++:
hooks::engine_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::hooked_isplaingdemo), 82);