3

We all know we could use dumpbin for .obj file to show all the symbols including external ones.

dumpbin /symbols ExternCTest.ob
00F 00000000 UNDEF  notype ()    External     | ?foo@@YAHH@Z (int __cdecl foo(int))

But I am wondering how could I do this for DLL ? I have also tried dumpbin /exports as well as dependency walker but it's NOT showing external symbols.

How should I do it ?

Thanks

RoundPi
  • 5,819
  • 7
  • 49
  • 75
  • 3
    /exports shows you what the DLL exports. /Imports shows you what external dependencies the DLL has, symbols that it needs to resolve by loading other DLLs. The equivalent of your snippet. If you get no output from /exports then you forgot to export functions with `__declspec(dllexport)` – Hans Passant Dec 10 '12 at 16:55
  • Thanks! is it doable from dependency walker for showing external symbol? I am trying to do analysis on a PC doesn't have Visual studio installed which probably mean dumpbin might not work ? – RoundPi Dec 10 '12 at 17:03
  • What problem are you trying to solve? – Hans Passant Dec 10 '12 at 17:06
  • Go to a separately standalone PC trying to check which component is out of date/sync as it's trying to access a external link that doesn't exist anymore. I can run Dependency walker there, probably not dumpbin? – RoundPi Dec 10 '12 at 17:12
  • Clearly you care about /imports here. Maybe you can diagnose it with depends.exe, it depends. It could be a dynamically loaded DLL or a COM component. You'll need to use its Profile option to see those. SysInternals' ProcMon utility shows everything. – Hans Passant Dec 10 '12 at 17:19
  • Looks like DW does the job but how does ProcMon do the trick ? I normally use it for file/reg monitoring... – RoundPi Dec 10 '12 at 17:40

1 Answers1

8

The command line argument you are looking for is /imports. This will show all external symbols referenced by the DLL.

Captain Obvlious
  • 19,754
  • 5
  • 44
  • 74
  • Thanks! is it doable from dependency walker for showing external symbol? I am trying to do analysis on a PC doesn't have Visual studio installed which probably mean dumpbin might not work ? – RoundPi Dec 10 '12 at 17:10
  • 1
    Yes, Dependency Walker will show both imports and exports for a PE file. It should also work just fine without VS installed (it's available as a separate app). – Captain Obvlious Dec 10 '12 at 17:18