*(float*)(animstate + 0x80)
-
Автор темы
- #1
hooks.h
hooks.cpp
MinHook HOOK:
debug:
inline decltype(&hk_frame_stage_notify) m_frame_stage_notify{};
void __fastcall hk_frame_stage_notify( e_frame_stage stage );
hooks.cpp
static const auto frame_stage_notify = reinterpret_cast<void*>((*reinterpret_cast<uintptr_t**>(interfaces::m_client))[37]);
HOOK( frame_stage_notify, hk_frame_stage_notify, og::m_frame_stage_notify );
MinHook HOOK:
hook:
#define HOOK(target, detour, og) \
if (MH_CreateHook( target, detour, reinterpret_cast<void**>(&(og))) == MH_OK && MH_EnableHook( target ) == MH_OK ) {\
printf("created target: 0x%p, detour: 0x%p, og: 0x%p\n", target, detour, og); hooks::m_targets.emplace_back(target);\
}
hk_frame_stage_notify:
void __fastcall hooks::hk_frame_stage_notify(e_frame_stage stage)
{
switch (stage)
{
case frame_net_update_postdataupdate_start:
{
break;
}
case frame_net_update_postdataupdate_end:
{
break;
}
case frame_net_update_end:
{
// update all players.
for (int i{ 1 }; i <= interfaces::m_globals->m_max_clients; ++i) {
c_base_player* player = reinterpret_cast<c_base_player*>(interfaces::m_entity_list->get_client_entity(i));
if (!player || player == ctx::local())
continue;
AimPlayer* data = &g_aimbot.m_players[i - 1];
data->OnNetUpdate(player);
}
break;
}
case frame_render_start:
{
break;
}
case frame_render_end:
{
break;
}
default:
break;
}
// call og.
return og::m_frame_stage_notify(stage);
}