.NET decompilation, how easy is it?

If the source code was normally compiled it is very easy to decompile .NET assemblies.

You could use .NET Reflector, originally developed by Lutz Roeder, now supported by Redgate Software. There is a screenshot at the bottom of this answer which gives you an impression what Reflector does.

You can browse through your namespaces and classes and see the source code and methods in your favorite .NET language. Denis Bauer's FileDisassembler will allow you (or the evil hackers in your case) to convert it into a VS solution and make modifications to the program.

There are some countermeasures like using a code obfuscator to make your code practically unreadable.

There are some other interesting questions on StackOverflow about this topic:

  • Should you obfuscate a commercial .Net application?
  • How do I decompile a .NET EXE into readable C# source code?
  • Best .NET obfuscation tools/strategy
  • .NET cryptography for licence keys?

Screenshot from Reflector:

alt text


Try opening your application with Reflector. You will probably be surprised :-)

And once a cracker has located the right location in your code, they can use a combination of ildasm/ilasm to remove the check from your application - even if the code Reflector generates won't compile.


Josh Smith also released Crack.NET recently which can be used to attach to a running .NET process, and then open that up in Reflector - so even if the assemblies on disk are encrypted somehow (to avoid people using Reflector to get at them), they'll still be able to use the in-memory versions