How To Make A D3D Hook [ Complete Tutorial ]
First of all i m not like those who afraid on giving a hook..i don't care about this i care bout helping people
First of all include those [they may have smth rong if any corrections i suggest @Swag to tell me]
Code:
Code:
[You must be registered and logged in to see this link.]
okay first lets start naked function
Code:
Code:
DWORD* DIP_hook = NULL;
DWORD DIP_return = NULL;
bool wallhack = true;
void myDIP(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE Type,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount)
{
IDirect3DVertexBuffer9* pStreamData = NULL;
UINT iOffsetInBytes,iStride;
pDevice->GetStreamSource(0,&pStreamData,&iOffsetInBytes,&iStride);
if(wallhack)
if ((iStride==40)||(iStride==44))
{
pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE );
pDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_NEVER);
}
}
_declspec(naked) void dwmyDIP()
{
__asm
{
//Call myDIP
MOV EAX, DWORD PTR [ESP+40];
PUSH EAX;
MOV EAX, DWORD PTR [ESP+40];
PUSH EAX;
MOV EAX, DWORD PTR [ESP+40];
PUSH EAX;
MOV EAX, DWORD PTR [ESP+40];
PUSH EAX;
MOV EAX, DWORD PTR [ESP+40];
PUSH EAX;
MOV EAX, DWORD PTR [ESP+40];
PUSH EAX;
MOV EAX, DWORD PTR [ESP+40];
PUSH EAX;
CALL myDIP;
ADD ESP, 28;
Then Restore EAX original value:
Code:
Code:
MOV EAX,DWORD PTR FS:[0];
Then put back the Original code:
Code:
Code:
PUSH EAX;
SUB ESP,0x20;
Then Return ur JMP Back:
Code:
Code:
JMP DIP_return;
Then Close ur naked Function:
Code:
Code:
}
}
Then We Find The Pattern For Our Wall h4ck:
Code:
Code:
DWORD FindPattern(DWORD dwAddress,DWORD dwLen,BYTE *bMask,char * szMask)
{
for(DWORD i=0; i
First of all i m not like those who afraid on giving a hook..i don't care about this i care bout helping people
First of all include those [they may have smth rong if any corrections i suggest @Swag to tell me]
Code:
Code:
[You must be registered and logged in to see this link.]
okay first lets start naked function
Code:
Code:
DWORD* DIP_hook = NULL;
DWORD DIP_return = NULL;
bool wallhack = true;
void myDIP(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE Type,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount)
{
IDirect3DVertexBuffer9* pStreamData = NULL;
UINT iOffsetInBytes,iStride;
pDevice->GetStreamSource(0,&pStreamData,&iOffsetInBytes,&iStride);
if(wallhack)
if ((iStride==40)||(iStride==44))
{
pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE );
pDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_NEVER);
}
}
_declspec(naked) void dwmyDIP()
{
__asm
{
//Call myDIP
MOV EAX, DWORD PTR [ESP+40];
PUSH EAX;
MOV EAX, DWORD PTR [ESP+40];
PUSH EAX;
MOV EAX, DWORD PTR [ESP+40];
PUSH EAX;
MOV EAX, DWORD PTR [ESP+40];
PUSH EAX;
MOV EAX, DWORD PTR [ESP+40];
PUSH EAX;
MOV EAX, DWORD PTR [ESP+40];
PUSH EAX;
MOV EAX, DWORD PTR [ESP+40];
PUSH EAX;
CALL myDIP;
ADD ESP, 28;
Then Restore EAX original value:
Code:
Code:
MOV EAX,DWORD PTR FS:[0];
Then put back the Original code:
Code:
Code:
PUSH EAX;
SUB ESP,0x20;
Then Return ur JMP Back:
Code:
Code:
JMP DIP_return;
Then Close ur naked Function:
Code:
Code:
}
}
Then We Find The Pattern For Our Wall h4ck:
Code:
Code:
DWORD FindPattern(DWORD dwAddress,DWORD dwLen,BYTE *bMask,char * szMask)
{
for(DWORD i=0; i