如何在首次安装后禁用exe文件?
有人知道这个问题的解决方案吗?我创建了我的软件的 exe 文件。第一次安装后,我必须禁用该exe,因此它无法再次运行,因为当有人从我这里购买该软件时,他们只能安装一次。
Does anybody know the solution for this? I create an exe file of my software. After first installation I have to disable the exe, so it cannot be run again because when someone purchases the software from me they can install it only once.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
为此,您需要在某个地方存储一些东西,这些东西可能是:
请记住,坚定的用户将能够绕过文件和注册表方法,也很可能绕过 Web 服务方法。前两者通过使用 进程监视器 等内容来识别文件/registry 您正在写入的条目并清除它们。对于后者,通过使用类似 Fiddler 来识别您正在进行和替换的 Web 服务调用允许他们绕过您的保护的响应。
请记住,最终用户可以反汇编您的代码并删除您设置的保护机制,因此不要依赖它们 100% 牢不可破
To do this you'll need to store something somewhere, that something could be:
Bear in mind that a determined user will be able to circumvent file and registry methods and also quite possibly the web service method. The former two by using something such as Process Monitor to identify the files/registry entries you're writing to and clear them. For the latter, by using something like Fiddler to identify the web service calls you're making and replacing the responses with ones that allow them to bypass your protection.
Remember, ultimately the user can disassemble your code and remove the protection mechanisms you've put in place, so don't rely on them being 100% un-breakable
忘了它吧,伙计。它是软件 - 你绝对不能强制执行类似的操作,因为用户可以完全控制二进制文件运行的环境,包括逆向工程、虚拟化、备份等。以及你想要阻止的人正是那些不遗余力地阻挠你发明的任何保护措施的人。
不,唯一有效的方法是强制在线连接并在您的系统上注册特定二进制文件已安装一次的事实,然后在下次禁止它。这要求您使每个安装程序都不同,并拥有一个加密功能强大的密钥生成器,并且它仍然容易受到重放攻击 - 但从定义上来说,这是唯一不是无用的东西。
(好吧,要么就是这样,要么让你的软件变得非常出色,以至于人们会爱上你并想要给你钱。这个解决方案可能更难。)
Forget it, mate. It's software - you absolutely cannot enforce something like that because the user has complete control over the environment where the binary runs, including reverse engineering, virtualization, backups etc. etc. And the ones who you want to foil are precisely the ones who will go to any length to thwart any protection measure you could invent.
No, the only thing that works is to force an online connection and register, on your system, the fact that a particular binary was installed once, then forbid it the next time. That requires you to make each installer different and have a cryptographically strong key generator, and it's still susceptible to replay attacks - but it's the only thing that is not useless by definition.
(Well, either that, or make your software so insanely great that people will fall in love you and want to give you the money. That solution is probably even harder.)
您可以将安装路径存储在注册表或某个秘密位置中,并让您的 .exe 检查它是否从与存储的位置不同的位置启动,然后简单地退出,因为您可能不想告诉用户您的内容正在做。
You could store the installation path in the registry or some secret location and have your .exe check that if it has started from a location different than the one stored, to simply exit, as you probably don't want to tell the user what you are doing.