6 #include <capstone/capstone.h>
184 cs_regs regs_read, regs_write;
185 uint8_t regs_read_count, regs_write_count;
188 if (ins->detail ==
NULL)
191 x86 = &(ins->detail->x86);
196 printf(
"\taddr_size: %u\n",
x86->addr_size);
207 if (
x86->sib_scale != 0)
208 printf(
"\t\tsib_scale: %d\n",
x86->sib_scale);
247 printf(
"\top_count: %u\n",
x86->op_count);
250 for (
i = 0;
i <
x86->op_count;
i++) {
253 switch((
int)
op->type) {
261 printf(
"\t\toperands[%u].type: MEM\n",
i);
268 if (
op->mem.scale != 1)
269 printf(
"\t\t\toperands[%u].mem.scale: %u\n",
i,
op->mem.scale);
270 if (
op->mem.disp != 0)
271 printf(
"\t\t\toperands[%u].mem.disp: 0x%" PRIx64 "\n",
i,
op->mem.disp);
279 printf(
"\t\toperands[%u].avx_bcast: %u\n",
i,
op->avx_bcast);
282 if (
op->avx_zero_opmask !=
false)
283 printf(
"\t\toperands[%u].avx_zero_opmask: TRUE\n",
i);
285 printf(
"\t\toperands[%u].size: %u\n",
i,
op->size);
291 printf(
"\t\toperands[%u].access: READ\n",
i);
294 printf(
"\t\toperands[%u].access: WRITE\n",
i);
297 printf(
"\t\toperands[%u].access: READ | WRITE\n",
i);
304 regs_read, ®s_read_count,
305 regs_write, ®s_write_count)) {
306 if (regs_read_count) {
307 printf(
"\tRegisters read:");
308 for(
i = 0;
i < regs_read_count;
i++) {
314 if (regs_write_count) {
315 printf(
"\tRegisters modified:");
316 for(
i = 0;
i < regs_write_count;
i++) {
323 if (
x86->eflags ||
x86->fpu_flags) {
324 for(
i = 0;
i < ins->detail->groups_count;
i++) {
327 for(
i = 0;
i <= 63;
i++)
336 if (
i == ins->detail->groups_count) {
338 for(
i = 0;
i <= 63;
i++)
@ CS_MODE_16
16-bit mode (X86)
@ CS_AC_READ
Operand read from memory or register.
@ CS_AC_WRITE
Operand write to memory or register.
#define X86_EFLAGS_SET_IF
@ X86_AVX_BCAST_INVALID
Uninitialized.
#define X86_EFLAGS_RESET_AF
#define X86_EFLAGS_PRIOR_DF
#define X86_FPU_FLAGS_RESET_C0
#define X86_FPU_FLAGS_SET_C3
#define X86_EFLAGS_PRIOR_NT
#define X86_FPU_FLAGS_UNDEFINED_C0
#define X86_FPU_FLAGS_UNDEFINED_C1
#define X86_EFLAGS_TEST_NT
@ X86_AVX_RM_INVALID
Uninitialized.
#define X86_EFLAGS_RESET_TF
#define X86_EFLAGS_RESET_DF
#define X86_EFLAGS_RESET_CF
#define X86_EFLAGS_SET_SF
#define X86_FPU_FLAGS_UNDEFINED_C3
#define X86_FPU_FLAGS_MODIFY_C0
#define X86_FPU_FLAGS_TEST_C0
#define X86_EFLAGS_SET_ZF
#define X86_EFLAGS_UNDEFINED_AF
#define X86_EFLAGS_MODIFY_CF
#define X86_EFLAGS_TEST_OF
#define X86_FPU_FLAGS_SET_C0
#define X86_EFLAGS_MODIFY_IF
#define X86_EFLAGS_MODIFY_DF
#define X86_FPU_FLAGS_MODIFY_C3
#define X86_EFLAGS_PRIOR_IF
#define X86_EFLAGS_SET_CF
#define X86_EFLAGS_TEST_TF
#define X86_EFLAGS_MODIFY_OF
#define X86_EFLAGS_RESET_SF
#define X86_EFLAGS_TEST_PF
#define X86_FPU_FLAGS_TEST_C1
@ X86_OP_IMM
= CS_OP_IMM (Immediate operand).
@ X86_OP_REG
= CS_OP_REG (Register operand).
@ X86_OP_MEM
= CS_OP_MEM (Memory operand).
#define X86_EFLAGS_SET_DF
#define X86_EFLAGS_MODIFY_PF
#define X86_EFLAGS_RESET_OF
#define X86_EFLAGS_UNDEFINED_ZF
#define X86_EFLAGS_MODIFY_TF
#define X86_EFLAGS_MODIFY_NT
#define X86_FPU_FLAGS_RESET_C2
#define X86_EFLAGS_PRIOR_OF
#define X86_EFLAGS_TEST_RF
#define X86_EFLAGS_SET_AF
#define X86_FPU_FLAGS_TEST_C3
#define X86_EFLAGS_RESET_PF
#define X86_EFLAGS_MODIFY_ZF
#define X86_EFLAGS_PRIOR_PF
#define X86_EFLAGS_MODIFY_AF
#define X86_FPU_FLAGS_MODIFY_C2
#define X86_FPU_FLAGS_SET_C1
@ X86_XOP_CC_INVALID
Uninitialized.
#define X86_EFLAGS_UNDEFINED_PF
#define X86_EFLAGS_TEST_ZF
#define X86_EFLAGS_TEST_AF
#define X86_FPU_FLAGS_UNDEFINED_C2
#define X86_EFLAGS_UNDEFINED_SF
#define X86_EFLAGS_RESET_ZF
#define X86_FPU_FLAGS_RESET_C3
#define X86_EFLAGS_TEST_SF
#define X86_FPU_FLAGS_RESET_C1
#define X86_EFLAGS_SET_PF
#define X86_FPU_FLAGS_SET_C2
#define X86_EFLAGS_PRIOR_ZF
#define X86_EFLAGS_RESET_NT
#define X86_EFLAGS_UNDEFINED_OF
#define X86_EFLAGS_PRIOR_AF
#define X86_EFLAGS_PRIOR_SF
#define X86_EFLAGS_PRIOR_TF
#define X86_EFLAGS_MODIFY_SF
@ X86_AVX_CC_INVALID
Uninitialized.
@ X86_SSE_CC_INVALID
Uninitialized.
#define X86_EFLAGS_RESET_IF
#define X86_EFLAGS_RESET_AC
#define X86_EFLAGS_TEST_DF
#define X86_EFLAGS_RESET_0F
#define X86_FPU_FLAGS_MODIFY_C1
#define X86_EFLAGS_TEST_CF
#define X86_EFLAGS_PRIOR_CF
#define X86_FPU_FLAGS_TEST_C2
#define X86_EFLAGS_UNDEFINED_CF
#define X86_EFLAGS_SET_OF
#define X86_EFLAGS_MODIFY_RF
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_regs_access(csh ud, const cs_insn *insn, cs_regs regs_read, uint8_t *regs_read_count, cs_regs regs_write, uint8_t *regs_write_count)
CAPSTONE_EXPORT int CAPSTONE_API cs_op_count(csh ud, const cs_insn *insn, unsigned int op_type)
CAPSTONE_EXPORT const char *CAPSTONE_API cs_reg_name(csh ud, unsigned int reg)
CAPSTONE_EXPORT int CAPSTONE_API cs_op_index(csh ud, const cs_insn *insn, unsigned int op_type, unsigned int post)
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count