Getting detailed crash dumps from a hooked exe

浪子不回头ぞ 提交于 2019-12-02 21:45:46

问题


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!


回答1:


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.



来源:https://stackoverflow.com/questions/28234165/getting-detailed-crash-dumps-from-a-hooked-exe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!