13

Ok, so I can use dumpbin.exe /exports library.dll to find all methods in the dll.

...but how do I find out which arguments to pass into them? Without a header file of course.

Amro
  • 123,847
  • 25
  • 243
  • 454
Presidenten
  • 6,327
  • 11
  • 45
  • 55
  • similar question: [Call function in c++ dll without header](http://stackoverflow.com/questions/554551/call-function-in-c-dll-without-header) – Amro Aug 13 '13 at 16:32

1 Answers1

11

For the usual C-style exports (e.g., Windows API DLLs): You can't. This information is not stored in the DLL and is inevitably lost after compilation (unless you have the headers or debuging symbols).

C++ exports, on the other hand, store their signature as part of the mangled function name and you can view them using Dependency Walker or similar tools, or demangle them manually using the UNDNAME tool or DUMPBIN's /SYMBOLS option.

Philipp
  • 48,066
  • 12
  • 84
  • 109
  • Ahh sweet. Thanks. But ... how do I decipher the names? For example these method names: ?GetCpuSpeed@@YAHXZ ?GetCpuSpeed@CDLL1@@QAEHXZ Any ideas? – Presidenten Jul 12 '10 at 14:42
  • At least Dependency Walker is able to demangle the names via some menu entry. For detailed information, see the "External links" section of http://en.wikipedia.org/wiki/Name_mangling – Philipp Jul 12 '10 at 14:48
  • More links: http://msdn.microsoft.com/en-us/library/5x49w699.aspx http://msdn.microsoft.com/en-us/library/b06ww5dd.aspx – Philipp Jul 12 '10 at 14:51