Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / How does cheat engine work?

Author
Message
print TheGourglex
12
Years of Service
User Offline
Joined: 24th Dec 2012
Location:
Posted: 5th May 2013 06:23
I'm trying to make my own cheat engine program, but i don't understand perfectly what that program does: does it open to read and makes a memblock from the file selected and show the piece of memory?
Other thing...
Do we get a memblock of a exe file opening the file for read and after making a memblock from the file?

"Better than do is try"
Rudolpho
19
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 5th May 2013 17:42
It's basically a memory scanner that also features the possibility to write to found addresses.
In order for the writing to work it must be continuously rewritten (because the edited process may change the value back again) at intervals. CheatEngine I think does this 2 times per second (or perhaps it was 20 or even 200) by default.

Since this kind of program is interested in running programs, reading the executable file won't do you much good. What you want to do is rather attach to another process.

It is possible to do this in DBPro through calling standard windows dll's. I did this for a bit (never completed it though, but as I recall it was able to attach to processes and scan their memory for certain values. I think it was slow and only found a fraction of the sought memory locations though, but that might very well just have been due to errors on my part) about two years ago when some game decided to crash whenever CheatEngine was opened. Not very good protection as obviously any other such program was indeed able to access it
(And no it wasn't an online game )


"Why do programmers get Halloween and Christmas mixed up?"
Mage
Valued Member
18
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 5th May 2013 23:10 Edited at: 5th May 2013 23:10
Windows runs programs in "Protected Memory" so programs can't access other programs memory space. This is a very good thing. The solution is to have a program launch and attach the exe in question to it as a second operating thread. Then as it is all under one protected memory space the cheat program has access to the memory.

This attaching behavior looks really really suspicious to antivirus programs. Almost the only type of program to rewrite itself while running is a virus. Then again a lot of trainers/cheats have viruses in them anyway to steal accounts and cd-keys.

A legitimate example of this is the 64bit memory launcher on Elder Scrolls and Fallout games that would allow the game to use more than 3GB of ram.

Be advised that some programs check for this as an anti-cheating mechanism.

Diggsey
19
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 6th May 2013 09:46
You don't need to attach to the other process for the simple things cheat engine does like scanning memory and changing values. Windows provides "ReadProcessMemory" and "WriteProcessMemory" to do that. You can even use "CreateRemoteThread" to inject code and run it.

[b]
Mage
Valued Member
18
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 7th May 2013 03:33
I wasn't aware there was a way around this. Sounds interesting.

Login to post a reply

Server time is: 2025-05-19 06:49:12
Your offset time is: 2025-05-19 06:49:12