How to turn hotkey hack on/off?

Posts 1–15 of 22 · Page 1 of 2
How to turn hotkey hack on/off?
Hello everyone, so i'm just going to let all of you know i'm a complete NOOB at C++ and making hacks... i'm just here to learn and hopefully become more advanced at this later on... Yes, i did C+P some stuff but it's all for educational purposes! so here we go !

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-2+6+4
}
}
void main()
{
while(true)
{
	if(GetAsyncKeyState(VK_NUMPAD0)<0){
		PushToConsole("SkelModelStencil -1" );
		PushToConsole("ModelDebug_DrawBoxes 1" );
	}
	if(GetAsyncKeyState(VK_NUMPAD1)<0){
		PushToConsole("FogEnable 1" );
	}
}
}

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;
}
Credits go to CoderNever, acid_burn , almost everyone here on mpgh!

As i said on the topic title, how do i make it so that i can turn the hacks on and off? i've tested this hack in game and all i can do right now is turn it on.... what i want is to be able to turn on and off! Thank you please teach me!!
AND yes, i'm quite sure there are errors as i'm a complete noob
void main()
{
bool chams = false;
while(true)
{
if(GetAsyncKeyState(VK_NUMPAD0)<0){
if(chams){
PushToConsole("SkelModelStencil 0" );
PushToConsole("ModelDebug_DrawBoxes 0" );
chams = false;
}else{
PushToConsole("SkelModelStencil 1" );
PushToConsole("ModelDebug_DrawBoxes 1" );
chams = true
}
}

}
}
Ok So what you want to do is to define a BOOL you can add the bool right above your include. A bool is a ture/false statement so you can put this under your incude.

Code:
bool HackStatus = false;
this will define it, and will set it to false.

Now you can add

Code:
&& HackStatus == true
after your hotkey define so it would look like..

Code:
if(GetAsyncKeyState(VK_NUMPAD0)<0 && HackStatus == true){
which means it will only work if it is set to true. So now we want to make it so we can set it to true, because none of the above codes set it to true xD.

so basically your entire main should look like this

Code:
void main()
{
while(true)
{
	if(GetAsyncKeyState(VK_NUMPAD0 <0 && HackStatus == true){
		PushToConsole("SkelModelStencil 0" );
		HackStatus = false;
	}
       if(GetAsyncKeyState(VK_NUMPAD0 <0 && HackStatus == false){
		HackStatus = true;
                PushToConsole("SkelModelStencil 1" );
	}

}
}
Ok, so i added the bool and the true/false thing, my code looks like this now
Code:
void main()
{
bool HackStatus = false;
while(true)
{
	if(GetAsyncKeyState(VK_NUMPAD0 <0 && HackStatus == true){
		PushToConsole("SkelModelStencil 0" );
		HackStatus = false;
	}
       if(GetAsyncKeyState(VK_NUMPAD0 <0 && HackStatus == false){
		HackStatus = true;
                PushToConsole("SkelModelStencil 1" );
	}

}
}
But C++ says
error C2143: syntax error : missing ')' before '{'
error C2143: syntax error : missing ')' before '{'
What am i doing wrong?
Thanks a lot!
add one more ")" to so it should look like this

&& HackStatus == true))

the same with the other one

&& HackStatus == false))
my num pad hack, you dont need the }else{..just saying
Damit CN's was better
Code:
bool chams = false;
Code:
if(GetAsyncKeyState(VK_NUMPAD1)<0){
			if(chams==false){
				ConsolePush("SkelModelStencil 1");
				chams=true;
			}else{
				ConsolePush("SkelModelStencil 0");
				chams=false;
			}
		}
is how i done mine
look at the error? it says missing ')' before '{'

double click on the syntax error.. it will take you to the code that the error is in.. just add ')' before you have the '{'
Thanks very much to everyone who helped me through this!! I just realised i'm more noob in C++ than i thought i was.... how i found that out? i never realised you could double click error to bring you to the error..... HAHA i'm such a noob!
I actually learned quite a lot from this! You guys are the best~!


Hey guys, i'm back... i just tested out the hack, and when i press the hotkey, nothing happens!! i feel like such a complete noob right now, here's the code:

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-2+6+4
}
}
void main()
{
bool HackStatus = false;
while(true)
{
	if(GetAsyncKeyState(VK_NUMPAD1 <0 && HackStatus == true)){
		PushToConsole("SkelModelStencil 0" );
		HackStatus = false;
	}
    if(GetAsyncKeyState(VK_NUMPAD1 <0 && HackStatus == false)){
        PushToConsole("SkelModelStencil -1" );
		HackStatus = true;
	}

}
}


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;
}
what am I doing wrong!! still trying to figure this out... :S

EDIT:


Hey guys, i'm back... i just tested out the hack, and when i press the hotkey, nothing happens!! i feel like such a complete noob right now, here's the code:

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-2+6+4
}
}
void main()
{
bool HackStatus = false;
while(true)
{
	if(GetAsyncKeyState(VK_NUMPAD1 <0 && HackStatus == true)){
		PushToConsole("SkelModelStencil 0" );
		HackStatus = false;
	}
    if(GetAsyncKeyState(VK_NUMPAD1 <0 && HackStatus == false)){
        PushToConsole("SkelModelStencil -1" );
		HackStatus = true;
	}

}
}


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;
}
what am I doing wrong!! still trying to figure this out... :S
Quote Originally Posted by fearmeknowme View Post
Thanks very much to everyone who helped me through this!! I just realised i'm more noob in C++ than i thought i was.... how i found that out? i never realised you could double click error to bring you to the error..... HAHA i'm such a noob!
I actually learned quite a lot from this! You guys are the best~!


Hey guys, i'm back... i just tested out the hack, and when i press the hotkey, nothing happens!! i feel like such a complete noob right now, here's the code:

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-2+6+4
}
}
void main()
{
bool HackStatus = false;
while(true)
{
	if(GetAsyncKeyState(VK_NUMPAD1 <0 && HackStatus == true)){
		PushToConsole("SkelModelStencil 0" );
		HackStatus = false;
	}
    if(GetAsyncKeyState(VK_NUMPAD1 <0 && HackStatus == false)){
        PushToConsole("SkelModelStencil -1" );
		HackStatus = true;
	}

}
}


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;
}
what am I doing wrong!! still trying to figure this out... :S

EDIT:


Hey guys, i'm back... i just tested out the hack, and when i press the hotkey, nothing happens!! i feel like such a complete noob right now, here's the code:

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-2+6+4
}
}
void main()
{
bool HackStatus = false;
while(true)
{
	if(GetAsyncKeyState(VK_NUMPAD1 <0 && HackStatus == true)){
		PushToConsole("SkelModelStencil 0" );
		HackStatus = false;
	}
    if(GetAsyncKeyState(VK_NUMPAD1 <0 && HackStatus == false)){
        PushToConsole("SkelModelStencil -1" );
		HackStatus = true;
	}

}
}


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;
}
what am I doing wrong!! still trying to figure this out... :S
Try doing it this way. It is the same concept.

Probably some typos, I didn't look over it.
Code:
bool hack = false

  if(GetAsyncKeyState(VK_NUMPAD0)<0)
  {
     if( hack = false )
     {
      PushToConsole("BLAHBLAHBLAH 1");
      hack = true;
      Sleep(10);
     }
     if( hack = true )
     {
     PushToConsole("BLAHBLAHBLAH 0");
     hack = false;
     Sleep(10);
     }
  }
Another way :
Code:
if(GetAsyncKeyState(VK_NUMPAD0) < 0){
    hack = !hack;
    if(hack){
        Push("Hack 1");
    } else {
        Push("Hack 0");
    }
    Sleep(200);
}
Possibly even :
Code:
if(GetAsyncKeyState(VK_NUMPAD0) < 0){
    hack = !hack;
    char pushbuffer[50];
    sprintf_s(pushbuffer, 50, "Hack %d", hack);
    Push(pushbuffer);
    Sleep(200);
}
The second one depends on if it's a command where you use 0 or 1 like No Fog for example.
Did they do like a silent patch? cause every time i try to use this it D/C's me... yet somehow it was working for him. and NX chams i made started D/C'ing as well
Quote Originally Posted by fvestrgenrl View Post
Did they do like a silent patch? cause every time i try to use this it D/C's me... yet somehow it was working for him. and NX chams i made started D/C'ing as well
Use a different PTC method.
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-2+6+4
}
}
void main()
{
bool HackStatus = false;
while(true)
{
	if(GetAsyncKeyState(VK_NUMPAD1 <0 && HackStatus == true)){
		PushToConsole("SkelModelStencil 0" );
		HackStatus = false;
	}
    if(GetAsyncKeyState(VK_NUMPAD1 <0 && HackStatus == false)){
        PushToConsole("SkelModelStencil -1" );
		HackStatus = true;
	}

}
}


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;
}
OPEN YOUR EYES PPL
He NEEDS TO PUT ")" after the VK_NUMPAD1
Posts 1–15 of 22 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us