#include <windows.h>
bool IsGameReadyForHook()
{
if( GetModuleHandleA( "d3d9.dll" ) != NULL
&& GetModuleHandleA( "ClientFX.fxd" ) != NULL
&& GetModuleHandleA( "CShell.dll" ) != NULL )
return true;
return false;
}
void __cdecl PushToConsole(const char* szCommand )
{
DWORD dwCShell = (DWORD)GetModuleHandleA("CShell.dll");
if( dwCShell != NULL )
{
DWORD *LTClient = ( DWORD* )( 0x377E7810 );
void* CONoff = ( void* )*( DWORD* )( *LTClient + 0x208 );
__asm
{
push szCommand;
call CONoff;
add esp, 4;
}
}
}
void main()
{
while(true)
{
PushToConsole("DrawParticles 0");
PushToConsole("ShowFps 1");
PushToConsole("FogEnable 0" );
PushToConsole("ActivationDistance 999999" );
PushToConsole("FRunVel 700.000000");
PushToConsole("BRunVel 700.000000");
PushToConsole("SRunVel 700.000000");
PushToConsole("PerturbRotationEffect 0.000000" );
PushToConsole("PerturbIncreaseSpeed 0.000000" );
PushToConsole("PerturbWalkPercent 0.000000" );
PushToConsole("PerturbFiringIncreaseSpeed 0.000000" );
PushToConsole("PerturbRecoil 0.000000" );
PushToConsole("FireMovePerturb 0.000000" );
PushToConsole("ZoomedFireMoveDuckPerturb 0.000000" );
PushToConsole("ZoomedFireMovePerturb 0.000000" );
PushToConsole("ZoomedFireDuckPerturb 0.000000" );
PushToConsole("SkelModelStencil 1" );
PushToConsole("JumpVel 2000.000000" );
PushToConsole("camdamage 0");
PushToConsole("CamMaxPosYOffset 100.000000" );
PushToConsole("ShowHitSphere 800.000");
memcpy((LPVOID)0x3737EE23, "\x90\x90\x90", 3);
memcpy((LPVOID)0x3745B7D1, "\x90\x90\x90", 3);
memcpy((LPVOID)0x3745B7E0, "\x90\x90\x90", 3);
memcpy((LPVOID)0x3745B7D4, "\x90\x90\x90\x90\x90\x90", 6);
memcpy((LPVOID)0x374A7434, "\x90\x90\x90\x90\x90\x90", 6);
}
}
DWORD WINAPI dwHackThread(LPVOID) {
while( !IsGameReadyForHook() )
Sleep(300);
main();
return 0;
}
BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{
DisableThreadLibraryCalls(hDll);
if ( dwReason == DLL_PROCESS_ATTACH )
{
CreateThread(NULL, NULL, dwHackThread, NULL, NULL, NULL);
}
return TRUE;
}