开发者

How Can I Protect My C# Code From Being Decompiled? [duplicate]

This question alre开发者_运维知识库ady has answers here: Closed 11 years ago.

Possible Duplicate:

.Net Obfuscation

Alternative for Obfuscation in the .NET world

Just a few minutes ago, I read that there are a number of tools, many free, that allow you to convert a C# .exe back to a VB solution. This means that my proprietary code can be viewed, edited, and recompiled/redistributed. Is there a way to prevent this?


In short you need to use Obfuscation. To name a few.

  1. Dotfuscator
  2. Obfuscator
  3. Skater (Freeware)
  4. DeployLX CodeVeil
  5. Plus Visual Studio comes with a light version of Dotfuscator.

You can read this MSDN article that has advice on how to obfuscate your code.


You can use an Obfuscator.. Salamander is one such tool for .NET...

Confuser is another free obfuscator for .NET. It is developed in C# and using Mono


You can use mono to compile it to a native binary, just google it up.


You could also code the sensitive functions/components into native C++, wrap it in C++/CLI and use with .NET in addition to obfuscating your .NET assemblies.

Even with obfuscation the JIT compiler will need to see the IL code eventually, you are just making it more difficult to decompile.


An obfuscator is a good bet, as it increases a person's effort to view, edit, redistribute, etc. the code.

While these don't protect your code physically they could prevent the behavior of decompiling your code: legal mechanisms such as patents, copyrights, and licenses.

Decompiling or reverse engineering is a battle of economic efforts. Is it worth it for you to obfuscate your code (potentially running afoul of reflection "gotchas") vs. is it worth it for someone to reverse engineer (with little context) instead of emulating or rewriting?

A comment on this answer, https://stackoverflow.com/a/1988467/64348, with which several agree, indicates that obfuscation does not prevent getting back to the original (or some close enough version of the original) code. Obfuscation is just a stand-in to a reversible translation with no real key needed except some useful context.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜