I currently have a .dll, one of whose functions I need. While I could LoadLibrary the thing, I somehow prefer having it linked directly (since I have to show my code..... hehehe I'm using ASM where most of my batchmates are using VB or C....). However I believe MASM cannot link directly to a dll, it needs a .lib file to link to the .dll. I guess I could rewrite the dll so that I can make the lib (all I really need is to access an I/O port in WinME or lower.... so I just need to write mov edx,dword ptr mov eax,dword ptr out dx,al in a dll routine.... or do I need to do something else in addition to that?).

I think I once read somewhere right on these boards about someone complaining about masm being unable to link .dll without their associated .lib, then someone showed how to get a .lib from an existing .dll..... but I can't remember it! >.<

And yeah it's been a long time since I've actually posted here, or even (gasp!) programmed wafuuuuuuuuuuuuu!!!
Posted on 2004-01-24 09:17:17 by AmkG
AmkG,

i dont know if i got the question right, but seens to me you can use IMPLIB.EXE tool.

ancev
Posted on 2004-01-24 09:43:57 by ancev
Yeah, I *think* that's what I was looking for.............

I forgot that the .lib of a .dll is called an IMPORT LIBRARY AAARG........... thx.

Obviously I haven't been programming in a LOONG WHILE. Thanks again.
Posted on 2004-01-24 09:48:32 by AmkG
Hi AmkG,

If you want an import library with decorated names,here is the solution:
-Create an include file full with the function prototypes coming from your DLL.


myfunc1 PROTO :DWORD,:DWORD,:DWORD
func2 PROTO :DWORD,:DWORD
etc...


-After,run Hutch's include to library tool (inc2l) to get an import library for your DLL
inc2l comes with the Masm32 package.

Second,if you would like to use import libraries with non-decorated names, you can try my dll2lib
Posted on 2004-01-24 14:12:12 by Vortex
Thanks vortex! Anyway it seems I have a really OLD copy of MASM32...... I don't have inc2l in the bin directory (I think the MASM32 I have is v7 or v6...)
Posted on 2004-01-24 19:18:13 by AmkG
l2inc says the library has no imports........ just how is dll2lib used?
Posted on 2004-01-24 19:54:09 by AmkG
AmkG,

There is a MASM32 tool where you write the include file yourself and run it and it will produce a library from that include file. It works fine when you have a DLL from another language or don't have the normal library built with a DLL using MASM.

Regards,
http://www.asmcommunity.net/board/cryptmail.php?tauntspiders=in.your.face@nomail.for.you&id=2f46ed9f24413347f14439b64bdc03fd
Posted on 2004-01-25 06:21:36 by hutch--
Yep! My old MASM32 package doesn't have it, but I found it pretty quick. It APPEARS to work, but since I'm doing hardware interfacing without the hardware (hehehe) I can't check if I'm doing it right. But I AM pretty sure it works.

Many thanks!
Posted on 2004-01-25 06:57:56 by AmkG

I guess I could rewrite the dll so that I can make the lib (all I really need is to access an I/O port in WinME or lower.... so I just need to write mov edx,dword ptr mov eax,dword ptr out dx,al in a dll routine.... or do I need to do something else in addition to that?).


Corect me if I'm wrong but I don't think it is possible to access I/O ports from win9x.
Posted on 2004-01-25 07:05:45 by ENF
From a DLL it is ;) I think :rolleyes:
Posted on 2004-01-25 07:07:28 by AmkG

l2inc says the library has no imports........ just how is dll2lib used?


You just specify the name of the DLL:


dll2lib kernel32.dll
Posted on 2004-01-25 09:00:00 by Vortex