I have made a DLL with fasm, and want to compile it with a masm project, but for that I need a .LIB file (or is there some other way of doing this?).
And I wodner if anyone knows some util for making a .lib from a .dll, I've tried to download makelib with little success (when I finaly thought I downloaded a copy it didn't ran).
Posted on 2003-04-30 13:56:36 by scientica
TASM has 2 command line tools for this impdef.exe and implib.exe ...
Dont know about MASM but i recall there was a way also
Posted on 2003-04-30 16:01:58 by BogdanOntanu
usually you have the linker create an "import library" for you. I think iczelion has a little essay somewhere on his site on how to create import libraries for masm when you only have the binary DLL.
Posted on 2003-04-30 16:14:32 by f0dder
I found that page/tutorial/essay on Iczelions site (after reading your post and looking on his page), here's the link:
http://spiff.tripnet.se/~iczelion/importlib.html - "Hints on how to create MASM import lib"
Posted on 2003-04-30 17:03:14 by scientica
Yes, but f0dder was also correct that the linker will produce both LIB and a DLL with the correct switches. (Dont remember off hand, but its not anything obscure).

:NaN:
Posted on 2003-04-30 18:18:38 by NaN
Afternoon, scientica.

Attached is the code + bat file I use to create the Tsunami import lib file. The created dll is deleted since this lib is only used so that I can use invoke within masm32.

The lines to assemble and link the dll are:
\masm32\bin\ml /c /coff /Cp TRM.ASM


\masm32\bin\Link /SECTION:.bss,S /DLL /DEF:TRM.def /SUBSYSTEM:WINDOWS

This will create a .lib and a .dll file.

Cheers,
Scronty
Posted on 2003-04-30 18:54:32 by Scronty
http://alink.home.dhs.org/

you could go there to the downloads section and get the alib executable. It creates .lib files(although idont know if its for masm though):confused: . I use it for Nasm.
Posted on 2003-04-30 19:26:02 by Guy on ASM
There is a tool in MASM32 that will do it for you, just write the prototypes for the functions in the library in MASM format and build an import library that way.

I just found it on my internet box so its attached. Run it from the command line and it displays how to use it.

Regards,

hutch@movsd.com
Posted on 2003-04-30 23:28:17 by hutch--
I got one more question, what are ordinals? In fasm when building a .edata section I found this in the PEDLL example:
section '.edata' export data readable


dd 0,0,0,RVA dlldemo_name,1
dd 1,1,RVA addresses_table,RVA names_table,RVA ordinal_table

addresses_table:
dd RVA WriteText

names_table:
dd RVA _WriteText
[b] ordinal_table:
dw 0[/b]

dlldemo_name db 'PEDLL.DLL',0

_WriteText db 'WriteText',0
Posted on 2003-05-01 08:57:43 by scientica
An ordinal is when you import by number instead of name. Should generally be avoided since it can cause quite some trouble...
Posted on 2003-05-01 09:30:39 by f0dder