Finding arguments that go with methods in C++ dll's
Asked Answered
P

1

15

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.

Pernod answered 12/7, 2010 at 14:11 Comment(1)
similar question: Call function in c++ dll without headerImpedance
O
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.

Ocker answered 12/7, 2010 at 14:16 Comment(3)
Ahh sweet. Thanks. But ... how do I decipher the names? For example these method names: ?GetCpuSpeed@@YAHXZ ?GetCpuSpeed@CDLL1@@QAEHXZ Any ideas?Pernod
At least Dependency Walker is able to demangle the names via some menu entry. For detailed information, see the "External links" section of en.wikipedia.org/wiki/Name_manglingOcker
More links: msdn.microsoft.com/en-us/library/5x49w699.aspx msdn.microsoft.com/en-us/library/b06ww5dd.aspxOcker

© 2022 - 2024 — McMap. All rights reserved.