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/utils.c b/utils.c
index 6d6f24b..413edee 100644
--- a/utils.c
+++ b/utils.c
@@ -50,7 +50,18 @@
// count number of positive members in a list.
// NOTE: list must be guaranteed to end in 0
-unsigned int count_positive(unsigned char *list)
+unsigned int count_positive(uint16_t *list)
+{
+ unsigned int c;
+
+ for (c = 0; list[c] > 0; c++);
+
+ return c;
+}
+
+// count number of positive members in a list.
+// NOTE: list must be guaranteed to end in 0
+unsigned int count_positive8(unsigned char *list)
{
unsigned int c;