获取的导出函数签名的DLL [英] Get signatures of exported functions in a DLL

查看:352
本文介绍了获取的导出函数签名的DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能从DLL得到一个输出(C风格?)函数的签名(参数个数/类型,返回类型)?我可以查看函数的名称,地址,序等的列表以及 DLL导出查看器但我不能查看签名。我只有DLL文件,并且没有既没有.H也不.DEF文件。

Is it possible to get an exported (C style?) function's signature (parameter count/types, return type) from a DLL? I can view the list of function names, addresses, ordinals, etc. with DLL Export Viewer but I can't view the signatures. I only have the dll file and don't have neither .h nor .def files.

更新:是一个名为 API监控,我可以附加到使用提及的处理工具DLL和看到的函数的调用。这让我看到的参数,返回值和它们的整数值(指针?)的数量,但这并不有很大的帮助。我也许应该找到一种方法来确定哪些类型的指针在通话时间指向。结构

UPDATE: Using a tool called API Monitor, I can attach to a process that uses the mentioned dll and see the calls to the functions. This lets me to see the number of parameters, return value and their integer values (pointers?) but this doesn't help a lot. I probably should find a way to determine what type of structures those pointers are pointing to at the call time.

推荐答案

DLL文件不存储它们导出函数的签名。其他答案提到C ++,当C ++函数被导出的为C ++ 的,那么名字的确会错位。用正确的编译器的重整方案还原函数它,你将有签名。但大多数的DLL不使用他们的C ++名称导出C ++函数。相反,选择DLL导出使用C风格的名字输出,因此即使该DLL用C ++编写的功能,导出的函数仍然不会有任何签名信息。

DLLs do not store the signatures of the functions they export. Other answers have mentioned C++, and when a C++ function is exported as C++, then the name will indeed be mangled. Demangle it with the right compiler's mangling scheme, and you'll have the signature. But most DLLs do not export C++ functions using their C++ names. Instead, the functions a DLL chooses to export are exported using C-style names, so even if the DLL was written in C++, the exported functions still won't have any signature information.

您没有头?大多数厂商在其软件开发工具包之类的事情。如果你没有得到一个,然后抱怨给供应商。如果你不应该得到一个,那么也许你会了解你的任务的错误的方式;你确定你应该直接使用该DLL?

You don't have the header? Most vendors include that sort of thing in their SDKs. If you didn't get one, then complain to the vendor. If you weren't supposed to get one, then maybe you're going about your task the wrong way; are you sure you're supposed to use that DLL directly?

如果你没有头文件,那么你也可能会问自己是否真的允许的,合法的,反正用在你的程序的DLL。如果它只是你在系统上发现了一个任意的DLL,那么即使你可以写code吧,你可能不允许重新分配它,当你船的程序。

If you do not have the header file, then you might also ask yourself whether you're really allowed, legally, to use the DLL in your program anyway. If it's just an arbitrary DLL you found on your system, then even if you can write code for it, you're probably not allowed to redistribute it when you ship your program.

这篇关于获取的导出函数签名的DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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