VC中无LIB时的DLL隐式链接,制作与VC相符....docxVIP

  • 3
  • 0
  • 约2.96千字
  • 约 7页
  • 2021-03-23 发布于山东
  • 举报

VC中无LIB时的DLL隐式链接,制作与VC相符....docx

VC 中无 LIB 时的 DLL 隐式链接 ,制作与 VC++ 相符 ... 请大家注意 !这种方法只能应用于输出为 C 格式的 __stdcall 调用方式! 使用 VC++ 的工具 DUMPBIN 将 DLL 中的导出函数表导出到一定义 (.DEF) 文件 EXAMPLE : DUMPBIN VideoDeCoder.dll /EXPROTS /OUT:VideoDeCoder.def 将导出的 .DEF 文件整理为一符合 .DEF 个数的函数导出文 件 EXAMPLE : VideoDeCoder.DEF 文件内容如下 Dump of file VideoDeCoder.dll File Type: DLL Section contains the following exports for VideoDeCoder.dll 0 characteristics 3D49E48F time date stamp Fri Aug 02 09:46:55 2002 0.00 version 1 ordinal base 11 number of functions 11 number of names ordinal hint RV A name 0 00010F60 _TM_ClearDecoderBuff@4 1 00010E80 _TM_CloseDecoder@4 2 00010F00 _TM_DecodePicture@4 3 00010ED0 _TM_DecodePictureHeader@4 4 00010FD0 _TM_GetFileEnd@4 5_TM_GetUValue@4 6_TM_GetVValue@4 7_TM_GetYValue@4 8 00010E10 _TM_OpenDecoder@8 9 00010F30 _TM_ReturnType@4 A 00010F90 _TM_SetFileEnd@8 Summary 2000 .data 1000 .rdata 1000 .reloc 15000 .text 按照以下方法整理 : 1gt; 添加 LIB 说明 LIBRARY VideoDeCoder ;xx 为 DLL 名 称 DESCRIPTION VideoDeCoder library 2gt; 去掉导出函数说明端以外的内容 ,在 LIB 说明 下添加 EXPROTS 说明导出函数 LIBRARY VideoDeCoder DESCRIPTION VideoDeCoder library EXPORTS ordinal hint RV A name 0 00010F60 _TM_ClearDecoderBuff@4 1 00010E80 _TM_CloseDecoder@4 2 00010F00 _TM_DecodePicture@ 3 00010ED0 _TM_DecodePictureH 4 00010FD0 _TM_GetFileEnd@4 5_TM_GetUValue@4 6_TM_GetVValue@4 7_TM_GetYValue@4 8 00010E10 _TM_OpenDecoder@8 9 00010F30 _TM_ReturnType@4 A 00010F90 _TM_SetFileEnd@8 3gt; 将所有的函数放至行首 ,去掉 hint 和 RVA 数据 ,留下函数的序号 ordinal , 在序号前加上 @ 符号 形成 _导出函数名 @参数字节和 式(__stdcall 方式调用导出的函数符号是  @序号 函数名称  此种格 @参数 字节和  ). 最后形成  .DEF  文件如下  : LIBRARY VideoDeCoder DESCRIPTION VideoDeCoder library EXPORTS TM_ClearDecoderBuff@4 @1 TM_CloseDecoder@4 @2 TM_DecodePicture@4 @3 TM_DecodePictureHeader@4 @4 TM_GetFileEnd@4 @5 TM_GetUValue@4 @6 TM_GetVValue@4 @7 TM_GetYValue@4 @8 TM_OpenDecoder@8 @9 TM_ReturnType@4 @10 TM_SetFileEnd@8 @11 使用 VC++ 的 LIB 工具 ,带 /DEF:(.def 文件名 ) /MACHINE:IX86(80X86 机器 ),就输出符合 VC++ 格式的的 LIB

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档