-1

Is there a tool that can make a .NET Assembly pretend to be a not .NET Assembly when someone try to see its source code using .NET Reflector or ILSpy etc .. ? like when puting the tool in .NET Reflector it will tell that the tool isn't a .NET Assembly

2 Answers2

0

The short answer is no. The problem is the .Net runtime must be able to recognize and load the assembly. If it can do that, someone can write a tool to do the same. Even if you encrypt the assembly and decrypt it before you load it, people can still capture the decrypted version.

I assume you want to protect the code inside the assembly. The best way to protect code is to not give it to customers. Have the application call back to code hosted on your servers. Of course, this is not suitable for all kinds of applications.

The second best option is code obfuscation. There are many tools out there that can mangle the variable, method and class names to make code difficult to understand. However, this provides limited benefit as people can still load and examine the code.

akton
  • 14,148
  • 3
  • 43
  • 47
  • But how can MoleBox do that ? I used MoleBox and then I tried ILSpy and it says that its not a .NET Assembly but the problem with MoleBox is it shows a message on startup thats the tool is using MoleBox, That's why I don't want to use MoleBox – user3425606 Apr 25 '14 at 01:04
  • If you are talking about an EXE, it is possible to wrap it. Themida (see http://www.oreans.com/) is another good wrapper. However, someone could easily write an unwrapper. It comes down to cost benefit. If you are happy stopping most people but not determined hackers, use a wrapper. You won't stop a determined hacker, though. – akton Apr 25 '14 at 01:08
0

Microsoft has been previewing .NET Native,

http://msdn.microsoft.com/en-US/vstudio/dotnetnative

Thus, when it is finally released you get what you want automatically without using any third party solutions.

Remember that @JoelCoehoorn is correct that any program can be disassembled and analyzed. If you really want to hide a secret, probably you should not write a line. All protections we add, only make it more difficult to be cracked.

Lex Li
  • 60,503
  • 9
  • 116
  • 147