i made my very first hack tonight thanks to the stickied (and very thurough) tutorial
now i want to add to it, i have added somethings that i have seen here on forum but my problem is that whatever the first hack code is that's included in the void menu() { *code here* } is the only hack that works when i start the game (yes i am recompiling it after each edit, yes i am rebuilding it after each edit -.-")
here is the code below, maybe it has to do with how i set it up...
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* )(0x3778BFB0);
void* CONoff = ( void* )*( DWORD* )( *LTClient + 0x208 );
__asm
{
push szCommand;
call CONoff;
add esp, 4;
}
}
void main() {
while(true)
{
{
PushToConsole("SkelModelStencil 1");
PushToConsole("PerturbRotationEffect 0.000000");
PushToConsole("PerturbIncreaseSpeed 0.000000");
PushToConsole("PerturbWalkPercent 0.000000");
PushToConsole("PerturbFiringIncreaseSpeed 0.006000");
}
{
bool walls = false;
while(true)
{
if(GetAsyncKeyState(VK_NUMPAD0)<0){
walls = !walls;
if(walls){
memcpy((LPVOID)0x57207A, "\x6A\x01", 2);
} else {
memcpy((LPVOID)0x57207A, "\x6A\x00", 2);
}
Sleep(300);
}
Sleep(10);
}
{
bool recoil = false;
while(true)
{
if(GetAsyncKeyState(VK_NUMPAD2)<0);
recoil = !recoil;
if(recoil){
memcpy((LPVOID)0x3741A550, "\x90\x90\x90", 3);
memcpy((LPVOID)0x3740AA99, "\x90\x90\x90", 3);
memcpy((LPVOID)0x3741A564, "\x90\x90\x90", 3);
memcpy((LPVOID)0x3741A567, "\x90\x90\x90", 3);
memcpy((LPVOID)0x3741A570, "\x90\x90\x90", 3);
} else {
memcpy((LPVOID)0x3741A550, "\xD8\x66\x54", 3);
memcpy((LPVOID)0x3740AA99, "\xD9\x46\x54", 3);
memcpy((LPVOID)0x3741A564, "\xD9\x5E\x54", 3);
memcpy((LPVOID)0x3741A567, "\xD9\x46\x48", 3);
memcpy((LPVOID)0x3741A570, "\xD9\x5E\x48", 3);
}
Sleep(300);
}
Sleep(10);
}
{
bool reload = false;
while(true)
{
if(GetAsyncKeyState(VK_NUMPAD3)<0);
reload = !reload;
if(reload){
memcpy((LPVOID)0x37466264, "\x90\x90\x90\x90\x90\x90", 6);
} else {
memcpy((LPVOID)0x37466264, "\x0F\x84\xB1\x01\x00\x00", 6);
}
Sleep(300);
}
Sleep(10);
}
}
}
}
void dwHackThread() {
}
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 )
{
CreateThread(NULL, NULL, dwHackThread, NULL, NULL, NULL);
}
return TRUE;
}
any help is greatly appreciated and you will be thanked! (also feel free to use any and/or all the code posted above, i can't say you can't...so do it if ya want lol)