Sign in to follow this  
Followers 0
dnix

Set Fake Current Date / Run Date for an App

11 posts in this topic

Hey all. I ran across a really clever little app that someone wrote that allows you to run an application and fool it into believing the date is some arbitrary date you set. The app is called "time stopper," and while I can't necessarily support it philosophically, I did find it to be extremely clever. Anyone have any idea how this might work?

Share this post


Link to post
Share on other sites



Hey all. I ran across a really clever little app that someone wrote that allows you to run an application and fool it into believing the date is some arbitrary date you set. The app is called "time stopper," and while I can't necessarily support it philosophically, I did find it to be extremely clever. Anyone have any idea how this might work?

Before anyone complains that this idea is unethical, I don't need to recreate this kind of thing, I could just use this app which is free but I dont really find myself wanting to work around trial periods for good software. I am simply curious about the technical mechanics.

Share this post


Link to post
Share on other sites

RunAsDate is free as well. I believe it was written somewhere that it injects code in to the program you want to run, but I forget what it was.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

This should do it:

#include <date.au3>
; Save current date
$SaveDate = _NowCalcDate()
; Set date 5 days back
$tempDate = _DateAdd( 'd',-5, _NowCalcDate())
$aTempDate = StringSplit($tempDate,"/")
_SetDate($aTempDate[3],$aTempDate[2],$aTempDate[1])
; do something
MsgBox(262144,"Waiting","Waiting")
; Reset Date
$aTempDate = StringSplit($SaveDate,"/")
_SetDate($aTempDate[3],$aTempDate[2],$aTempDate[1])

It will require a fix in Date.au3:

Line 1341 should be :

Return Int($iRetval)
Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

That is similar, but these don't actually change your time, they just "inject" a new time if you will. But, that may work well enough for him.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

That is similar, but these don't actually change your time, they just "inject" a new time if you will. But, that may work well enough for him.

Sure, can you run this by me again but this time slowly?

The DATE does change on the Computer you run the script on and changes back after closing the MsgBox().

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Yes, but what I am saying is that RunAsDate and Time Stopper don't actually change your system time, they just trick the other program. So I said they were similar but not exact, and that your method may work fine for him.

Share this post


Link to post
Share on other sites

Yes, but what I am saying is that RunAsDate and Time Stopper don't actually change your system time, they just trick the other program. So I said they were similar but not exact, and that your method may work fine for him.

Ok, well this is the AutoIt3 forum so I am trying to use native AutoIt3 code as a solution. ;)

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Ok, well this is the AutoIt3 forum so I am trying to use native AutoIt3 code as a solution. ;)

Jos, just in case your mis-understanding the OP...

The OP wants to change the current date only for the specified application. The main system date will stay the same, but the injected (and I use that term lightly) application sees a date you set.

RunAsDate intercepts the kernel API calls that returns the current date and time (GetSystemTime, GetLocalTime, GetSystemTimeAsFileTime), and replaces the current date/time with the date/time that you specify.

Source.

Which seems to imply that RunAsDate changes the whole system time/date?

Edited by JamesBrooks

Share this post


Link to post
Share on other sites

That's what I meant.

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

I have used something like the above script on a time expired software ones which really only tested at startup so that was working fine.

So you say these other programs mentioned create an Isolated environment with its own date?

Jos

Edit: ok just saw your Edit with the explanation .... slick .

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0