I've lately gotten my hands on the (in)famous Cheat Engine[1] and found that it was really easy to simulate it in C++, there's just one thing that keeps to disturb me; how to "iterate" through memory addresses (using a void pointer, as types may differ per address)?
Cheat Engine[1]: Iterates through a list of addresses of unknown types, in which the list length is determined at run-time. It adds elements to this list whenever the current pointer (dereferenced) equals the value of the input and is of the specified type.
The whole point is that I get access to addresses which are determined at run-time, and then iterate till an end value is reached (in normal cases 0xFFFFFF). How to do this?
Note, the addresses stated here are from outside the program itself.
If you want to iterate through memory one byte at a time then you need to cast it to a char*. If you want to iterate through however many bytes make up an int each iteration then you need to cast the memory to an int*.