I would like to start a software (which has expiration date!!) giving a differetn date from the one of the system. Is it possible to do it with envoirment variables or any other way? i dont wanna change the true date in my OS !
Thanks
Alex
Assign a different date for software execution
Re: Assign a different date for software execution
Wine implements the normal Windows time functions, which get their time from unix (Time Functions, n.d.), so there is no time/date override you can set directly.eiem wrote:I would like to start a software (which has expiration date!!) giving a differetn date from the one of the system. Is it possible to do it with envoirment variables or any other way? i dont wanna change the true date in my OS !
Thanks
Alex
However... Wine is open-source, so you could do some hacking.
To get you started, wine's (GetSystemTime, n.d.). is in kernel32. Using grep GetSystemTime within Downloads/src/wine/dlls/kernel32 reveals the function is located in, guess what, time.c
Looking at time.c and using similar detective work (let me know if there is an easier way to navigate this) reveals that wine's implementation is just a wrapper for ntdll time.c NtQuerySystemTime(), which gets the time from unix gettimeofday().
Anywhere along the chain you could, for example, perform some subtraction magic, or even go so far as to get the value to subtract by using the registry. (Registry Functions, n.d.)
Ref.
GetSystemTime Function (Windows). (n.d.). . Retrieved March 31, 2010, from http://msdn.microsoft.com/en-us/library ... S.85).aspx
Registry Functions (Windows). (n.d.). . Retrieved March 31, 2010, from http://msdn.microsoft.com/en-us/library ... S.85).aspx
Time Functions (Windows). (n.d.). . Retrieved March 31, 2010, from http://msdn.microsoft.com/en-us/library ... S.85).aspx
Re: Assign a different date for software execution
I'm bored, so here is the rest of my (lack of) knowledge on the subject

- Some windows programs out there can intercept the windows GetSystemTime, GetLocalTime, e.g. http://www.nirsoft.net/utils/run_as_date.html but they don't work with wine because wine's kernel32.dll / ntdll.dll are fake, i.e. you can't just hook functions in them with LoadLibrary() and GetProcAddress() like a regular windows dll.
- You said you didn't want to change the system time, so the TZ environment variable could be set to report a different time of day, e.g. export TZ=America/Los_Angeles This won't change the date, however.
- There may be a Linux command line tool that wraps gettimeofday <sys/time.h> but I'm unaware if such a thing exists and wouldn't know how to search for it.
hellork preload file for Linux exist to change data and time. Only one problem wine uses it own loader so that option does not work.
eiem basically stop nicking software and find or start development of something so you don't have to. Wine will never have an offical patch to do the alteration you are requesting.
Name one legal above board reason for requiring todo it.
eiem basically stop nicking software and find or start development of something so you don't have to. Wine will never have an offical patch to do the alteration you are requesting.
Name one legal above board reason for requiring todo it.