Author Topic: MS COFF import library to module definition file converter  (Read 885 times)

Vortex

  • Member
  • *****
  • Posts: 2600
Hello,

Here is lib2def V2.2, my MS COFF import library to module definition file converter. A bug causing crash is now fixed. The tool can process 32-bit and 64-bit import libraries. lib2def accepts wildcards like *.lib

http://vortex.masmcode.com/files/lib2def22.zip

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 8741
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: MS COFF import library to module definition file converter
« Reply #1 on: May 23, 2021, 10:44:35 AM »
This looks good Erol, thanks for posting this useful tool.  :thup:
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

JudeEngbretson

  • Regular Member
  • *
  • Posts: 1
  • Hello! I am a doctor of medical sciences.
Re: MS COFF import library to module definition file converter
« Reply #2 on: October 12, 2021, 10:55:44 PM »
Is there a way to convert the COFF library (lib file) to OMF library for use with C ++ Builder6? This coff is not just an import library, it contains some code. When I try to convert it using borland coff2omf.exe I get a 1KB file from a 15KB file.

HSE

  • Member
  • *****
  • Posts: 1808
  • AMD 7-32 / i3 10-64
Re: MS COFF import library to module definition file converter
« Reply #3 on: October 12, 2021, 11:26:53 PM »
Hi Jude!

Is there a way to convert the COFF library (lib file) to OMF library for use with C ++ Builder6? This coff is not just an import library, it contains some code. When I try to convert it using borland coff2omf.exe I get a 1KB file from a 15KB file.

You can try with Agner Fog ObjConv tool https://www.agner.org/optimize/#objconv

Vortex

  • Member
  • *****
  • Posts: 2600
Re: MS COFF import library to module definition file converter
« Reply #4 on: October 13, 2021, 05:45:56 AM »
Hi JudeEngbretson,

HSE's suggestion to try Agner Fog's objconv is very good but you need to be careful with mixed libraries containing imports + code. Such "glued" libraries are not easy to maintain and they can be complicated. You should try objconv.

vitsoft

  • Regular Member
  • *
  • Posts: 11
    • vit$oft
Re: MS COFF import library to module definition file converter
« Reply #5 on: October 17, 2021, 03:45:26 AM »
I didn't test it with Builder6 but my object convertor can cope with 16bit and 32bit object libraries with code + import information. Here is the linker script, if you want to give it a try:

OMFlibrary PROGRAM FORMAT=LIBOMF ; Convert COFF object library to OMF library.
             LINK "COFFlibrary.lib"
           ENDPROGRAM OMFlibrary


Execute the script with euroasm.exe script.asm