I DO NOT TAKE CREDIT FOR THIS! I saw it posted on a bulletin that I will not mention here. This is the public version of the model editor used to create wallhack. Enjoy.


Code:
//**Color**//
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;
}

struct pixels
{
IDirect3DTexture9 *pBlue, *pRed, *pPurple, *pOrange, *pWhite, *pGreen, *pYellow, *pPink,*pCyan,*pBlack;
}; pixels pi;

#define pchamp( x, b, f )
if( x )
{
YourDevice->SetRenderState( D3DRS_ZENABLE, FALSE );
YourDevice->SetRenderState( D3DRS_ZFUNC, D3DCMP_NEVER );
YourDevice->SetTexture( 0, NULL );
YourDevice->SetTexture( 0, f );
YourDevice->DrawIndexedPrimitive( Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount );
YourDevice->SetRenderState( D3DRS_ZENABLE, TRUE );
YourDevice->SetRenderState( D3DRS_ZFUNC,D3DCMP_LESSEQUAL );
YourDevice->SetTexture( 0, b );
YourDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
return YourDevice->DrawIndexedPrimitive( Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount );
}
//**//
EndScene
Code:
int color = true;
if(color)
{
GenerateTexture(YourDevice,&pi.pRed, D3DCOLOR_ARGB(255,255,0,0 ));
GenerateTexture(YourDevice,&pi.pCyan, D3DCOLOR_ARGB(255,0,255,255 ));
GenerateTexture(YourDevice,&pi.pYellow, D3DCOLOR_ARGB(255,255,255,0 ));
GenerateTexture(YourDevice,&pi.pBlue, D3DCOLOR_ARGB(255,0,0,255 ));
GenerateTexture(YourDevice,&pi.pGreen, D3DCOLOR_ARGB(255,0,255,0 ));
GenerateTexture(YourDevice,&pi.pOrange, D3DCOLOR_ARGB(255,255,165,0 ));
GenerateTexture(YourDevice,&pi.pPurple, D3DCOLOR_ARGB(255,160,32,240 ));
GenerateTexture(YourDevice,&pi.pWhite, D3DCOLOR_ARGB(255,255,255,255 ));
GenerateTexture(YourDevice,&pi.pPink, D3DCOLOR_ARGB(255,255,105,180 ));
GenerateTexture(YourDevice,&pi.pBlack, D3DCOLOR_ARGB(255,0,0,0 ));
color = false;
}
DrawIndexedPrimitive()
Code:
if(chams)
{
pchamp(m_Stride == 44,pi.pBlue,pi.pGreen);
}