leoisso (07-20-2010)
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!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
leoisso (07-20-2010)
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
}
}
}
}
leoisso (07-20-2010)
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.
this will define it, and will set it to false.Code:bool HackStatus = false;
Now you can add
after your hotkey define so it would look like..Code:&& 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.Code:if(GetAsyncKeyState(VK_NUMPAD0)<0 && HackStatus == true){
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" ); } } }
DaBrowSky (07-21-2010),fearmeknowme (07-20-2010),leoisso (07-20-2010),whit (07-20-2010)
my num pad hack, you dont need the }else{..just saying
Need Help With Coding or Something??? MSN me
zmansquared@hotmail.com
I am the one and only Microsoft Fag!!!
Quote:
Originally Posted by Arhk
All games should be hacked, if we don't do it someone else will. Hackers force the progress, of better programming methods.
~
Take this Pic everyone!
next-
Code:bool chams = false;is how i done mineCode:if(GetAsyncKeyState(VK_NUMPAD1)<0){ if(chams==false){ ConsolePush("SkelModelStencil 1"); chams=true; }else{ ConsolePush("SkelModelStencil 0"); chams=false; } }
Ok, so i added the bool and the true/false thing, my code looks like this now
But C++ saysCode: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" ); } } }
error C2143: syntax error : missing ')' before '{'
error C2143: syntax error : missing ')' before '{'
What am i doing wrong?
Thanks a lot!
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 '{'
fearmeknowme (07-20-2010)
add one more ")" to so it should look like this
&& HackStatus == true))
the same with the other one
&& HackStatus == false))
fearmeknowme (07-20-2010),GameTrainerMaker (07-20-2010)
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:
what am I doing wrong!! still trying to figure this out... :SCode:#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; }
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:
what am I doing wrong!! still trying to figure this out... :SCode:#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; }
GameTrainerMaker (07-20-2010)
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 :
Possibly even :Code:if(GetAsyncKeyState(VK_NUMPAD0) < 0){ hack = !hack; if(hack){ Push("Hack 1"); } else { Push("Hack 0"); } Sleep(200); }
The second one depends on if it's a command where you use 0 or 1 like No Fog for example.Code:if(GetAsyncKeyState(VK_NUMPAD0) < 0){ hack = !hack; char pushbuffer[50]; sprintf_s(pushbuffer, 50, "Hack %d", hack); Push(pushbuffer); Sleep(200); }
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
fvestrgenrl (07-21-2010)
OPEN YOUR EYES PPLCode:#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; }
He NEEDS TO PUT ")" after the VK_NUMPAD1