Add r_core_prevop_addr_force() with fallback

This commit is contained in:
Florian Märkl 2017-12-16 17:30:38 +01:00 committed by radare
parent 52f5bb123d
commit 7028e3113d
2 changed files with 12 additions and 1 deletions

View File

@ -765,6 +765,16 @@ R_API bool r_core_prevop_addr(RCore *core, ut64 start_addr, int numinstrs, ut64
return false;
}
// Like r_core_prevop_addr(), but also uses fallback from prevop_addr() if
// no anal info is available.
R_API ut64 r_core_prevop_addr_force(RCore *core, ut64 start_addr, int numinstrs) {
int i;
for (i = 0; i < numinstrs; ++i) {
start_addr = prevop_addr (core, start_addr);
}
return start_addr;
}
static void reset_print_cur(RPrint *p) {
p->cur = 0;
p->ocur = -1;

View File

@ -251,7 +251,8 @@ R_API int r_core_is_valid_offset (RCore *core, ut64 offset);
R_API int r_core_shift_block(RCore *core, ut64 addr, ut64 b_size, st64 dist);
R_API void r_core_visual_prompt_input (RCore *core);
R_API int r_core_visual_refs(RCore *core, bool xref);
R_API bool r_core_prevop_addr (RCore* core, ut64 start_addr, int numinstrs, ut64* prev_addr);
R_API bool r_core_prevop_addr(RCore* core, ut64 start_addr, int numinstrs, ut64* prev_addr);
R_API ut64 r_core_prevop_addr_force(RCore *core, ut64 start_addr, int numinstrs);
R_API bool r_core_visual_hudstuff(RCore *core);
R_API int r_core_visual_classes(RCore *core);
R_API int r_core_visual_types(RCore *core);