arc_
May 25th, 2009, 14:26
Quote:
[Originally Posted by http://msdn.microsoft.com/en-us/library/bb173085(VS.85).aspx]PIX is a debugging and analysis tool that captures detailed information from a Direct3D application as it executes. PIX can be configured to gather data, such as the list of Direct3D APIs called, timing information, mesh vertices before and after transformations, screenshots, and select statistics. PIX can also be used for debugging vertex and pixel shaders, including setting breakpoints and stepping through shader code. |
Thus, a highly useful tool right from the MS DirectX SDK for e.g. finding the cause of a rendering problem: for any captured frame, you can click through the executed DX API functions and see how the frame is being built up, eventually finding out what part is to blame.
http://files.uploadffs.com/c/5636cc39/pix.png
But what about reversing a closed source application's renderer? PIX does not store a call stack; it merely logs *what* DX functions are called, but not from *where*. Therefore it is not very useful for reversing by default.
I didn't want to let such a great tool go to waste. After some reversing work I ended up patching PIX to log and show (part of) the call stack for each DirectX call that the target program makes. Each call stack entry has both the virtual address and the module name.
http://files.uploadffs.com/5/5e3e56be/callstack.png
Example usage of the resulting modified tool is finding out about and messing with a game's renderer, or more simply locating the HUD rendering code and quickly finding the data that it represents (e.g. health, money) rather than having to resort to memory scanning.
Fullsize screenshot: http://files.uploadffs.com/0/54880c80/callstack.png
Download: http://www.mediafire.com/file/nhtzmjdi0z2/pix-callstack.rar