Does anyone know how to fix this crap? i have a source for wall hack but the wall hack doesn't show through every texture it bugs a lot and only shows through certain textures i don't want to remove the textures because then if i tried shooting and i hit the object for example i cant see enemy through a rock so i removed the texture rendered it as see through if i didnt know it was there id shoot it.
Shader
Code:
HRESULT GenerateShader(IDirect3DDevice9 *pDevice, IDirect3DPixelShader9 **pShader, float r, float g, float b)
{
char szShader[256];
ID3DXBuffer *pShaderBuf = NULL;
sprintf(szShader, "ps_3_0\ndef c0, %f, %f, %f, %f\nmov oC0,c0", r, g, b, 1.0f);
D3DXAssembleShader(szShader, sizeof(szShader), NULL, NULL, 0, &pShaderBuf, NULL);
if (FAILED(pDevice->CreatePixelShader((const DWORD*)pShaderBuf->GetBufferPointer(), pShader)))return E_FAIL;
return S_OK;
}
button function
Code:
if (wh) {
if (_Features[0]) {
pDevice->SetRenderState(D3DRS_ZENABLE, FALSE);
pDevice->SetPixelShader(BlueTex);
oDrawIndexedPrimitive(pDevice, Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, PrimitiveCount);
pDevice->SetRenderState(D3DRS_ZENABLE, TRUE);
pDevice->SetPixelShader(RedTex);
}
}
Hook
Code:
int InitD3D(void)
{
DWORD D3DBase, ResultadoD3DBase, *vTable;
D3DBase = 0; do { // wait till we can find the d3d9 dll the game and grab its base address. The base address is where the dll (module) gets loaded in memory
D3DBase = (DWORD)GetModuleHandle("d3d9.dll");
Sleep(10);
}
while (!D3DBase); // grab pattern of D3D9 Vtable, or VMT Table, or virtual method table
ResultadoD3DBase = ProcurePattern(D3DBase, 0x128000, (PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86", "xx????xx????xx");
// vtable + 0x0 = Function1Address
// vtable + 0x4 = Function2Address
// vtable + 0x8 = Function3Address
// vtable + 0xC = Function4Address
if (ResultadoD3DBase) { // if we found the vtable in memory, if your in a d3d9 game this will always be found.
memcpy(&vTable, (void *)(ResultadoD3DBase + 2), 4); // make own copy
oEndScene = (tEndScene)DetourFunction((PBYTE)vTable[42], (PBYTE)hkEndScene);
oDrawIndexedPrimitive = (tDrawIndexedPrimitive)DetourFunction((PBYTE)vTable[82], (PBYTE)hkDrawIndexedPrimitive);
}
return 0; // return out of function
}