Demystifying .NET Decompilers


Code written in C#, VB.NET, or F# is converted into IL code, or Intermediate Language, during compilation. A DLL file is then used to store this IL code. The JIT compiler compiles the IL code contained in the DLLs to native code at runtime. The CPU then starts executing the native code directly. JIT, or just-in-time, compilation refers to the process of only compiling IL code into native code when a method is called for the first time during runtime.

NET compilation process illustrated:

dotnet-compilation

The opposite of C# compilation is .NET decompilation. To convert compiled IL code into readable C# source code, one needs a.NET Decompiler tool.

dotnet-decompilation

A list of the tools that are available is as follows:

  • ILSpy – ILSpy is the open-source .NET assembly browser and decompiler
  • DotPeek – dotPeek is a free-of-charge standalone tool based on ReSharper‘s bundled decompiler.
  • Dnspy – you can use it to edit and debug assemblies even if you don’t have any source code available
dotnet 

See also