Go Back   UnKnoWnCheaTs - Multiplayer Game Hacking and Cheats

  • MidFunction Hook MidFunction Hook
    sponsored advertisements
    Reply
     
    Thread Tools

    MidFunction Hook (W7 & Vista)
    Old 27th August 2010, 05:39 AM   #1
    Shad0w_
    Sick as Sin

    Shad0w_'s Avatar

    Join Date: Jul 2009
    Location: England M8
    Posts: 1,525
    Reputation: 12556
    Rep Power: 388
    Shad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server space
    Points: 37,205, Level: 29
    Points: 37,205, Level: 29 Points: 37,205, Level: 29 Points: 37,205, Level: 29
    Level up: 37%, 1,595 Points needed
    Level up: 37% Level up: 37% Level up: 37%
    Activity: 0%
    Activity: 0% Activity: 0% Activity: 0%
    Last Achievements MidFunction HookMidFunction HookMidFunction Hook
    MidFunction Hook (W7 & Vista)

    Thought I would release this since I don't use it anymore
    I made it as a method to counter hackshields protection
    However there are easier methods to counter hackshield


    Defines
    Code:
    DWORD * VTable;
    DWORD dwEndscene_hook, dwEndscene_ret;
    BYTE EndSceneOpCodes[6];
    Endscene
    Code:
    __declspec(naked) void MyEndscene( )
    {
        __asm 
        {
            mov dword ptr ss:[ebp - 10], esp;
            mov esi, dword ptr ss:[ebp + 0x8]; //replace patched code
                    mov m_pD3Ddev, esi; //Get the device
        }
    
    
        __asm 
        {
            jmp dwEndscene_ret;//jump back to normal endscene
        }
    
    }
    My offset init function using vtable pattern that Gordon' posted
    Code:
    void Dx9Hook( LPCSTR D3D9 )
    {
        DWORD hD3D = NULL;
        while (!hD3D) hD3D = (DWORD)GetModuleHandle(D3D9);
        DWORD PPPDevice = FindPattern(hD3D, 0x128000, (PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86", "xx????xx????xx");
        memcpy( &VTable, (void *)(PPPDevice + 2), 4);
    
        dwEndscene_hook = VTable[42] + 0x2A; //mid function
        dwEndscene_ret = dwEndscene_hook + 0x6; //return address
    }
    Usuage @ Mainthread
    Code:
    Dx9Hook("d3d9.dll");
    
    
    Memcpy((void *)Endscene_opcodes, (void *)"\x89\x65\xF0\x8B\x75\x08", 6);
            
    while( 1 )
    {
        Sleep( 1000 );
    
        if(memcmp((void *)Endscene_opcodes, (void *)dwEndscene_hook, 6) == 0 )
            Detour(dwEndscene_hook, MyEndscene);
     
    }
    Loop to counter repatching from hackshield
    Detour must be 6 bytes long, since your over writing this instruction in endscene:
    mov dword ptr ss:[ebp - 10], esp;
    mov esi, dword ptr ss:[ebp + 0x8];

    Enjoy.

    This should work on most functions within the d3d interface, since I'm hooking just after the device is mov to esi.

    Last edited by Shad0w_; 31st August 2010 at 02:48 AM.
    Shad0w_ is offline
    Reply With Quote

    Old 27th August 2010, 05:53 AM   #2
    SEGnosis
    Hacked North Korea

    SEGnosis's Avatar

    Join Date: Mar 2009
    Posts: 2,838
    Reputation: 25709
    Rep Power: 422
    SEGnosis has reputation that takes up 2GB of server space!SEGnosis has reputation that takes up 2GB of server space!SEGnosis has reputation that takes up 2GB of server space!SEGnosis has reputation that takes up 2GB of server space!SEGnosis has reputation that takes up 2GB of server space!SEGnosis has reputation that takes up 2GB of server space!SEGnosis has reputation that takes up 2GB of server space!SEGnosis has reputation that takes up 2GB of server space!SEGnosis has reputation that takes up 2GB of server space!SEGnosis has reputation that takes up 2GB of server space!SEGnosis has reputation that takes up 2GB of server space!
    Recognitions Award symbolizing a retired staff member who dedicated a notable amount of time and effort to their past staff position. Former Staff
    Points: 90,129, Level: 43
    Points: 90,129, Level: 43 Points: 90,129, Level: 43 Points: 90,129, Level: 43
    Level up: 68%, 1,471 Points needed
    Level up: 68% Level up: 68% Level up: 68%
    Activity: 0%
    Activity: 0% Activity: 0% Activity: 0%
    Last Achievements MidFunction HookMidFunction HookMidFunction HookMidFunction Hook
    o: looks decent, but too many undefined vars.
    __________________
    SEGnosis is offline
    Reply With Quote

    Old 27th August 2010, 05:56 AM   #3
    Shad0w_
    Sick as Sin

    Shad0w_'s Avatar

    Threadstarter
    Join Date: Jul 2009
    Location: England M8
    Posts: 1,525
    Reputation: 12556
    Rep Power: 388
    Shad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server space
    Points: 37,205, Level: 29
    Points: 37,205, Level: 29 Points: 37,205, Level: 29 Points: 37,205, Level: 29
    Level up: 37%, 1,595 Points needed
    Level up: 37% Level up: 37% Level up: 37%
    Activity: 0%
    Activity: 0% Activity: 0% Activity: 0%
    Last Achievements MidFunction HookMidFunction HookMidFunction Hook
    Quote:
    Originally Posted by SEGnosis View Post
    o: looks decent, but too many undefined vars.
    Not really, 4 basic and simple ones.
    For people who can't master them, they should be doing this:
    Code:
    DWORD * VTable;
    DWORD dwEndscene_hook, dwEndscene_ret;
    BYTE EndSceneOpCodes[6];

    Last edited by Shad0w_; 26th September 2010 at 10:23 PM.
    Shad0w_ is offline
    Reply With Quote

    Old 27th August 2010, 06:05 AM   #4
    Gellin
    The Legendary Cheater

    Gellin's Avatar

    Join Date: Nov 2007
    Location: msdn
    Posts: 563
    Reputation: 5519
    Rep Power: 411
    Gellin DEFINES UNKNOWNCHEATSGellin DEFINES UNKNOWNCHEATSGellin DEFINES UNKNOWNCHEATSGellin DEFINES UNKNOWNCHEATSGellin DEFINES UNKNOWNCHEATSGellin DEFINES UNKNOWNCHEATSGellin DEFINES UNKNOWNCHEATSGellin DEFINES UNKNOWNCHEATSGellin DEFINES UNKNOWNCHEATSGellin DEFINES UNKNOWNCHEATSGellin DEFINES UNKNOWNCHEATS
    Recognitions Award symbolizing a retired staff member who dedicated a notable amount of time and effort to their past staff position. Former Staff
    Members who have contributed financial support towards UnKnoWnCheaTs. Donator (1)
    Code:
    __declspec(naked) void MyEndscene( )
    {
    	__asm 
    	{
    		mov dword ptr ss:[ebp - 10], esp;
    		mov esi, dword ptr ss:[ebp + 0x8]; //replace patched code
                    mov m_pD3Ddev, esi; //Get the device
                    pushad;
    	}
    
    
    	__asm 
    	{
                    popad;
    		jmp dwEndscene_ret;//jump back to normal endscene
    	}
    
    }
    __________________
    Gellin is offline
    Reply With Quote

    Old 27th August 2010, 06:07 AM   #5
    Shad0w_
    Sick as Sin

    Shad0w_'s Avatar

    Threadstarter
    Join Date: Jul 2009
    Location: England M8
    Posts: 1,525
    Reputation: 12556
    Rep Power: 388
    Shad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server space
    Points: 37,205, Level: 29
    Points: 37,205, Level: 29 Points: 37,205, Level: 29 Points: 37,205, Level: 29
    Level up: 37%, 1,595 Points needed
    Level up: 37% Level up: 37% Level up: 37%
    Activity: 0%
    Activity: 0% Activity: 0% Activity: 0%
    Last Achievements MidFunction HookMidFunction HookMidFunction Hook
    When I was using this method of hooking, I never had the need to push or pop any registers.
    Never crashed, failed or error'd anyways.
    Shad0w_ is offline
    Reply With Quote

    Old 27th August 2010, 12:00 PM   #6
    thelick
    h4x0!2

    thelick's Avatar

    Join Date: Jul 2010
    Posts: 94
    Reputation: 53
    Rep Power: 336
    thelick is known to create posts fair in quality
    I'm not expert like you by the way i don't use the endscene in my hook and i don't see any reason to use it or i'm wrong?
    Endscene it's constantly scanned from the hs but it isn't so needful
    thelick is offline
    Reply With Quote

    Old 27th August 2010, 12:52 PM   #7
    fatboy88
    A Forum Hero

    fatboy88's Avatar

    Join Date: May 2005
    Posts: 1,607
    Reputation: 23044
    Rep Power: 0
    fatboy88 has reputation that takes up 2GB of server space!fatboy88 has reputation that takes up 2GB of server space!fatboy88 has reputation that takes up 2GB of server space!fatboy88 has reputation that takes up 2GB of server space!fatboy88 has reputation that takes up 2GB of server space!fatboy88 has reputation that takes up 2GB of server space!fatboy88 has reputation that takes up 2GB of server space!fatboy88 has reputation that takes up 2GB of server space!fatboy88 has reputation that takes up 2GB of server space!fatboy88 has reputation that takes up 2GB of server space!fatboy88 has reputation that takes up 2GB of server space!
    Recognitions The UC Member of the Month award is a prestigious award given to a single community member on a monthly basis. Based on a vote from community members, the award is given to the forum member that has shown exemplary achievement and potential in the UnKnoWnCheaTs community, and has shown great commitment to upholding the principles upon which UnKnoWnCheaTs stands for. A member who has been awarded the Member of the Month award has been distinguished as an asset to the UnKnoWnCheaTs community. Member of the Month (1)
    Last Achievements MidFunction HookMidFunction HookMidFunction HookMidFunction Hook
    Quote:
    Originally Posted by thelick View Post
    I'm not expert like you by the way i don't use the endscene in my hook and i don't see any reason to use it or i'm wrong?
    Endscene it's constantly scanned from the hs but it isn't so needful
    its scanned cuz people with esp usally hook and draw there.

    BeginScene: begins the scene data is drawn to back buffer

    Present: the backbuffer is flipped to front buffer

    Endscene: ends the front buffer drawing, swaps pointer back to the back buffer?

    correct me if wrong ^^

    Last edited by fatboy88; 27th August 2010 at 01:03 PM.
    fatboy88 is offline
    Reply With Quote

    Old 27th August 2010, 01:06 PM   #8
    thelick
    h4x0!2

    thelick's Avatar

    Join Date: Jul 2010
    Posts: 94
    Reputation: 53
    Rep Power: 336
    thelick is known to create posts fair in quality
    And is it really needed?
    I should thank Shad0w for his contribute aniway,but i think that there is always another way..
    thelick is offline
    Reply With Quote

    Old 27th August 2010, 02:06 PM   #9
    M.Holder
    Junior Member

    M.Holder's Avatar

    Join Date: Aug 2010
    Location: Germany
    Posts: 47
    Reputation: -91
    Rep Power: 0
    M.Holder is becoming an outcast
    Whre kann i find the LPDIRECT3DDEVICE9 ?

    Quote:
    Endscene
    Code:
    __declspec(naked) void MyEndscene( )
    {
        __asm 
        {
            mov dword ptr ss:[ebp - 10], esp;
            mov esi, dword ptr ss:[ebp + 0x8]; //replace patched code
                    mov m_pD3Ddev, esi; //Get the device
        }
     
     
        __asm 
        {
            jmp dwEndscene_ret;//jump back to normal endscene
        }
     
    }
    Can i use this for Reset and DIP too?

    Thank you for releasing this hook.
    M.Holder is offline
    Reply With Quote

    Old 27th August 2010, 02:24 PM   #10
    Geecko
    A Forum Hero

    Geecko's Avatar

    Join Date: Apr 2009
    Posts: 1,426
    Reputation: 12621
    Rep Power: 394
    Geecko 's rep takes up 1 gig of server spaceGeecko 's rep takes up 1 gig of server spaceGeecko 's rep takes up 1 gig of server spaceGeecko 's rep takes up 1 gig of server spaceGeecko 's rep takes up 1 gig of server spaceGeecko 's rep takes up 1 gig of server spaceGeecko 's rep takes up 1 gig of server spaceGeecko 's rep takes up 1 gig of server spaceGeecko 's rep takes up 1 gig of server spaceGeecko 's rep takes up 1 gig of server spaceGeecko 's rep takes up 1 gig of server space
    Points: 37,063, Level: 29
    Points: 37,063, Level: 29 Points: 37,063, Level: 29 Points: 37,063, Level: 29
    Level up: 31%, 1,737 Points needed
    Level up: 31% Level up: 31% Level up: 31%
    Activity: 0%
    Activity: 0% Activity: 0% Activity: 0%
    Last Achievements MidFunction HookMidFunction HookMidFunction Hook
    just add:
    Quote:
    LPDIRECT3DDEVICE9 m_pD3Ddev;
    before the first "_asm"
    i think u can use it, u only need to get more parameters...ebp+0xC..and so on..
    Geecko is offline
    Reply With Quote

    Old 27th August 2010, 03:14 PM   #11
    M.Holder
    Junior Member

    M.Holder's Avatar

    Join Date: Aug 2010
    Location: Germany
    Posts: 47
    Reputation: -91
    Rep Power: 0
    M.Holder is becoming an outcast
    Can you give me an example please?
    M.Holder is offline
    Reply With Quote

    Old 27th August 2010, 05:47 PM   #12
    fatboy88
    A Forum Hero

    fatboy88's Avatar

    Join Date: May 2005
    Posts: 1,607
    Reputation: 23044
    Rep Power: 0
    fatboy88 has reputation that takes up 2GB of server space!fatboy88 has reputation that takes up 2GB of server space!fatboy88 has reputation that takes up 2GB of server space!fatboy88 has reputation that takes up 2GB of server space!fatboy88 has reputation that takes up 2GB of server space!fatboy88 has reputation that takes up 2GB of server space!fatboy88 has reputation that takes up 2GB of server space!fatboy88 has reputation that takes up 2GB of server space!fatboy88 has reputation that takes up 2GB of server space!fatboy88 has reputation that takes up 2GB of server space!fatboy88 has reputation that takes up 2GB of server space!
    Recognitions The UC Member of the Month award is a prestigious award given to a single community member on a monthly basis. Based on a vote from community members, the award is given to the forum member that has shown exemplary achievement and potential in the UnKnoWnCheaTs community, and has shown great commitment to upholding the principles upon which UnKnoWnCheaTs stands for. A member who has been awarded the Member of the Month award has been distinguished as an asset to the UnKnoWnCheaTs community. Member of the Month (1)
    Last Achievements MidFunction HookMidFunction HookMidFunction HookMidFunction Hook
    Quote:
    Originally Posted by thelick View Post
    And is it really needed?
    I should thank Shad0w for his contribute aniway,but i think that there is always another way..

    there is but im explaining why most people hook it.
    fatboy88 is offline
    Reply With Quote

    Old 27th August 2010, 05:58 PM   #13
    Kosaki
    h4x0!2

    Kosaki's Avatar

    Join Date: Aug 2009
    Posts: 97
    Reputation: 297
    Rep Power: 358
    Kosaki has just realized Linux > WindowsKosaki has just realized Linux > WindowsKosaki has just realized Linux > Windows
    Quote:
    Originally Posted by Geecko View Post
    just add:


    before the first "_asm"
    i think u can use it, u only need to get more parameters...ebp+0xC..and so on..
    You can't do that in a naked function.
    Rather use a global variable.
    Kosaki is offline
    Reply With Quote

    Old 27th August 2010, 06:05 PM   #14
    M.Holder
    Junior Member

    M.Holder's Avatar

    Join Date: Aug 2010
    Location: Germany
    Posts: 47
    Reputation: -91
    Rep Power: 0
    M.Holder is becoming an outcast
    Hi,

    thank you two for your replies.
    Can you explain me where to put ebp + 0xC and what happens at the execution? (bcause i am not a c&p coder, i want to know what the code does at runtime)

    How can i understand this: BYTE EndSceneOpCodes[6]; ?
    When i am hooking Reset, what must be changed to get it working?
    M.Holder is offline
    Reply With Quote

    Old 27th August 2010, 11:06 PM   #15
    thelick
    h4x0!2

    thelick's Avatar

    Join Date: Jul 2010
    Posts: 94
    Reputation: 53
    Rep Power: 336
    thelick is known to create posts fair in quality
    You don't need it for the reset :S
    And some1 correct me if i'm wrong, cause i'm not so good with asm and i'm a beginner with the c++ , EBP allocate variables on the stack
    thelick is offline
    Reply With Quote

    Old 28th August 2010, 02:28 AM   #16
    Shad0w_
    Sick as Sin

    Shad0w_'s Avatar

    Threadstarter
    Join Date: Jul 2009
    Location: England M8
    Posts: 1,525
    Reputation: 12556
    Rep Power: 388
    Shad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server spaceShad0w_ 's rep takes up 1 gig of server space
    Points: 37,205, Level: 29
    Points: 37,205, Level: 29 Points: 37,205, Level: 29 Points: 37,205, Level: 29
    Level up: 37%, 1,595 Points needed
    Level up: 37% Level up: 37% Level up: 37%
    Activity: 0%
    Activity: 0% Activity: 0% Activity: 0%
    Last Achievements MidFunction HookMidFunction HookMidFunction Hook
    Quote:
    Originally Posted by thelick View Post
    You don't need it for the reset :S
    And some1 correct me if i'm wrong, cause i'm not so good with asm and i'm a beginner with the c++ , EBP allocate variables on the stack
    EBP is filled with data from the stack pointer.
    EBP now points to offsets containing data (the parameters).
    It's the most generic place I found to hook, as far as I know it will work on many functions.
    Not present, since it works... differently.

    For endscene however, this is pretty much a complete working base code.
    Shad0w_ is offline
    Reply With Quote

    Old 28th August 2010, 05:51 AM   #17
    Gellin
    The Legendary Cheater

    Gellin's Avatar

    Join Date: Nov 2007
    Location: msdn
    Posts: 563
    Reputation: 5519
    Rep Power: 411
    Gellin DEFINES UNKNOWNCHEATSGellin DEFINES UNKNOWNCHEATSGellin DEFINES UNKNOWNCHEATSGellin DEFINES UNKNOWNCHEATSGellin DEFINES UNKNOWNCHEATSGellin DEFINES UNKNOWNCHEATSGellin DEFINES UNKNOWNCHEATSGellin DEFINES UNKNOWNCHEATSGellin DEFINES UNKNOWNCHEATSGellin DEFINES UNKNOWNCHEATSGellin DEFINES UNKNOWNCHEATS
    Recognitions Award symbolizing a retired staff member who dedicated a notable amount of time and effort to their past staff position. Former Staff
    Members who have contributed financial support towards UnKnoWnCheaTs. Donator (1)
    This is probably OS specific, because the d3d9.dll differs for Win XP and Win 7 | Win Vista, unless you found a place to hook that the code you patched over is the same for both d3d9.dll versions.

    I might be wrong though.
    __________________
    Gellin is offline
    Reply With Quote

    Old 28th August 2010, 08:35 AM   #18
    M.Holder
    Junior Member

    M.Holder's Avatar

    Join Date: Aug 2010
    Location: Germany
    Posts: 47
    Reputation: -91
    Rep Power: 0
    M.Holder is becoming an outcast
    Quote:
    Originally Posted by Shad0w_ View Post
    EBP is filled with data from the stack pointer.
    EBP now points to offsets containing data (the parameters).
    It's the most generic place I found to hook, as far as I know it will work on many functions.
    Not present, since it works... differently.

    For endscene however, this is pretty much a complete working base code.
    So, if i understand you correctly, i can´t hook Present with it?

    Can i hook DIP and Reset with it?

    EDIT:

    Warrock crashs with that code:

    Hookthread:
    Code:
    void HookD3D()
    {
        Dx9EndSceneHook("d3d9.dll");
     
     
        memcpy((void *)EndSceneOpCodes, (void *)"\x89\x65\xF0\x8B\x75\x08", 6);
     
        while( 1 )
        {
            Sleep( 1000 );
     
            if(memcmp((void *)EndSceneOpCodes, (void *)dwEndScene_hook, 6) == 0 )
                DetourCreate((PBYTE)dwEndScene_hook, (PBYTE)myEndScene, 6);
     
        } 
    }
    Code:
    __declspec(naked) void myEndScene()
    {
        __asm
        {
            mov dword ptr ss:[ebp - 10], esp;
            mov esi, dword ptr ss:[ebp + 0x8];    //replace pathced code
            mov m_pD3DDev, esi;    //Get Device
        }
     
        DrawBoxA(m_pD3DDev, 20, 20, 200, 200, D3DCOLOR_ARGB(255, 255, 255, 0), D3DCOLOR_ARGB(255, 0, 0, 0));
     
        __asm
        {
            jmp dwEndScene_ret; //jump back to normal endscene
        }
    }
    Code:
    void Dx9EndSceneHook(LPCSTR D3D9)
    {
        DWORD hD3D = NULL;
        while (!hD3D) hD3D = (DWORD)GetModuleHandle(D3D9);
        DWORD PPPDevice = FindPattern(hD3D, 0x128000, (PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86", "xx????xx????xx");
        memcpy ( &VTable, (void *)(PPPDevice + 2), 4);
     
        dwEndScene_hook = VTable[42] + 0x2A;
        dwEndScene_ret =dwEndScene_hook + 0x6;
    }
    My Detour:
    Code:
    void *DetourCreate (BYTE *src, const BYTE *dst, const int len)
    {
        BYTE *jmp;
        DWORD dwback;
        DWORD jumpto, newjump;
     
        VirtualProtect(src,len,PAGE_READWRITE,&dwback);
     
        if(src[0] == 0xE9)
        {
            jmp = (BYTE*)malloc(10);
            jumpto = (*(DWORD*)(src+1))+((DWORD)src)+5;
            newjump = (jumpto-(DWORD)(jmp+5));
            jmp[0] = 0xE9;
            *(DWORD*)(jmp+1) = newjump;
            jmp += 5;
            jmp[0] = 0xE9;
            *(DWORD*)(jmp+1) = (DWORD)(src-jmp);
        }
        else
        {
            jmp = (BYTE*)malloc(5+len);
            memcpy(jmp,src,len);
            jmp += len;
            jmp[0] = 0xE9;
            *(DWORD*)(jmp+1) = (DWORD)(src+len-jmp)-5;
        }
        src[0] = 0xE9;
        *(DWORD*)(src+1) = (DWORD)(dst - src) - 5;
     
        for(int i = 5; i < len; i++)
            src[i] = 0x90;
        VirtualProtect(src,len,dwback,&dwback);
        return (jmp-len);
    }
    Should i use an other detour?

    It is crashing after the the Chapter 2 MainScreen. But it shows my Rectangle there.
    F*** HackShield.

    Regards

    Last edited by M.Holder; 28th August 2010 at 09:31 AM.
    M.Holder is offline
    Reply With Quote

    Old 28th August 2010, 09:16 AM   #19
    ZeaS
    The 0n3

    ZeaS's Avatar

    Join Date: May 2008
    Location: Germany
    Posts: 428
    Reputation: 5690
    Rep Power: 399
    ZeaS DEFINES UNKNOWNCHEATSZeaS DEFINES UNKNOWNCHEATSZeaS DEFINES UNKNOWNCHEATSZeaS DEFINES UNKNOWNCHEATSZeaS DEFINES UNKNOWNCHEATSZeaS DEFINES UNKNOWNCHEATSZeaS DEFINES UNKNOWNCHEATSZeaS DEFINES UNKNOWNCHEATSZeaS DEFINES UNKNOWNCHEATSZeaS DEFINES UNKNOWNCHEATSZeaS DEFINES UNKNOWNCHEATS
    Recognitions Members who have contributed financial support towards UnKnoWnCheaTs. Donator (20)
    Awarded to members who have donated 10 times or more. Gratuity (2)
    Quote:
    Originally Posted by M.Holder View Post
    So, if i understand you correctly, i can´t hook Present with it?

    Can i hook DIP and Reset with it?
    you basically can hook every function, you just need to replace the code that your jump messed up, thats all

    Quote:
    How can i understand this: BYTE EndSceneOpCodes[6]; ?

    he's storing the original bytes in there and is checking them in a loop so if the current bytes match these bytes he knows that hackshield removed his hooks and is rehooking then.

    Quote:
    Whre kann i find the LPDIRECT3DDEVICE9 ?
    if you would look at shadow's example, you would see, where you can get the device from "mov m_pD3DDev, esi; //Get the device"

    edit
    he edited his post

    please use code tags :S try using pushad(fd) / popad(fd)
    __________________


    Last edited by ZeaS; 28th August 2010 at 09:26 AM.
    ZeaS is offline
    Reply With Quote

    Old 28th August 2010, 09:43 AM   #20
    thelick
    h4x0!2

    thelick's Avatar

    Join Date: Jul 2010
    Posts: 94
    Reputation: 53
    Rep Power: 336
    thelick is known to create posts fair in quality
    Quote:
    Originally Posted by Shad0w_ View Post
    EBP is filled with data from the stack pointer.
    EBP now points to offsets containing data (the parameters).
    It's the most generic place I found to hook, as far as I know it will work on many functions.
    Not present, since it works... differently.

    For endscene however, this is pretty much a complete working base code.
    thx for the explanation and good job

    @M.Holder this works goods for the endscene,and the detour that you are using is a simple jmp detour detected from the hackshield ---> 0xe9 00 00 00 00 almost patched months ago

    Last edited by thelick; 28th August 2010 at 09:47 AM.
    thelick is offline
    Reply With Quote
    Reply


    Similar Threads
    Thread Thread Starter Forum Replies Last Post
    help with DIP midfunction hook Anddos Direct3D 5 4th September 2012 05:40 AM
    [Source] Midfunction Hook (v2) Shad0w_ D3D Tutorials and Source 146 25th August 2012 05:10 PM
    [Help] Midfunction Hook DIP ON Windows XP Comanderz D3D Tutorials and Source 4 19th May 2012 02:46 PM
    MidFunction Hook (XP) Shad0w_ Direct3D 17 17th May 2012 06:31 PM
    Help midfunction hook XP ragnakrorn77 Direct3D 18 26th January 2011 09:16 AM

    Tags
    hook, midfunction


    Forum Jump


    All times are GMT. The time now is 05:04 PM.

    Contact Us - Toggle Dark Theme
    Terms of Use Information Privacy Policy Information
    Copyright ©2000-2024, Unknowncheats™
    MidFunction Hook MidFunction Hook
    sponsored advertisement
    no new posts