views:

157

answers:

5

I know that .NET apps are difficult to protect. I use RedGate Reflector and know that generally speaking you can get source code from many .NET dlls.

however my question is - is it actually feasible to decompile the whole application?

I mean - create a workable VS solution so the pirate can just press F5 and get the exactly same result as if the author on his machine?

+1  A: 

For a small application, it is both possible AND feasible. You have to decompile the classes one by one and copy/paste the code into Visual Studio.

For a large application, while possible, it's not really feasible since the copy/paste process becomes extremely tedious.

Justin Niessner
+3  A: 

Reflector have few plugins that allows to dump assembly into code: http://www.denisbauer.com/NETTools/FileDisassembler.aspx http://filegenreflector.codeplex.com/

But I'm not sure that can create a project file.

STO
+1  A: 

It really depends on what kind of code you are writing. If you use a lot of the new features in C# 3 and above like lambda expressions, automatic properties, and yield, the decompiled source code is not runnable and requires quite a bit of work to get it to compile.

Even without those features though, I have usually experienced at least some problems compiling the decompiled source code of a full winforms application.

tster
+1  A: 

I don't think there's anything that fully automates this for an app made up of multiple assemblies, but I can say that it's really not that hard to stitch the pieces together into a solution yourself. Perhaps a bit tedious for a large app, but if you really want to it's certainly doable.

Fortunately, I don't worry about it that much.

Joel Coehoorn
+1  A: 

There are many obfuscators these days that protect your .NET applications from decompilation. One such obfuscator is http://www.red-gate.com/products/smartassembly/index.htm . They try to make your well structured .NET IL code into spegatti code (which still works) that decompilers cannot generate original code. It's not like 100% sure piraters cannot get the recompilable code but it will not be easy for them to decompile when using obfuscator.

VOX