472,146 Members | 1,306 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,146 software developers and data experts.

How to check current time for demonstration product

Hi, I'd like to know the best way of checking the current time during a
demonstration product. At the minute i store the first run date, then
compare that to the system time, but obviously a user can just change
their clock back a month and continue using the product.

I heard it is best to check the access time on a system dll? I had a
quick look at the user32.dll file and realised the access time was the
time my machine booted up, but when i check in .net (via
File.GetLastAccessedTime or FileInfo.LastAccessedTime) it is different
to the time windows displays in the properties sheet.

So does anyone have any suggestions?

(BTW: This isn't meant as fool-proof hacker protection, it's just to
deter the most basic attempts at getting around the demonstration period)

Cheers,
Nov 15 '06 #1
3 1700
Hi, I'd like to know the best way of checking the current time during a
demonstration product. At the minute i store the first run date, then
compare that to the system time, but obviously a user can just change
their clock back a month and continue using the product.

I heard it is best to check the access time on a system dll? I had a
quick look at the user32.dll file and realised the access time was the
time my machine booted up, but when i check in .net (via
File.GetLastAccessedTime or FileInfo.LastAccessedTime) it is different
to the time windows displays in the properties sheet.

So does anyone have any suggestions?

(BTW: This isn't meant as fool-proof hacker protection, it's just to
deter the most basic attempts at getting around the demonstration period)
Check the 'created' or 'last modified' date on your executable, and compare
this with the current timestamp.
changing the current time back and forth gets very annoying, so it is
unlikely that users will do it continuously. you have to be admin as well to
do that.

Or store the first run date in the registry, possibly encrypted. hide it
amongs a dozen similar reg keys, and make it so your program stops working if
not all of the kyes are there. your installer then has to create those keys
during installation.

But there is NO fool proof to do this. Using FileMon or ProcessMonitor will
quickly show what your app is doing to protect itself.
And a user could always re-install the demo app.

--
Kind regards,
Bruno.
br**********************@hotmail.com
Remove only "_nos_pam"

Nov 15 '06 #2
Bruno van Dooren [MVP VC++] wrote:
>
But there is NO fool proof to do this. Using FileMon or ProcessMonitor will
quickly show what your app is doing to protect itself.
And a user could always re-install the demo app.
Hi, thanks for the prompt reply. One of our requirements is that the
application can be run without an installer and the demo should start
from the first run (not the install date).

Currently I write the demo period and the start time out to a file, read
that in and compare against the current date / time.

I didn't realise you needed to be an admin to change the date / time though

Cheers,
Nov 15 '06 #3

"Mark Ingram" <no****@nowhere.comwrote in message
news:u3**************@TK2MSFTNGP06.phx.gbl...
Bruno van Dooren [MVP VC++] wrote:
>>
But there is NO fool proof to do this. Using FileMon or ProcessMonitor
will quickly show what your app is doing to protect itself.
And a user could always re-install the demo app.

Hi, thanks for the prompt reply. One of our requirements is that the
application can be run without an installer and the demo should start from
the first run (not the install date).

Currently I write the demo period and the start time out to a file, read
that in and compare against the current date / time.
You can also store the most recent run date along with the first run date,
and check for time going backwards. If you catch time going backwards,
refuse to run unless you can access a reliable (i.e. cryptographically
signed) network time source.
>
I didn't realise you needed to be an admin to change the date / time
though

Cheers,

Nov 15 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by TN Bella | last post: by
1 post views Thread by John Rivers | last post: by
reply views Thread by Saiars | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.