instrlist_encode

Function instrlist_encode 

Source
pub unsafe extern "C" fn instrlist_encode(
    drcontext: *mut c_void,
    ilist: *mut instrlist_t,
    pc: *mut byte,
    has_instr_jmp_targets: bool_,
) -> *mut byte
Expand description

Encodes each instruction in \p ilist in turn in contiguous memory starting at \p pc. Returns the pc after all of the encodings, or NULL if any one of the encodings failed. Uses the x86/x64 mode stored in each instr, not the mode of the current thread. In order for instr_t operands to be encoded properly, \p has_instr_jmp_targets must be true. If \p has_instr_jmp_targets is true, the offset field of each instr_t in ilist will be overwritten, and if any instr_t targets are not in \p ilist, they must have their offset fields set with their offsets relative to pc. x86 instructions can occupy up to 17 bytes each, so the caller should ensure the target location has enough room to avoid overflow.