Search code examples
visual-c++hookcrash-reportscrash-dumps

Getting detailed crash dumps from a hooked exe


I am trying find a problem with my program that is hooking into a game. This is vc++. Basically I launch the program and then hook into it using SDL. When I run the code from VS2010, all works fine. But when I try to run from command prompt, my program can launch the game, but after that the game crashes immediately.

I was viewing windows event logs, and it appears that there is an access violation. 0xc000005

How can I log any further details about the program that crashes? I tried "procdump" but that is not useful as I cannot INDIRECTLY target the hooked game from console. Rather it can only target my application that hooks.

Anyway of getting detailed dumps is highly appreciated in this case. Thanks!


Solution

  • You can perform postmortem debugging by using a combination of the WER registry keys/values to trap any dump that is produced. I’ve used this method to prevent the WER system from collecting the dump file (.dmp). I’ve also written about this in another similar post. To accomplish this, you will need to create a registry key under

    Software\Microsoft\Windows\Windows Error Reporting

    if one does not already exist. The key should be

    LocalDumps\your application.exe

    Once that’s done, modify these keys/values to meet your needs:

    DumpCount, DumpFolder, DumpType

    You’ll need Administrator rights to create and modify the keys, and, you should reset everything you’ve modified when you’re done debugging.