我怎样才能混淆我的 c# 代码,所以它不能那么容易地被反混淆?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19163701/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I obfuscate my c# code, so it can't be deobfuscated so easily?
提问by Ben
I release a bunch of tools for free, but recently I have began to sell an application, that has private research, and people have been able to get my source code, and one person publically released my entire source. I spent a lot of time on this program, just to have someone crack it, and release my entire source.
我免费发布了一堆工具,但最近我开始销售一个应用程序,它进行了私人研究,人们已经能够获得我的源代码,并且有人公开发布了我的整个源代码。我花了很多时间在这个程序上,只是为了让有人破解它,并发布我的整个源代码。
How can I go about protecting my program? I have tried HWID, but people are still able to crack it. I know I am limited by C#, but it the most convenient to use. I just need a way to protect my programs from people trying to do this.
我该如何保护我的程序?我已经尝试过 HWID,但人们仍然能够破解它。我知道我受 C# 限制,但它最方便使用。我只需要一种方法来保护我的程序免受试图这样做的人的侵害。
回答by Sebastiaan van den Broek
You could have a look at the many obfuscation tools that are out there, for example these:
您可以查看现有的许多混淆工具,例如:
回答by Trevor Elliott
There's Dotfuscator (http://www.preemptive.com/products/dotfuscator/overview). But the best solution in some cases is to offer what you do as a web site (Software as a Service).
有 Dotfuscator ( http://www.preemptive.com/products/dotfuscator/overview)。但在某些情况下,最好的解决方案是提供您作为网站所做的事情(软件即服务)。
Consider this tool for example to convert VB to C#: http://converter.telerik.com/
考虑这个工具,例如将 VB 转换为 C#:http: //converter.telerik.com/
Or this tool to format JSON: http://jsonformatter.curiousconcept.com/
或者这个工具来格式化 JSON:http: //jsonformatter.curiousconcept.com/
This may or may not work for you. I don't know what the nature of the software you're trying to protect is.
这可能适合您,也可能不适合。我不知道您要保护的软件的性质是什么。
回答by Gray
Well, the problem with languages like C#/Java is that they are generally much easier to de-obfuscate. The way to secure this is generally to put this stuff into a webservice, but you said you couldn't really do that. What about porting specific non-trivial functions over to a language like C, and obfuscate that. Your C# program could then use reflection to make calls to this external/unmanaged dll. It would increase the difficulty for de-obfuscating, but the problem is that if someone wants it bad enough, they can figure it out as it is client-side.
嗯,像 C#/Java 这样的语言的问题在于它们通常更容易去混淆。确保这一点的方法通常是将这些东西放入网络服务中,但你说你不能真正做到这一点。如何将特定的非平凡函数移植到像 C 这样的语言上,并对其进行混淆。然后,您的 C# 程序可以使用反射来调用此外部/非托管 dll。这会增加去混淆的难度,但问题是如果有人想要它足够糟糕,他们可以解决它,因为它是客户端。
It may be that legal action is the only real solution here, but this is not a site for legal advice, and I am not qualified to give it if it were.
也许法律行动是这里唯一真正的解决方案,但这不是提供法律建议的网站,如果是的话,我也没有资格提供。
Additionally, this could be a business decision. Consider Making your software open-source and post a donation link. I am also not qualified to give business advice, but this is worth considering. It may actually increase your revenue, not to mention the other benefits that come with releasing open-source software.
此外,这可能是一项商业决策。考虑将您的软件开源并发布捐赠链接。我也没有资格提供商业建议,但这值得考虑。它实际上可能会增加您的收入,更不用说发布开源软件带来的其他好处了。
回答by carpenterjc
No, your code needs to contain the information needed to decrypt itself, its an impossible problem to solve.
不,您的代码需要包含解密自身所需的信息,这是一个不可能解决的问题。
Your best solution is to put your intellectual property on a server in the cloud that only you have access to. Give your customers a unique login, audit their access to check for abuse, off load as much grunt work onto your customers machines, but keep your algorithms locked into the cloud.
您最好的解决方案是将您的知识产权放在只有您可以访问的云服务器上。为您的客户提供唯一的登录名,审核他们的访问权限以检查滥用情况,将尽可能多的繁重工作卸载到您的客户机器上,但将您的算法锁定在云中。