Начинающий
-
Автор темы
- #1
Маленький хук студии и авто поинтеры
C++:
r_studio_interface_t* g_pStudioAPI = nullptr;
int( *StudioDrawPlayer )( int flags , struct entity_state_s *pplayer );
int newStudioDrawPlayer( int flags , struct entity_state_s *pplayer )
{
if ( flags && pplayer )
g_Engine.Con_Printf( "newStudioDrawPlayer [ %i ]\n" , pplayer->number );
return StudioDrawPlayer( flags , pplayer );
}
int( *StudioDrawModel )( int flags );
int newStudioDrawModel( int flags )
{
if ( flags )
g_Engine.Con_Printf( "newStudioDrawModel [ %i ]\n" , flags );
return StudioDrawModel( flags );
}
void HookFunction()
{
g_pClient->HUD_Frame = HUD_Frame;
g_pClient->HUD_Redraw = HUD_Redraw;
g_pClient->CL_CreateMove = CL_CreateMove;
g_pStudioAPI = *(r_studio_interface_t**)offset.FindPattern( "\xC7\xFF\xFF\xFF\xFF\xFF\xF3\xA5\xB9\xFF\xFF\xFF\xFF\xE8\xFF\xFF\xFF\xFF\x5F\xB8\xFF\xFF\xFF\xFF\x5E\xC3" , "x?????xxx????x????xx????xx" , offset.ClBase , offset.ClEnd , 0x2 );
if ( g_pStudioAPI )
{
StudioDrawPlayer = g_pStudioAPI->StudioDrawPlayer;
g_pStudioAPI->StudioDrawPlayer = newStudioDrawPlayer;
StudioDrawModel = g_pStudioAPI->StudioDrawModel;
g_pStudioAPI->StudioDrawModel = newStudioDrawModel;
g_Engine.Con_Printf( "g_pStudioAPI: %X\n" , g_pStudioAPI->version );
}
}
Последнее редактирование: