Results 1 to 8 of 8
  1. #1
    yaserifti1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    The finest pussies of Earth
    Posts
    251
    Reputation
    9
    Thanks
    10
    My Mood
    Angelic

    First hack, simple hotkey.

    Hey guys, this is my first hack, and I'm having troubles... I'm pretty new to C++, so please help, and don't flame.


    Here is the script.
    Code:
    #include <windows.h>
    bool IsGameReadyForHook()
    bool hack;
    bool hack = false;
    {
    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) {
    if bool hack = true {
    if(GetAsyncKeyState(VK_NUMPAD1)&1){
    PushToConsole("SkelModelStencil 1");
    hack = true;
    }
    } else {
    PushToConsole("SkelModelStencil 0");
    bool hack = false;
    }
    }
    }
    }
    }
    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;
    }
    Here are my errors.
    Code:
    1>------ Build started: Project: cahacks1, Configuration: Debug Win32 ------
    1>  Base.cpp
    1>c:\users\administrator\documents\visual studio 2010\projects\cahacks1\cahacks1\base.cpp(3): error C2144: syntax error : 'bool' should be preceded by ';'
    1>c:\users\administrator\documents\visual studio 2010\projects\cahacks1\cahacks1\base.cpp(4): error C2086: 'bool hack' : redefinition
    1>          c:\users\administrator\documents\visual studio 2010\projects\cahacks1\cahacks1\base.cpp(3) : see declaration of 'hack'
    1>c:\users\administrator\documents\visual studio 2010\projects\cahacks1\cahacks1\base.cpp(5): error C2447: '{' : missing function header (old-style formal list?)
    1>c:\users\administrator\documents\visual studio 2010\projects\cahacks1\cahacks1\base.cpp(25): error C2062: type 'bool' unexpected
    1>c:\users\administrator\documents\visual studio 2010\projects\cahacks1\cahacks1\base.cpp(25): error C2143: syntax error : missing ';' before '{'
    1>c:\users\administrator\documents\visual studio 2010\projects\cahacks1\cahacks1\base.cpp(30): error C2181: illegal else without matching if
    1>c:\users\administrator\documents\visual studio 2010\projects\cahacks1\cahacks1\base.cpp(36): error C2059: syntax error : '}'
    1>c:\users\administrator\documents\visual studio 2010\projects\cahacks1\cahacks1\base.cpp(36): error C2143: syntax error : missing ';' before '}'
    1>c:\users\administrator\documents\visual studio 2010\projects\cahacks1\cahacks1\base.cpp(36): error C2059: syntax error : '}'
    1>c:\users\administrator\documents\visual studio 2010\projects\cahacks1\cahacks1\base.cpp(37): error C2143: syntax error : missing ';' before '}'
    1>c:\users\administrator\documents\visual studio 2010\projects\cahacks1\cahacks1\base.cpp(37): error C2059: syntax error : '}'
    1>c:\users\administrator\documents\visual studio 2010\projects\cahacks1\cahacks1\base.cpp(39): error C2143: syntax error : missing ';' before '{'
    1>c:\users\administrator\documents\visual studio 2010\projects\cahacks1\cahacks1\base.cpp(39): error C2447: '{' : missing function header (old-style formal list?)
    1>c:\users\administrator\documents\visual studio 2010\projects\cahacks1\cahacks1\base.cpp(50): error C2065: 'dwHackThread' : undeclared identifier
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    Can somebody please help me fix this?
    Last edited by yaserifti1; 02-05-2011 at 01:47 PM.
    Key:
    = done
    = not done
    = working on it
    = damn I killed it!

    Accomplishments On MPGH:

    make a mod -

    make a gun to gun mod -

    make a hack -

    learn C++ -

    roast a nub -

  2. #2
    LionelMessi10's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Location
    MPGH.NET
    Posts
    6,125
    Reputation
    114
    Thanks
    4,545
    My Mood
    Aggressive
    Many keys wrong

  3. #3
    yaserifti1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    The finest pussies of Earth
    Posts
    251
    Reputation
    9
    Thanks
    10
    My Mood
    Angelic
    Quote Originally Posted by Alessandro10 View Post
    Many keys wrong
    So, what do I do? I'm sorry, first time making a hack, and I am pretty new to C++.
    Key:
    = done
    = not done
    = working on it
    = damn I killed it!

    Accomplishments On MPGH:

    make a mod -

    make a gun to gun mod -

    make a hack -

    learn C++ -

    roast a nub -

  4. #4
    TheAvenger's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    Justin Bieber`s House!Yeh Posts:19,251
    Posts
    1,469
    Reputation
    65
    Thanks
    134
    My Mood
    Doh
    Um you are suppose to fix them it says where you are wrong which line 1,2,3,4 as u can see there just find some tutorials on youtube how to find your wrong keywords

  5. #5
    _Fk127_'s Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    724
    Reputation
    16
    Thanks
    208
    My Mood
    Bitchy
    [Highlight=C++]#include <windows.h>
    bool hack = false;
    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) {

    if(GetAsyncKeyState(VK_NUMPAD1)&1){
    hack =! hack;
    }
    if(hack)
    {
    PushToConsole("SkelModelStencil 1");
    } else {
    PushToConsole("SkelModelStencil 0");
    }
    }
    }

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

    [/Highlight]
    i fixed a bunch of stuff, come back and say whats still causing errors



    Put this image in your signature if you support HTML5 development!

  6. #6
    yaserifti1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    The finest pussies of Earth
    Posts
    251
    Reputation
    9
    Thanks
    10
    My Mood
    Angelic
    Quote Originally Posted by _Fk127_ View Post
    [Highlight=C++]#include <windows.h>
    bool hack = false;
    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) {

    if(GetAsyncKeyState(VK_NUMPAD1)&1){
    hack =! hack;
    }
    if(hack)
    {
    PushToConsole("SkelModelStencil 1");
    } else {
    PushToConsole("SkelModelStencil 0");
    }
    }
    }

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

    [/Highlight]
    i fixed a bunch of stuff, come back and say whats still causing errors
    Oh, I see what you did. Thanks!
    Last edited by yaserifti1; 02-05-2011 at 02:24 PM. Reason: problem solved!
    Key:
    = done
    = not done
    = working on it
    = damn I killed it!

    Accomplishments On MPGH:

    make a mod -

    make a gun to gun mod -

    make a hack -

    learn C++ -

    roast a nub -

  7. #7
    _Fk127_'s Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    724
    Reputation
    16
    Thanks
    208
    My Mood
    Bitchy
    Theres a stickied PTC commands thread



    Put this image in your signature if you support HTML5 development!

  8. #8
    yaserifti1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    The finest pussies of Earth
    Posts
    251
    Reputation
    9
    Thanks
    10
    My Mood
    Angelic
    Quote Originally Posted by _Fk127_ View Post
    Theres a stickied PTC commands thread
    Yeah, I know, but what do integer do I use to set it off, also can you fix the other problem?


    edit - Never mind, problem solved!
    Key:
    = done
    = not done
    = working on it
    = damn I killed it!

    Accomplishments On MPGH:

    make a mod -

    make a gun to gun mod -

    make a hack -

    learn C++ -

    roast a nub -