Skip to content

Commit

Permalink
FIx aaa for x86-32 systems and ensure aaef is used ##analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Apr 11, 2024
1 parent a4bfe47 commit 38dd5db
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
11 changes: 9 additions & 2 deletions libr/core/cmd_anal.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -13727,17 +13727,24 @@ static int cmd_anal_all(RCore *core, const char *input) {
logline (core, 68, "Finding xrefs in noncode section (e anal.in=io.maps.x)");
r_core_cmd_call (core, "aavq");
r_core_task_yield (&core->tasks);
}
if (!r_str_startswith (asm_arch, "hex")) {
// XXX moving this oustide the x86 guard breaks some tests, missing types
if (cfg_debug) {
logline (core, 70, "Skipping function emulation in debugger mode (aaef)");
// nothing to do
} else {
bool use_pcache = false;
const bool io_cache = r_config_get_i (core->config, "io.pcache");
r_config_set_b (core->config, "io.pcache", true);
if (use_pcache) {
r_config_set_b (core->config, "io.pcache", true);
}
logline (core, 70, "Emulate functions to find computed references (aaef)");
r_core_cmd_call (core, "aaef");
r_core_task_yield (&core->tasks);
r_config_set_b (core->config, "io.pcache", io_cache);
if (use_pcache) {
r_config_set_b (core->config, "io.pcache", io_cache);
}
}
}
if (r_cons_is_breaked ()) {
Expand Down
17 changes: 17 additions & 0 deletions test/db/anal/emu
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
NAME=emu x86-32 aaef via aaa
FILE=bins/elf/libtest_32.so
CMDS=<<EOF
aaa
s 0x00000500
pd 1
axt
EOF
EXPECT=<<EOF
;-- section..rodata:
;-- str.Hello_World__n:
; STRN XREF from sym.test @ 0x4d3(r)
0x00000500 .string "Hello World!\n" ; len=14 ; [13] -r-- section size 14 named .rodata
sym.test 0x4d3 [STRN:r--] lea ecx, str.Hello_World__n
EOF
RUN

NAME=emu ret0
FILE=bins/mach0/ret0ret1restr
ARGS=-2
Expand Down

0 comments on commit 38dd5db

Please sign in to comment.