Get Function list from Dll?

Login to reply to this topic.
Fri, 2006-05-05 06:47
Joined: 2005-08-11
Forum posts: 278
Hi All,

Is it possible to get all the functions implemented in a dll? I want to get the list of functions implemented in a dll in an array.
If it is possible please help me out.

Thanks,
Max_i

Fri, 2006-05-05 07:31
Joined: 2006-04-05
Forum posts: 104
Re: Get Function list from Dll?
Hi Max_i

Give this article a look

http://www.newlc.com/How-to-dump-DLL-exports-using-LIB.html

this should give you the exported methods.  I don´t know if there is a way to get hold of the non-exported methods.

Also i´m not sure if this is what you need as you mention that you want the info in an array but maybe it´ll help you out.   Smiley

Best regards

PL
Fri, 2006-05-05 14:05
Joined: 2005-08-11
Forum posts: 278
Re: Get Function list from Dll?
Thanks petxolobo for your reply. Grin
But this only give a pointer to the function at that specific ordinal.
I want to get the function name/names.
Is there any other way.

thanks,
max_i
Fri, 2006-05-05 15:24
Forum Nokia Champion
Joined: 2003-10-01
Forum posts: 723
Re: Get Function list from Dll?
Well, it's there. You can easily check it if you look at a lib file under \epoc32\release\<platform\<build> directory (e.g. avkon.lib). You can see that the exported methods and classnames are there, you "just" need to get them somehow. It's even possible to get the type of the arguments one method accepts, however, don't expect to see the argument names, too.

Although I've never heard such a tool that does this kind of task, but I wouldn't be surprised if someone said he had already found one.  Undecided

tOtE

Gabor Torok
Software architect, Agil Eight (http://www.agileight.com/)
Blog: http://mobile-thoughts.blogspot.com/

Fri, 2006-05-05 20:58
Joined: 2005-03-30
Forum posts: 206
Re: Get Function list from Dll?
if dll is build for arm then u won't be able to get names of exported functions .. this  is because functions are exported in symbian by ordinal and not by name.


guda

Fri, 2006-05-05 22:33
Forum Nokia Champion
Joined: 2003-10-01
Forum posts: 723
Re: Get Function list from Dll?
Khm, I've just checked a few lib files built for arm and thumb and they both contained function names.  Shocked

In any case, I guess it would be enough for our fellow to get the method names even from a wins build and then use that information in his/her code in any build.

Tote

Gabor Torok
Software architect, Agil Eight (http://www.agileight.com/)
Blog: http://mobile-thoughts.blogspot.com/

Sat, 2006-05-06 16:26
Joined: 2004-11-29
Forum posts: 1246
Re: Get Function list from Dll?
ofcourse the lib-file contains the function names.

How else would the compiler know where to find them? magic? Smiley

When building a dll, you get a lib/dll pair, where the dll in release mode, does not contain any function names, but only a table of pointers.
The lib-file then contains the link between name and ordinal that the compiler uses when linking your binary.

The only problem is that they are "mangled" the c++-way. (its how c++ implements namespaces and function overloads).

There is "demanglers" out there, I know I have seen links to one before on this forum, try search a bit.
Sat, 2006-05-06 16:57
Joined: 2005-03-30
Forum posts: 206
Re: Get Function list from Dll?
the lib from sdk contains names of exported functions ... but unfortunately this libs are not complet ... if u take let's say euser.dll from phone and do a dump bin on it u will see many exports.. much more than euser.lib from sdk provides.

guda

Tue, 2006-05-09 07:56
Joined: 2005-08-11
Forum posts: 278
Re: Get Function list from Dll?
Hi All,
Thanks for your replies.
But still i not able to get the exported function names from a dll. Huh
Using RLibrary::Fullname() i am getting the dll name....
But still i don't know wat to use for getting the function name.
I am using series 60 fp2 2nd edition. Building for wins.
thanks,
max_i
Tue, 2006-05-09 08:02
Joined: 2005-06-09
Forum posts: 174
Re: Get Function list from Dll?
max_i: There's no way to do this at runtime, as the info just isn't available in the DLL:s. 

Tue, 2006-05-09 08:09
Joined: 2005-08-11
Forum posts: 278
Re: Get Function list from Dll?
Thanks puterman for your reply.
And wat about the lib file.
It contains the function name and the ordinals rite!
Can i access it. If yes, how?
Thanks,
max_i
Tue, 2006-05-09 08:57
Forum Nokia Champion
Joined: 2003-10-01
Forum posts: 723
Re: Get Function list from Dll?
It seems we were not clear enough. You have to find a tool that does this job for you. Symbian and its toolset included in any SDKs do not make it possible. You have to look for such a tool on the internet.

Tote

Gabor Torok
Software architect, Agil Eight (http://www.agileight.com/)
Blog: http://mobile-thoughts.blogspot.com/

Tue, 2006-05-09 09:11
Joined: 2005-08-11
Forum posts: 278
Re: Get Function list from Dll?
Thanks tote for your reply..
Yeah i got what you said earlier.
Actually i want to do it without a tool. using an API(if it's there). But i guess it's not support.
But the tool will also use some API or something to access and get the exported function rite?
Anyway thanks for the information,
max_i
Tue, 2006-05-09 10:17
Forum Nokia Champion
Joined: 2003-10-01
Forum posts: 723
Re: Get Function list from Dll?
THAT tool is not necessarily written in Symbian C++, but in any other programming language on any other operating system.  I bet that such will be (or already has been) written in another programming language/OS than Symbian (C++).

Tote

Gabor Torok
Software architect, Agil Eight (http://www.agileight.com/)
Blog: http://mobile-thoughts.blogspot.com/

Wed, 2006-05-10 08:29
Joined: 2005-06-09
Forum posts: 174
Re: Get Function list from Dll?
You can use objdump to list symbols in the lib files and c++filt to demangle the names.  These tools are part of binutils and hence come with the SDK.

Wed, 2006-05-10 12:13
Joined: 2005-07-18
Forum posts: 33
Re: Get Function list from Dll?
Is it something like this you´re looking for?

Microsoft (R) COFF Binary File Dumper Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.


Dump of file euser.lib

File Type: LIBRARY

     Exports

       ordinal    name

          1663    ??0?$CArrayFixFlat@H@@QAE@H@Z (public: __thiscall CArrayFixFlat<int>::CArrayFixFlat<int>(int))
          1664    ??0?$CArrayFixFlat@VTUid@@@@QAE@H@Z (public: __thiscall CArrayFixFlat<class TUid>::CArrayFixFlat<class TUid>(int))
             2    ??0CActive@@IAE@H@Z (protected: __thiscall CActive::CActive(int))
             3    ??0CActiveScheduler@@QAE@XZ (public: __thiscall CActiveScheduler::CActiveScheduler(void))
             4    ??0CArrayFixBase@@IAE@P6APAVCBufBase@@H@ZHH@Z (protected: __thiscall CArrayFixBase::CArrayFixBase(class CBufBase * (__cdecl*)(int),int,int))
             5    ??0CArrayPakBase@@IAE@P6APAVCBufBase@@H@ZH@Z (protected: __thiscall CArrayPakBase::CArrayPakBase(class CBufBase * (__cdecl*)(int),int))
             6    ??0CArrayVarBase@@IAE@P6APAVCBufBase@@H@ZH@Z (protected: __thiscall CArrayVarBase::CArrayVarBase(class CBufBase * (__cdecl*)(int),int))
             7    ??0CAsyncCallBack@@QAE@ABVTCallBack@@H@Z (public: __thiscall CAsyncCallBack::CAsyncCallBack(class TCallBack const &,int))
             8    ??0CAsyncCallBack@@QAE@H@Z (public: __thiscall CAsyncCallBack::CAsyncCallBack(int))
             9    ??0CAsyncOneShot@@QAE@H@Z (public: __thiscall CAsyncOneShot::CAsyncOneShot(int))
            10    ??0CBase@@IAE@XZ (protected: __thiscall CBase::CBase(void))
            11    ??0CBitMapAllocator@@IAE@HH@Z (protected: __thiscall CBitMapAllocator::CBitMapAllocator(int,int))
            12    ??0CBufBase@@IAE@H@Z (protected: __thiscall CBufBase::CBufBase(int))


This hase been retreived using DumpBin supplied from Microsoft Visual Studio.
It is not freeware however and comes with Visual Studio, but a quick search at Google threw up a bunch of other alternatives. For example LibDump 1.0 which I havn´t tried so you have to try it on your own.

Good luck and please post back so that we can know if this was what you were looking for  Grin
  • Login to reply to this topic.