Getting the size of the freeze frame

Is there a way to get the callstack size (in bytes) in C ++?
Or at least its bottom address (and then can I subtract it from the ESP register?

+4
source share
2 answers

You can use VirtualQuery twice.

For the first time, you can use the address of any value on the stack to get the base address and size (in bytes) of the reserved stack space.

Subtract the size from the base address and call VirtualQuery again. This way you get the space reserved for the stack.

By adding two sizes, you get the total stack size.

+1
source

All Articles