I would like to make a checksum of the current stack in the main, in order to check if it has been altered between two points.
For example:
int main(void) {
...
stack_checksum();
... process ...
if(stack_checksum() != ...)
altered.
}
How can I grab the base stack address and the current address of the stack's top ?
EDIT: With @Miroslav Bajtoš help, step for approach:
- Put local variable in a structure
- Check backtrace return array