Author Topic: Import libraries for UASM  (Read 518 times)

Vortex

  • Member
  • *****
  • Posts: 2583
Import libraries for UASM
« on: May 17, 2021, 05:51:32 PM »
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

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Re: Import libraries for UASM
« Reply #1 on: May 17, 2021, 11:03:10 PM »

For what need ?
Fa is a musical note to play with CL

Vortex

  • Member
  • *****
  • Posts: 2583
Re: Import libraries for UASM
« Reply #2 on: May 17, 2021, 11:15:50 PM »
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 :

Code: [Select]
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 :

Code: [Select]
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

  • Member
  • ****
  • Posts: 515
    • Github
Re: Import libraries for UASM
« Reply #3 on: May 20, 2021, 08:57:18 PM »
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.
fearless

Lian Li PC-O11DW Case, ASUS ROG Crosshair VIII Hero WiFi, AMD Ryzen 9 5950X, 32GB DDR4-3600MHz, MSI RX 5700XT Gaming X, NZXT Kraken Z73 360mm Cooler, Seasonic PRIME 1000W PSU

My Github  Twitter