从C#中的非托管DLL获取所有方法 [英] Get all methods from a unmanaged DLL in C#

查看:510
本文介绍了从C#中的非托管DLL获取所有方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





通过C#中的反射,可以从托管代码中获取库中的所有方法(使用 Type.GetMethods() [ ^ ]方法)。现在,我正在尝试从非托管代码中获取所有方法。例如,我试图从C#中获取 user32.dll (以及其他DLL的方法)中的所有方法。

我该如何那样做吗?



提前致谢。

Hi,

With reflection in C#, it's possible to get all methods from a library from managed code (using the Type.GetMethods()[^] method). Now, I'm trying to get all methods from unmanaged code. For example, I'm trying to get all methods from user32.dll (and the methods from other DLL's) in C#.
How can I do that?

Thanks in advance.

推荐答案



要获取功能名称列表,



转到VS命令提示符,



类型



1)dumpbin / exports user32.dll> C:\ FunctionList_User32.txt

2)link / dump / exports user32.dll> C:\ FunctionList_User32.txt。







http://msdn.microsoft.com/en-us/library/aa720146(v=vs.71)。 aspx [ ^ ]


你可以做到(在有限的范围内),但我从未尝试过,因为你可以得到的信息对你来说是没用的。为什么?因为非托管DLL不包含像托管程序集那样的参数列表,所以DLL函数列表就是:没有其他信息的名称。



有工具可以检索这些名称: Dependancy Walker [ ^ ]是非常有用的,但是为了使用您可以检索的名称,您仍然需要查看文档。所以说实话,你可能最好先从文件开始!
You can do it (to a limited extent) but I've never tried as the information you can get is pretty useless to you. Why? Because unmanaged DLLs do not contain parameter lists like managed assemblies do, so a list of DLL functions is just that: the names with no other information.

There are tools to retrieve those names: Dependancy Walker[^] is a very useful one, but in order to use the names you can retrieve, you still need to look at the documentation. So to be honest, you are probably better off starting with the documents in the first place!


这篇关于从C#中的非托管DLL获取所有方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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