Add default noreturn functions, adjust xrefs and fix regression in type

This commit is contained in:
pancake 2016-02-16 03:24:47 +01:00
parent 3140749266
commit 0e69bfd541
3 changed files with 17 additions and 4 deletions

View File

@ -449,9 +449,7 @@ static int cmd_meta_hsdmf (RCore *core, const char *input) {
char *rep = strchr (input + 2, '[');
if (!rep) rep = strchr (input + 2, ' ');
if (rep) {
rep++;
repeat = r_num_get (core->num, rep);
*rep = 0;
repeat = r_num_get (core->num, rep+1);
}
}
int repcnt = 0;

View File

@ -1197,6 +1197,18 @@ R_API int r_core_init(RCore *core) {
core->assembler->num = core->num;
r_asm_set_user_ptr (core->assembler, core);
core->anal = r_anal_new ();
/* default noreturn functions */
/* osx */
r_anal_noreturn_add (core->anal, "sym.imp.__assert_rtn", UT64_MAX);
r_anal_noreturn_add (core->anal, "sym.imp.exit", UT64_MAX);
r_anal_noreturn_add (core->anal, "sym.imp._exit", UT64_MAX);
r_anal_noreturn_add (core->anal, "sym.imp.__stack_chk_fail", UT64_MAX);
/* linux */
r_anal_noreturn_add (core->anal, "sym.__assert_fail", UT64_MAX);
r_anal_noreturn_add (core->anal, "sym.abort", UT64_MAX);
r_anal_noreturn_add (core->anal, "sym.exit", UT64_MAX);
core->anal->meta_spaces.cb_printf = r_cons_printf;
core->anal->cb.on_fcn_new = on_fcn_new;
core->anal->cb.on_fcn_delete = on_fcn_delete;

View File

@ -640,6 +640,9 @@ static void handle_show_xrefs (RCore *core, RDisasmState *ds) {
xrefs = r_anal_xref_get (core->anal, ds->at);
if (!xrefs) return;
if (r_list_length (xrefs) > ds->maxrefs) {
int cols = r_cons_get_size (NULL);
cols -= 15;
cols /= 23;
RAnalFunction *f = r_anal_get_fcn_in (core->anal,
ds->at, R_ANAL_FCN_TYPE_NULL);
beginline (core, ds, f);
@ -648,7 +651,7 @@ static void handle_show_xrefs (RCore *core, RDisasmState *ds) {
r_list_foreach (xrefs, iter, refi) {
r_cons_printf ("%s 0x%08"PFMT64x" ",
r_anal_xrefs_type_tostring (refi->type), refi->addr);
if (count == 2) {
if (count == cols) {
if (iter->n) {
r_cons_newline ();
beginline (core, ds, f);