CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2010
    Posts
    121

    Hooking on a __fastcall will fail eventually?

    Code:
    char __fastcall hooked_game_thunk(void* a1, void* a2)
    {	
    	try {
    		__asm {
    			pushad
    		}
    
    		DWORD mess = ((struct game_message*)a2)->Message_Base;
    		stringstream oss;
    		oss << mess << endl;
    		logfile2->shared_print(0, oss.str());		 
    
    		__asm {
    			popad
    		}
    
    		return original_game_thunk(a1, a2);
    	}
    	catch (std::exception e)
    	{
    		MessageBox(0, e.what(), e.what(), 0);
    		return 0;
    	}
    }
    The hook will succeed for about 4000 iterations, and the application will fail without reasons.
    The catch block is not reached, how can I know what went wrong?
    Thanks
    Jack

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Hooking on a __fastcall will fail eventually?

    It fails because there is a 4000 count limit to hacking a game.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured