Useful D3D9 Functions

Posts 1–15 of 17 · Page 1 of 2
Useful D3D9 Functions


I were bored.

Wallhack

Code:
void Wallhack( LPDIRECT3DDEVICE9 D3DDEVICE, DWORD VALUE )
{
	D3DDEVICE->SetRenderState( D3DRS_ZENABLE, VALUE );
}
FullBright
Code:
void FullBright( LPDIRECT3DDEVICE9 D3DDEVICE, DWORD VALUE )
{
	D3DDEVICE->SetRenderState( D3DRS_LIGHTING, VALUE ); 
}
Fillmode
Code:
void Fillmode( LPDIRECT3DDEVICE9 D3DDEVICE, DWORD FILLMODE )
{
	D3DDEVICE->SetRenderState( D3DRS_FILLMODE, FILLMODE );
}
Chams
Code:
void Chams( LPDIRECT3DDEVICE9 D3DDEVICE, DWORD COLOR )
{
	D3DDEVICE->SetRenderState( D3DRS_AMBIENT, COLOR );
}
Instant Chams
Code:
void InstantChams( LPDIRECT3DDEVICE9 D3DDEVICE, LPDIRECT3DTEXTURE9 tCOLOR, DWORD COLOR )
{
	GenerateTexture( D3DDEVICE, &tCOLOR, COLOR );
	D3DDEVICE->SetTexture( 0, tCOLOR );
}

Usage
Code:
/*Wallhack*/
Wallhack( pDevice, D3DZB_FALSE );

/*FullBright*/
FullBright( pDevice, D3DZB_FALSE );

/*Fillmode*/
FullBright( pDevice, D3DFILL_WIREFRAME ); //You even can use Point etc.

/*Chams*/
Chams( pDevice, Red );

/*Instant Chams*/
InstantChams( pDevice, tYellow, Yellow );//Define tYellow like that: LPDIRECT3DTEXTURE9 tYellow;
Please NOTE:
The Instant Chams Function requires another function, too.( GenerateTexture )

 
GenerateTexture
Credits for that @azorbix
Code:
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;
}


Here are a few screenshots





Credits:
UnlimitedCheating

Thanks & GoodJop
Good Job
Yo , how to use this xD ? just copy-paste ?
Not a good job... you have memory leaks, fail job...
Quote Originally Posted by ~FALLEN~ View Post
Not a good job... you have memory leaks, fail job...
Agreed ^

Also this shit has been posted many times before .... getting bored of this section now
Quote Originally Posted by Tele1337 View Post
err0r lollll
wtf are you talking about lol
Nice!!!!!!
Nice But I Feel That I Saw This Codes Before.........Never Mind Good JoB @[H]aaBX
And Thanks For Sharing
@ulti.koko are you kidding me ?
I made them yesterday bcs I were bored
do someone know how to make D3D hack work on WIN8 ??
this is for wiin7
Code:
 // Windows 7
                        DIPD3D9 = FindPattern( hD3D,
                                0x128000,
                                ( PBYTE )"\xC3\x90\x90\x90\x90\x90\x8B\xFF\x55\x8B\xEC\x5D\xEB\x05\x90\x90\x90\x90\x90\x8B\xFF\x55\x8B\xEC\x6A\xFF",
                                "xxxxxxxxxxxxxxxxxxxxxxxxxx" );
.
.
.
so how i make this work on win8 ??
tnx for help and sry for bad eng.
Posts 1–15 of 17 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us