Add new API and start to provide access information for instruction operands
- New API cs_regs_access() that provide registers being read & modified by instruction
- New field cs_x86_op.access provides access info (READ, WRITE) for each operand
- New field cs_x86.eflags provides EFLAGS affected by instruction
- Extend cs_detail.{regs_read, regs_write} from uint8_t to uint16_t type
diff --git a/cs_priv.h b/cs_priv.h
index f22994e..b47323e 100644
--- a/cs_priv.h
+++ b/cs_priv.h
@@ -24,6 +24,11 @@
// return register name, given register ID
typedef char *(*GetRegisterName_t)(unsigned RegNo);
+// return registers accessed by instruction
+typedef void (*GetRegisterAccess_t)(const cs_insn *insn,
+ cs_regs regs_read, uint8_t *regs_read_count,
+ cs_regs regs_write, uint8_t *regs_write_count);
+
// for ARM only
typedef struct ARM_ITStatus {
unsigned char ITStates[128]; // FIXME
@@ -54,6 +59,7 @@
uint8_t skipdata_size; // how many bytes to skip
cs_opt_skipdata skipdata_setup; // user-defined skipdata setup
uint8_t *regsize_map; // map to register size (x86-only for now)
+ GetRegisterAccess_t reg_access;
};
#define MAX_ARCH 8