Use fastcall in emustr on function calls ##disasm

This commit is contained in:
fcasal 2018-10-30 22:43:28 +00:00 committed by radare
parent 13bfc1e56f
commit 7117f2a76c
3 changed files with 15 additions and 8 deletions

View File

@ -3130,7 +3130,7 @@ static void found_xref(RCore *core, ut64 at, ut64 xref_to, RAnalRefType type, in
// Add to SDB
if (xref_to) {
r_anal_xrefs_set (core->anal, at, xref_to, type);
}
}
} else if (rad == 'j') {
// Output JSON
if (count > 0) {
@ -3193,7 +3193,7 @@ R_API int r_core_anal_search_xrefs(RCore *core, ut64 from, ut64 to, int rad) {
eprintf ("Error: cannot allocate a temp block\n");
free (buf);
return -1;
}
}
if (rad == 'j') {
r_cons_printf ("{");
}

View File

@ -4379,15 +4379,22 @@ static void ds_print_esil_anal(RDisasmState *ds) {
// function name not resolved
nargs = DEFAULT_NARGS;
if (fcn) {
nargs = fcn->nargs;
// @TODO: fcn->nargs should be updated somewhere and used here instead
nargs = r_anal_var_count (core->anal, fcn, 's', 1) +
r_anal_var_count (core->anal, fcn, 'b', 1) +
r_anal_var_count (core->anal, fcn, 'r', 1);
}
if (nargs > 0) {
ds_comment_middle (ds, "; CALL: ");
if (fcn_name) {
ds_comment_middle (ds, "; %s(", fcn_name);
} else {
ds_comment_middle (ds, "; 0x%"PFMT64x"(", pcv);
}
for (i = 0; i < nargs; i++) {
ut64 v = r_debug_arg_get (core->dbg, R_ANAL_CC_TYPE_STDCALL, i);
ut64 v = r_debug_arg_get (core->dbg, R_ANAL_CC_TYPE_FASTCALL, i);
ds_comment_middle (ds, "%s0x%"PFMT64x, i?", ":"", v);
}
ds_comment_end (ds, "");
ds_comment_end (ds, ")");
}
}
r_reg_setv (core->anal->reg, sp, spv); // reset stack ptr

View File

@ -194,8 +194,8 @@ enum {
R_ANAL_FQUALIFIER_VIRTUAL = 5,
};
/*--------------------Function Convnetions-----------*/
//XXX dont use then in the future
/*--------------------Function Conventions-----------*/
//XXX dont use them in the future
#define R_ANAL_CC_TYPE_STDCALL 0
#define R_ANAL_CC_TYPE_PASCAL 1
#define R_ANAL_CC_TYPE_FASTCALL 'A' // syscall