Results 1 to 12 of 12
  1. #1
    blackdragon4661's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Posts
    19
    Reputation
    10
    Thanks
    7
    My Mood
    Psychedelic

    Unhappy Keep getting errors with my hack...

    Okay, so... I'm new to hacking (please don't flame me, i'm trying and learning )

    So, This is my 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 CPush(constchar* cmd)
    {
    _asm
    {
    PUSH cmd
    MOV EAX, 0x00485FA0
    CALL EAX
    ADD ESP, 0x4
    }
    }
    void main()
    {
    while(true)
    {
    PushToConsole("SkelModelStencil 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;
    }
    It is pretty much auto-on chams (I set out for it to be that, at least...)
    But when I go to build, I get:

    Code:
    error C2065: 'constchar' : undeclared identifier
    error C2065: 'cmd' : undeclared identifier
    error C2448: 'CPush' : function-style initializer appears to be a function definition
    error C3861: 'PushToConsole': identifier not found
    Can anyone please help me? I'm completely lost. I think I have the right unwrapp console code.... And I think I have it in there right, I'm just not sure what I did wrong...

  2. #2
    dllbaseII's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    Integrais e Derivadas
    Posts
    962
    Reputation
    12
    Thanks
    462
    My Mood
    Chatty
    wrong place mate
    .


    Skype:
    MPGH.dllbaseII

  3. #3
    -Dimensions-'s Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    243
    Reputation
    2
    Thanks
    162
    My Mood
    Aggressive
    Code:
    //You may want to use a class for the RunConsoleCommand, IsInGame, Main, and IsGameReadyForHook Functions.
    /* Just in case you decide adding some stuff.
    #include <d3d9.h>
    #include <d3dx9.h>
    #include <d3dx9core.h>
    #include <fstream>
    #include <iostream>
    #include <sstream>
    #include <stdio.h>
    #include <stdlib.h> 
    #include <string>
    #include <time.h>
    #include <Winuser.h>
    */
    #include <windows.h>
    void __cdecl RunConsoleCommand( const char* cCommand )
    {
    	void* address = ( void* )0x00485FA0; //Unwrapped Console Address
    	__asm
    	{
    		Push cCommand
    		call address
    		add esp, 0x4
    	}
    }
    bool IsInGame()
    {
    	switch(*(int*)0x377B11B0) //Game Status Address
    	{ 
    	case 1:
    		return true; //Your in a game
    	case 5:
    		return false; //Your in the lobby
    	}
    	return false; //Even if you aren't
    }
    void main( void )
    {
    	while ( true )
    	{
    		if ( IsInGame == true /*In-Game*/ && GetAsyncKeyState( VK_NUMPAD1 ) < 0 /*Self Explanitory*/ )
    		{
    			this->RunConsoleCommand( "SkelModelStencil 1" ); //On
    		}else{
    			this->RunConsoleCommand( "SkelModelStencil 0" ); //Off
    		}
    	}
    }
    bool IsGameReadyForHook()
    {
    	if( GetModuleHandleA( "d3d9.dll"     ) != NULL &&
    		GetModuleHandleA( "ClientFX.fxd" ) != NULL &&
    		GetModuleHandleA( "CShell.dll"   ) != NULL )
    		return true;
    
    	return false;
    }
    DWORD WINAPI dwHackThread( LPVOID )
    {
    	while ( !IsGameReadyForHook() )
    		Sleep( 25 );
    
    	main();
    
    	return EXIT_SUCCESS;
    }
    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;
    }
    Heres credits:
    Me, DeadLine, Flameswort10, Gellin.

    Much neater and if you get a error fix it yourself.
    Those were the easiest errors to fix ever, but I'm guessing your a noobie.
    I'm not going to flame or troll b/c that not me.
    Additionally like DLLBaseII said, wrong section.
    Make sure its MultiByte in the Project Properties.
    Consider my assistance expired. Bye.
    Last edited by -Dimensions-; 07-30-2011 at 01:51 PM.

  4. The Following User Says Thank You to -Dimensions- For This Useful Post:

    blackdragon4661 (07-30-2011)

  5. #4
    blackdragon4661's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Posts
    19
    Reputation
    10
    Thanks
    7
    My Mood
    Psychedelic
    Thank you so much, and yes, I am a noobie :/ But i'm trying to learn. I searched google for those errors but nothing popped up. Thank you for not trolling, and actually helping
    Last edited by blackdragon4661; 07-30-2011 at 01:51 PM.

  6. #5
    Skaterforeva1's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Up your ass
    Posts
    936
    Reputation
    32
    Thanks
    485
    My Mood
    Psychedelic
    Quote Originally Posted by -Dimensions- View Post
    Code:
    //You may want to use a class for the RunConsoleCommand, IsInGame, Main, and IsGameReadyForHook Functions.
    /* Just in case you decide adding some stuff.
    #include <d3d9.h>
    #include <d3dx9.h>
    #include <d3dx9core.h>
    #include <fstream>
    #include <iostream>
    #include <sstream>
    #include <stdio.h>
    #include <stdlib.h> 
    #include <string>
    #include <time.h>
    #include <Winuser.h>
    */
    #include <windows.h>
    void __cdecl RunConsoleCommand( const char* cCommand )
    {
    	void* address = ( void* )0x00485FA0; //Unwrapped Console Address
    	__asm
    	{
    		Push cCommand
    		call address
    		add esp, 0x4
    	}
    }
    bool IsInGame()
    {
    	switch(*(int*)0x377B11B0) //Game Status Address
    	{ 
    	case 1:
    		return true; //Your in a game
    	case 5:
    		return false; //Your in the lobby
    	}
    	return false; //Even if you aren't
    }
    void main( void )
    {
    	while ( true )
    	{
    		if ( IsInGame == true /*In-Game*/ && GetAsyncKeyState( VK_NUMPAD1 ) < 0 /*Self Explanitory*/ )
    		{
    			this->RunConsoleCommand( "SkelModelStencil 1" ); //On
    		}else{
    			this->RunConsoleCommand( "SkelModelStencil 0" ); //Off
    		}
    	}
    }
    bool IsGameReadyForHook()
    {
    	if( GetModuleHandleA( "d3d9.dll"     ) != NULL &&
    		GetModuleHandleA( "ClientFX.fxd" ) != NULL &&
    		GetModuleHandleA( "CShell.dll"   ) != NULL )
    		return true;
    
    	return false;
    }
    DWORD WINAPI dwHackThread( LPVOID )
    {
    	while ( !IsGameReadyForHook() )
    		Sleep( 25 );
    
    	main();
    
    	return EXIT_SUCCESS;
    }
    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;
    }
    Heres credits:
    Me, DeadLine, Flameswort10, Gellin.

    Much neater and if you get a error fix it yourself.
    Those were the easiest errors to fix ever, but I'm guessing your a noobie.
    I'm not going to flame or troll b/c that not me.
    Additionally like DLLBaseII said, wrong section.
    Make sure its MultiByte in the Project Properties.
    Consider my assistance expired. Bye.
    &#x202a;INTERIOR CROCODILE ALLIGATOR&#x202c;&rlm; - YouTube
    thanks i been looking for an ingame function thats y my hack hasnt been working that well




    ^Suck it!

  7. #6
    -Dimensions-'s Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    243
    Reputation
    2
    Thanks
    162
    My Mood
    Aggressive
    Once again, press Thanks if I helped.

  8. The Following User Says Thank You to -Dimensions- For This Useful Post:

    Skaterforeva1 (07-31-2011)

  9. #7
    freedompeace's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    3,033
    Reputation
    340
    Thanks
    2,792
    My Mood
    Sad
    You errors, in friendly descriptions, are:
    - 'constchar' : undeclared identifier
    - 'cmd' : undeclared identifier
    - 'CPush' : function-style initializer appears to be a function definition
    - 'PushToConsole': identifier not found

    (pretty obvious lol)

  10. #8
    kibbles18's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Location
    US
    Posts
    860
    Reputation
    5
    Thanks
    127
    You copy - pasted some random functions into your compiler and expected it to work. Whats even sadder is that you googled the errors l0l.

  11. #9
    Gordon`'s Avatar
    Join Date
    Dec 2007
    Gender
    male
    Posts
    283
    Reputation
    24
    Thanks
    325
    Code:
    void CPush(constchar* cmd)
    =>
    Code:
    void PushToConsole(const char* cmd)
    as freedompeace said, the error messages got all infos u need to fix the problem.

    constchar doesnt exist in c++, its const char. the reason why the error log also says that "cmd" is an undeclared identifier is because constchar doesnt exist.


  12. #10
    yodaliketaco's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    winsock.dll
    Posts
    645
    Reputation
    45
    Thanks
    514
    My Mood
    Tired
    Quote Originally Posted by -Dimensions- View Post
    Code:
    //You may want to use a class for the RunConsoleCommand, IsInGame, Main, and IsGameReadyForHook Functions.
    /* Just in case you decide adding some stuff.
    #include <d3d9.h>
    #include <d3dx9.h>
    #include <d3dx9core.h>
    #include <fstream>
    #include <iostream>
    #include <sstream>
    #include <stdio.h>
    #include <stdlib.h> 
    #include <string>
    #include <time.h>
    #include <Winuser.h>
    */
    #include <windows.h>
    void __cdecl RunConsoleCommand( const char* cCommand )
    {
    	void* address = ( void* )0x00485FA0; //Unwrapped Console Address
    	__asm
    	{
    		Push cCommand
    		call address
    		add esp, 0x4
    	}
    }
    bool IsInGame()
    {
    	switch(*(int*)0x377B11B0) //Game Status Address
    	{ 
    	case 1:
    		return true; //Your in a game
    	case 5:
    		return false; //Your in the lobby
    	}
    	return false; //Even if you aren't
    }
    void main( void )
    {
    	while ( true )
    	{
    		if ( IsInGame == true /*In-Game*/ && GetAsyncKeyState( VK_NUMPAD1 ) < 0 /*Self Explanitory*/ )
    		{
    			this->RunConsoleCommand( "SkelModelStencil 1" ); //On
    		}else{
    			this->RunConsoleCommand( "SkelModelStencil 0" ); //Off
    		}
    	}
    }
    bool IsGameReadyForHook()
    {
    	if( GetModuleHandleA( "d3d9.dll"     ) != NULL &&
    		GetModuleHandleA( "ClientFX.fxd" ) != NULL &&
    		GetModuleHandleA( "CShell.dll"   ) != NULL )
    		return true;
    
    	return false;
    }
    DWORD WINAPI dwHackThread( LPVOID )
    {
    	while ( !IsGameReadyForHook() )
    		Sleep( 25 );
    
    	main();
    
    	return EXIT_SUCCESS;
    }
    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;
    }
    Heres credits:
    Me, DeadLine, Flameswort10, Gellin.

    Much neater and if you get a error fix it yourself.
    Those were the easiest errors to fix ever, but I'm guessing your a noobie.
    I'm not going to flame or troll b/c that not me.
    Additionally like DLLBaseII said, wrong section.
    Make sure its MultiByte in the Project Properties.
    Consider my assistance expired. Bye.
    &#x202a;INTERIOR CROCODILE ALLIGATOR&#x202c;&rlm; - YouTube
    One problem I see in your code:

    Code:
    if ( IsInGame == true &&...)
    Change that to

    Code:
    if ( IsInGame() &&...)
    Otherwise you are checking if the address of the function IsInGame is 1, which is obviously never the case.

  13. #11
    -Dimensions-'s Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    243
    Reputation
    2
    Thanks
    162
    My Mood
    Aggressive
    Quote Originally Posted by yodaliketaco View Post
    One problem I see in your code:

    Code:
    if ( IsInGame == true &&...)
    Change that to

    Code:
    if ( IsInGame() &&...)
    Otherwise you are checking if the address of the function IsInGame is 1, which is obviously never the case.
    My bad thank you.

  14. #12
    DecoderBack's Avatar
    Join Date
    May 2011
    Gender
    male
    Posts
    111
    Reputation
    10
    Thanks
    12
    Quote Originally Posted by yodaliketaco View Post
    One problem I see in your code:

    Code:
    if ( IsInGame == true &&...)
    Change that to

    Code:
    if ( IsInGame() &&...)
    Otherwise you are checking if the address of the function IsInGame is 1, which is obviously never the case.
    Nice one bro
    Last edited by DecoderBack; 08-02-2011 at 05:49 AM.

    C#(.net)/C++ Coder
    Assembly coder [Current learning more]

Similar Threads

  1. [Solved] Getting error with NA hack in-game
    By bullshit1234 in forum CrossFire Help
    Replies: 9
    Last Post: 11-02-2011, 10:24 AM
  2. I keep getting error when opening hack[HELP!!!!!!]
    By Cagamer in forum Combat Arms Hacks & Cheats
    Replies: 18
    Last Post: 12-18-2008, 09:19 PM
  3. Error with new hacks rofl. With pics.
    By omgonoes in forum Combat Arms Hacks & Cheats
    Replies: 12
    Last Post: 12-18-2008, 03:38 PM
  4. Keep Getting Error Code
    By Promisetime in forum Combat Arms Hacks & Cheats
    Replies: 15
    Last Post: 08-14-2008, 04:48 PM
  5. Still get Error from charm hack
    By azngamerboi9 in forum Combat Arms Hacks & Cheats
    Replies: 2
    Last Post: 08-04-2008, 10:36 AM