C#应用程序的行为类似于WINDBG的“进入"特征 [英] C# app to act like WINDBG's "step into" feature

查看:125
本文介绍了C#应用程序的行为类似于WINDBG的“进入"特征的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了很多学术性"安全项目,这些项目主要针对Linux平台,但是最近我对Windows产生了一些兴趣.因此,我要做的是制作一些小工具,例如一个应用程序,以使其他应用程序崩溃,等等,只是为了激发行为.因此,我不得不大量使用WINDBG来逐步执行过程,这非常有用,比GDB(linux)凉爽得多.

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).

因此,我现在要制作的工具基本上就像WINDBG中的步进功能一样.我所能做的是作为System.Diagnostis.Process对象启动一个进程,并查看所有线程等.但是接下来我需要做的就是碰壁.

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.

如何使用C#(最好是使用System.Diagnostics.Process类)以编程方式逐步完成"一个过程.

我想要实现的基本上是与从WINDBG获得的信息相同的信息.希望是我能够创建一个宏"系统来自动完成程序.

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.

推荐答案

您的问题非常复杂,实际上没有简单的答案.

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

这是MattiasHögström的一个项目,旨在帮助您入门.他的项目使用IDebugClient类以某种方式处理非托管代码,他可以遍历调用堆栈.有了这些知识,并且调试器参考,您可以编写CLR(c ++)和它的接口,以便可以从本机C#应用程序访问它.

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.

这篇关于C#应用程序的行为类似于WINDBG的“进入"特征的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆