If you want to see a lower-level example of how trainers find the process to hook into and actually write to the memory space of something else and all that fun jazz, there is tutorials in C++ and in VB and other languages out there (it all looks like it is in the win32 API anyways).