Some more tuning to bring back the good analysis times

This commit is contained in:
pancake 2014-11-25 02:07:01 +01:00
parent 0a6d2f4cdb
commit d503b72801
3 changed files with 21 additions and 6 deletions

View File

@ -7,7 +7,7 @@
#define FCN_DEPTH 16
#define JMP_IS_EOB 1
#define JMP_IS_EOB_RANGE 512
#define JMP_IS_EOB_RANGE 32
#define CALL_IS_EOB 0
// 64KB max size
@ -414,7 +414,17 @@ repeat:
#endif
}
#endif
}
} else {
/* if not eobjmp. a jump will break the function if jumps before the begining of the function */
if (op.jump < fcn->addr) {
if (!overlapped) {
bb->jump = op.jump;
bb->fail = UT64_MAX;
}
FITFCNSZ();
return R_ANAL_RET_END;
}
}
break;
case R_ANAL_OP_TYPE_CJMP:
#define recurseAt(x) \

View File

@ -844,7 +844,7 @@ R_API int r_core_config_init(RCore *core) {
SETICB("anal.from", -1, (RConfigCallback)&cb_anal_from, "Minimum address in the anal.limits range");
SETICB("anal.to", -1, (RConfigCallback)&cb_anal_from, "Last address to be analized (see anal.limits)");
SETCB("anal.eobjmp", "true", &cb_analeobjmp, "jmp is end of block mode (option)");
SETCB("anal.eobjmp", "false", &cb_analeobjmp, "jmp is end of block mode (option)");
SETI("anal.depth", 16, "Max depth at code analysis"); // XXX: warn if depth is > 50 .. can be problematic
SETICB("anal.sleep", 0, &cb_analsleep, "Sleep some usecs before analyzing more. Avoid 100% cpu usage");
SETPREF("anal.hasnext", "true", "Continue analysis after each function");

View File

@ -1520,15 +1520,20 @@ static void handle_print_dwarf (RCore *core, RDisasmState *ds) {
if (len<30) len = 30-len;
if (ds->sl) {
if ((!ds->osl || (ds->osl && strcmp (ds->sl, ds->osl)))) {
char *line = strdup (ds->sl);
r_str_replace_char (line, '\t', ' ');
r_str_replace_char (line, '\x1b', ' ');
r_str_replace_char (line, '\r', ' ');
r_str_replace_char (line, '\n', '\x00');
handle_set_pre (ds, " ");
handle_comment_align (core, ds);
if (ds->show_color)
r_cons_printf ("%s ; %s"Color_RESET"%s",
ds->pal_comment, ds->sl, ds->pre);
else r_cons_printf (" ; %s%s", ds->sl, ds->pre);
r_cons_printf ("%s ; %s"Color_RESET, ds->pal_comment, line);
else r_cons_printf (" ; %s", line);
free (ds->osl);
ds->osl = ds->sl;
ds->sl = NULL;
free (line);
}
}
}