Search code examples
anti-piracy

How to mix 'record count limit' into program logic for a trial version


Do you have any ideas of implementing a 'record count' limit for a trial version of a software?

  1. Assume it's a task management program;
  2. Trial version and full version are separate downloads;
  3. 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!


Solution

  • I'd be evil and do something like this:

    In the full version use an array/list/etc without a limit.
    In the trial version use a static array/list/etc of a specified size and do not bounds check. Also in the trial version add the code you suggested that is easily bypassed.

    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.