The MASM Forum

Members Gallery => Showcase => Topic started by: Vortex on May 18, 2021, 03:15:39 AM

Title: MS COFF import library to module definition file converter
Post by: Vortex on May 18, 2021, 03:15:39 AM
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
Title: Re: MS COFF import library to module definition file converter
Post by: hutch-- on May 23, 2021, 10:44:35 AM
This looks good Erol, thanks for posting this useful tool.  :thup:
Title: Re: MS COFF import library to module definition file converter
Post by: JudeEngbretson 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.
Title: Re: MS COFF import library to module definition file converter
Post by: HSE on October 12, 2021, 11:26:53 PM
Hi Jude!

Quote from: JudeEngbretson 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.

You can try with Agner Fog ObjConv tool https://www.agner.org/optimize/#objconv
Title: Re: MS COFF import library to module definition file converter
Post by: Vortex 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.
Title: Re: MS COFF import library to module definition file converter
Post by: vitsoft on October 17, 2021, 03:45:26 AM
I didn't test it with Builder6 but my object convertor (https://euroassembler.eu/eadoc/#EaFnConvert) 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