Results 1 to 5 of 5
  1. #1
    gflames12's Avatar
    Join Date
    Jul 2013
    Gender
    male
    Location
    Rochester, Ny
    Posts
    21
    Reputation
    10
    Thanks
    6

    Endscene Engine Hook

    Here is the current end scene engine hook.

    Code:
    #include <windows.h>
    #include <d3d9.h>
    #include <d3dx9.h>
    
    #pragma comment(lib, "d3d9.lib")
    #pragma comment(lib, "d3dx9.lib")
    
    #define EndScene        0x570743
    
    DWORD retEndScene = ( EndScene + 0x8 );
    
    __declspec( naked ) HRESULT WINAPI EndSceneMidfunction( )
    {
        static LPDIRECT3DDEVICE9 pDevice;
    
        __asm
        {
    		MOV ECX, DWORD PTR DS:[EAX]
    		MOV EDX, DWORD PTR DS:[ECX + 0xA8]
    		MOV DWORD PTR DS:[pDevice], EAX
            PUSHAD
        }
    
        __asm
        {
            POPAD
            JMP retEndScene
        }
    }
    
    VOID *DetourCreate( BYTE *src, CONST BYTE *dst, CONST INT len )
    {
        BYTE *jmp =( BYTE * ) malloc( len + 5 );
        DWORD dwBack;
    
        VirtualProtect( src, len, PAGE_READWRITE, &dwBack );
        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 );
    }
    
    DWORD WINAPI Hook( VOID )
    {
        while( TRUE )
        {
            if( memcmp( ( VOID * )EndScene, ( VOID * )( PBYTE )"\x8B\x08", 2 ) == 0 )
            {
                Sleep( 100 );
                DetourCreate( ( PBYTE )EndScene, ( PBYTE )EndSceneMidfunction, 8 );
            }
            Sleep( 50 );
        }
     
        return 0;
    }
    
    
    BOOL WINAPI DllMain( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
    { 
        if( dwReason == DLL_PROCESS_ATTACH )
        {
            DisableThreadLibraryCalls( hDll );
            CreateThread( 0, 0, (LPTHREAD_START_ROUTINE)Hook, 0, 0, 0 );
        }
     
        return TRUE;
    }
    Credits
    Wellington

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

    gibam761 (08-01-2013),Skaterforeva1 (08-01-2013)

  3. #2
    ßest's Avatar
    Join Date
    Jul 2013
    Gender
    male
    Posts
    12
    Reputation
    10
    Thanks
    3
    Thx for sharing

  4. #3
    OwNAppLe's Avatar
    Join Date
    Jul 2013
    Gender
    male
    Location
    United states of niggers
    Posts
    164
    Reputation
    10
    Thanks
    20
    You got a very nice Copy Paste skills.

  5. #4
    gflames12's Avatar
    Join Date
    Jul 2013
    Gender
    male
    Location
    Rochester, Ny
    Posts
    21
    Reputation
    10
    Thanks
    6
    Quote Originally Posted by OwNAppLe View Post
    You got a very nice Copy Paste skills.
    All i did was update the adress's and redid the original asm cause it jumped 9 bytes from orignial address instead of 8, and changed where i call our device. i gave credits to the person who origanally posted the code.

  6. #5
    Inferno17's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    47
    Reputation
    10
    Thanks
    2
    Do you have updated addresses for DIPEngine and ResetEngine?

Similar Threads

  1. [Source Code] Engine Hook - Reset, Present, BeginScene, EndScene and DrawIndexedPrimitive
    By [H]aaBX in forum Combat Arms EU Hack Coding/Source Code
    Replies: 3
    Last Post: 02-21-2013, 11:02 PM
  2. EndScene Engine + DIP Engine
    By [mi5 in forum CrossFire Hack Coding / Programming / Source Code
    Replies: 11
    Last Post: 10-26-2012, 11:20 PM
  3. [Release] ☆☆☆☆☆ [ Midfuntion Engine Hook - 09/27/2012 ] ☆☆☆☆☆
    By Gangnam Boy in forum CrossFire Hack Coding / Programming / Source Code
    Replies: 13
    Last Post: 09-27-2012, 11:44 AM
  4. [RELEASE] Crysis engine hook
    By Hell_Demon in forum C++/C Programming
    Replies: 14
    Last Post: 01-20-2010, 09:59 AM
  5. [Release] WiirtuallCA Cheat Engine Hook V 1.2 [64BIT Vista/7Only]
    By Wiirtuallca in forum Combat Arms Europe Hacks
    Replies: 11
    Last Post: 12-16-2009, 06:40 PM