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 !
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
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;
}
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




