Free options for Reflector (.NET decompiler)

After Reflector did change their licensing so it was no longer free to use I did stick around for a long time on an old version of Reflector. The time have now come to find an replacement for Reflector. After some searching I found 4 good candidates.

JustDecompile
http://www.telerik.com/products/decompiling.aspx
Feature
• Fast code navigation
• Create visual studio projects
• Extract resources from assemblies
• Easy assembly management
• Visual studio inline decompilation
• Command line support
• Integrate with Windows Explorer Context Menu
• Silverlight XAP decompilation from URL

dotPeek
http://www.jetbrains.com/decompiler/
Feature
• Decompiling .NET 1.0-4.5 assemblies to C#
• Support for .dll, .exe, .zip, .vsix, .nupkg, and .winmd files
• Quick jump to a type, assembly, symbol, or type member
• Effortless navigation to symbol declarations,
implementations, derived and base symbols, and more
• Accurate search for symbol usages
with advanced presentation of search results
• Overview of inheritance chains
• Support for downloading code from source servers
• Syntax highlighting
• Complete keyboard support

.NET CodeReflect
http://www.devextras.com/decompiler/
Features
• Assembly class browsing
• Decompile .NET code
• MSIL disassembly view
• Decompile C# code
• Decompile VB.NET code
• Extract embedded resources
• Hyperlink based navigation
• Assembly dependency list
• .NET framework 1.0, 1.1, 2.0, 3.5 & 4.0 support
• Decompile any .NET assembly that supports reflection
• Commercially maintained

ILSpy
http://ilspy.net/
Features
• Assembly browsing
• IL Disassembly
• Support C# 5.0 “async”
• Decompilation to C#
• Supports lambdas and ‘yield return’
• Shows XML documentation
• Decompilation to VB
• Saving of resources
• Save decompiled assembly as .csproj
• Search for types/methods/properties (substring)
• Hyperlink-based type/method/property navigation
• Base/Derived types navigation
• Navigation history
• BAML to XAML decompiler
• Save Assembly as C# Project
• Find usage of field/method
• Extensible via plugins (MEF)
• Assembly Lists

Decompilation output comparison
An example of decompiling the File class in mscorelib.dll
JustDecompile
JustDecompileOutPut
dotPeek
DotPeekOutPut
.NET CodeReflect
NETCodeReflectOutPut
ILSpy
ILSpyOutPut

From above screenshot’s we can quick find 2 major differences between the different products. The visualization in .Net CodeReflect of the decompress file doesn’t contain implementation for methods. You need to click on every method name to see the implementation. The other major difference is that JustDecompile sort all methods in alphabetic order.

Feature comparison
Both .NET CodeReflect, ILSpy and JustDecompile can decompile to VB, IL and C# compared to dotPeek that only have support for C#. JustDecompile and ILSspy are the only tool that support to save the decompiled code as a visual studio project with can be very useful in some cases. What i really like with dotPeek is that it use normal Visual Studio shortcuts as for example F12 to got to declaration. A cool feature in JustDecompile is the integration with windows explorer context menu. ILSpy is the only one that can’t extract embedded resources but is on the other hand the only open source tool.

Summary
Both dotPeek and JustDecompile gives me a feature scope and good visualization. If you are going for simple but powerful decompiler and you can leave with only C# support I would recommend dotPeek. If you want that little extra as saving to Visual Studio project and windows explorer context menu integration, then JustDecompile is the product. The only drawback with JustDecompile is that you need to register to install it with I don’t like since I don’t know what they will use my personal information for. If you prefer open source and can leave without possibility to extract embedded resources ILSpy is your tool. I can’t really recommend .NET CodeReflect for any reasons when it’s compared to the other tools.

4.80 avg. rating (94% score) - 5 votes

About Peter Wibeck

Comments

3 Responses to “Free options for Reflector (.NET decompiler)”
  1. Arnaud Dovi says:

    When I realized Telerik JustDecompile was spamming my decompiled codes of goto statements, I quickly send it to Junk in flavor of dotPeek

    dotPeek for the exact same file did not used a single goto. JustDecompile puts labels outside scope of goto statements…

    I believe the Telerik JustDecompile are just lazy boys and should give up to share such tool generating codes that horrible.

  2. Chris Eargle says:

    The most recent release of JustDecompile is faster and more correct than other .NET decompilers. Try the latest version, and if you still find a situation where JD is doing more poorly than another decompiler, let me know. I’ll work with the devs to fix it.

    • Chris Dunaway says:

      I just downloaded the latest version of JustDecompile. Decompiling one of the methods from Jon Skeet’s MoreLinq, JustDecompile produces this (note the weird use of goto):

      private static IEnumerable ExpectingCountYieldingImpl(IEnumerable source, int count, Func errorSelector)
      {
      int num = 0;
      IEnumerator enumerator = source.GetEnumerator();
      using (enumerator)
      {
      while (enumerator.MoveNext())
      {
      TSource current = enumerator.Current;
      num++;
      if (num > count)
      {
      throw errorSelector(1, count);
      }
      yield return current;
      }
      goto Label1;
      throw errorSelector(1, count);
      }
      Label1:
      if (num != count)
      {
      throw errorSelector(-1, count);
      }
      }

      dotPeek produces this (without the goto):

      private static IEnumerable ExpectingCountYieldingImpl(IEnumerable source, int count, Func errorSelector)
      {
      int iterations = 0;
      foreach (TSource source1 in source)
      {
      ++iterations;
      if (iterations > count)
      throw errorSelector.Invoke(1, count);
      else
      yield return source1;
      }
      if (iterations != count)
      throw errorSelector.Invoke(-1, count);
      }

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!

*