| View previous topic :: View next topic |
| Author |
Message |
ipivb Master Cheater
Reputation: 5
Joined: 29 May 2010 Posts: 256
|
Posted: Fri Jan 07, 2011 9:27 am Post subject: Any way to block the Elapsed Milliseconds function? |
|
|
I'm trying to hack a certain, time-based PC game that has a timer which counts down.
I'm sure it depends on Milliseconds() in some way to calculate time. Is there any way to block/freeze this with cheat engine? It's displayed in MM:SS format on screen.
The timer is listed in a DLL file but I already peeked through its functions list and couldn't find anything related to a timer. I even tried writing a few bytes over some function definitions that I thought might be related to the timer but it didn't affect anything.
I know that it must depend on elapsed milliseconds because if I completely freeze the code execution, the timer is "still counting" as if it wasn't really frozen at all.
Also, this is a single player game, so it's not connected to a server or anything.
If I wrote a program to do it, is there a way to hook into the game and detect when it calls the milliseconds function and return a false value to it? Or something similar?
|
|
| Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Fri Jan 07, 2011 9:54 am Post subject: |
|
|
| I'm not sure how timers are implemented internally by Windows. You could try logging calls to GetTickCount and QueryPerformanceCounter to see if it's using those. If so, all you have to do to freeze a timer is to check the initial return of those functions and continuing returning that value each time it's called. However I suspect that there is some interrupt which is doing the work at a lower level. My suggestion is to find the code which writes to the text that is being displayed on the screen and trace back from there because most likely the time is updated logically then the UI notified to change.
|
|
| Back to top |
|
 |
ipivb Master Cheater
Reputation: 5
Joined: 29 May 2010 Posts: 256
|
Posted: Fri Jan 07, 2011 10:09 am Post subject: |
|
|
Thank you so much, that's exactly what I did pretty much!
I underestimated the power of CheatEngine! Without really knowing what I was doing, I kept playing around until I was able to freeze the pointer which changes the timer!
Now I just have to wait a few minutes to find out if the timer is still going in the background, or if I really changed it for good :]
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Fri Jan 07, 2011 5:00 pm Post subject: |
|
|
| Slugsnack wrote: | | I'm not sure how timers are implemented internally by Windows. You could try logging calls to GetTickCount and QueryPerformanceCounter to see if it's using those. If so, all you have to do to freeze a timer is to check the initial return of those functions and continuing returning that value each time it's called. However I suspect that there is some interrupt which is doing the work at a lower level. My suggestion is to find the code which writes to the text that is being displayed on the screen and trace back from there because most likely the time is updated logically then the UI notified to change. |
GetTickCount() and maybe TimeGetTime() just read a value out of memory afaik. QueryPerformanceCounter() will go and query whatever hardware timer it feels like, I think there's a couple it may possibly use depending on your OS version and hardware I guess.
|
|
| Back to top |
|
 |
|