1

I'll be very specific about this, this is a real question and I'm facing a real problem right now.

I don't want to optimize my program, or my code, in order to make it run faster, its not that. I must write a program that changes the 'speed' of another program.

An example for this is CE 'speedhack', you select a target program and makes it run faster or slower, if you're playing a flash game in a browser you can slow down the flash plugin speed which makes the game run 'faster' or 'slower'.

enter image description here

I know that CE does this loading a library into the other program and most certainly the library creates a thread at DllMain, DLL_PROCESS_ATTACH which will change the 'speed' of other threads in the program. So it doesn't even gets to be 'other' application at that case.

All I want is the right direction for this, how is this 'speed' changed. Please do not close my question, if you did not understand please leave a comment I'll provide necessary details. I'm a real programmer looking for a real answer.

Paul R
  • 208,748
  • 37
  • 389
  • 560
Vinícius
  • 15,498
  • 3
  • 29
  • 53
  • 1
    `I'm a real programmer looking for a real answer` Had to laugh :D – poitroae Feb 03 '13 at 11:16
  • You asked the same question like 10 minutes ago. –  Feb 03 '13 at 11:16
  • possible duplicate of [Speed up another application](http://stackoverflow.com/questions/14671718/speed-up-another-application) –  Feb 03 '13 at 11:16
  • I cannot delete it, I've asked to, this might silly as it is, but it's what I need – Vinícius Feb 03 '13 at 11:17
  • 1
    Are you looking for a platform independent solution or just for Windows? – Tony Feb 03 '13 at 11:17
  • (This is merely my speculation. I have no evidence at all.) In most program, delay() is used to control the frame rate. Cheat Engine might reduce the duration of delay() to change the speed of the program. – Konfle Dolex Feb 03 '13 at 11:19
  • 2
    Have you read the wiki: http://wiki.cheatengine.org/index.php?title=Cheat_Engine:Internals#Speedhack – nhahtdh Feb 03 '13 at 11:20
  • What I understood is that it is hooking `GetTickCount()` and returning its own value, is that right? – Vinícius Feb 03 '13 at 11:21

1 Answers1

3

First of all, this "speedhack" doesn't actually make a program run faster. It just manipulates the timers the program uses by hooking (via dll-injection). Just like the values that Java's System.currentTimeMillis() or C++'s time_t time; time(&time) give. A more detailed explanation can be found at Cheat Engine internals.

The formula then is returned_time = basetime+((currenttime-basetime)*speed_factor).

poitroae
  • 21,129
  • 10
  • 63
  • 81