Example embodiments provide for effectively executing a stack-walk and
other operations by dynamically accessing information about the expected
location of cookies on a stack. For example, a first function is executed
that causes a stack-walk operation to occur. While performing the
stack-walk operation, cookie location information for a cookie placed on
the stack by a second function different from the first function is
accessed. The cookie, if uncorrupted, includes a known value that is used
to determine if the stack has been corrupted. Based on the cookie
location information, corrupt data representative of the cookie is
accessed. A global cookie, which also includes the known value, is also
accessed. The known value of the global cookie is then compared with the
corrupt data to determine that the stack is corrupted at least up to the
location of the corrupt data representative of the cookie.