混淆是一种方法,但它不能防止破坏应用程序的盗版保护安全性。如何确保应用程序不被篡改,如何确保注册机制不会被逆向工程?
此外,还可以将c#应用程序转换为本机代码,而Xenocode的成本太高。
c#提供了很多特性,是编写代码的理想语言,所以用c++重新编写整个代码库是不可能的。
安全证书可以很容易地从. net中的签名程序集中删除。
混淆是一种方法,但它不能防止破坏应用程序的盗版保护安全性。如何确保应用程序不被篡改,如何确保注册机制不会被逆向工程?
此外,还可以将c#应用程序转换为本机代码,而Xenocode的成本太高。
c#提供了很多特性,是编写代码的理想语言,所以用c++重新编写整个代码库是不可能的。
安全证书可以很容易地从. net中的签名程序集中删除。
当前回答
是的。如果代码没有混淆,. net代码非常容易进行逆向工程。
混淆将给试图逆向工程您的软件的人增加一层烦恼。根据你得到的版本不同,你会得到不同程度的保护。
Visual Studio包括Dotfuscator的一个版本。因为它是一个捆绑版本,你肯定不会得到最强烈的混淆。如果您查看它们的特性列表,就会清楚地看到您遗漏了什么(以及应用程序将如何使您的代码更安全)。
还有其他一些免费或开源的。net混淆器(但我不能评论它们的质量或使用的各种方法):
Obfuscar 巴别塔。网上
最后,没有什么是完美的。如果有人真的想看看你的软件是如何工作的,他们会的。
其他回答
. net Reflector只能打开“托管代码”,这基本上意味着“。NET代码”。所以你不能用它来分解COM DLL文件、原生c++、经典的Visual Basic 6.0代码等。编译后的。net代码的结构非常方便、可移植、可发现、可验证等。net Reflector利用了这一点,让你窥探已编译的程序集,但反编译器和反汇编器绝不是。net特有的,它们和编译器一样早就存在了。
您可以使用混淆器使代码更难阅读,但是您不能在不使. net无法读取的情况下完全阻止它被反编译。市面上有一些产品(通常价格昂贵)声称可以将托管代码应用程序“链接”到本地代码应用程序,但即使这些产品真的可以工作,有决心的人总能找到方法。
然而,当涉及到混淆时,一分钱一分货。因此,如果您的代码是如此专有,以至于您必须竭尽全力来保护它,那么您应该愿意在一个好的混淆器上投资。
However, in my 15 or so years of experience writing code I've realized that being over-protective of your source code is a waste of time and has little benefit. Just trying to read original source code without supporting documentation, comments, etc. can be very difficult to understand. Add to that the senseless variable names that decompilers come up with and the spaghetti code that modern obfuscators create - you probably don't have to worry too much about people stealing your intellectual property.
你不能。
您可以采取一些步骤来增加一些难度,但最终本地机器上的任何可执行文件都是可以被破解的。最终,这些代码必须转换为本机机器码,每个可运行的应用程序都很容易受到攻击。
你要做的就是让它变得足够难破解,让它不值得人们去麻烦。
我有一些建议可以帮助你保护你的应用程序:
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代码,并且再也没有回头。
如果您希望人们能够运行您的代码(如果您不希望,那么为什么要首先编写它?),那么他们的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.)
或者,您可以什么都不做,这意味着您的代码将自动受到版权法的保护。
这真的值得吗?只要有足够的决心,任何保护机制都可以被打破。考虑你的市场、产品价格、客户数量等。
如果您想要更可靠的东西,那么就使用硬件键,但这相当麻烦(对用户来说),而且成本更高。软件解决方案可能会浪费时间和资源,它们唯一会给你的是一种虚假的“安全感”。
还有一些想法(没有一个是完美的,因为没有完美的人)。
AntiDuplicate 改变语言,使用Skype的作者使用的好技巧 许可证服务器
不要在这上面浪费太多时间,因为破解者在典型技术方面有很多经验,比你领先几步。除非你想使用大量的资源,可能会改变编程语言(做Skype的方式)。
广义上讲,有三种人。
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回答中建议的技术来增加难度)。