What software can be used to view the source code in a .dll file, irrespective of the programming language used for the source code?
10 Answers
If it's a managed DLL (.NET), you can open it using tools such as Reflector or ILDASM and you'll see the IL code. (Edit 2017-02-03: In 7+ years, .NET disassemblers have of course progressed a lot and are now able to produce very decent C# code)
If it's an unmanaged DLL (native), you're out of luck. The best you can do is load a disassembler. Which leads you nearly nowhere unless you know exactly where you want to go.

- 21,494
- 13
- 69
- 110
You're interested in decompiling assemblies. Well here's a start on decompiling .NET assemblies: https://web.archive.org/web/20210802164013/https://aspnet.4guysfromrolla.com/articles/080404-1.aspx
A popular tool in the .NET community for decompiling assemblies is .NET Reflector

- 9,072
- 2
- 43
- 53
-
For various definitions of "view source code". Cheers. – Oct 22 '09 at 11:23
-
ya.. .net DLL code i can see, but i have win32 language DLL. is de-compilation possible for this. – Naruto Oct 22 '09 at 11:44
They are different formats.
For a .NET dll, you can use ildasm.exe (installed with .net framework) or .NET Reflector (download)

- 13,543
- 2
- 56
- 59
-
-
They're not so easily decompiled into their original languages. I don't know of a good tool, other than a dissasembler (and then you'll see x86 assembly only...) – Arjan Einbu Oct 22 '09 at 12:10
It's not possible(1) to decompile object code to source code. Inspecting an interface is another matter altogether; there are tools that exist but I don't know of any offhand.
(1) - well, OK, it is possible for some languages and under certain conditions but the code produced won't exactly be readable...
The only readable code you'll get is assembly language (there are many programs for this). There are some languages that can be decompiled to original (or close to) source code, such as Visual Basic 3. But who writes programs in VB3 nowadays? Nobody. As far as seeing the imports/exports of the DLL, you can use the Dependency walker program from: http://www.dependencywalker.com/
For some languages, for example Visual Basic or C#, you can get readable source-code if you use a good decompiler and the code is not obfuscated (which it most of the time isn't)
Check this site if you're interested in decompiling: http://www.program-transformation.org/Transform/DecompilationPossible
For .Net, .NET Reflector is the way to go. It will decompile your dll into either C# or VB.NET http://www.aisto.com/roeder/dotnet/

- 24,433
- 12
- 63
- 94
For .NET, Reflector will do this; the "Pro" version (now in preview) has a plugin for Visual Studio that lets you debug into most managed code within the VS IDE itself, rather than being a separate tool. So far, it is looking very sweet.
Reflector EAP http://www.simple-talk.com/community/blogs/alex/attachment/74919.ashx

- 1,026,079
- 266
- 2,566
- 2,900
There was enough said about decompiling .NET. If you ever decide to start with reverse-engineering native binaries, I recommend to use IDA.
It supports different OSs, processor architectures, detects and shows standard libraries usage (so you can easily find places of interest), shows graphs of dependencies between subroutines, shows procedures arguments at stack etc. It also can be scripted and there're scripts that detect C++ classes and try-catch blocks, finds COM interfaces names for UUIDs and do many other things. It's a great tool and there's free version of it.

- 7,849
- 24
- 31
-
A few *caveats* about IDA: 1. The free version (available at the [download center](https://www.hex-rays.com/products/ida/support/download.shtml)) is many releases behind the commercial version and only supports 32 bit binaries; 2. the "starter" commercial version currently costs 589 USD and "does not support 64-bit files;" 3. the "professional" version (which supports 64-bit files) costs 1129 USD. – CODE-REaD Sep 17 '16 at 23:01
To decompile a .Net DLL, you can use .Net Reflector. It will work for DLLs written in any .Net language.
To decompile a Java JAR file, try Java Decompiler.
Decompiling native code (C++) is much more difficult.

- 868,454
- 176
- 1,908
- 1,964
Unless you're in .NET land, what's in a DLL is binary code. The only language you can see this in is assembler - which is just a mnemonic way of presenting machine language.

- 219,715
- 46
- 258
- 445
Irrespective of a .Net language you use - everything will be compiled to MSIL (Microsoft intermediate language). You can use tools like Ildasm to convert it to readable "disassembled text":
http://msdn.microsoft.com/en-us/library/f7dy01k1.aspx
You can also use Reflector: http://www.builderau.com.au/program/asp/soa/Look-inside-NET-DLL-files-with-Reflector/0,339028371,339287377,00.htm
to examine classes and methods (it supports different .Net languages)

- 5,542
- 1
- 22
- 32
For native DLL's this program, Hex-Rays Decompiler (a layer on top of the excellent IDAPro disassembler-debugger) is probably as close as you can get. It doesn't restore the original code but converts the disassembly in a C-like pseudocode. It's not cheap though.

- 32,488
- 6
- 61
- 79