197

I have a DLL file. How can I view the functions in that DLL?

Mark Amery
  • 143,130
  • 81
  • 406
  • 459
sumit
  • 1,971
  • 2
  • 12
  • 3
  • 2
    this link servers well [view-contents-of-a-dll][1] [1]: http://stackoverflow.com/questions/6210305/view-contents-of-a-dll – PSR Mar 26 '13 at 05:03

10 Answers10

95

For native code it's probably best to use Dependency Walker. It also possible to use dumpbin command line utility that comes with Visual Studio.

detunized
  • 15,059
  • 3
  • 48
  • 64
  • 2
    With newer editions of VS, try DumpBin as an [External Tool](https://stackoverflow.com/questions/45477382/how-to-read-a-obj-file/49669631#49669631). – Laurie Stearn Apr 05 '18 at 10:08
  • 3
    There is a Wikipedia article about Dependency Walker. Apparently the program has become outdated and does not work with some newer features of Windows, but there is a replacement available: https://github.com/lucasg/Dependencies – user1324109 Apr 17 '20 at 20:03
  • This replacement doesn't work on my side. I wouldn't rely on it for ages as I did on late dependency walker. Sad news. – Olórin Feb 23 '21 at 15:49
  • dependencywalker easy to use https://www.dependencywalker.com/ – Carlos Feb 11 '22 at 16:41
66

Use the free DLL Export Viewer, it is very easy to use.

mrswadge
  • 1,659
  • 1
  • 20
  • 43
Ken D
  • 5,880
  • 2
  • 36
  • 58
  • 8
    @sumit can you be more specific? this tools works for me along the years. – Ken D Feb 18 '14 at 09:16
  • 7
    Actually the tool works nice, plain and simple, just what I needed. – informatik01 Oct 31 '14 at 10:22
  • 7
    It's a great tool to generate a list of methods/functions, but it does not show the parameters of the methods (nor their types). – bvdb Jun 15 '17 at 07:55
  • 1
    Very great to have something that is small and compact, and not some bloated product like the official MS products usually are. – alexpanter Apr 28 '20 at 20:43
51

You may try the Object Browser in Visual Studio.

Select Edit Custom Component Set. From there, you can choose from a variety of .NET, COM or project libraries or just import external DLLs via Browse.

bad_coder
  • 11,289
  • 20
  • 44
  • 72
cslewy
  • 627
  • 5
  • 3
  • 23
    Visual Studio says "The selected component cannot be browsed" when using Browse and selecting DLL :( - http://msdn.microsoft.com/query/dev12.query?appId=Dev12IDEF1&l=EN-US&k=k(VS.Message.ObjectBrowserErrors)&rd=true – Xdg Dec 19 '14 at 14:52
  • 8
    object browser has moved to `View`. And yes, it doesn't work (why would it, it's microsoft) – phil294 Apr 22 '16 at 20:58
  • 1
    More a vendor than a MS problem. Probablay there's no typelib in the dll. See: https://stackoverflow.com/a/13903040/1614903 – Holger Böhnke Nov 21 '17 at 12:10
  • @HolgerBöhnke no typelib in userdll32 either – Kimmax Apr 04 '18 at 17:31
  • 2
    @Kimmax Yep, but user32.dll is a native windows DLL and not a COM server. Only COM servers (e.g. COM dlls, ActiveX controls, *.ocx...) possibly have typelibs, if they were compiled in, in the first place. For native (=non COM object) DLLs some of the other tools mentioned here (dumpbin et. al.) may work. That is, if the DLL exports it's funtions by name and not by ordinal only. – Holger Böhnke Apr 04 '18 at 20:59
  • @HolgerBöhnke thanks for the heads up. Interesting stuff to read into :) – Kimmax Apr 05 '18 at 07:58
  • It told me that the selected component could not be browsed. – Vipin Verma Nov 21 '19 at 08:15
48

Use dumpbin command-line.

  • dumpbin /IMPORTS <path-to-file> should provide the function imported into that DLL.
  • dumpbin /EXPORTS <path-to-file> should provide the functions it exports.
kenorb
  • 155,785
  • 88
  • 678
  • 743
jmcarter9t
  • 731
  • 6
  • 11
14

For .NET DLLs you can use ildasm

altumano
  • 2,676
  • 2
  • 26
  • 20
  • As ildasm is a Microsoft product and is installed on PC by default if you have Visual Studio installed.I believe it is the best option.It also has a UI so you don't need to use the command line. Thanks – Nick Mehrdad Babaki Jul 13 '17 at 01:41
  • It can be found: **C:\Program Files (x86)\Microsoft SDKs\Windows\\bin** – f4d0 Apr 20 '19 at 09:41
12

Use dotPeek by JetBrains.

https://www.jetbrains.com/decompiler/

dotPeek is a free tool based on ReSharper. It can reliably decompile any .NET assembly into C# or IL code.

Shayan
  • 709
  • 1
  • 15
  • 31
7

Without telling us what language this DLL/assembly is from, we can only guess.

So how about .NET Reflector.

bad_coder
  • 11,289
  • 20
  • 44
  • 72
Adriaan Stander
  • 162,879
  • 31
  • 289
  • 284
2

If a DLL is written in one of the .NET languages and if you only want to view what functions, there is a reference to this DLL in the project.

Then doubleclick the DLL in the references folder and then you will see what functions it has in the OBJECT EXPLORER window.

If you would like to view the source code of that DLL file you can use a decompiler application such as .NET reflector.

bad_coder
  • 11,289
  • 20
  • 44
  • 72
gwt
  • 2,331
  • 4
  • 37
  • 59
2

For non .NET dlls, installing binutils on a Linux system presents the objdump command that can be used to display information of a dll.

objdump --private-headers <file.dll>

Look for the Export Address Table section in the output.

Robert Brisita
  • 5,461
  • 3
  • 36
  • 35
0

.NET ildasm

ildasm helped and even dumped methods body, but to edit .DLL you also need any hex editor.

ildasm example to fix Help Viewer v2.x issue:
error: "An error occurred while updating content: File '???.cab' was not signed by Microsoft"

here could be image
more example files

grizlyk
  • 1
  • 2
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 03 '21 at 23:43