当前位置:编程学习 > C/C++ >>

学习windows编程外篇(1)--分析lib文件


  
大家都知道,lib文件是很多obj文件合在一起得到的一个静态库文件。那某一个特定的lib文件,到底是由哪些obj文件组成的呢?

有一个工具可以帮到你,它的名字叫做lib.exe。

还是用LIBC.LIB来举例。我电脑上这个lib文件的位置是在“d:Program FilesMicrosoft Visual StudioVC98LibLIBC.LIB”,进入这个目录。

所有的lib使用选项:

d:Program FilesMicrosoft Visual StudioVC98Lib>lib /?
Microsoft (R) Library Manager Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

usage: LIB [options] [files]

   options:

      /CONVERT
      /DEBUGTYPE:CV
      /DEF[:filename]
      /EXPORT:symbol
      /EXTRACT:membername
      /INCLUDE:symbol
      /LIBPATH:dir
      /LINK50COMPAT
      /LIST[:filename]
      /MACHINE:{ALPHA|ARM|IX86|MIPS|MIPS16|MIPSR41XX|PPC|SH3|SH4}
      /NAME:filename
      /NODEFAULTLIB[:library]
      /NOLOGO
      /OUT:filename
      /REMOVE:membername
      /SUBSYSTEM:{NATIVE|WINDOWS|CONSOLE|WINDOWSCE|POSIX}[,#[.##]]
      /VERBOSE

可以使用list来显示其中的obj文件。

d:Program FilesMicrosoft Visual StudioVC98Lib>lib /list libc.lib

整个列表比较长,所以我又做了个重定向,将输入放到log文件中了。

d:Program FilesMicrosoft Visual StudioVC98Lib>lib /list libc.lib > d: estlibc.log

最终输出有600多行,所以折叠起来,大家可以展开看。


show sourceview sourceprint?001 Microsoft (R) Library Manager Version 6.00.8447 

002 Copyright (C) Microsoft Corp 1992-1998. All rights reserved. 

003   

004 ..uildintelst_objutil.obj 

005 ..uildintelst_objmatherr.obj 

006 ..uildintelst_objldexp.obj 

007 ..uildintelst_objieeemisc.obj 

008 ..uildintelst_objfrexp.obj 

009 ..uildintelst_objfpexcept.obj 

010 ..uildintelst_objessel.obj 

011 ..uildintelst_objxmmi2_fp_emul.obj 

012 ..uildintelst_objxmmi_fp_emul.obj 

013 ..uildintelst_objsqrt.obj 

014 ..uildintelst_objpow.obj 

015 ..uildintelst_objlog10.obj 

016 ..uildintelst_objlog.obj 

017 ..uildintelst_obj an.obj 

018 ..uildintelst_objcos.obj 

019 ..uildintelst_objsin.obj 

020 ..uildintelst_objatan.obj 

021 ..uildintelst_objacos.obj 

022 ..uildintelst_objasin.obj 

023 ..uildintelst_obj estfdiv.obj 

024 ..uildintelst_objpowhlp.obj 

025 ..uildintelst_objmodf.obj 

026 ..uildintelst_objieee87.obj 

027 ..uildintelst_objhypot.obj 

028 ..uildintelst_objhuge.obj 

029 ..uildintelst_objgenexcep.obj 

030 ..uildintelst_objftol.obj 

031 ..uildintelst_objfsqrt.obj 

032 ..uildintelst_objfrnd.obj 

033 ..uildintelst_objfpctrl.obj 

034 ..uildintelst_objfloor.obj 

035 ..uildintelst_objfilter_simd.obj 

036 ..uildintelst_objfilter.obj 

037 ..uildintelst_objfabs.obj 

038 ..uildintelst_objcommon.obj 

039 ..uildintelst_objceil.obj 

040 ..uildintelst_objadj_fdiv.obj 

041 ..uildintelst_obj87trigh.obj 

042 ..uildintelst_obj87triga.obj 

043 ..uildintelst_obj87trig.obj 

044 ..uildintelst_obj87tran.obj 

045 ..uildintelst_obj87sqrt.obj 

046 ..uildintelst_obj87fmod.obj 

047 ..uildintelst_obj87except.obj 

048 ..uildintelst_obj87disp.obj 

049 ..uildintelst_obj87ctrigh.obj 

050 ..uildintelst_obj87ctriga.obj 

051 ..uildintelst_obj87ctran.obj 

052 ..uildintelst_obj87cdisp.obj 

053 ..uildintelst_objfltinf.obj 

054 ..uildintelst_objx10fout.obj 

055 ..uildintelst_obj enpow.obj 

056 ..uildintelst_objstrgtold.obj 

057 ..uildintelst_objmantold.obj 

058 ..uildintelst_objintrncvt.obj 

059 ..uildintelst_objfpinit.obj 

060 ..uildintelst_objcvt.obj 

061 ..uildintelst_objconstpow.obj 

062 ..uildintelst_objcfout.obj 

063 ..uildintelst_objcfin.obj 

064 buildintelst_objwutime.obj 

065 buildintelst_objwstrtime.obj 

066 buildintelst_objwstrdate.obj 

067 buildintelst_objwctime.obj 

068 buildintelst_objwasctime.obj 

069 buildintelst_objwcsftime.obj 

070 buildintelst_objutime.obj 

071 buildintelst_obj zset.obj 

072 buildintelst_obj imeset.obj 

073 buildintelst_obj ime.obj 

074 buildintelst_objsystime.obj 

075 buildintelst_objstrtime.obj 

076 buildintelst_objstrdate.obj 

077 buildintelst_objstrftime.obj 

078 buildintelst_objmktime.obj 

079 buildintelst_objlocaltim.obj 

080 buildintelst_objgmtime.obj 

081 buildintelst_objftime.obj 

082 buildintelst_objdtoxtime.obj 

083 buildintelst_objdifftime.obj 

084 buildintelst_objdays.obj 

085 buildintelst_objctime.obj 

086 buildintelst_objclock.obj 

087 buildintelst_objasctime.obj 

088 buildintelst_obj cmapmbslen.obj 

089 buildintelst_obj cmap set.obj 

090 buildintelst_obj cmap icoll.obj 

091 buildintelst_obj cmap icmp.obj 

092 buildintelst_obj cmap cpy.obj 

093 buildintelst_obj cmap coll.obj 

094 buildintelst_obj cmap cmp.obj 

095 buildintelst_obj cmap cat.obj 

096 buildintelst_obj cmap bset.obj 

097 buildintelst_obj cmap bicoll.obj 

098 buildintelst_obj cmap bicmp.obj 

099 buildintelst_obj cmap bcpy.obj 

100 buildintelst_obj cmap bcoll.obj 

101 buildintelst_obj cmap bcmp.obj 

102 buildintelst_obj cmap bcat.obj 

103 buildintelst_obj cmap\_mbscpy.obj 

104 buildintelst_obj cmap\_mbclen.obj 

105 buildintelst_obj cmaplen.obj 

106 buildintelst_obj cmapicoll.obj 

107 buildintelst_obj cmapcoll.obj 

108 buildintelst_obj cmapicmp.obj 

109 buildintelst_obj cmapcmp.obj 

110 buildintelst_obj cmapupr.obj 

111 buildintelst_obj cmaplwr.obj 

112 buildintelst_obj cmapspnp.obj 

113 buildintelst_obj cmap inc.obj 

114 buildintelst_obj cmap extc.obj 

115 buildintelst_obj cmap ccnt.obj 

116 buildintelst_obj cmap bcnt.obj 

117 build

补充:软件开发 , C语言 ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,