tags:

views:

476

answers:

5

How to view source code of dll files?

+9  A: 

The process of going from dll to Source Code is known as decompilation. It is a technology specific to the source language. Can you give us more information on the source language so we can point you to a given technology?

EDIT Update

If C# is the language of choice then the best way to see the source is using Reflector.exe. Note this will not give you back the 100% original source. It is instead an estimation of what the original source was. It can and will produce in accurate output in certain circumstances.

JaredPar
i use c# dll in VS2008
S.Mehdi
@S.Mehdi, updated my answer
JaredPar
@JaredPar thanks, I give vote for you.
S.Mehdi
where is Reflector.exe?
S.Mehdi
@S.Mehdi - Red Gate's .NET Reflector http://www.red-gate.com/products/reflector/
Carlos Gutiérrez
A: 

The same way with any other compiled binary.

You either look at the original source, or you use a decompiler.

Joe
+1  A: 

Maybe use .NET Reflector or Introspector but as @JaredPar said depends on what technology

David
+16  A: 

You can make hamburgers with a cow, but you can't make a cow with hamburgers.

Carlos Gutiérrez
+1 this is a hilarious quote for disassembly requests :)
Pekka
Might be funny but not very useful.
DMKing
@DMKing - FWIW the question wasn't tagged C# when posted, and I sent S.Mehdi the link to .NET Reflector in the comments of the next answer.
Carlos Gutiérrez
Awesome, just awesome.
Ed Swangren
@DMKing: It is funny. It may not be useful, but it's accurate in many cases. Nor can the Universe make everybody happy here: there's people who want to see the source code, and people who want to hide it.
David Thornley
+1  A: 

Since you've said you're using C#.Net then you can use .NET Reflector to decompile the DLL into, for example, C# code. As others have said, you will get a fair representation of the original code, but probably not the exact original C# code.

There is an exception to this - some companies apply an obfuscator like Salamander .NET Obfuscator to their assemblies before shipping them. The result of this process is that the decompiled code is difficult to comprehend than if the obfuscator had not been used. Some companies go as far as encrypting assemblies. Obfuscation and encryption protect intellectual property from casual attack but can not prevent a significant, well-crafted reverse-engineering effort. Given that reality, not all companies even go to the effort of obfuscation, much less encryption.

You don't say where the the dlls came from, but if you bought them, Reflector will not help you much if the vendor doesn't want you looking inside. And finally, keep in mind that if you purchased the software, decompiling it (whether or not the dlls are obfuscated) may be in violation of the software license agreement.

JeffH