Originally Posted by
topblast
Looking to building an updated version, to add DirectX 12 support
Het topblast, nice work that sounds amazing if you could do that.
Can I ask for your help, I've tried my best to get this working with your answer a few posts back on here but I can't get the D3D11DrawIndexedhook to call can you help me out?
Can you see what i'm doing wrong here?
InitD3D11Hook()
....
Code:
if (SUCCEEDED(hr))
{
context->Release();
device->Release();
bSuccess = true;
UPARAM * vtbl = *(UPARAM**)swap;
UPARAM * vtblcontext = *(UPARAM**)context;
d3d11SwapPresent.Hook((FARPROC)*(vtbl + (32 / 4)), (FARPROC)DXGISwapPresentHook);
d3d11ResizeBuffer.Hook((FARPROC)*(vtbl + (52 / 4)), (FARPROC)DXGISwapResizeBuffersHook);
d3d11DrawIndexed.Hook((FARPROC)*(vtblcontext + (48 / 4)), (FARPROC)D3D11DrawIndexedhook);
swap->Release();
d3d11SwapPresent.Rehook();
d3d11ResizeBuffer.Rehook();
d3d11DrawIndexed.Rehook();
}
Code:
void __stdcall D3D11DrawIndexedhook(ID3D11DeviceContext* context, UINT IndexCount, UINT StartIndexLocation, INT BaseVertexLocation)
{
Logger::LogMessage("D3D11DrawIndexedhook()\n");
d3d11DrawIndexed.Unhook();
//if(GetAsyncKeyState(VK_F10) & 1 )
//Output("IndexCount == %d", IndexCount);
context->DrawIndexed(IndexCount, StartIndexLocation, BaseVertexLocation);
d3d11DrawIndexed.Rehook();
}
- - - Updated - - -
Also how do you know the vtbl position for these? Is it different for all games?
Code:
d3d11SwapPresent.Hook((FARPROC)*(vtbl + (32 / 4)), (FARPROC)DXGISwapPresentHook);
d3d11ResizeBuffer.Hook((FARPROC)*(vtbl + (52 / 4)), (FARPROC)DXGISwapResizeBuffersHook);
d3d11DrawIndexed.Hook((FARPROC)*(vtblcontext + (48 / 4)), (FARPROC)D3D11DrawIndexedhook);