Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to test an unknown function DLL file

Status
Not open for further replies.

sedawk

Programmer
Feb 5, 2002
247
0
0
US
Hi All,

I was given a *.dll file saying that it provides some networking functions without any detail explanation. It is more like a black box to me. So my question is:

How can I test what function the *.dll file has?
 
MSVC++ provides a tool called dumpbin. in a dos window, go to the folder where the dll is and run the following command

dumpbin /exports dllfilename.dll

this will list all the functions in the dll that are available to you.

txjump
 
Visual C++ ships with a windows application called Depends.
Try this it has a very nice output.

HTH,
ahoodin
 
I tried the dumpbin /exports method. Sometimes it gave me a blank window(I think it depends on the *.dll file), sometimes it simply says:

error: cannot execute link.exe

Even I copied the link.exe to that folder, I had the same error but one more popup message box:

Error: cannot find necessary .dll file -- mspdb60.dll

How to use dumpbin.exe?

As for the Depends method, where can I get this application?

 
What I tried is with msdetstf.dll located in /msdev/vc98/lib folder and other files. But similar results obtained.
 
The "Depends" application is a Microsoft Visual Studio tool. Here's where it's likely located on the Windows Start Menu:

Programs/Microsoft Visual Studio 6.0/Tools/Depends

If it's installed, you can also use it from the command line.
 
maybe your path environment variable does not include the folder that holds all of mvc++ files. i had to modify my path variable so those folders were seen.

the way i use dumpbin is to change directory till i get to the parent folder of my dll file. then i just type

dumpbin /exports mydll.dll


if your path isnt set right you can go to the folder where dumpbin.exe exists and type the full path to your dll (maybe)

dumpbin /exports c:\myfullpath\tosomeplace\mydll.dll

if you type just dumpbin on the command line you will see the available options. heres microsofts link to info on dumpbin

 
Thanks, folks. It was about the dumpbin.exe path and mspdb60.dll directory must be in the same directory. I made it work. I am hesitate to say this tool told me all the info. But the thing is my computer doesn't have Depends according to programsecrets.

Anyway, thank your guy's input and I appreciate it very much.
 
the dll may very well have lots of other functions in it but, if they were not compiled w/ extern or were not listed in a .def file, those functions are private to the dll.

according to what ive read and my experince, the /exports option does give you everything that is "public" for the dll.

i used it when i was creating a dll so i could make sure that i compiled correctly and that others would be able to use the dll fully. i left some functions private and they didnt show up. unless i had a typo, all my extern functions and functions listed in the .def file were listed when i used the /exports option.

good luck :)
txjump
 
Hi,

Eventually I found out what the *.dll file is about though roughly. Now I would like to test it. How to use the entry points in the *.dll file. For example, the *.dll has entry points:

DllEntry1
DllEntry2 etc.

Do I need to include the *.dll file in my client application or there are other ways to call this *.dll file like in project setting? Since this is the only file I have. Sorry I am asking this very basic question.
 
To find out, which functions a dllor anexe has, You can use an application PCHacker. You can try to starts functions from dll with this program too!
Download it from:

Expand the program and go to Menu Info about->Library..., select a File and You've got it.
 
Hi,

Sorry for my persistence. I have solve what the file roughly about. Now the problem turns to how to use it:

Do I need to change some setting in "Project Setting"?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top