[ACCEPTED]-Get signatures of exported functions in a DLL-apimonitor

Accepted answer
Score: 23

DLLs do not store the signatures of the 25 functions they export. Other answers have 24 mentioned C++, and when a C++ function is 23 exported as C++, then the name will indeed be 22 mangled. Demangle it with the right compiler's 21 mangling scheme, and you'll have the signature. But 20 most DLLs do not export C++ functions using 19 their C++ names. Instead, the functions 18 a DLL chooses to export are exported using 17 C-style names, so even if the DLL was written 16 in C++, the exported functions still won't 15 have any signature information.

You don't 14 have the header? Most vendors include that 13 sort of thing in their SDKs. If you didn't 12 get one, then complain to the vendor. If 11 you weren't supposed to get one, then maybe 10 you're going about your task the wrong way; are 9 you sure you're supposed to use that DLL 8 directly?

If you do not have the header file, then 7 you might also ask yourself whether you're 6 really allowed, legally, to use the DLL 5 in your program anyway. If it's just an 4 arbitrary DLL you found on your system, then 3 even if you can write code for it, you're 2 probably not allowed to redistribute it 1 when you ship your program.

Score: 5

For C functions, this information is not 5 stored in the DLL at all. The only thing 4 I can suggest is to disassemble the function 3 and look at how it interacts with variables 2 on the stack and then try to determine the 1 signature.

Good luck!

Score: 4

In C++, the function signatures are "mangled" into 9 the name in a compiler-dependent way. This 8 doesn't happen in C. So, if you have C functions 7 in your DLL, you'll see unmangled names. If 6 it's a C++ one, you'll see mangled ones.

C++ needs 5 mangled names to allow the linker to resolve 4 overloaded functions with different signatures.

I 3 don't think there's any way for you to get 2 the function singatures from a "C" DLL. They 1 simply aren't present.

More Related questions