Skip to main content

drwrap_get_retaddr_if_sentinel

Function drwrap_get_retaddr_if_sentinel 

Source
pub unsafe extern "C" fn drwrap_get_retaddr_if_sentinel(
    drcontext: *mut c_void,
    possibly_sentinel: *mut app_pc,
)
Expand description

If the provided app_pc (\p possibly_sentinel) is indeed the return address sentinel used to implement #DRWRAP_REPLACE_RETADDR, this routine replaces it with the actual return address of the inner-most nested wrapped function. Otherwise, it is a no-op. This allows mitigation of a transparency violation under the #DRWRAP_REPLACE_RETADDR strategy where the actual app return address on the stack is replaced with a return address sentinel.