I am using Stackdumps with Win32, to write all return adresses into my logfile. I match these with a mapfile later on (see my article [Post Mortem Debugging][1]).
<
The trick is to stop calling StackWalk64
when it returns 0 in stk.AddrReturn.Offset
. This means there are no more frames on the stack. If stk.AddrReturn.Offset
is non-zero, you can use that value as the return address.
If you continue calling StackWalk64
after this, my guess is that it will try to interpret whatever is in the memory locations as being a stack and will return unpredictable data.