混淆是一种方法,但它不能防止破坏应用程序的盗版保护安全性。如何确保应用程序不被篡改,如何确保注册机制不会被逆向工程?

此外,还可以将c#应用程序转换为本机代码,而Xenocode的成本太高。

c#提供了很多特性,是编写代码的理想语言,所以用c++重新编写整个代码库是不可能的。

安全证书可以很容易地从. net中的签名程序集中删除。


当前回答

如果您希望人们能够运行您的代码(如果您不希望,那么为什么要首先编写它?),那么他们的CPU需要能够执行您的代码。为了能够执行代码,CPU需要能够理解它。

由于cpu是愚蠢的,而人类不是,这意味着人类也可以理解代码。

只有一种方法可以确保你的用户不会得到你的代码:不要把你的代码给他们。

这可以通过两种方式实现:软件即服务(SaaS),即在服务器上运行软件,只允许用户远程访问它。例如,这就是Stack Overflow使用的模型。我很确定Stack Overflow不会混淆他们的代码,但是你不能反编译它。

The other way is the appliance model: instead of giving your users your code, you give them a computer containing the code. This is the model that gaming consoles, most mobile phones and TiVo use. Note that this only works if you "own" the entire execution path: you need to build your own CPU, your own computer, write your own operating system and your own CLI implementation. Then, and only then can you protect your code. (But note that even the tiniest mistake will render all of your protections useless. Microsoft, Apple, Sony, the music industry and the movie industry can attest to that.)

或者,您可以什么都不做,这意味着您的代码将自动受到版权法的保护。

其他回答

只需编写一个好的应用程序和一个简单的保护系统。不管你选择什么保护,它都会被逆转……所以不要浪费太多时间/金钱。

不幸的是,你逃不掉的。最好的办法是用C语言编写代码,然后P/调用它。

这里有一个小小的catch-22,有人可能只是将您的应用程序反编译到CIL并杀死任何验证/激活代码(例如,对C库的调用)。请记住,用C语言编写的应用程序也会被更顽固的黑客逆向工程(看看现在的游戏被破解的速度就知道了)。没有什么可以保护您的应用程序。

最后,它的工作原理很像你的家,保护得足够好,这样就花费了太多的精力(意大利面条代码在这里会有所帮助),这样攻击者就会转移到你的隔壁邻居(竞争:))。看看Windows Vista,肯定有10种不同的破解方法。

有包在那里,将加密你的EXE文件,并在用户被允许使用它时解密它,但再一次,这是使用一个通用的解决方案,毫无疑问已被破解。

激活和注册机制针对的是“普通人”:那些没有足够的技术知识来绕过它(或者就此而言,他们知道他们可以绕过它)的人。不要为饼干费心了,他们有太多的时间。

广义上讲,有三种人。

Those who will not buy your software and resort to cracks, or if they don't find any, not use your software at all. Don't expect to make any money from this group. They rely either on their own skills or on crackers (who tend to prioritize their time depending on your useful and how big your audience is. The more useful, the sooner a crack will be available). The group of legitimate users who will buy (pay for) your software, irrespective of what protection mechanism you use. Don't make life hard for your legitimate users by using an elaborate protection mechanism since they are going to pay for it in any case. A complex protection mechanism can easily spoil the user experience and you don't want this happening to this group. Personally, I'd vote against any hardware solution, which adds to the cost of your software. A minority who will resort to "unethical" cracking and will only pay for your software because its features are protected by a licensing mechanism. You probably don't want to make it exceedingly easy for this group to circumvent your protection. However, all that effort you spend on protecting your software will pay back, depending on how big this group of people is. This entirely depends on the type of software you're building.

根据您所说的,如果您认为有足够多的少数人可以被推动购买您的软件,那么请继续执行某种形式的保护。考虑一下你能从这些少数人身上赚到多少钱,与你花在保护上的时间相比,或者你花在第三方保护API/工具上的钱。

如果您想实现自己的解决方案,那么使用公钥加密是防止容易被黑客攻击的好方法(与对称算法相反)。例如,您可以对您的许可证(序列号或许可证文件)进行数字签名。解决这个问题的唯一方法就是反编译、修改和重新编译代码(你可以使用Simucal回答中建议的技术来增加难度)。

你不能。

您可以采取一些步骤来增加一些难度,但最终本地机器上的任何可执行文件都是可以被破解的。最终,这些代码必须转换为本机机器码,每个可运行的应用程序都很容易受到攻击。

你要做的就是让它变得足够难破解,让它不值得人们去麻烦。

我有一些建议可以帮助你保护你的应用程序:

Obfuscate your code. Dotfuscator has a free edition and comes with Visual Studio. Use public/private key or asymmetric encryption to generate your product licenses. This ensures that only you can generate your license codes. Even if your application is cracked, you can be sure that they won't be releasing a key generator for your application, because it is impossible to reverse the key generating algorithm. Use a third-party packer to pack your .NET executable into an encrypted Win32 wrapper application. Themida is one of the better ones. This stops people from reflecting your application in .NET Reflector and makes it a pain to unpack for reversing. Write your own custom packer. If the third-party packers are too expensive, consider writing your own. Sometimes custom packers can be very effective, because there aren't well published methods on how to unpack them. The tutorial How to write your own packer gives a ton of good information on writing your own Win32 packer.

最终,如果人们想要破解你的应用,他们会的。看看所有的商业软件,它们有大量的资源来保护它们的应用程序,但它们在应用程序发布给公众之前就被破解了。

一个熟练的逆向工程师可以启动IDA-Pro,并像切黄油一样切开您的应用程序,无论您做什么。一个打包的应用程序可以被解包,而混淆只会阻止它变得像在公园里散步一样简单。您使用复杂许可代码所做的所有艰苦工作都可以通过一个单字节补丁来完成。

你只需要接受这样一个事实:人们很有可能会盗版你的软件。有些人无论如何都不会为你的应用程序付费,这些人是你不需要担心的。

然而,有许多企业永远不会冒着诉讼的风险,他们很乐意购买软件许可证,而许多计算机用户要么不想冒险,要么发现它是错误的,要么没有足够的技术知识来盗版。这些是你真正的客户,你应该把精力集中在为他们提供良好的用户体验上,而忽略那些破解你软件的人。

我的应用程序以前被盗版过,我认为这是对我个人的侮辱。我是一个小开发者,全身心地投入到一个应用中,而这些人却有胆量剽窃我的作品?!他们直接从我口袋里拿钱!

我立即添加了一堆严格的DRM代码,并试图破坏任何使用非法或破解副本的人。当然,我应该努力让我的应用程序变得更好,而不是试图阻止不可避免的事情。不仅如此,我还伤害了我真正的客户,因为我设置了这些额外的保护措施。

经过长时间的战斗,我意识到我是在与潮流作斗争,所有这些浪费的时间都是徒劳的。除了最基本的许可函数之外,我取出了所有的phone-home代码,并且再也没有回头。

客户端上运行的任何东西都可以被反编译和破解。混淆只会让它更难。我不了解你的应用程序,但99%的情况下,我认为不值得这么做。