如何查看 Windows 库 (*.lib) 的内容 [英] How to See the Contents of Windows library (*.lib)

查看:20
本文介绍了如何查看 Windows 库 (*.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 ?

类似于 emfarelfdump 实用程序(在 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屋!

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