示例#1
0
// convert Intel access info to AT&T access info
static void get_op_access(cs_struct *h, unsigned int id, uint8_t *access, uint64_t *eflags)
{
	uint8_t count, i;
	uint8_t *arr = X86_get_op_access(h, id, eflags);

	if (!arr) {
		access[0] = 0;
		return;
	}

	// find the non-zero last entry
	for(count = 0; arr[count]; count++);

	if (count == 0)
		return;

	// copy in reverse order this access array from Intel syntax -> AT&T syntax
	count--;
	for(i = 0; i <= count; i++) {
		if (arr[count - i] != CS_AC_IGNORE)
			access[i] = arr[count - i];
		else
			access[i] = 0;
	}
}
示例#2
0
// copy & normalize access info
static void get_op_access(cs_struct *h, unsigned int id, uint8_t *access, uint64_t *eflags)
{
#ifndef CAPSTONE_DIET
	uint8_t *arr = X86_get_op_access(h, id, eflags);
	uint8_t i;

	// copy to access but zero out CS_AC_IGNORE
	for(i = 0; arr[i]; i++) {
		if (arr[i] != CS_AC_IGNORE)
			access[i] = arr[i];
		else
			access[i] = 0;
	}

	// mark the end of array
	access[i] = 0;
#endif
}