From 8a73d190f214cbaa5d362f82845a91c123a303b7 Mon Sep 17 00:00:00 2001 From: pancake Date: Wed, 15 Nov 2023 16:03:29 +0100 Subject: [PATCH] aap /rc and others use R_LOG_DEBUG now to be less noisy for batch runs --- libr/core/canal.c | 12 ++++++------ libr/core/cmd_search.inc.c | 11 +++++------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/libr/core/canal.c b/libr/core/canal.c index a29de79e3eb3d..8777df643abff 100644 --- a/libr/core/canal.c +++ b/libr/core/canal.c @@ -4160,6 +4160,11 @@ static bool opiscall(RCore *core, RAnalOp *aop, ut64 addr, const ut8* buf, int l // TODO(maskray) RAddrInterval API #define OPSZ 8 R_API int r_core_anal_search(RCore *core, ut64 from, ut64 to, ut64 ref, int mode) { + r_return_val_if_fail (core, -1); + if (!ref) { + R_LOG_ERROR ("Null reference search is not supported"); + return -1; + } ut8 *buf = (ut8 *)malloc (core->blocksize); if (!buf) { return -1; @@ -4182,11 +4187,6 @@ R_API int r_core_anal_search(RCore *core, ut64 from, ut64 to, ut64 ref, int mode // ??? // XXX must read bytes correctly do_bckwrd_srch = bckwrds = core->search->bckwrds; - if (!ref) { - R_LOG_ERROR ("Null reference search is not supported"); - free (buf); - return -1; - } r_cons_break_push (NULL, NULL); if (core->blocksize > OPSZ) { if (bckwrds) { @@ -4200,7 +4200,7 @@ R_API int r_core_anal_search(RCore *core, ut64 from, ut64 to, ut64 ref, int mode at = from; } while ((!bckwrds && at < to) || bckwrds) { - eprintf ("\r[0x%08"PFMT64x"-0x%08"PFMT64x"] ", at, to); + R_LOG_DEBUG ("[0x%08"PFMT64x"-0x%08"PFMT64x"]", at, to); if (r_cons_is_breaked ()) { break; } diff --git a/libr/core/cmd_search.inc.c b/libr/core/cmd_search.inc.c index 0a5e220ed76e7..c1ac14b518718 100644 --- a/libr/core/cmd_search.inc.c +++ b/libr/core/cmd_search.inc.c @@ -4091,7 +4091,7 @@ static int cmd_search(void *data, const char *input) { RListIter *iter; RIOMap *map; r_list_foreach (param.boundaries, iter, map) { - eprintf ("-- 0x%"PFMT64x" 0x%"PFMT64x"\n", r_io_map_begin (map), r_io_map_end (map)); + R_LOG_DEBUG ("-- 0x%"PFMT64x" 0x%"PFMT64x, r_io_map_begin (map), r_io_map_end (map)); r_core_anal_search (core, r_io_map_begin (map), r_io_map_end (map), n, 0); } } @@ -4101,7 +4101,7 @@ static int cmd_search(void *data, const char *input) { RListIter *iter; RIOMap *map; r_list_foreach (param.boundaries, iter, map) { - eprintf ("-- 0x%"PFMT64x" 0x%"PFMT64x"\n", r_io_map_begin (map), r_io_map_end (map)); + R_LOG_DEBUG ("-- 0x%"PFMT64x" 0x%"PFMT64x, r_io_map_begin (map), r_io_map_end (map)); r_core_anal_search (core, r_io_map_begin (map), r_io_map_end (map), n, 'c'); } } @@ -4111,7 +4111,7 @@ static int cmd_search(void *data, const char *input) { RListIter *iter; RIOMap *map; r_list_foreach (param.boundaries, iter, map) { - eprintf ("-- 0x%"PFMT64x" 0x%"PFMT64x"\n", r_io_map_begin (map), r_io_map_end (map)); + R_LOG_DEBUG ("-- 0x%"PFMT64x" 0x%"PFMT64x, r_io_map_begin (map), r_io_map_end (map)); ut64 refptr = r_num_math (core->num, input + 2); ut64 curseek = core->offset; r_core_seek (core, r_io_map_begin (map), true); @@ -4145,7 +4145,7 @@ static int cmd_search(void *data, const char *input) { RListIter *iter; RIOMap *map; r_list_foreach (param.boundaries, iter, map) { - eprintf ("-- 0x%"PFMT64x" 0x%"PFMT64x"\n", r_io_map_begin (map), r_io_map_end (map)); + R_LOG_DEBUG ("-- 0x%"PFMT64x" 0x%"PFMT64x, r_io_map_begin (map), r_io_map_end (map)); r_core_anal_search (core, r_io_map_begin (map), r_io_map_end (map), n, input[1]); } } @@ -4159,8 +4159,7 @@ static int cmd_search(void *data, const char *input) { ut64 from = r_io_map_begin (map); ut64 to = r_io_map_end (map); if (input[param_offset - 1] == ' ') { - r_core_anal_search (core, from, to, - r_num_math (core->num, input + 2), 0); + r_core_anal_search (core, from, to, r_num_math (core->num, input + 2), 0); do_ref_search (core, r_num_math (core->num, input + 2), from, to, ¶m); } else { r_core_anal_search (core, from, to, core->offset, 0);