如何混合“记录数限制”进入试用版的程序逻辑
您是否有对软件试用版实施“记录计数”限制的想法?
- 假设它是一个任务管理程序;
- 试用版和完整版是分开下载的;
- 在试用版中我想限制最大值。允许用户创建的任务数量。
我的问题是,如何将这个“任务计数限制”应用到核心程序逻辑中,以便它不能轻易被绕过?例如,显然可以轻松绕过以下代码:
if (varTotalTaskCount > 20)
{
ShowMessage("This is a trial version and you can create up to 20 tasks only");
return false;
}
有什么想法吗?谢谢!
Do you have any ideas of implementing a 'record count' limit for a trial version of a software?
- Assume it's a task management program;
- Trial version and full version are separate downloads;
- in the trial version I want to limit the max. amount of tasks allowed to be created by the users.
My question is, show to apply this 'task count limit' into the core program logic, so that it can't be bypassed easily? For example, obviously the following code can be bypassed easily:
if (varTotalTaskCount > 20)
{
ShowMessage("This is a trial version and you can create up to 20 tasks only");
return false;
}
Any ideas? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我会很邪恶,做这样的事情:
这意味着如果存在最大限制检查,它不会崩溃,但如果破解者删除该检查,它将崩溃。当代码包含许多错误时,修复代码会更困难。
最后,我不建议以这种方式编码,但如果我想让破解者尽可能地困难而不诉诸客户端-服务器类型的保护,那么这就是我会做的。
I'd be evil and do something like this:
This will mean that it won't crash if the maximum limit check is present but will crash if the crackers remove the check. It is harder to fix the code when it contains many errors.
Finally, I do not recommend coding this way but if I would want to make it as hard as possible for crackers without resorting to client-server type of protection then this is what I would have done.
好吧,定义“轻松”;)
如果这是用解释性语言(如 PHP)编写的,那么最好的选择就是代码混淆。
通过编译的程序,你可以更好地隐藏这个逻辑(例如通过使用自修改代码,或者执行各种计算来计算任务限制),但最终,你仍然必须做出“尝试或不尝试”的决定。
最后,如果有人愿意破解你的程序,他们就会这么做。
Well, define "easily" ;)
If this is written in an interpreted language (like PHP), then your best bet is code obfuscation.
With compiled programs, you can hide this logic better (e.g. by using self-modifying code, or performing various computations to calculate the task limit), but in the end, you still have to make the decision "trial or not".
In the end, if someone is willing to crack your program, they will.