Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 05-24-2005, 02:09
bedrock's Avatar
bedrock bedrock is offline
Friend
 
Join Date: May 2002
Posts: 91
Rept. Given: 8
Rept. Rcvd 5 Times in 2 Posts
Thanks Given: 6
Thanks Rcvd at 1 Time in 1 Post
bedrock Reputation: 5
Timer Functions

I'm debugging an demo version of an application that terminates after 1 hour, with the intention of trying to find the timer, and kill it so the application will run continuously.

I have been looking at various time related API's, but i haven't found how it checks if the hour is up yet.

Does anyone have any more API's i could look at, or a list of windows timer related API's, so far i have looked for:

SetTimer
KillTimer
GetTickCount
GetSystemTime
GetLocalTime

Or any general advice on how to seek and kill time trial based software

Thanks in advance

--
bedrock
Reply With Quote
  #2  
Old 05-24-2005, 02:41
baatazu
 
Posts: n/a
Very strange. I cant think any other way. A possibility is (although very rare) to read the time via WMI calls. But that makes the application compatible only with XP/2K, since the WMI is available to Win98 only if the WMI Core is installed. Have you checked if it reads the time of system files, maybe via GetFileTime? Have you done the test to set the clock forward to see if detects it and kills the app? If yes, then the trial system is time comparable. If not, then its sounds like timer (GetTickCount).

Why you dont share with us the name of the application?
Reply With Quote
  #3  
Old 05-24-2005, 02:59
Polaris's Avatar
Polaris Polaris is offline
Friend
 
Join Date: Feb 2002
Location: Invincible Cyclones Of FrostWinds
Posts: 97
Rept. Given: 3
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 0
Thanks Rcvd at 2 Times in 2 Posts
Polaris Reputation: 0
Are you sure that the time is read through an API? There are a thousands of ways in which one can get the current time...
Reply With Quote
  #4  
Old 05-24-2005, 03:34
bedrock's Avatar
bedrock bedrock is offline
Friend
 
Join Date: May 2002
Posts: 91
Rept. Given: 8
Rept. Rcvd 5 Times in 2 Posts
Thanks Given: 6
Thanks Rcvd at 1 Time in 1 Post
bedrock Reputation: 5
Polaris, this is my point, i dont know it is an API, i have tried the ones i can think of to check, but i dont know all these other ways to get current time, maybe if there is 1000's of way then i will not learn them all, but any pointers?

--
bedrock
Reply With Quote
  #5  
Old 05-24-2005, 04:33
Jay Jay is offline
VIP
 
Join Date: Feb 2002
Posts: 249
Rept. Given: 31
Rept. Rcvd 3 Times in 3 Posts
Thanks Given: 15
Thanks Rcvd at 13 Times in 5 Posts
Jay Reputation: 3
WINMM.DLL

recently came across an time limited app using the timer functions in winmm.dll.
Reply With Quote
  #6  
Old 05-24-2005, 05:58
JMI JMI is offline
Leader
 
Join Date: Jan 2002
Posts: 1,627
Rept. Given: 5
Rept. Rcvd 199 Times in 99 Posts
Thanks Given: 0
Thanks Rcvd at 96 Times in 94 Posts
JMI Reputation: 100-199 JMI Reputation: 100-199
Have you considered the possibility that it might not check the "time" at all, that, perhaps it simply loads a counter of some form and just "counts" it down to zero and unloads.

Regards,
__________________
JMI
Reply With Quote
  #7  
Old 05-24-2005, 06:29
Naides Naides is offline
Friend
 
Join Date: Mar 2005
Location: Planet Earth
Posts: 40
Rept. Given: 7
Rept. Rcvd 2 Times in 1 Post
Thanks Given: 21
Thanks Rcvd at 10 Times in 7 Posts
Naides Reputation: 2
One app I reversed a long time ago learned the time by creating a dummy file and then reading the time stamp of the file (Then it erased it) so a run with filemon and api like FileTimeToSystemTime and the like might give you something.

On the other hand, one sure thing that happens after an hour is that the app QUITS.

What about looking for API that close an app? PostQuitMessage for instance.

Finally, the use of a good api monitor like APISPY may help you find your guilty API sooner.
Reply With Quote
  #8  
Old 05-24-2005, 07:58
goggles99 goggles99 is offline
Friend
 
Join Date: Aug 2004
Posts: 62
Rept. Given: 5
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 1
Thanks Rcvd at 4 Times in 4 Posts
goggles99 Reputation: 0
Smile Time for a trace

I'm afraid to say that the best bet you may have is to fun a trace on the program and let it sit for a while... overnight possibly.
Since it may be a different thread that kills the program or provides a callback to another thread, the best way to start is to place a bp on all termination function calls and determine which thread closes the app and where.

When you run your trace (on the thread with the terminator) let it run untill it hits that last api (the one that kills that app), then look back and see what comparison and jump was taken, or not taken to wind up there.

BTW, you should be putting BP on the return of api's becasue some apps emulate the first few instructions of them and then jump into the center of them. Many Api's are just wrappers for other API's in the nt.dll, find out if any of the api's you are calling end up there. This program may be calling the nt.dll's functions directly.

If the Application is using some kind of internal countdown timer (as JMI suggested), perhaps you could use a memory searcher like T-search and do a search for an unknown integer, wait a few seconds and do a second search for a integer value that has decreased. A few of these and you will find the value (in memory) that is counting down. Attach a debugger and place a memory write bp on that address to see what is modifying it...
nop or modify that code.

What is the Demo App called??? I'll have a look at it.
Reply With Quote
  #9  
Old 05-24-2005, 09:24
TQN TQN is offline
VIP
 
Join Date: Apr 2003
Location: Vietnam
Posts: 343
Rept. Given: 142
Rept. Rcvd 20 Times in 12 Posts
Thanks Given: 169
Thanks Rcvd at 130 Times in 43 Posts
TQN Reputation: 20
Another two API functions used to get time are: GetProcessTimes in kernel32.dll and timeGetTime in winmm.dll.
Regards,
Reply With Quote
  #10  
Old 05-24-2005, 23:09
bedrock's Avatar
bedrock bedrock is offline
Friend
 
Join Date: May 2002
Posts: 91
Rept. Given: 8
Rept. Rcvd 5 Times in 2 Posts
Thanks Given: 6
Thanks Rcvd at 1 Time in 1 Post
bedrock Reputation: 5
Well it seems this particular target used a WaitForSingleObject call with a timeout value, and then a loop with a couter, seems to run for longer than an hour now

thanks for all the ideas

--
bedrock
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
where are second level dll functions raygun General Discussion 2 01-24-2005 05:56
The best method to kill TIMER kunam General Discussion 6 09-07-2004 02:14
Functions within a Dll SOLAR General Discussion 7 08-27-2004 21:00


All times are GMT +8. The time now is 02:38.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( 1998 - 2024 )