I take the chance to write this answer to advise you against messing with the executable itself. As for why, here are the reasons stated in the comments and some of mine:
- As Rik said, most likely the developer of said program didn't hardcode the actual expiration date (as that would entail building another program as soon as a year passed). That would mean higher maintenance and support costs for said developer.
- Even if he did hardcode the date, there is no consensus on how to store it. If the expiration date is a string, you might have some luck because as Frank said, most strings are stored as is inside an executable. This isn't a rule, however, and the string might be encrypted or, depending on how the compiler optimized the code, it might be buried inside binary text you can't easily understand.
- Assuming you could disassemble the program, you would then need to understand the thousands of lines of code that went into the program and detect where the expiration date is stored or called from. However, and depending on country and legislation, this activity is either frowned upon or illegal.
Advices aside, I'm piggybacking on what Rik said, and expanding it a little.
You can create a batch file (as you said .exe files, I'm assuming Windows) using the following commands:
SET CUR_DATE=%DATE%
DATE <insert your pretended date here>
<start your program here>
DATE %CUR_DATE%
Although I haven't tested it, this supposedly does the following:
- Stores the current date, as given by %DATE%.
- Sets the PC's date to the one you want, using the DATE command.
- Runs the program you want.
- Resets the date to the current one, as soon as your program exits.
You can store this batch inside the program's directory, as such you only need to write the program's name, rather than the full path. Be consistent, however, on the date you input, as it needs to be in the same format as what your system expects. See the link about the DATE command for more info; alternatively just do echo %date%
to see what format your computer expects the date you input to be.
1strings in a exe remain just encoded text, but date formats are binary types, and will not appear in any kind of text search. what you are asking for will be quite tricky for someone without knowledge of debugging and the binary patching of files. – Frank Thomas – 2013-12-10T18:04:26.157
Maybe the best courses of action are the following: 1. Go back a couple of years in your own computer date. 2. Actually explain what is your concrete problem, with what software. Trying to hack (let's say disassemble) executables is time consuming and near fruitless. For the record, I do have software that behaves like that and usually I just regress the PC's date. – Doktoro Reichard – 2013-12-10T18:13:00.717
@DoktoroReichard do you know any simple program (so I can avoid having to write one myself) that would change the date to a good one, start the app, and just after it perceives program started it changes the date back? – FernandoSBS – 2013-12-10T18:42:56.313
@FrankThomas is there any program you know which would convert a date I give to the binary format so I can search the file for that? it's quite simple. Also, what program do I need to overwrite that binary code with the new date binary code? – FernandoSBS – 2013-12-10T18:49:03.400
I'd say parsing the existing date is prerequisite to writing it back, but basically, you would read in the program binary, determine the length and offset you need to overwrite at, generate your new date, replace from offset for length, and write the file back out again. – Frank Thomas – 2013-12-10T19:12:38.673
@FrankThomas ok but how to find the date in the exe code? I have used an hex editor but how should I convert the date to one that the program can searches? For ex, 2013/12/07 ? – FernandoSBS – 2013-12-10T19:15:24.530
1questions like these are the reason we as a group are trying to convince you to give up, or take another tact. as it standas without knowing the runtime and compiler used in compiling your application, there is no way to even begin looking. – Frank Thomas – 2013-12-10T20:33:43.793
1@FernandoSBS If this is to avoid a license which expired (you didn't specify "your problem") then you probably won't find a 'hard' date (binary or otherwise) in the code. (I'm a programmer and i wouldn't make it that easy ;). Even so, SU is not a place to ask for advise to hack a program like that (too technical and slightly unethical) You might haves some luck creating a batch-file with saving the date from
date /t
, setting it todate 01-01-2013
, starting your program and setting the date back todate %saved_date%
. – Rik – 2013-12-10T20:38:03.203