A .net disassembler/decompiler [closed]
Asked Answered
H

6

26

I am looking for a disassembler or better, a decompiler for .net. The situation is that the source code for an assembly written by one of my predecessors is lost and I'd like to take a look to see what it's doing.

I know that ildasm comes with the Visual Studio installation so I can get at the MSIL, but I was hoping there was a program clever enough to work back to the C# code (or best approximation).

Are there any tools for this out there?

(If not, I suppose it'll be a good excuse for me to sit down and start to learn MSIL)

Humidistat answered 23/2, 2009 at 19:3 Comment(0)
T
40

Have you looked at Reflector?

http://www.red-gate.com/products/reflector/

Tso answered 23/2, 2009 at 19:5 Comment(3)
Although I would like to agree with annakata, clearly s/he, is wrong. Reflector = double awesome! :)Pedigo
Red gate didn't originally write Reflector. The only other tool I have used from them (SQL Intellisense for SQL Server 2005) was slow. :)Chomp
Not free anymoreCasern
C
55

Now that Red Gate have started charging for the .NET Reflector tool you might want to check out these free alternatives instead...

Telerik JustDecompile

JetBrains dotPeek

(Open Source) ILSpy

Circumvent answered 13/5, 2011 at 4:46 Comment(3)
Just tried the ILSpy beta, and it's as good as Reflector for me. Minus the licensing hassle.Combat
dotPeek is an eval copy -- looks almost as good as Reflector but seems to run a little more slowly. ILSpy does the trick for me, though its interface isn't quite as slick -- member sorting and treatment of generics both leave a little to be desired, but good enough, especially at the price!Goatherd
As of 2012 dotPeek is now fully free and no longer a eval trial.Krill
T
40

Have you looked at Reflector?

http://www.red-gate.com/products/reflector/

Tso answered 23/2, 2009 at 19:5 Comment(3)
Although I would like to agree with annakata, clearly s/he, is wrong. Reflector = double awesome! :)Pedigo
Red gate didn't originally write Reflector. The only other tool I have used from them (SQL Intellisense for SQL Server 2005) was slow. :)Chomp
Not free anymoreCasern
A
7

Reflector is the way to go, but if you can't use that for some reason, Microsoft ships a disassembler called ILDasm with the framework.

A good source for MSIL knowledge is the book Expert .NET 2.0 IL Assembler by Serge Lidin.

Aurel answered 23/2, 2009 at 19:18 Comment(0)
S
2

.NET Reflector is the usual tool for this.

Songful answered 23/2, 2009 at 19:4 Comment(0)
M
1

Reflector.

Mweru answered 23/2, 2009 at 19:5 Comment(0)
S
1

Ok,

I tried on a project. ILSpy

Telerik JustDecompile

.NET Reflector Demo

All can create Visual C# project. The generated code did not compile for JustDecompile and Reflector. In one case, ILSpy made a code that compiled (just references had to be set) The mistakes IlSpy did not look as compiicated as one found in others. All generated code can be fixed if one know C# well enough.

An interesting direction can be used to decompile code using both JustDecompile and Ilspy and merge the codes that are correct because these decompilers (and third as well) seem to make different mistakes.

Spearwort answered 5/7, 2012 at 18:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.