Alvin-vince PH Hacks

Alvin-vince PH Hacks

Keywords

December 2017

MonTueWedThuFriSatSun
    123
45678910
11121314151617
18192021222324
25262728293031

Calendar Calendar

Navigation

Affiliates

free forum

Top posting users this month

Affiliates

free forum

Affiliates

free forum


    Undetected D3D Base 6/9/2012

    Share
    avatar
    alvin-vince
    Admin

    Posts : 58
    Points : 163
    Reputation : 4
    Join date : 28/05/2011

    Undetected D3D Base 6/9/2012

    Post  alvin-vince on Thu Sep 06, 2012 7:47 am

    This is an example d3d base using engine hook, for learning purpose.

    pictures

    [Only admins are allowed to see this link]


    #include <windows.h>
    #include <stdio.h>
    #include <d3d9.h>
    #include <d3dx9.h>

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

    #define PresentEngine 0x004C41AF
    DWORD retPresentEngine = ( PresentEngine + 0x5 );

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

    typedef struct{
    int index;
    char * title;
    int *hack;
    int hackmaxval;
    int hacktype;
    DWORD HCOLOR;
    }ITEM;

    int hackcount;
    int selector;
    int x,y,w,h;
    DWORD COLOR;

    ITEM HACKITEM[99];
    char hackrval[256];

    int xFontOffSet = 15;
    int hackopt1;
    int MenuHeight = 10;
    int show = 0;
    int hack1, hack2, hack3;

    LPDIRECT3DDEVICE9 pDevice;
    LPD3DXFONT Font;

    VOID StartFont( LPDIRECT3DDEVICE9 pDevice )
    {
    if( Font )
    {
    Font->Release();
    Font = NULL;
    }

    if( !Font )
    {
    D3DXCreateFont( pDevice,
    14,
    0,
    FW_BOLD,
    1,
    0,
    DEFAULT_CHARSET,
    OUT_DEFAULT_PRECIS,
    DEFAULT_QUALITY,
    DEFAULT_PITCH | FF_DONTCARE,
    "Arial",
    &Font );
    }
    }

    VOID WriteText(char pString[], INT x, INT y, DWORD color )
    {
    RECT rect;
    SetRect( &rect, x, y, x, y );
    Font->DrawText( NULL, pString, -1, &rect, DT_NOCLIP | DT_LEFT, color );
    }

    void CreateItem(int index, char * title, int *hack, int hackmaxval,int hacktype)
    {
    hackcount++;
    HACKITEM[hackcount].index = index;
    HACKITEM[hackcount].hack = hack;
    HACKITEM[hackcount].hackmaxval = hackmaxval;
    HACKITEM[hackcount].hacktype = hacktype;
    WriteText(title, xFontOffSet, index*15,HACKITEM[hackcount].HCOLOR); //If you want to move the menu opts down do something like this (index*15)+20 and to move it left or right just add/subtract from font offset.
    }

    void RenderMenu()
    {
    if(GetAsyncKeyState(VK_DOWN)&1)
    selector++;

    if(GetAsyncKeyState(VK_UP)&1)
    if(selector > 1)
    selector--;

    if (GetAsyncKeyState(VK_RIGHT)<0)
    {
    for(int i=0;i < (hackcount+1);i++)
    {
    if(selector == HACKITEM[i].index)
    {
    if(*HACKITEM[i].hack < HACKITEM[i].hackmaxval)
    *HACKITEM[i].hack += 1;
    }
    }
    }

    if (GetAsyncKeyState(VK_LEFT)<0)
    {
    for(int i=0;i < (hackcount+1);i++)
    {
    if(selector == HACKITEM[i].index)
    {
    *HACKITEM[i].hack = 0;
    Sleep(20);
    }
    }
    }

    for(int i=0;i < (hackcount+1);i++)
    {
    if(selector == HACKITEM[i].index)
    HACKITEM[i].HCOLOR = Green;
    else
    HACKITEM[i].HCOLOR = Red;
    }

    for(int i=1; i<(hackcount+1); i++)
    {
    if(HACKITEM[i].hacktype == 0)
    {
    if(*HACKITEM[i].hack == 1) //to move the opts down do something like this (HACKITEM[i].index*15)+20
    WriteText("On", xFontOffSet+100, HACKITEM[i].index*15,Yellow);
    else
    WriteText("Off", xFontOffSet+100, HACKITEM[i].index*15,Red);
    }
    }

    for(int i=1; i<(hackcount+1); i++)
    {
    if(HACKITEM[i].hackmaxval >1 && HACKITEM[i].hacktype == 1)
    {
    sprintf_s(hackrval, "%i", *HACKITEM[i].hack);
    WriteText(hackrval, xFontOffSet+100, HACKITEM[i].index*15,Red);
    }
    }

    if(selector < 1)
    selector = 1;

    if(selector > hackcount)
    selector = 1;

    hackcount = 0;
    }

    void BuildMenu(char * menuname, int x, int y, int h, int w, DWORD TITLECOL, DWORD BACKCOLOR, DWORD BORDERCOLOR, LPDIRECT3DDEVICE9 pDevice)
    {
    if(GetAsyncKeyState(VK_INSERT)&1) show=(!show);

    if(!show)
    {
    WriteText(menuname, 5, 2, TITLECOL);
    return;
    }

    WriteText(menuname, x+10, y+2, TITLECOL);

    CreateItem(1,"Player Chams", &hack1, 1, 0);
    CreateItem(2,"Asus Wallhack", &hack2, 1, 0);
    CreateItem(3,"Fullbright", &hack3, 1, 0);

    RenderMenu();
    }

    /*void MemoryHackHere()
    {
    //load modules & continue with hacks

    if(hack3)
    {

    }

    //do not put sleep()
    }
    */

    __declspec( naked ) HRESULT WINAPI PresentMidfunction( )
    {
    static LPDIRECT3DDEVICE9 pDevice;

    __asm
    {
    MOV ECX, DWORD PTR DS:[EAX]
    MOV EDX, DWORD PTR DS:[ECX + 0x44]
    MOV DWORD PTR DS:[pDevice], EAX
    PUSH 0
    PUSHAD
    }

    //================================================================================== font
    StartFont( pDevice );

    //================================================================================== menu
    BuildMenu("Avene D3D Menu Crossfire 6/9/2012",0,0,180,200,Red,Black,Green,pDevice);

    //================================================================================== hack
    //MemoryHackHere();

    __asm
    {
    POPAD
    JMP retPresentEngine
    }
    }

    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 * )PresentEngine, ( VOID * )( PBYTE )"\x8B\x51", 2 ) == 0 )
    {
    Sleep( 100 );
    DetourCreate( ( PBYTE )PresentEngine, ( PBYTE )PresentMidfunction, 5 );
    }
    Sleep( 50 );
    }

    return 0;
    }

    BOOL WINAPI DllMain( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
    {
    if( dwReason == DLL_PROCESS_ATTACH )
    {
    DisableThreadLibraryCalls( hDll );
    //MessageBox( 0, "Avene D3D Menu", "Crossfire", 0 );
    CreateThread( 0, 0, (LPTHREAD_START_ROUTINE)StartRoutine, 0, 0, 0 );
    }

    return TRUE;
    }
















    [Only admins are allowed to see this link]

      Current date/time is Mon Dec 11, 2017 12:41 pm