How does CheatEngine's speed hack work?

Shubham picture Shubham · Jul 7, 2013 · Viewed 64.5k times · Source

Cheat Engine comes with a feature called speed hack which basically can slow down or increase speed of the game. Actually, not only games, if there is a software with clock ticking it can speed-en up that too. How does that work? I might imagine there is some internal clock on which these things run but not sure how these things happen on low level.

While this feature has worked on most of the games I tried, it has also failed on many, for eg, NFS Most wanted. Why? Is there any different mechanism on which these games run or it is just some anti-cheat?

Answer

Harold picture Harold · Jul 18, 2014

Cheat Engines Old Speedhack:

  • Runs the application in a very high priority thread
  • Uses timed sleeping to speed up the game
  • When a function is called, it will be given an emulated timer which is sped up

Cheat Engines New Speedhack:

  • When the Cheat Engine speed dll is injected into the program, it is modified to the speed you selected in the Cheat Engine panel
  • Sets a base reference of the current time
  • returned time = basetime+((currenttime-basetime)*speed

Detection:

  • Both Methods are easy to detect by sending a packet with the time every couple of seconds to be validated by a server
  • The game may be able to detect the dll being injected

Source: http://wiki.cheatengine.org/index.php?title=Cheat_Engine:Internals#Speedhack