如何查看 Windows 库 (*.lib) 的内容 [英] How to See the Contents of Windows library (*.lib)
问题描述
我有一个二进制文件 - Windows 静态库 (*.lib).
有没有一种简单的方法可以从该库中找出函数名称及其接口?
I have a binary file - Windows static library (*.lib).
Is there a simple way to find out names of the functions and their interface from that library ?
类似于 emfar
和 elfdump
实用程序(在 Linux 系统上)的东西?
Something similar to emfar
and elfdump
utilities (on Linux systems) ?
推荐答案
假设您在谈论静态库,DUMPBIN/SYMBOLS
显示库中的函数和数据对象.如果您在谈论导入库(用于引用从 DLL 导出的符号的 .lib
),那么您需要 DUMPBIN/EXPORTS
.
Assuming you're talking about a static library, DUMPBIN /SYMBOLS
shows the functions and data objects in the library. If you're talking about an import library (a .lib
used to refer to symbols exported from a DLL), then you want DUMPBIN /EXPORTS
.
请注意,对于与C"二进制接口链接的函数,这仍然不会让您返回值、参数或调用约定.该信息根本没有编码在 .lib
中;您必须提前知道这一点(例如,通过头文件中的原型)才能正确调用它们.
Note that for functions linked with the "C" binary interface, this still won't get you return values, parameters, or calling convention. That information isn't encoded in the .lib
at all; you have to know that ahead of time (via prototypes in header files, for example) in order to call them correctly.
对于与 C++ 二进制接口链接的函数,调用约定和参数在函数的导出名称中进行编码(也称为名称修改").DUMPBIN/SYMBOLS
将向您显示损坏的"函数名称以及解码后的参数集.
For functions linked with the C++ binary interface, the calling convention and arguments are encoded in the exported name of the function (also called "name mangling"). DUMPBIN /SYMBOLS
will show you both the "mangled" function name as well as the decoded set of parameters.
这篇关于如何查看 Windows 库 (*.lib) 的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!