如何保护我的 C# 代码不被反编译?

发布于 2024-12-03 03:03:44 字数 373 浏览 7 评论 0 原文

可能的重复:
.Net 混淆
.NET 世界中的混淆替代方案

就在几分钟前,我读到有很多工具(很多是免费的)可以让您将 C# .exe 转换回 VB 解决方案。这意味着我的专有代码可以被查看、编辑和重新编译/重新分发。有办法防止这种情况吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

倥絔 2024-12-10 03:03:44

简而言之,您需要使用混淆。仅举几例。

  1. Dotfuscator
  2. 混淆器
  3. Skater(免费软件)
  4. DeployLX CodeVeil
  5. Plus Visual Studio 附带Dotfuscator 的轻型版本。

您可以阅读这篇 MSDN 文章,其中提供了有关如何混淆代码的建议。

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.

谜泪 2024-12-10 03:03:44

您可以使用 Obfuscator.. Salamander 就是这样一种 .NET 工具...

< a href="http://confuser.codeplex.com/" rel="nofollow">Confuser 是另一个免费的 .NET 混淆器。它是用 C# 开发并使用 Mono

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

凡尘雨 2024-12-10 03:03:44

您可以使用 mono 将其编译为本机二进制文件,只需 google 即可。

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

安稳善良 2024-12-10 03:03:44

除了混淆 .NET 程序集之外,您还可以将敏感函数/组件编码为本机 C++,将其包装在 C++/CLI 中并与 .NET 一起使用。

即使进行了混淆,JIT 编译器最终也需要查看 IL 代码,但这只会让反编译变得更加困难。

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.

—━☆沉默づ 2024-12-10 03:03:44

混淆器是一个不错的选择,因为它增加了人们查看、编辑、重新分发代码等的工作量。

虽然这些不能从物理上保护您的代码,但它们可以防止反编译代码的行为:专利、版权和许可证等法律机制。

反编译或逆向工程是一场经济努力的战斗。你是否值得混淆你的代码(可能会与反射“陷阱”发生冲突),而对于某人来说是否值得进行逆向工程(几乎没有上下文)而不是模拟或重写?

对此答案的评论,https://stackoverflow.com/a/1988467/64348,几个人都同意,表明混淆不会阻止返回到原始代码(或原始代码的一些足够接近的版本)。混淆只是可逆翻译的替代,除了一些有用的上下文之外不需要真正的密钥。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文