|
|
|
@ -135,6 +135,8 @@ const char *ARM_reg_name(csh handle, unsigned int reg) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static insn_map insns[] = { |
|
|
|
|
{ 0, 0, { 0 }, { 0 }, { 0 }, 0, 0 }, // dummy item
|
|
|
|
|
|
|
|
|
|
{ ARM_ADCri, ARM_INS_ADC, { ARM_REG_CPSR, 0 }, { ARM_REG_CPSR, 0 }, { ARM_GRP_ARM, 0 }, 0, 0 }, |
|
|
|
|
{ ARM_ADCrr, ARM_INS_ADC, { ARM_REG_CPSR, 0 }, { ARM_REG_CPSR, 0 }, { ARM_GRP_ARM, 0 }, 0, 0 }, |
|
|
|
|
{ ARM_ADCrsi, ARM_INS_ADC, { ARM_REG_CPSR, 0 }, { ARM_REG_CPSR, 0 }, { ARM_GRP_ARM, 0 }, 0, 0 }, |
|
|
|
@ -2298,10 +2300,13 @@ static insn_map insns[] = { |
|
|
|
|
{ ARM_tUXTH, ARM_INS_UXTH, { 0 }, { 0 }, { ARM_GRP_THUMB, ARM_GRP_THUMB1ONLY, ARM_GRP_V6, 0 }, 0, 0 }, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static unsigned short *insn_cache = NULL; |
|
|
|
|
|
|
|
|
|
void ARM_get_insn_id(cs_insn *insn, unsigned int id, int detail) |
|
|
|
|
{ |
|
|
|
|
int i = insn_find(insns, ARR_SIZE(insns), id); |
|
|
|
|
if (i != -1) { |
|
|
|
|
int i = insn_find(insns, ARR_SIZE(insns), id, &insn_cache); |
|
|
|
|
if (i != 0) { |
|
|
|
|
insn->id = insns[i].mapid; |
|
|
|
|
|
|
|
|
|
if (detail) { |
|
|
|
@ -2788,11 +2793,19 @@ arm_reg ARM_map_insn(const char *name) |
|
|
|
|
|
|
|
|
|
bool ARM_rel_branch(unsigned int id) |
|
|
|
|
{ |
|
|
|
|
int i = insn_find(insns, ARR_SIZE(insns), id); |
|
|
|
|
if (i != -1) |
|
|
|
|
int i = insn_find(insns, ARR_SIZE(insns), id, &insn_cache); |
|
|
|
|
if (i != 0) |
|
|
|
|
return (insns[i].branch && !insns[i].indirect_branch); |
|
|
|
|
else { |
|
|
|
|
printf("ALERT: rel_branch() got incorrect id!\n"); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ARM_free_cache(void) |
|
|
|
|
{ |
|
|
|
|
if (insn_cache) |
|
|
|
|
free(insn_cache); |
|
|
|
|
|
|
|
|
|
insn_cache = NULL; |
|
|
|
|
} |
|
|
|
|