JMK
JMK

Reputation: 28059

View the members of a C++ DLL

I have a C++ DLL which was written in 1998, and I want to view the members (properties, fields, methods, constructors etc). I am of the understanding that the company who wrote the DLL is no longer about, but it is still used.

If I have only the DLL, is this possible? Or do you have to just know what is inside the DLL to work with it. If it is possible how would I go about this?

I am looking to work with the DLL from .Net via P/Invoke.

Upvotes: 5

Views: 5771

Answers (4)

John Deer
John Deer

Reputation: 2358

NirSoft offers 'DLL Export Viewer'

https://www.nirsoft.net/utils/dllexp.zip

Convinient UI application which can display dll members.

Upvotes: 0

user4860969
user4860969

Reputation:

you can use VS Command prompt a simple command is:

dumpbin /exports <nameofdll>

Upvotes: 0

Yakk - Adam Nevraumont
Yakk - Adam Nevraumont

Reputation: 275565

Get this: http://www.dependencywalker.com/ , use depends.exe to open the DLL, then activate "Undecorate C++ Functions" in the "View" menu. I mainly use it to find dependencies, but it also exposes entry points of DLLs.

This is not fool proof, because a DLL that exposes a class doesn't have to export its methods. For example, pure virtual method layout is sufficiently uniform that you can expose your instances as interface pointers with maybe a factory function. But it might solve your problem.

And regardless, you need a copy of dependency walker. :)

Upvotes: 6

Luchian Grigore
Luchian Grigore

Reputation: 258618

You can use a tool like IDA to dissasemble the binary and try to make out function names, but this can be hard. Why do you only have the DLL? It would be much easier to get the info from the export table of the associated lib or, even better, header files.

Upvotes: 3

Related Questions