How does a software like Cheat Engine work?

Cheat Engine is a tool for searching and modifying the memory of other running processes. I used to think this was pretty much trivial: going to an address and simply modifying it. But I realize now that things are not that simple. Each process has its own virtual memory and two processes can't play with each other's memory. So how exactly is Cheat Engine able to violate process isolation and modify other processes' memory?


Solution 1:

A process can be attached to another process such that it has access to that process's memory. This is designed for debugging programs - a debugger needs to be attached to the process being debugged, and needs to be able to read any memory data, break execution, edit memory data, inject code, etc. Cheat Engine just re-purposes these debugger functions in order to cheat in games.

Solution 2:

Reading about GDB may shed some light on this.

This question and this question discuss similar things.