Code:
void _cdecl cEngine_t::RegisterTags( )
{
//Register your tags hire
#ifdef COD5BOT_DEBUG
LOG.Log ( "[DEBUG_LOG] cEngine_t::RegisterTags( )","Hooked");
#endif
ENGINE.orig_RegisterTags( );
}
void _cdecl cEngine_t::ClientFrame( )
{
//Draw your rendering Functions
#ifdef COD5BOT_DEBUG
LOG.Log ( "[DEBUG_LOG] cEngine_t::ClientFrame( )","Hooked");
#endif
ENGINE.orig_ClientFrame( );
}
void _cdecl cEngine_t::ShoutDown( )
{
void * clDo = NULL;
__asm mov clDo, eax
//Do detourRemoves hire or save your lates configs
#ifdef COD5BOT_DEBUG
LOG.Log ( "[DEBUG_LOG] cEngine_t::ShoutDown( )","Hooked");
#endif
__asm mov eax, clDo
ENGINE.orig_ShoutDown( );
}
void _cdecl cEngine_t::CG_Init( int serverMessageNum, int serverCommandSequence, int clientNum, int unk )
{
//Register your shaders hire
#ifdef COD5BOT_DEBUG
LOG.Log ( "[DEBUG_LOG] cEngine_t::CG_Init( int serverMessageNum, int serverCommandSequence, int clientNum, int unk)","Hooked");
#endif
ENGINE.orig_CG_Init( serverMessageNum, serverCommandSequence, clientNum, unk );
}
void _cdecl cEngine_t::CL_Init( )
{
//Register your fonts hire
#ifdef COD5BOT_DEBUG
LOG.Log ( "[DEBUG_LOG] cEngine_t::CL_Init( ), "Hooked";
#endif
ENGINE.orig_CL_Init( );
}
void _cdecl cEngine_t::CG_FireWeaponRecoil( int a1, int a2, signed int a3, __int16 a4, unsigned int a5, int a6 )
{
//do a sound or what ever
#ifdef COD5BOT_DEBUG
LOG.Log ( "[DEBUG_LOG] cEngine_t::CG_FireWeaponRecoil( int a1, int a2, signed int a3, __int16 a4, unsigned int a5, int a6 )","Hooked");
#endif
}
DWORD WINAPI cEngine_t::HooK( LPVOID )
{
aERROR.EnableHandler( );
if( ENGINE.isOn == 1 )
{
DetourFunction( ( PBYTE )0x592140, ( PBYTE )&ENGINE.CL_Init );
__asm MOV [ ENGINE.orig_CL_Init ], EAX;
DetourFunction( ( PBYTE )0x457A30, ( PBYTE )&ENGINE.CG_Init );
__asm MOV [ ENGINE.orig_CG_Init ], EAX;
DetourFunction( ( PBYTE )0x548D30, ( PBYTE )&ENGINE.RegisterTags );
__asm MOV [ ENGINE.orig_RegisterTags ], EAX;
DetourFunction( ( PBYTE )0x43A550, ( PBYTE )&ENGINE.ClientFrame );
__asm MOV [ ENGINE.orig_ClientFrame ], EAX;
DetourFunction( ( PBYTE )0x4807A0, ( PBYTE )&ENGINE.CG_FireWeaponRecoil );
DetourFunction( ( PBYTE )0x44B390, ( PBYTE )&Obituary.CG_Obituary );
__asm MOV [ Obituary.orig_CG_Obituary ], EAX;
DetourFunction( ( PBYTE )0x49D150, ( PBYTE )&ENGINE.ShoutDown );
__asm MOV [ ENGINE.orig_ShoutDown ], EAX;
LOG.Log ( "HooK","is: Enable" );
}
else
{
LOG.Log ( "HooK","is: Disable" );
}
return 0;
}