delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/03/06/02:58:49

From: vischne AT ibm DOT net
Subject: Re: Exporting fns from .EXE files
6 Mar 1998 02:58:49 -0800 :
Message-ID: <199802260554.FAA61092.cygnus.gnu-win32@out1.ibm.net>
Mime-Version: 1.0
To: jrogers AT world DOT std DOT com, gnu-win32 AT cygnus DOT com

At 07:37 PM 2/25/98 -0500, you wrote:
>Hello, vischne.  Below is the information I promised you.  Could you post
it to the gnuwin32 list for me, as I don't remember the address off the top
of my head, and I'm only subscribed at work.
>
>The steps to export functions from an .exe are as follows : 
>
>1.)  Write a .def file listing the name of the function(s) you want to
>export 
>
>2.)  Use this command line :
>
>"dlltool --def defname.def --dllname exename --output-exp exename.exp
>-v --nodelete",
>
>where : 'defname.def' is the name of your .DEF file, and 'exename' is
>the name of your executable program, minus the .EXE extension.  This
>will produce a temporary file named 'tappname.exp'.  
>
>3.)  Edit this temporary file, changing :
>	name:	.asciz	"APPNAME"
>to
>	name:	.asciz	"APPNAME.EXE"
>
>Remember to keep the quotes when editing the file!
>
>4.)  Assemble this temporary file, and link the resultant .o file into
>your executable with ld.
>
>Hope this helps!  Feel free to direct any questions to my work account
>(jrogers AT cascadenet DOT com) or my personal account
>(jrogers AT world DOT std DOT com).
>
Well, let's see:

dlltool --def ExportLib.def --dllname ExportLib --output-exp ExportLib.exp
-v --nodelete
// Followed by the appropriate editing of tExportLib.exp
as tExportLib.exp -o tExportLib.o
gcc -O -o ExportLib ExportLib.c tExportLib.o -luser32 -lkernel32

and the following occurs:
LIBCALL  EXE         3,584  02-26-98 12:46a libcall.exe
EXPORT~1 EXE         4,096  02-26-98 12:43a ExportLib.exe
         2 file(s)          7,680 bytes
         0 dir(s)     806,846,464 bytes free

E:\src\bcsock>libcall
libhandle = 0
Calling export1 with address 0x0
Calling export2 with address 0x0
Calling export3 with address 0x0

Guess I'll have to wait until cygnus.com recovers from whatever stops
incoming http connections to go after all the documentation I lost
with my last disk crash.

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019