Code:
#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 *LTClient = ( DWORD* )( 0x377C8538 );
DWORD CNADDIE = 0x46F670;
void* Send = ( void* )*( DWORD* )(CNADDIE);
void* CONoff = ( void* )*( DWORD* )( *LTClient + 0x208 );
__asm
{
push szCommand;
call CONoff;
add esp,4;
}
}
void main()
{
while(!IsGameReadyForHook()){ Sleep(200); }
bool chams = false;
bool spread = false;
bool recoil = false;
bool glass = false;
bool reload = false;
while(true)
{
//
if(GetAsyncKeyState(VK_NUMPAD1)&1){//Comando per le chams.
chams = !chams;
}
if(chams){
PushToConsole("SkelModelStencil 1");
} else {
PushToConsole("SkelModelStencil 0");
}
if(GetAsyncKeyState(VK_NUMPAD3)&1){//Comando per il no spread.
spread = !spread;
}
if(spread){//
PushToConsole("PerturbRotationEffect 0.000000");
PushToConsole("PerturbIncreaseSpeed 0.000000");
PushToConsole("PerturbWalkPercent 0.000000");
PushToConsole("PerturbFiringIncreaseSpeed 0.000000");
} else {
PushToConsole("PerturbRotationEffect 3.000000");
PushToConsole("PerturbIncreaseSpeed 3.000000");
PushToConsole("PerturbDecreaseSpeed 9.000000");
PushToConsole("PerturbWalkPercent 0.500000");
}
if(GetAsyncKeyState(VK_NUMPAD4)&1){//Comando per il no recoil.
recoil = !recoil;
}
if(recoil){//
memcpy((LPVOID)0x3745FA90, "\x90\x90\x90", 3);//You will have to update these your self.Drake has a thread posted.Thank him for his hardwork and thank me :D.
memcpy((LPVOID)0x37232A69, "\x90\x90\x90", 3);
memcpy((LPVOID)0x3745FAA4, "\x90\x90\x90", 3);
memcpy((LPVOID)0x3745FAA7, "\x90\x90\x90", 3);
memcpy((LPVOID)0x3745FAB0, "\x90\x90\x90", 3);
} else {
memcpy((LPVOID)0x3745FA90, "\xD8\x66\x54", 3);
memcpy((LPVOID)0x37232A69, "\xD9\x46\x54", 3);
memcpy((LPVOID)0x3745FAA4, "\xD9\x5E\x54", 3);
memcpy((LPVOID)0x3745FAA7, "\xD9\x46\x48", 3);
memcpy((LPVOID)0x3745FAB0, "\xD9\x5E\x48", 3);
}
if(GetAsyncKeyState(VK_NUMPAD2)&1){//Comando per i glass walls.
glass = !glass;
}
if(glass){
memcpy((LPVOID)0x5721AA, "\x6A\x00", 2);
} else {
memcpy((LPVOID)0x5721AA, "\x6A\x01", 2);
}
if(GetAsyncKeyState(VK_NUMPAD5)&1){//Comando per il no reload.
reload = !reload;
}
if(reload){
memcpy((LPVOID) 0x374AB714, "\x90\x90\x90\x90\x90\x90", 6);
} else {
memcpy((LPVOID) 0x374AB714, "\x0F\x84\xB1\x01\x00\x00", 6);
}
Sleep(50);
}
}
DWORD WINAPI dwHackThread(LPVOID)
{
while( !IsGameReadyForHook() )
Sleep(100);
main();
return 0;
}
BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{
DisableThreadLibraryCalls(hDll);
if ( dwReason == DLL_PROCESS_ATTACH )
{
system("start http:mysite.com/");
}
{CreateThread(NULL, NULL, dwHackThread, NULL, NULL, NULL);
}
return TRUE;
}
bool Memoria( void * pDest, char * szPatch, size_t sSize )//NOP Function
{
DWORD dwOrgProtect = NULL;
if ( !VirtualProtect ( pDest, sSize, PAGE_EXECUTE_READWRITE, &dwOrgProtect ))
return FALSE;
memcpy( pDest, szPatch, sSize );
VirtualProtect( pDest, sSize, dwOrgProtect, NULL );
return TRUE;
}
Please help me (address are not update but when they was update, the hack worked only with gordon injector)