The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: Vortex on August 07, 2005, 12:15:30 PM

Title: Import library to MASM include file converter
Post by: Vortex on August 07, 2005, 12:15:30 PM
Hi friends,

Here is my tool converting MS COFF import libraries to MASM include files.

Tested with import libraries coming with Hutch's masm32 package and PellesC V3.00

The tool accepts wildcards like *.lib

http://vortex.masmcode.com/files/lib2inc10.zip
Title: Re: Import library to MASM include file converter
Post by: PBrennick on August 07, 2005, 11:53:59 PM
Hi Erol,
You have certainly been a busy lad creating all these nice tools and we are all better off for it.

You have 'my' thanks,
Paul
Title: Re: Import library to MASM include file converter
Post by: GregL on August 08, 2005, 01:56:01 AM
Thanks Vortex  :U


Title: Re: Import library to MASM include file converter
Post by: Vortex on August 14, 2005, 11:22:58 AM
Hi friends,

Here is lib2inc V1.1 :

- Fixed bug with duplicate names from user32.lib  ( Many thanks Paul informing me about the bug )

The tool is able to extract fuction prototypes from static libraries. If you have the time, could you test the tool with static libs?

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

Here is the include file set extracted from Pelles import libraries V 4.00 beta1 :

http://vortex.masmcode.com/files/PellesC_incV11.zip
Title: Re: Import library to MASM include file converter
Post by: PBrennick on August 14, 2005, 12:43:02 PM
Hi Erol,
That was quick, I will check it out later today.  Thank you.

Paul
Title: Re: Import library to MASM include file converter
Post by: Ghirai on August 14, 2005, 12:45:35 PM
Great job Vortex  :U
Title: Re: Import library to MASM include file converter
Post by: Vortex on August 15, 2005, 10:17:03 AM
Here is version V1.11 :

- Fixed bug : lib2inc is now able to extract function names with leading @ :


@DnsGetDomainName PROTO :DWORD
@DnsIsAMailboxType PROTO :DWORD
etc...


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

http://vortex.masmcode.com/files/PellesC_inc111.zip
Title: Re: Import library to MASM include file converter
Post by: Vortex on August 23, 2005, 04:32:08 PM
Here are the include files extracted from PellesC library set V4.00 beta 3 :

http://vortex.masmcode.com/files/PellesC4b3_inc.zip
Title: Re: Import library to MASM include file converter
Post by: Vortex on January 01, 2006, 02:14:50 PM
Here is lib2inc V1.2 translated to Poasm. Now, the tool supports both MASM and POASM

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

Include file set extracted from Pelles import libraries 4.00.50

http://vortex.masmcode.com/files/PellesC_inc12.zip
Title: Re: Import library to MASM include file converter
Post by: Vortex on January 15, 2006, 11:11:37 AM
Here is lib2inc V1.3 supporting static libraries. To create an include file from a static library :

lib2inc statlib.lib -s

As usually, creating include files from import libraries :

lib2inc importlib.lib

http://vortex.masmcode.com/files/lib2inc13.zip
Title: Re: Import library to MASM include file converter
Post by: Vortex on July 29, 2006, 11:29:41 AM
Here is lib2inc V2.0 now supporting Fasm.

Usage    : lib2inc libfile.lib [options]

Switches :

-s : set global calling convention to STDCALL for MASM \ POASM

   MessageBoxA PROTO STDCALL :DWORD,:DWORD,:DWORD,:DWORD

-fd : output EXTERNDEFs for Fasm - direct calls
   lib2inc outputs include files enabling direct function calls

   EXTERNDEF '_MessageBoxA@16',MessageBox

-fi : output EXTERNDEFs for Fasm - indirect calls
     lib2inc outputs include files enabling indirect function calls

   EXTRNDEF '__imp__MessageBoxA@16',MessageBox


If the user doesn't specify any optinonal parameter then the tool emits standard include files for Masm.

http://vortex.masmcode.com/files/lib2inc20.zip
Title: Re: Import library to MASM include file converter
Post by: PBrennick on July 29, 2006, 05:24:12 PM
Hi Vortex,
Your tools keep getting better.  Take a rest every now and then.

Paul
Title: Re: Import library to MASM include file converter
Post by: Vortex on July 29, 2006, 09:29:20 PM
Hi Paul,

Thanks for your support.
Title: Re: Import library to MASM include file converter
Post by: Vortex on August 15, 2007, 07:06:52 PM
Version 2.1 supporting LzAsm :

Switches :
Quote-s    : set global calling convention to STDCALL for MASM \ POASM

      MessageBoxA PROTO STDCALL :DWORD,:DWORD,:DWORD,:DWORD
      MessageBox equ <MessageBoxA>

-fd    : output EXTERNDEFs for Fasm - direct calls

      lib2inc outputs include files for direct function calls

      EXTERNDEF '_MessageBoxA@16',MessageBox

-fi    : output EXTERNDEFs for Fasm - indirect calls

        lib2inc outputs include files for indirect function calls

      EXTRNDEF '__imp__MessageBoxA@16',MessageBox

-lz      : output LzAsm include files

        lib2inc outputs include files for LzAsm

      PROCDESC MessageBoxA :DWORD,:DWORD,:DWORD,:DWORD
      MessageBox equ <MessageBoxA>

http://vortex.masmcode.com/files/lib2inc21.zip
Title: Re: Import library to MASM include file converter
Post by: Mark Jones on August 15, 2007, 10:45:45 PM
Thanks, keep up the excellent work. :U
Title: Re: Import library to MASM include file converter
Post by: Vortex on August 16, 2007, 05:43:07 PM
Hi Mark,

Thanks for your support.
Title: Re: Import library to MASM include file converter
Post by: Timbo on August 17, 2007, 03:17:42 AM
Vortex,

Thanks for this tool.  I use it (and have used it for some time now) in all of my library projects (some of which are written in C) to automatically construct my includes for use with MASM.  Very useful.

Regards,

Tim
Title: Re: Import library to MASM include file converter
Post by: Vortex on August 17, 2007, 05:43:39 PM
Hi Tim,

Thanks for your kind words.
Title: Re: Import library to MASM include file converter
Post by: Vortex on February 20, 2008, 07:43:55 PM
Version 2.2 supporting Solar Assembler.

An example :

lib2inc kernel32.lib -so

extern ActivateActCtx alias _ActivateActCtx@8
extern AddAtom alias _AddAtomA@4
extern AddAtomW alias _AddAtomW@4
extern AddConsoleAlias alias _AddConsoleAliasA@12
.
.
.


The zip file includes a SolAsm COFF example linked with Pelle's linker Polink.

http://vortex.masmcode.com/files/lib2inc22.zip
Title: Re: Import library to MASM include file converter
Post by: Vortex on May 31, 2008, 10:19:58 AM
Added SolAsm support :

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