[][src]Function capstone_sys::cs_reg_read

pub unsafe extern "C" fn cs_reg_read(
    handle: csh,
    insn: *const cs_insn,
    reg_id: c_uint
) -> bool

Check if a disassembled instruction IMPLICITLY used a particular register. Find the register id from header file of corresponding architecture (arm.h for ARM, x86.h for X86, ...) Internally, this simply verifies if @reg_id matches any member of insn->regs_read array.

NOTE: this API is only valid when detail option is ON (which is OFF by default)

WARN: when in 'diet' mode, this API is irrelevant because the engine does not update @regs_read array.

@insn: disassembled instruction structure received from cs_disasm() or cs_disasm_iter() @reg_id: register that you want to check if this instruction used it.

@return: true if this instruction indeed implicitly used the given register, or false otherwise.