At a basic level, this is how modern tools like CheatEngine work today. Find all the memory addresses containing your current health level. Do something to manipulate that value, find all the addresses that reflect the new value, rinse and repeat until you know where your health is stored, then write whatever you want to that address.
It can do more than that of course, but it's cool to see that the gameshark I had as a little kid worked in a similar fashion.
It can do more than that of course, but it's cool to see that the gameshark I had as a little kid worked in a similar fashion.