pub unsafe extern "C" fn drutil_insert_get_mem_addr(
drcontext: *mut c_void,
bb: *mut instrlist_t,
where_: *mut instr_t,
memref: opnd_t,
dst: reg_id_t,
scratch: reg_id_t,
) -> bool_Expand description
Inserts instructions prior to \p where in \p bb that determine and store the memory address referred to by \p memref into the register \p dst. May clobber the register \p scratch. Supports far memory references. For far memory references via DS and ES, we assume that the segment base is 0.
All registers used in \p memref must hold their original application values in order for the proper address to be computed into \p dst. The \p dst register may overlap with the registers used in \p memref. On ARM, \p scratch must be different from those used in \p memref (as well as from \p dst). On x86, \p scratch will not be used unless \p memref is a far reference that either uses \p dst or is a base-disp with both a base and an index, or \p memref is a reference in the #OP_xlat instruction.
To obtain each memory address referenced in a single-instruction string loop, use drutil_expand_rep_string() to transform such loops into regular loops containing (non-loop) string instructions.
\return whether successful.