C# app to act like WINDBG's “step into” feature

£可爱£侵袭症+ 提交于 2019-12-11 02:06:46

问题


I do a lot "academic" security projects mostly targeted at Linux platforms but recently I've had some interest in Windows. So what I'm I've done is make some small tools like an app to crash other apps and such, just to provoke behavior. So I've had to use WINDBG a lot for stepping through processes, which is been pretty useful, way cooler than GDB(linux).

So the tool I'm trying to make now is essentially just like the stepping feature in WINDBG. What I can do is launch a process as a System.Diagnostis.Process object, and look at all the threads and such. But what I need to do next is where I've hit a wall.

How would one programmatically "step through" a process using C#, and preferably using the System.Diagnostics.Process class.

What I'm trying to achieve would essentially be the same kind of information one would get from WINDBG. The hope is I'd be able to make a "macro" system for stepping through programs automatically.


回答1:


http://www.codeproject.com/Articles/371137/A-Mixed-Mode-Stackwalk-with-the-IDebugClient-Inter

Your question's pretty complex, there's really no simple answer.

Here's a project by Mattias Högström to get you started. His project handles unmanaged code in a way using the IDebugClient class he can walk a call stack. With some of that knowledge and and The Debugger reference you can write a CLR (c++), and an interface for it so you can access it from your native C# app.



来源:https://stackoverflow.com/questions/25144043/c-sharp-app-to-act-like-windbgs-step-into-feature

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