News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Import libraries for UASM

Started by Vortex, May 17, 2021, 05:51:32 PM

Previous topic - Next topic

Vortex

Hello,

I think adding an option to the UASM package to create import libraries should be possible. What about creating 32-bit import libraries from module definition files? The .def file can be extracted from Pelles libraries or MS VC.  64-bit libraries can be created from DLLs since they are not decorated.

TouEnMasm

Fa is a musical note to play with CL

Vortex

Easy. The Masm32 and Asmc packages are providing their own import library sets. UASM could provide the same system.

A quick example, here is how to extract the def files from import libraries and regenerating them :

The DOS batch file creating the .def files :

For %%a IN (\PellesC\lib\Win\*.lib) Do @( \PellesC\bin\Polib.exe /MACHINE:x86 /MAKEDEF:%%~na.def %%~fa  )

The batch file creating the import libraries :

For %%a IN (*.def) Do @( \PellesC\bin\Polib.exe /MACHINE:x86 /DEF:%%a /OUT:%%~na.lib )

Adding the .def files and the necessary batch files to the UASM package would do the job.

fearless

I forgot that I created this, which might be useful: https://github.com/mrfearless/Dll2Def. Could include that with any distribution and run a batch file with commands to create the .def files then convert the .def to .lib

Dll2Def supports * wildcard. I think i coded it to support x64 dll's as well.

Vortex

Hi John and Branislav,

Any plans to add an option to the Uasm package to build import libraries?

johnsa

It's not something I'd considered, I'd normally just do this on demand as I required it per dll/def file as there isn't anything in UASM itself to do this. I'm happy to include an additional tool in the package to do this if someone has one, possibly this Dll2Def?


fearless

Feel free to include Dll2Def in any package if you want.


Vortex

Hi John,

For 32-bit programming, you need decorated import libraries. I can extract the module definitions files from the Masm32 import libraries and supply my def2lib tool, plus a batch file to create the libraries. Is it OK for you?


Vortex

#10
Hi John,

Here is the zip file containing the .def files and the tools def2lib & lib2def :

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

Jotti's report :

https://virusscan.jotti.org/en-US/filescanjob/3kb48biu4m

You can run MakeLib.bat to create the import libraries :

def2lib *.def

def2lib ntvdm.def -e

The .def files are extracted from the Masm32 import libraries, many thanks to Hutch :

MakeDef.bat :

lib2def G:\masm32\lib\*.lib
del bhsupp.def
del dpserial.def
del dpwsock.def
del dststlog.def
del kernl32p.def
del masm32.def

Some import libraries with no exports are eliminated