SolvedCompile this

Posts 14 of 4 · Page 1 of 1
Compile this
I can't compile cause I didn't install any SDK

my com can't include <d3dx9.h>

Code:
#include <windows.h>
#include <d3d9.h>
#include <d3dx9.h>

#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "d3dx9.lib")

// NUMPAD1 => On/Off chams.
// NUMPAD2 => Change colors.

#define GameStatus      0x377791CC
#define DIPEngine       0x006A358A

DWORD retDIPEngine = ( DIPEngine + 0x8 );

INT chams;
INT color;

#define Red     D3DCOLOR_ARGB( 255, 255, 000, 000 )
#define Green   D3DCOLOR_ARGB( 255, 000, 255, 000 )
#define Blue    D3DCOLOR_ARGB( 255, 000, 000, 255 )
#define Black   D3DCOLOR_ARGB( 255, 000, 000, 000 )

__declspec( naked ) HRESULT WINAPI DIPMidfunction( )
{
    static LPDIRECT3DDEVICE9 pDevice;
    static INT BaseVertexIndex;
    static UINT MinVertexIndex, NumVertices, startIndex, primCount;

    __asm
    {
        MOV ECX, DWORD PTR DS:[EAX]
        MOV EDX, DWORD PTR DS:[ECX + 0x148]
        MOV DWORD PTR DS:[pDevice], EAX
        MOV ECX, DWORD PTR DS:[EBP + 0x18]
        MOV DWORD PTR DS:[BaseVertexIndex], ECX
        MOV ECX, DWORD PTR DS:[EBP + 0x8]
        MOV DWORD PTR DS:[MinVertexIndex], ECX
        MOV ECX, DWORD PTR DS:[EBP + 0x10]
        MOV DWORD PTR DS:[NumVertices], ECX
        MOV ECX, DWORD PTR DS:[EBP + 0xC]
        MOV DWORD PTR DS:[startIndex], ECX
        MOV ECX, DWORD PTR DS:[EBP + 0x14]
        MOV DWORD PTR DS:[primCount], ECX
        PUSHAD
    }

    if( GetAsyncKeyState(VK_NUMPAD1)&1 )
        chams = !chams;
 
    if( GetAsyncKeyState(VK_NUMPAD2)&1 )
        color++;
    
    if( color > 4 )
        color = 0;
    
    if( chams )
    {
        pDevice->SetRenderState( D3DRS_ZENABLE, D3DZB_FALSE );
        if( color == 1 ) pDevice->SetRenderState( D3DRS_AMBIENT, Red   );
        if( color == 2 ) pDevice->SetRenderState( D3DRS_AMBIENT, Green );
        if( color == 3 ) pDevice->SetRenderState( D3DRS_AMBIENT, Blue  );
        if( color == 4 ) pDevice->SetRenderState( D3DRS_AMBIENT, Black );
    }

    __asm
    {
        POPAD
        JMP retDIPEngine
    }
}

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 StartRoutine( LPVOID )
{
    while( TRUE )
    {
        if( memcmp( ( VOID * )DIPEngine, ( VOID * )( PBYTE )"\x8B\x08", 2 ) == 0 )
        {
            Sleep( 100 );
            DetourCreate( ( PBYTE )DIPEngine, ( PBYTE )DIPMidfunction, 8 );
        }
        Sleep( 50 );
    }
 
    return 0;
}

BOOL WINAPI DllMain( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{ 
    if( dwReason == DLL_PROCESS_ATTACH )
    {
        DisableThreadLibraryCalls( hDll );
        MessageBoxA( 0, " DIP Based ", "Elab V1.0", 0 );
        CreateThread( 0, 0, (LPTHREAD_START_ROUTINE)StartRoutine, 0, 0, 0 );
    }
 
    return TRUE;
}
Thanks
How find dip engine addy?
i dont understand what u want...
We're not here to compile your hacks on demand and give them to you.

Learn C++ and download the SDK and include it to your project. Compile it yourself

/Solved
/Closed
Posts 14 of 4 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?