Jump to content

Set Fake Current Date / Run Date for an App


dnix
 Share

Recommended Posts

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?

Link to comment
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.

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

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. ;)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...