1. Pinoy Hideout is the Ultimate Pinoy Chat, Mobile and PC Community
    We have been leading the scene for over 7 years and currently offer:
    • latest and updated game cheats and softwares
    • internet tricks for your android phone, mobile network, and computer
    • a staff team who helps protect its members from malware while enforcing a great community

    • You must register an account before you can post, download files, and see any advanced features or content.

  2. How to avail PHO VIP hack/s?
    Click here for more Info!
    [PHO] VIP Hacks Price

      SF1 VIP|ROS VIP

    • 7 Days = php 150
    • 15 Days = php 200
    • 1 Month = php 300

      SF2 VIP

    • 7 Days = php 200
    • 15 Days = php 250
    • 1 Month = php 500
    Dismiss Notice
Dismiss Notice
Announcement!
Gusto mo bang makakuha ng VIP subcription ng libre? CLICK HERE<

Source Undetected DIP Int3 BreakPoint Hook

Discussion in 'D3D Tutorials and Source' started by trismund, Jan 31, 2019.

  1. trismund

    trismund King in the East
    Staff Member Administrator SF2 VIP SF1 VIP ROS VIP

    Reputations:
    1,501
    Joined:
    Oct 28, 2012
    Posts:
    2,659
    Likes Received:
    639
    Trophy Points:
    30

    Code:
    #include <windows.h>
    #include <d3d9.h>
    #include <d3dx9.h>
    #pragma comment(lib, "d3dx9.lib")
    #pragma comment(lib, "d3d9.lib")
    
    //==============================================================================
    
    typedef HRESULT(__stdcall* DrawIndexedPrimitive_t)(LPDIRECT3DDEVICE9, D3DPRIMITIVETYPE, INT, UINT, UINT, UINT, UINT);
    DrawIndexedPrimitive_t OrigDrawIndexedPrimitive;
    
    typedef HRESULT(__stdcall* DrawIndexedPrimitivePlusTwo_t)(LPDIRECT3DDEVICE9, D3DPRIMITIVETYPE, INT, UINT, UINT, UINT, UINT);
    DrawIndexedPrimitivePlusTwo_t OrigDrawIndexedPrimitivePlusTwo;
    
    // Generating Textures.
    HRESULT GenerateTexture(IDirect3DDevice9 *pD3Ddev, IDirect3DTexture9 **ppD3Dtex, DWORD colour32)
    {
        if (FAILED(pD3Ddev->CreateTexture(8, 8, 1, 0, D3DFMT_A4R4G4B4, D3DPOOL_MANAGED, ppD3Dtex, NULL)))
            return E_FAIL;
    
        WORD colour16 = ((WORD)((colour32 >> 28) & 0xF) << 12)
            | (WORD)(((colour32 >> 20) & 0xF) << 8)
            | (WORD)(((colour32 >> 12) & 0xF) << 4)
            | (WORD)(((colour32 >> 4) & 0xF) << 0);
    
        D3DLOCKED_RECT d3dlr;
        (*ppD3Dtex)->LockRect(0, &d3dlr, 0, 0);
        WORD *pDst16 = (WORD*)d3dlr.pBits;
    
        for (int xy = 0; xy < 8 * 8; xy++)
            *pDst16++ = colour16;
    
        (*ppD3Dtex)->UnlockRect(0);
    
        return S_OK;
    }
    //==============================================================================
    
    HRESULT __stdcall Hooked_DrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE PrimType, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount)
    {
        LPDIRECT3DVERTEXBUFFER9 Stream;
        UINT Stride;
        UINT Offset;
    
        if (pDevice->GetStreamSource(0, &Stream, &Offset, &Stride) == D3D_OK)
        {
            Stream->Release();
        }
    
    
        if (Stride == 64 || Stride == 32)
        {
        pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
       OrigDrawIndexedPrimitivelusTwo(pDevice, PrimType,BaseVertexIndex,MinVertexIndex, NumVertices, startIndex, primCount);
       pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);
    
        }
     
        return OrigDrawIndexedPrimitivePlusTwo(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount); // continue after the breakpoint.( previously mov edi, edi ).
    }
    
    void Set_int3_Breakpoint(void *address)
    {
        DWORD dwOldProtect;
        BYTE *ptr = (BYTE *)address;
        VirtualProtect(address, 1, PAGE_EXECUTE_READWRITE, &dwOldProtect);
        *ptr = 0xCC;
        VirtualProtect(address, 1, dwOldProtect, &dwOldProtect);
    }
    
    LONG WINAPI MyExceptionFilter(struct _EXCEPTION_POINTERS* ExceptionInfo)
    {
        if (ExceptionInfo->ExceptionRecord->ExceptionCode == EXCEPTION_BREAKPOINT)
        {
            //Check exception address
            if (ExceptionInfo->ContextRecord->Eip == (DWORD)OrigDrawIndexedPrimitive)
            {
                ExceptionInfo->ContextRecord->Eip = (DWORD)Hooked_DrawIndexedrimitive; // Change instruction pointer - will jump to our hook
                return EXCEPTION_CONTINUE_EXECUTION; //Copies all registers from pExceptionInfo to the real registers
            }
      
        }
        return EXCEPTION_CONTINUE_SEARCH;
    }
    
    bool bCompare(const BYTE* pData, const BYTE* bMask, const char* szMask)
    {
        for (; *szMask; ++szMask, ++pData, ++bMask)
            if (*szMask == 'x' && *pData != *bMask)
                return false;
    
        return (*szMask) == NULL;
    }
    
    DWORD FindPattern(DWORD dwAddress, DWORD dwLen, BYTE *bMask, char * szMask)
    {
        for (DWORD i = 0; i < dwLen; i++)
            if (bCompare((BYTE*)(dwAddress + i), bMask, szMask))
                return (DWORD)(dwAddress + i);
    
        return 0;
    }
    
    void DXhook()
    {
        DWORD *vtbl;
    
        // wait for the d3dx dll
        DWORD hD3D = 0;
        do {
            hD3D = (DWORD)GetModuleHandleA("d3d9.dll");
            Sleep(10);
        } while (!hD3D);
        DWORD adr = FindPattern(hD3D, 0x128000, (PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86", "xx????xx????xx");
    
        if (adr)
        {
            memcpy(&vtbl, (void*)(adr + 2), 4);
          
            OrigDrawIndexedPrimitive = (HRESULT(__stdcall *)(LPDIRECT3DDEVICE9, D3DPRIMITIVETYPE, INT, UINT, UINT, UINT, UINT))vtbl[82];
            OrigDrawIndexedPrimitivePlusTwo = (HRESULT(__stdcall *)(LPDIRECT3DDEVICE9, D3DPRIMITIVETYPE, INT, UINT, UINT, UINT, UINT)) (((DWORD)OrigDrawIndexedPrimitive) + 2);
    
            AddVectoredExceptionHandler(1, MyExceptionFilter);
            set_int3_Breakpoint(OrigDrawIndexedPrimitive); // write CC on mov edi, edi
     
    
        }
    }
    //==============================================================================
    BOOL WINAPI DllMain(HMODULE hModule,DWORD dwReason,LPVOID lpReserved)
    {
        UNREFERENCED_PARAMETER(lpReserved);
        if ( dwReason == DLL_PROCESS_ATTACH )
        {
    
            CreateThread(0,0,(LPTHREAD_START_ROUTINE)DXhook,0,0,0);
        }
            return ( TRUE );
    }
    Video Tutorial:
     
    #1 trismund, Jan 31, 2019
    Last edited: Mar 20, 2019
  2. trismund

    trismund King in the East
    Staff Member Administrator SF2 VIP SF1 VIP ROS VIP

    Reputations:
    1,501
    Joined:
    Oct 28, 2012
    Posts:
    2,659
    Likes Received:
    639
    Trophy Points:
    30

    Goodluck!
     
  3. captcha1

    captcha1 Leecher

    Reputations:
    0
    Joined:
    Feb 2, 2019
    Posts:
    1
    Likes Received:
    0
    Trophy Points:
    0

    Thanks for sharing, Its working!
     
  4. Linux2

    Linux2 Sage

    Reputations:
    131
    Joined:
    Dec 17, 2013
    Posts:
    1,736
    Likes Received:
    29
    Trophy Points:
    35

    thanks for sharing It's working! I'm using it in SF1 :gewd:
     
    #4 Linux2, Feb 21, 2019
    Last edited by a moderator: Jul 22, 2019
  5. raydequito

    raydequito Well-Known Member

    Reputations:
    37
    Joined:
    Feb 9, 2019
    Posts:
    110
    Likes Received:
    7
    Trophy Points:
    18

    SIR SANA PO MAY TUTORIAL DIN KAYO SA MGA GANITONG CODING PARA MAPAG ARALAN PO NAMIN MAKATULONG PO KAMI SAINYO GUMAWA NG HACK TY
     
  6. trismund

    trismund King in the East
    Staff Member Administrator SF2 VIP SF1 VIP ROS VIP

    Reputations:
    1,501
    Joined:
    Oct 28, 2012
    Posts:
    2,659
    Likes Received:
    639
    Trophy Points:
    30

    Video tutorial Added.
    Palike and Subscribe nalang ng Youtube Channel na yan dyan ko ilalagay lahat ng tutorials
     
    #6 trismund, Mar 20, 2019
    Last edited: Mar 20, 2019
    raydequito likes this.
  7. TechCore

    TechCore Well-Known Member

    Reputations:
    11
    Joined:
    Jun 16, 2016
    Posts:
    135
    Likes Received:
    9
    Trophy Points:
    0

    Thanks for Sharing sir Tris:gewd::D
     
  8. raydequito

    raydequito Well-Known Member

    Reputations:
    37
    Joined:
    Feb 9, 2019
    Posts:
    110
    Likes Received:
    7
    Trophy Points:
    18

    sir sorry ngaun lng po ang reply salmat po pinag aarlan ko na poo
     
  9. oonalang123

    oonalang123 Newbie

    Reputations:
    0
    Joined:
    Jul 15, 2014
    Posts:
    19
    Likes Received:
    0
    Trophy Points:
    1
  10. Eigene27

    Eigene27 C4SP3R is the BEST ABOVE ALL
    Banned!

    Reputations:
    194
    Joined:
    Feb 21, 2017
    Posts:
    241
    Likes Received:
    37
    Trophy Points:
    20
  11. zNova

    zNova Member
    Staff Member Moderator

    Reputations:
    45
    Joined:
    Feb 24, 2019
    Posts:
    35
    Likes Received:
    9
    Trophy Points:
    8

    Extreme injector is working fine
     
  12. Eigene27

    Eigene27 C4SP3R is the BEST ABOVE ALL
    Banned!

    Reputations:
    194
    Joined:
    Feb 21, 2017
    Posts:
    241
    Likes Received:
    37
    Trophy Points:
    20

    Download link please ?
     
  13. zNova

    zNova Member
    Staff Member Moderator

    Reputations:
    45
    Joined:
    Feb 24, 2019
    Posts:
    35
    Likes Received:
    9
    Trophy Points:
    8

    Just search extreme injector v.3.6.1
     

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Share This Page

Pinoy Hideout