Results 1 to 6 of 6
  1. #1
    nakar's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Posts
    3
    Reputation
    10
    Thanks
    0

    [C++]Game Hook Problem

    Hi guys, I m trying to hack with the hook method to BLR. But somethings wrong, i can't found my problem.Can anybody help me?

    I'm using the thefeckness SDK REV51.

    Code:
    FILE* file = fopen("logst.txt", "a");
    
    //00F94699 > $ E8 70020000    CALL BLR.00F9490E
    
    DWORD dwOvwrBytes = 0;
    
    #define UObject_ProcessEvent 0x0044C770
    
    UCanvas* pCanvas;
    DWORD dwCallingObject = 0;
    
    FColor MakeColor(int R, int G, int B, int A)
    {
    	FColor ReturnedColor;
    	ReturnedColor.R = R;
    	ReturnedColor.G = G;
    	ReturnedColor.B = B;
    	ReturnedColor.A = A;
    	return ReturnedColor;
    }
    
    FColor Green = MakeColor(0,255,255,255);
    
    
    UFunction* pFunction;
     void* pParms;
     void* pResult = NULL;
    
    VOID WINAPI DispatchFunction()
    {
    	fprintf(file,"log : %s\n", "3");
    
        if(pFunction == NULL || pParms == NULL)
            return;
    
    	fprintf(file,"log : %s\n", "4");
    
        if(!strcmp(pFunction->GetFullName(), "Function Engine.GameViewportClient.PostRender"))
        {
            pCanvas = ((UGameViewportClient_eventPostRender_Parms *)pParms)->Canvas;
    
            if(pCanvas != NULL)
            {
                pCanvas->CurX = 50;
                pCanvas->CurY = 50;
                pCanvas->DrawColor = Green;
                pCanvas->DrawText(L"y0o we draw here!!", NULL, 1.0f, 1.0f, NULL);
            }
        }
    }
    
    VOID __declspec(naked) ProxyFunction()
    {
    	fprintf(file,"log : %s\n", "5");
        __asm
        {
            mov dwCallingObject, ecx
    
            push edx
            mov edx, dword ptr [esp + 0x8]
            mov pFunction, edx
            mov edx, dword ptr [esp + 0xC]
            mov pParms, edx
            pop edx
    
            pushad
        }
    	fprintf(file,"log : %s\n", "6");
        DispatchFunction();
    
        __asm
        {
            popad
            jmp [dwOvwrBytes]
        }
    }
    
    int __stdcall DllMain( HMODULE hModule, unsigned long dwReason, void* lpReserved )
    {
    		
    	fprintf(file,"log : %s\n", "0");
        if ( dwReason == DLL_PROCESS_ATTACH )
        {		     
    			fprintf(file,"log : %s\n", "1");
           dwOvwrBytes = (DWORD)DetourFunction((BYTE*)UObject_ProcessEvent, (BYTE*)ProxyFunction);
    	   fprintf(file,"log : %s : %s\n", "1",dwOvwrBytes);
        }
    		fprintf(file,"log : %s\n", "2");
        return TRUE;
    }
    Last edited by nakar; 09-23-2012 at 02:21 PM.

  2. #2
          ( ° ͜ʖ͡°)╭∩╮
    Former Staff
    MarkHC's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    127.0.0.1
    Posts
    2,750
    Reputation
    66
    Thanks
    14,529
    My Mood
    Angelic
    I don't see what can be wrong since you copypasted the whole hook from lolHertz
     

    Code:
    DWORD dwOvwrBytes = 0;
    ...
    VOID WINAPI DispatchFunction()
    {
    
        if(pFunction == NULL || pParams == NULL)
            return;
    
        if(!strcmp(pFunction->GetFullName(), "Function FoxGame.FoxGameViewportClient.PostRender"))
        {
            pCanvas = ((UFoxGameViewportClient_eventPostRender_Parms *)pParams)->Canvas;
    
            if(pCanvas != NULL)
            {
                pCanvas->CurX = 10;
                pCanvas->CurY = 10;
                pCanvas->DrawColor = Color;
                pCanvas->DrawText(L"y0o we draw here!!", NULL, 1.0f, 1.0f, NULL);
            }
        }
    }
    
    VOID __declspec(naked) ProxyFunction()
    {
        __asm
        {
            mov dwCallingObject, ecx
    
            push edx
            mov edx, dword ptr [esp + 0x8]
            mov pFunction, edx
            mov edx, dword ptr [esp + 0xC]
            mov pParams, edx
            pop edx
    
            pushad
        }
    
        DispatchFunction();
    
        __asm
        {
            popad
            jmp [dwOvwrBytes]
        }
    }
    ...
    dwOvwrBytes = (DWORD)DetourFunction((BYTE *)dwProcessEvent, (BYTE *)ProxyFunction, 5); 
    ...


    /Nuff said
    Last edited by MarkHC; 09-24-2012 at 11:09 AM.


    CoD Minion from 09/19/2012 to 01/10/2013

  3. The Following User Says Thank You to MarkHC For This Useful Post:

    unspeakable (09-24-2012)

  4. #3
    kJNR's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Location
    Australia
    Posts
    58
    Reputation
    10
    Thanks
    23
    My Mood
    Yeehaw
    Eh... Sigh,
    It Could Be, Acutally why do i even Bother, you C&Pasted the Whole fucking Thing.
    Whats the Point in Acutally helping when it Seems you dont Have the Slightest Clue
    GO AND READ A FUCKING BOOK to learn the C++ Synatx

  5. The Following 2 Users Say Thank You to kJNR For This Useful Post:

    'Bruno (09-24-2012),unspeakable (09-24-2012)

  6. #4
    unspeakable's Avatar
    Join Date
    Mar 2012
    Gender
    male
    Location
    WorldWide
    Posts
    73
    Reputation
    21
    Thanks
    7
    My Mood
    Dead
    what do you expect from newbies? i mean seriously......
    "out out , brief candle" life is a matter of seconds.

  7. #5
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by unspeakable View Post
    what do you expect from newbies? i mean seriously......
    To actually learn a language before trying to leech a hack. It's not that much to ask, really.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  8. #6
    nakar's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Posts
    3
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by kJNR View Post
    GO AND READ A FUCKING BOOK to learn the C++ Synatx
    Thank you.
    You right, acctually i m a programmer but i'm learning new lang (c++). I just tried my chance. Thank u all.
    Last edited by nakar; 09-24-2012 at 02:02 PM.

Similar Threads

  1. [SOLVED]VAC Chaos 2.04 Game Loading Problem!
    By mvenom101 in forum Call of Duty Modern Warfare 2 Help
    Replies: 4
    Last Post: 07-04-2010, 05:29 PM
  2. Won't find a game (AlterIWNet problem)
    By Nikita285 in forum Call of Duty Modern Warfare 2 Private Servers
    Replies: 2
    Last Post: 06-23-2010, 06:10 AM
  3. [Delphi] Api Hooking problem
    By P4uLo in forum Programming Tutorial Requests
    Replies: 0
    Last Post: 05-31-2010, 11:44 PM
  4. D3D9 Hook problem [solved]
    By why06 in forum C++/C Programming
    Replies: 12
    Last Post: 03-28-2010, 08:02 PM
  5. CA Menu Pointer And Game Hooks
    By Syko_0 in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 10
    Last Post: 03-05-2010, 08:01 PM