Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET decompilation, how easy is it?

I was looking into the best encryption for a license key for an application, and someone said that someone can easily decompile the application and then just skip the test for the license key.

how would someone go about doing that practically speaking? So they have my .dll, they have to decompile it somehow, then comment out the function call to check the license, then recompile it? The decompiler has to be really good such that the code still compiles!

like image 937
Blankman Avatar asked Nov 05 '08 14:11

Blankman


2 Answers

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.

like image 73
Rasmus Faber Avatar answered Oct 29 '22 22:10

Rasmus Faber


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

like image 45
splattne Avatar answered Oct 29 '22 23:10

splattne