I am in need for a hook/detour into directx functions. I normally hook swapchain present as such using ms detours
oPresent = (tPresent)DetourFunction(BSAddr,(PBYTE)hPresent);
HRESULT STDMETHODCALLTYPE hPresent(IDXGISwapChain* pDevice,UINT SyncInterval,UINT Flags)
This gives me the ability to Draw Text etc into any DX10 rendered program. The reason I need to go deeper is because Gaming anti-cheat software will often scan any hooks at main levels. So the Present function must be intact with original bytes.
## Deliverables
Here is the ASM dump of DX10 SwapChain Present with my hook already:
645CD7B9 -E9 42ACD2AD JMP bc2.122F8400 //My Current Hook
645CD7BE FF75 10 PUSH DWORD PTR SS:[EBP+10]
645CD7C1 8B4D 08 MOV ECX,DWORD PTR SS:[EBP+8]
645CD7C4 FF75 0C PUSH DWORD PTR SS:[EBP+C]
645CD7C7 E8 F3F5FFFF CALL dxgi.645CCDBF //Want to hook inside this function
645CD7CC 8BC8 MOV ECX,EAX
645CD7CE 81E9 02007A08 SUB ECX,87A0002
645CD7D4 74 0C JE SHORT dxgi.645CD7E2
645CD7D6 83E9 03 SUB ECX,3
645CD7D9 75 09 JNZ SHORT dxgi.645CD7E4
645CD7DB B8 01007A08 MOV EAX,87A0001
645CD7E0 EB 02 JMP SHORT dxgi.645CD7E4
645CD7E2 33C0 XOR EAX,EAX
645CD7E4 5D POP EBP
645CD7E5 C2 0C00 RETN 0C
i'd like to hook that dxgi method - and be able to draw dx10 functions from inside that hook.