How do time-locked computer programs know the REAL time?

There are a lot of computer programs with time limits on their use, such as shareware with a 30-day free trial. The thing is, even if you change the computer’s date, the software will still know when the 30 days really expire. How does it do this?

In the software my company writes, we just add a 1 to the date in the database every day.

There are a couple ways the program could detect your tampering…

  1. It could check the time every few seconds, and notice that it’s now earlier than it was a few seconds ago. Therefore, the current time is not what the computer’s clock says it is, but rather the time it was a few seconds ago plus a few seconds. (This will only work if you change the time while the computer’s running.)

  2. It could get the time from a source other than your PC’s internal clock - i.e. a site on the internet.

There are probably some more advanced techniques, too. The arms race between shareware authors and those who can’t pay for shareware has been going on for a long, long time.

Ok, dumb question from an ex-programmer. How does your software know when another day passes? Seems like this one goes in circles.

If the program is running constantly, it can use a system timer to keep track of time, increment a counter every day or whatever. But that way, you can only track the amount of time that the program is running… and shareware with a 30 day limit typically expires 30 days after you install it, no matter how much time you actually spent running it in those 30 days.

Damn, you’re good! I can’t change my computer’s time when it’s not running! It just sits there and says “I’m asleep,” and won’t let me change anything.

On my several macs, I’ve had good luck finding the specific prefs in the system folder and deleting them. You’ll lose anything you’ve saved with the app, but the app might re-set and work again.

YMMV, as always. Don’t try to do anything while your computer is not running.

Heh, guess I screwed that up. :slight_smile:

What I meant was changing the time while the program is running and able to notice that the time has changed, as opposed to (1) closing it, changing the time, and restarting it, or (2) rebooting your computer and changing the time through BIOS setup.

In your super-secret place, store the # of days passed and the current date. If the date ever goes backward, increment the # of days anyway, plus store the new date as the current date.

This is simple and you can still get around it but it stops trivial date rolling back.

…and you’re a good sport. I was just ragging on you on how to change your comp when it’s not ‘running.’ Not pitworthy, just a little fun. :slight_smile:

Another thing a lot of Windows based programs do is use the registry. They will have a coded entry in the registry that tracks:

The date of install
How many days have passed
The date of “shutdown”

I know that many pieces of software will also make such entries in the registry backup files. When the computer boots and a date change happens that conflicts with the registry files it will shut down the progam completely.