Skip to main content

drmgr_insert_emulation_start

Function drmgr_insert_emulation_start 

Source
pub unsafe extern "C" fn drmgr_insert_emulation_start(
    drcontext: *mut c_void,
    ilist: *mut instrlist_t,
    where_: *mut instr_t,
    instr: *mut emulated_instr_t,
) -> bool_
Expand description

Inserts a label into \p ilist prior to \p where to indicate the start of a sequence of instructions emulating an instruction \p instr. The label has data attached which describes the instruction being emulated.

A label will also appear at the end of the sequence, added using drmgr_insert_emulation_end() (unless #DR_EMULATE_REST_OF_BLOCK is set). These start and stop labels can be detected by an observational client using drmgr_is_emulation_start() and drmgr_is_emulation_end() allowing the client to distinguish between native app instructions and instructions used for emulation.

When calling this function, the \p size field of \p instr should be set using sizeof(). This allows the API to check for compatibility.

Information about the instruction being emulated can be read from the label using drmgr_get_emulated_instr_data().

If label callbacks are used, please note that the callback will not be cloned and its use is currently not consistent (xref i#3962).

\return false if the caller’s \p emulated_instr_t is not compatible, true otherwise.