dr_syscall_set_param

Function dr_syscall_set_param 

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

Usable only from a pre-syscall (dr_register_pre_syscall_event()) event, or from a post-syscall (dr_register_post_syscall_event()) event when also using dr_syscall_invoke_another(). Sets the value of system call parameter number \p param_num to \p new_value.

It is up to the caller to ensure that writing this parameter is safe: this routine does not know the number of parameters for each system call, nor does it check whether this might write beyond 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.