Board index » cppbuilder » Listing the function names exported from a DLL

Listing the function names exported from a DLL

(1) How to list (programatically) the function names exported from a DLL ?
    (Similar to using quick-view to see the function list in DLL)

(2) Is there a way to find out return value type and parameter types of the
exported functions in DLL?

Pang Fu
pan...@hotmail.com

 

Re:Listing the function names exported from a DLL


"Pang Fu" <pan...@hotmail.com> schrieb im Newsbeitrag
news:3ef86866@newsgroups.borland.com...

Quote
> (1) How to list (programatically) the function names exported from a DLL ?
>     (Similar to using quick-view to see the function list in DLL)

GX_PeInfo.pas that is part of GExperts or JclPeImage.pas that is part of the
Jedi Code Library
have procedures/objects that permit to extract the function-names. Both are
available for free
with full source.

Quote
> (2) Is there a way to find out return value type and parameter types of
the
> exported functions in DLL?

Unfortunately this is guess-work. There is no information about that
directly stored in the DLL.
You can try to figure out from the assembler-code but there is no general,
always valid method.

I have written an article about something similar, if you are interested:
http://home.arcor.de/mael/en/awe64all.htm

Greetings, Ma?l

Re:Listing the function names exported from a DLL


Quote
Pang Fu wrote:
> (1) How to list (programatically) the function names exported from a DLL ?
>     (Similar to using quick-view to see the function list in DLL)

Use the outpu of tdump -ee yourlib.dll

Quote
> (2) Is there a way to find out return value type and parameter types of the
> exported functions in DLL?

Only if you've got the header file of the library.

Yours,
--
Robert Bienert <robertbien...@gmx.net>
Check also my free software at http://www.rbprogs.de.vu/

Re:Listing the function names exported from a DLL


Quote
"Pang Fu" <pan...@hotmail.com> wrote in message

news:3ef86866@newsgroups.borland.com...

Quote
> (1) How to list (programatically) the function names exported from a DLL ?
>     (Similar to using quick-view to see the function list in DLL)

If you want to do it manually, then you would need to walk the DLL's PE
(Portable Executable) header itself.  The PE header is a series of
structures at the very beginning of the file which point out where the
various sections of the DLL are located within the file, such as the
exported functions list, the resources list, the code segments, etc.  Have a
look at the following article for more information:

    An In-Depth Look into the Win32 Portable Executable File Format
    http://msdn.microsoft.com/msdnmag/issues/02/02/PE/default.aspx

Quote
> (2) Is there a way to find out return value type and parameter types of
the
> exported functions in DLL?

No.

Gambit

Re:Listing the function names exported from a DLL


Quote
"Pang Fu" <pan...@hotmail.com> wrote in message

news:3ef86866@newsgroups.borland.com...

Quote
> (2) Is there a way to find out return value type and parameter types of
> the exported functions in DLL?

Only if the functions are name mangled, you know what language and version
of the compiler the DLL was created in, and you know how to decode the
mangled name.  Alos, in the case of C++ the return value is not included in
the name mangling.

In general, the answer to this question is "no" unless you are writing a
very specific tailored application and want to spend some time creating the
decoding algorithm.

- Clayton

Re:Listing the function names exported from a DLL


"robertbienert<AT>gmx.net gmx.net >" <"robertbienert<AT> wrote in message
news:3ef8958c@newsgroups.borland.com...

Quote
> Pang Fu wrote:
> > (1) How to list (programatically) the function names exported from a DLL
?
> >     (Similar to using quick-view to see the function list in DLL)

> Use the outpu of tdump -ee yourlib.dll

   Is there a way (a set of WinAPI etc.) to function as tdump -ee *.dll ?

Re:Listing the function names exported from a DLL


Quote
Pang Fu wrote:

>>Use the outpu of tdump -ee yourlib.dll

>    Is there a way (a set of WinAPI etc.) to function as tdump -ee *.dll ?

Well, Borland made it with tdump, M$ made it with quickview. There has
to be a way, but I don't know it actually. Maybe someone from Borland
can help you.

Yours,
--
Robert Bienert <robertbien...@gmx.net>
Check also my free software at http://www.rbprogs.de.vu/

Re:Listing the function names exported from a DLL


Quote
"Pang Fu" <pan...@hotmail.com> wrote in message

news:3efb1b3c@newsgroups.borland.com...

Quote
>    Is there a way (a set of WinAPI etc.) to function as tdump -ee *.dll ?

Please see my earlier reply, I already posted a link to an article for that.

Gambit

Re:Listing the function names exported from a DLL


there is a example for you wanted!

http://www.csdn.net/cnshare/soft/openfile.asp?kind=1&id=16635

this example can get all component of package, property/event name of
component, and can dynamic create instance of compomnent of a form.

Other Threads