From 90eee1b4e1adebeee1ff8744157e7725155cdeb9 Mon Sep 17 00:00:00 2001 From: pancake Date: Fri, 17 Nov 2023 11:59:58 +0100 Subject: [PATCH] A bit verboser esil step --- libr/core/cmd_anal.inc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libr/core/cmd_anal.inc.c b/libr/core/cmd_anal.inc.c index bc0de3ebc9b7a..7afa52430921a 100644 --- a/libr/core/cmd_anal.inc.c +++ b/libr/core/cmd_anal.inc.c @@ -6410,7 +6410,8 @@ R_API int r_core_esil_step(RCore *core, ut64 until_addr, const char *until_expr, return 0; } char *pcname = strdup (_pcname); - const bool r2wars = r_config_get_b (core->config, "cfg.r2wars"); + const bool is_x86 = r_str_startswith (r_config_get (core->config, "asm.arch"), "x86"); + const bool r2wars = is_x86 && r_config_get_b (core->config, "cfg.r2wars"); const bool breakoninvalid = r_config_get_b (core->config, "esil.breakoninvalid"); const int esiltimeout = r_config_get_i (core->config, "esil.timeout"); ut64 startTime = 0; @@ -6422,6 +6423,7 @@ R_API int r_core_esil_step(RCore *core, ut64 until_addr, const char *until_expr, ut64 addr = -1; ut64 oaddr = -1; int minopsz = r_arch_info (core->anal->arch, R_ARCH_INFO_MIN_OP_SIZE); + int dataAlign = r_anal_archinfo (esil->anal, R_ANAL_ARCHINFO_DATA_ALIGN); ut64 naddr = addr + minopsz; bool notfirst = false; for (; true; r_anal_op_fini (&op)) { @@ -6470,7 +6472,6 @@ R_API int r_core_esil_step(RCore *core, ut64 until_addr, const char *until_expr, return_tail (1); } } - int dataAlign = r_anal_archinfo (esil->anal, R_ANAL_ARCHINFO_DATA_ALIGN); if (dataAlign > 1) { if (addr % dataAlign) { if (esil->cmd && R_STR_ISNOTEMPTY (esil->cmd_trap)) { @@ -6484,7 +6485,7 @@ R_API int r_core_esil_step(RCore *core, ut64 until_addr, const char *until_expr, } (void) r_io_read_at (core->io, addr, code, sizeof (code)); // TODO: sometimes this is dupe - ret = r_anal_op (core->anal, &op, addr, code, sizeof (code), R_ARCH_OP_MASK_ESIL | R_ARCH_OP_MASK_HINT); + ret = r_anal_op (core->anal, &op, addr, code, sizeof (code), R_ARCH_OP_MASK_BASIC | R_ARCH_OP_MASK_ESIL | R_ARCH_OP_MASK_HINT); naddr = addr + op.size; // if type is JMP then we execute the next N instructions // update the esil pointer because RAnal.op() can change it @@ -6549,6 +6550,7 @@ R_API int r_core_esil_step(RCore *core, ut64 until_addr, const char *until_expr, r_debug_trace_op (core->dbg, &op); core->dbg->reg = reg; } else if (R_STR_ISNOTEMPTY (e)) { + R_LOG_DEBUG ("esil_parse: %s", e); r_esil_parse (esil, e); if (esil->trap) { R_LOG_WARN ("ESIL TRAP %d/%d ON %s at 0x%08"PFMT64x,