14 #define X86_REL_ADDR(insn) (((insn).detail->x86.operands[0].type == X86_OP_IMM) \
15 ? (uint64_t)((insn).detail->x86.operands[0].imm) \
16 : (((insn).address + (insn).size) + (uint64_t)(insn).detail->x86.disp))
75 #define X86_EFLAGS_MODIFY_AF (1ULL << 0)
76 #define X86_EFLAGS_MODIFY_CF (1ULL << 1)
77 #define X86_EFLAGS_MODIFY_SF (1ULL << 2)
78 #define X86_EFLAGS_MODIFY_ZF (1ULL << 3)
79 #define X86_EFLAGS_MODIFY_PF (1ULL << 4)
80 #define X86_EFLAGS_MODIFY_OF (1ULL << 5)
81 #define X86_EFLAGS_MODIFY_TF (1ULL << 6)
82 #define X86_EFLAGS_MODIFY_IF (1ULL << 7)
83 #define X86_EFLAGS_MODIFY_DF (1ULL << 8)
84 #define X86_EFLAGS_MODIFY_NT (1ULL << 9)
85 #define X86_EFLAGS_MODIFY_RF (1ULL << 10)
86 #define X86_EFLAGS_PRIOR_OF (1ULL << 11)
87 #define X86_EFLAGS_PRIOR_SF (1ULL << 12)
88 #define X86_EFLAGS_PRIOR_ZF (1ULL << 13)
89 #define X86_EFLAGS_PRIOR_AF (1ULL << 14)
90 #define X86_EFLAGS_PRIOR_PF (1ULL << 15)
91 #define X86_EFLAGS_PRIOR_CF (1ULL << 16)
92 #define X86_EFLAGS_PRIOR_TF (1ULL << 17)
93 #define X86_EFLAGS_PRIOR_IF (1ULL << 18)
94 #define X86_EFLAGS_PRIOR_DF (1ULL << 19)
95 #define X86_EFLAGS_PRIOR_NT (1ULL << 20)
96 #define X86_EFLAGS_RESET_OF (1ULL << 21)
97 #define X86_EFLAGS_RESET_CF (1ULL << 22)
98 #define X86_EFLAGS_RESET_DF (1ULL << 23)
99 #define X86_EFLAGS_RESET_IF (1ULL << 24)
100 #define X86_EFLAGS_RESET_SF (1ULL << 25)
101 #define X86_EFLAGS_RESET_AF (1ULL << 26)
102 #define X86_EFLAGS_RESET_TF (1ULL << 27)
103 #define X86_EFLAGS_RESET_NT (1ULL << 28)
104 #define X86_EFLAGS_RESET_PF (1ULL << 29)
105 #define X86_EFLAGS_SET_CF (1ULL << 30)
106 #define X86_EFLAGS_SET_DF (1ULL << 31)
107 #define X86_EFLAGS_SET_IF (1ULL << 32)
108 #define X86_EFLAGS_TEST_OF (1ULL << 33)
109 #define X86_EFLAGS_TEST_SF (1ULL << 34)
110 #define X86_EFLAGS_TEST_ZF (1ULL << 35)
111 #define X86_EFLAGS_TEST_PF (1ULL << 36)
112 #define X86_EFLAGS_TEST_CF (1ULL << 37)
113 #define X86_EFLAGS_TEST_NT (1ULL << 38)
114 #define X86_EFLAGS_TEST_DF (1ULL << 39)
115 #define X86_EFLAGS_UNDEFINED_OF (1ULL << 40)
116 #define X86_EFLAGS_UNDEFINED_SF (1ULL << 41)
117 #define X86_EFLAGS_UNDEFINED_ZF (1ULL << 42)
118 #define X86_EFLAGS_UNDEFINED_PF (1ULL << 43)
119 #define X86_EFLAGS_UNDEFINED_AF (1ULL << 44)
120 #define X86_EFLAGS_UNDEFINED_CF (1ULL << 45)
121 #define X86_EFLAGS_RESET_RF (1ULL << 46)
122 #define X86_EFLAGS_TEST_RF (1ULL << 47)
123 #define X86_EFLAGS_TEST_IF (1ULL << 48)
124 #define X86_EFLAGS_TEST_TF (1ULL << 49)
125 #define X86_EFLAGS_TEST_AF (1ULL << 50)
126 #define X86_EFLAGS_RESET_ZF (1ULL << 51)
127 #define X86_EFLAGS_SET_OF (1ULL << 52)
128 #define X86_EFLAGS_SET_SF (1ULL << 53)
129 #define X86_EFLAGS_SET_ZF (1ULL << 54)
130 #define X86_EFLAGS_SET_AF (1ULL << 55)
131 #define X86_EFLAGS_SET_PF (1ULL << 56)
132 #define X86_EFLAGS_RESET_0F (1ULL << 57)
133 #define X86_EFLAGS_RESET_AC (1ULL << 58)
135 #define X86_FPU_FLAGS_MODIFY_C0 (1ULL << 0)
136 #define X86_FPU_FLAGS_MODIFY_C1 (1ULL << 1)
137 #define X86_FPU_FLAGS_MODIFY_C2 (1ULL << 2)
138 #define X86_FPU_FLAGS_MODIFY_C3 (1ULL << 3)
139 #define X86_FPU_FLAGS_RESET_C0 (1ULL << 4)
140 #define X86_FPU_FLAGS_RESET_C1 (1ULL << 5)
141 #define X86_FPU_FLAGS_RESET_C2 (1ULL << 6)
142 #define X86_FPU_FLAGS_RESET_C3 (1ULL << 7)
143 #define X86_FPU_FLAGS_SET_C0 (1ULL << 8)
144 #define X86_FPU_FLAGS_SET_C1 (1ULL << 9)
145 #define X86_FPU_FLAGS_SET_C2 (1ULL << 10)
146 #define X86_FPU_FLAGS_SET_C3 (1ULL << 11)
147 #define X86_FPU_FLAGS_UNDEFINED_C0 (1ULL << 12)
148 #define X86_FPU_FLAGS_UNDEFINED_C1 (1ULL << 13)
149 #define X86_FPU_FLAGS_UNDEFINED_C2 (1ULL << 14)
150 #define X86_FPU_FLAGS_UNDEFINED_C3 (1ULL << 15)
151 #define X86_FPU_FLAGS_TEST_C0 (1ULL << 16)
152 #define X86_FPU_FLAGS_TEST_C1 (1ULL << 17)
153 #define X86_FPU_FLAGS_TEST_C2 (1ULL << 18)
154 #define X86_FPU_FLAGS_TEST_C3 (1ULL << 19)
x86_avx_bcast
AVX broadcast type.
@ X86_AVX_BCAST_8
AVX512 broadcast type {1to8}.
@ X86_AVX_BCAST_4
AVX512 broadcast type {1to4}.
@ X86_AVX_BCAST_INVALID
Uninitialized.
@ X86_AVX_BCAST_2
AVX512 broadcast type {1to2}.
@ X86_AVX_BCAST_16
AVX512 broadcast type {1to16}.
x86_prefix
Instruction prefixes - to be used in cs_x86.prefix[].
@ X86_PREFIX_LOCK
lock (cs_x86.prefix[0]
@ X86_PREFIX_REPE
repe/repz (cs_x86.prefix[0]
@ X86_PREFIX_FS
segment override FS (cs_x86.prefix[1]
@ X86_PREFIX_REPNE
repne/repnz (cs_x86.prefix[0]
@ X86_PREFIX_OPSIZE
operand-size override (cs_x86.prefix[2]
@ X86_PREFIX_ES
segment override ES (cs_x86.prefix[1]
@ X86_PREFIX_CS
segment override CS (cs_x86.prefix[1]
@ X86_PREFIX_GS
segment override GS (cs_x86.prefix[1]
@ X86_PREFIX_REP
rep (cs_x86.prefix[0]
@ X86_PREFIX_ADDRSIZE
address-size override (cs_x86.prefix[3]
@ X86_PREFIX_SS
segment override SS (cs_x86.prefix[1]
@ X86_PREFIX_DS
segment override DS (cs_x86.prefix[1]
struct cs_x86 cs_x86
Instruction structure.
struct x86_op_mem x86_op_mem
x86_avx_rm
AVX static rounding mode type.
@ X86_AVX_RM_RD
Round down.
@ X86_AVX_RM_RN
Round to nearest.
@ X86_AVX_RM_RZ
Round toward zero.
@ X86_AVX_RM_INVALID
Uninitialized.
struct cs_x86_op cs_x86_op
Instruction operand.
x86_insn
X86 instructions.
@ X86_INS_VPBROADCASTMW2D
@ X86_INS_AESKEYGENASSIST
@ X86_INS_VBROADCASTI64X4
@ X86_INS_VPBROADCASTMB2Q
@ X86_INS_VBROADCASTI32X4
@ X86_INS_VAESKEYGENASSIST
x86_op_type
Operand type for instruction's operands.
@ X86_OP_IMM
= CS_OP_IMM (Immediate operand).
@ X86_OP_INVALID
= CS_OP_INVALID (Uninitialized).
@ X86_OP_REG
= CS_OP_REG (Register operand).
@ X86_OP_MEM
= CS_OP_MEM (Memory operand).
struct cs_x86_encoding cs_x86_encoding
x86_xop_cc
XOP Code Condition type.
@ X86_XOP_CC_INVALID
Uninitialized.
x86_insn_group
Group of X86 instructions.
@ X86_GRP_INVALID
= CS_GRP_INVALID
@ X86_GRP_BRANCH_RELATIVE
= CS_GRP_BRANCH_RELATIVE
@ X86_GRP_INT
= CS_GRP_INT
@ X86_GRP_CALL
= CS_GRP_CALL
@ X86_GRP_IRET
= CS_GRP_IRET
@ X86_GRP_PRIVILEGE
= CS_GRP_PRIVILEGE
@ X86_GRP_RET
= CS_GRP_RET
@ X86_GRP_VM
all virtualization instructions (VT-x + AMD-V)
@ X86_GRP_JUMP
= CS_GRP_JUMP
x86_avx_cc
AVX Code Condition type.
@ X86_AVX_CC_INVALID
Uninitialized.
x86_sse_cc
SSE Code Condition type.
@ X86_SSE_CC_INVALID
Uninitialized.
uint8_t imm_offset
Immediate offset, or 0 when irrelevant.
uint8_t modrm_offset
ModR/M offset, or 0 when irrelevant.
uint8_t disp_offset
Displacement offset, or 0 when irrelevant.
bool avx_zero_opmask
AVX zero opmask {z}.
x86_op_mem mem
base/index/scale/disp value for MEM operand
uint8_t size
size of this operand (in bytes).
x86_op_type type
operand type
x86_reg reg
register value for REG operand
int64_t imm
immediate value for IMM operand
x86_avx_bcast avx_bcast
AVX broadcast type, or 0 if irrelevant.
x86_avx_rm avx_rm
AVX static rounding mode.
x86_xop_cc xop_cc
XOP Code Condition.
uint8_t modrm
ModR/M byte.
x86_sse_cc sse_cc
SSE Code Condition.
x86_reg sib_base
SIB base register, or X86_REG_INVALID when irrelevant.
uint8_t addr_size
Address size, which can be overridden with above prefix[5].
cs_x86_encoding encoding
encoding information
int64_t disp
Displacement value, valid if encoding.disp_offset != 0.
x86_avx_cc avx_cc
AVX Code Condition.
uint8_t sib
SIB value, or 0 when irrelevant.
int8_t sib_scale
SIB scale, only applicable if sib_index is valid.
uint8_t rex
REX prefix: only a non-zero value is relevant for x86_64.
x86_reg sib_index
SIB index register, or X86_REG_INVALID when irrelevant.
bool avx_sae
AVX Suppress all Exception.
x86_reg index
index register (or X86_REG_INVALID if irrelevant)
x86_reg segment
segment register (or X86_REG_INVALID if irrelevant)
int64_t disp
displacement value
int scale
scale for index register
x86_reg base
base register (or X86_REG_INVALID if irrelevant)