Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 797
JMK Avatar asked Dec 11 '12 14:12

JMK


2 Answers

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. :)

like image 149
Yakk - Adam Nevraumont Avatar answered Nov 18 '22 10:11

Yakk - Adam Nevraumont


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.

like image 34
Luchian Grigore Avatar answered Nov 18 '22 09:11

Luchian Grigore