From 5de4a421d8737d3e509b796b390b7c16e9aef1de Mon Sep 17 00:00:00 2001 From: pancake Date: Mon, 23 Dec 2024 01:30:07 +0100 Subject: [PATCH 1/2] Do not change seek when priorizing fds in iova=0 ##io --- libr/core/cbin.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libr/core/cbin.c b/libr/core/cbin.c index 3d457021ad23d..824d8f133b1ed 100644 --- a/libr/core/cbin.c +++ b/libr/core/cbin.c @@ -1579,9 +1579,11 @@ static bool bin_entry(RCore *r, PJ *pj, int mode, ut64 laddr, int va, bool inifi free (s); r_table_free (table); } else if (IS_MODE_SET (mode)) { - if (entry) { - ut64 at = rva (r->bin, entry->paddr, entry->vaddr, va); - r_core_seek (r, at, false); + if (r_config_get_b (r->config, "io.va")) { + if (entry) { + ut64 at = rva (r->bin, entry->paddr, entry->vaddr, va); + r_core_seek (r, at, false); + } } } else if (IS_MODE_RAD (mode)) { r_cons_println ("'fs-"); @@ -4835,12 +4837,11 @@ R_API bool r_core_bin_info(RCore *core, int action, PJ *pj, int mode, int va, RC } if ((action & R_CORE_BIN_ACC_FIELDS)) { if (IS_MODE_SIMPLE (mode)) { - // ret &= bin_fields (core, NULL, mode, va); ret &= bin_fields (core, NULL, mode, va); // ret &= bin_header (core, mode); } else if (IS_MODE_NORMAL (mode)) { - // ret &= bin_header (core, mode); ret &= bin_fields (core, NULL, mode, va); + // ret &= bin_header (core, mode); } else { if ((action & R_CORE_BIN_ACC_HEADER) || action & R_CORE_BIN_ACC_FIELDS) { ret &= bin_fields (core, pj, mode, va); From a455e6b8d549e8569b33da49dee6a1333d71e4a0 Mon Sep 17 00:00:00 2001 From: pancake Date: Mon, 23 Dec 2024 01:33:48 +0100 Subject: [PATCH 2/2] add test --- test/db/cmd/cmd_io | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/db/cmd/cmd_io b/test/db/cmd/cmd_io index d36266b3c7644..451a36e507b13 100644 --- a/test/db/cmd/cmd_io +++ b/test/db/cmd/cmd_io @@ -142,3 +142,25 @@ nth vaddr bind type lib name 6 ---------- WEAK FUNC __cxa_finalize EOF RUN + +NAME=opseeks +FILE=bins/mach0/ls-m1 +CMDS=<