Log in

View Full Version : 30 day trial -- WM_QUIT


riptide
February 2nd, 2007, 16:44
My head hurts

So, I have an application which is a 30 day trial. Setting the date on my system forward disables the application (no notification before it exits) and setting the date back allows it to run again. Simple so far.

Tracing through the application with Olly I find that there is a byte in memory that gets set to 01h when it determines the 30 day trial is up. Then doing a break on memory write for that offset I find a jz instruction jumping to the mov that sets that byte... ok, so I nop the jump and the program runs w/o exiting -- great!

Not quite... I can't exit the program at all now . So I look back at the code, and see that the cmp before our nop'd jump is comparing the resulting message from a peekmessage to 12h -- WM_QUIT. So this code is used to exit the application for all of the methods of exiting the program.

Now I break on all send/post message and postquitmessage calls in the application to try and find one that queries the system date before it or something similar only to find that nothing sends WM_QUIT from the application's code. The message is coming from elsewhere... (system libraries?) but I am a bit confused and stuck.

Can anyone who has seen anything like this before point me in the right direction?

Any help much appreciated.
(wasn't sure if this should go here or in advanced, but it just doesn't seem very advanced, and I don't feel like I'm that good when I can't do this)

naides
February 2nd, 2007, 17:56
Hi riptide. Take a couple of advils, turn off the computer and go out for beers.
It is Friday!!!!

Tomorrow your head will hurt again, but for much pleasurable reasons. . .

I think you got close to the protection, but not quite. Your modification nopping a jump, has side effects so the flag byte that you found is used by both, the normal exit process and the time-is-up exit process.

You are close, look a few steps back. . . see who sets the flag byte when the time is up and compare who sets the flag byte when the app just wants to quit.

Also try figuring out how the app knows time-is-up and attack the problem from a different front. . . but tomorrow afternoon.