Direct3D 9 Hook v1.1

February 1, 2008

Update: Since new DLLs were pushed out a while back, this doesn’t work any longer. The function offsets are wrong, and the hook injection method is a little too flaky to be relied upon. Feel free to use this code as a basis, but I’d recommend the use of Microsoft Detours for the hook injection. [...]

33

Run-time determination of VC++ 2005 virtual member function addresses

November 29, 2007

I was recently somewhat surprised to find that there is really no C++ way to resolve a virtual function to its address at run-time. Admittedly, there is no good reason why anybody would morally need to do this, but when you’ve already lowered yourself to patching another process’s own code without consent, it seems like [...]

1

Drawing on another Direct3D program’s viewport

November 27, 2007

Update: A new version of this exists, but since new DLLs were pushed out a while back, neither sample works any longer. The function offsets are wrong, and the hook injection method is a little too flaky to be relied upon. Feel free to use the code as a basis, but I’d recommend the use [...]

39

Case study: Fraps

November 22, 2007

One of the topics that I often find myself bluffing through on GameDev is Direct3D hooking. In particular, how to display an overlay of your own on the window of another Direct3D program, often a commercial game. It’s pretty clear that the simplest method would involve somehow hooking the call to IDirect3DDevice8/9/10::Present, but the details [...]

10

DLL injection via CreateRemoteThread

November 15, 2007

This isn’t exactly news, but I thought I’d briefly run through the now standard method of injecting a DLL of your choice into an arbitrary process under 32-bit Windows. It will serve as a foundation for the upcoming post on function hooking via DLL injection. So you have analysed a target program, know how it [...]

6