Skip to content

Commit

Permalink
Only use anal hints in aac on arm 16/32 ##analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
radare authored and trufae committed Jun 11, 2024
1 parent a837a5d commit 2f4944f
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions libr/core/cmd_anal.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -9607,6 +9607,12 @@ static void _anal_calls(RCore *core, ut64 addr, ut64 addr_end, bool printCommand
minop = 1;
}
int setBits = r_config_get_i (core->config, "asm.bits");
bool armthumb_switches = false;
if (setBits == 16 || setBits == 32) {
if (r_str_startswith (r_config_get (core->config, "asm.arch"), "arm")) {
armthumb_switches = true;
}
}
r_cons_break_push (NULL, NULL);
bool valid = true;
while (addr < addr_end && !r_cons_is_breaked ()) {
Expand All @@ -9621,13 +9627,18 @@ static void _anal_calls(RCore *core, ut64 addr, ut64 addr_end, bool printCommand
addr += bsz;
continue;
}
RAnalHint *hint = r_anal_hint_get (core->anal, addr);
if (hint && hint->bits) {
setBits = hint->bits;
}
r_anal_hint_free (hint);
if (setBits != core->rasm->config->bits) {
r_config_set_i (core->config, "asm.bits", setBits);
if (armthumb_switches) {
// this thing is slow
RAnalHint *hint = r_anal_hint_get (core->anal, addr);
if (hint) {
if (hint->bits) {
setBits = hint->bits;
}
r_anal_hint_free (hint);
}
if (setBits != core->rasm->config->bits) {
r_config_set_i (core->config, "asm.bits", setBits);
}
}
if (r_anal_op (core->anal, &op, addr, buf + bufi, bsz - bufi, 0) > 0) {
if (op.size < 1) {
Expand Down

0 comments on commit 2f4944f

Please sign in to comment.