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

查看:137
本文介绍了如何查看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显示库中的函数和数据对象.如果您在谈论导入库(.lib用来引用从DLL导出的符号),则需要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天全站免登陆