views:

382

answers:

10

Hi,

I am curious about how to view the source code present in a DLL, irrespective of the language used. Is there any software available for this?

Thanks

+1  A: 

You're interested in decompiling assemblies. Well here's a start on decompiling .NET assemblies: http://aspnet.4guysfromrolla.com/articles/080404-1.aspx

A popular tool in the .NET community for decompiling assemblies is .NET Reflector

Cloud
For various definitions of "view source code". Cheers.
pst
ya.. .net DLL code i can see,but i have win32 language DLL. is de-compilation possible for this.
Shadow
+1  A: 

They are different formats.

For a .NET dll, you can use ildasm.exe (installed with .net framework) or .NET Reflector (download)

Arjan Einbu
Thanks,But how about win32 DLL's?
Shadow
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
+6  A: 

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.

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.

Serge - appTranslator
A: 

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.

SLaks
+1  A: 

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/

Suraj Chandran
A: 

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.

sbi
+1  A: 
Marc Gravell
A: 

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)

DmitryK
A: 

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.

elder_george
A: 

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.

fvu