views:

29

answers:

1

I have an application that makes use of Direct 3D to draw several things onto the screen. I'm looking to inject a DLL and hook a low level direct 3d function so I can record the screen and eventually convert it to a video file.

My question really is; what should I be hooking into? I suppose I need to do it where Direct 3D writes to the framebuffer. I'm looking at exports from d3dx9_41 but can't really seem to find a suitable function.

Any help is much appreciated :)

edit:

Perhaps this is the best way?

  • Hook CreateDevice
  • Use my own calls to Present()
A: 

There is lots of info on doing this on the site already. e.g:

http://stackoverflow.com/questions/1994676/hooking-directx-endscene-from-an-injected-dll

Thing is you are inspecting the wrong DLL. D3DX is just useful glue code it isn't D3D itself. Try D3D9.dll. And your best plan is to hook the EndScene call and insert any rendering you wish to do before calling the real EndScene and then letting the application get on with it :)

Goz