dr_syscall_get_param

Function dr_syscall_get_param 

Source
pub unsafe extern "C" fn dr_syscall_get_param(
    drcontext: *mut c_void,
    param_num: c_int,
) -> reg_t
Expand description

Usable only from a pre-syscall (dr_register_pre_syscall_event()) event. Returns the value of system call parameter number \p param_num.

It is up to the caller to ensure that reading this parameter is safe: this routine does not know the number of parameters for each system call, nor does it check whether this might read off the base of the stack.

\note On some platforms, notably MacOS, a 32-bit application’s system call can still take a 64-bit parameter (typically on the stack). In that situation, this routine will consider the 64-bit parameter to be split into high and low parts, each with its own parameter number.