mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-26 09:06:02 +00:00
Config variables for jmp/cjmp references
This commit is contained in:
parent
412934d20e
commit
ad6581f265
@ -504,7 +504,8 @@ repeat:
|
||||
return R_ANAL_RET_END;
|
||||
}
|
||||
if (anal->opt.bbsplit) {
|
||||
(void) r_anal_fcn_xref_add (anal, fcn, op.addr, op.jump, R_ANAL_REF_TYPE_CODE);
|
||||
if (anal->opt.jmpref)
|
||||
(void) r_anal_fcn_xref_add (anal, fcn, op.addr, op.jump, R_ANAL_REF_TYPE_CODE);
|
||||
if (!overlapped) {
|
||||
bb->jump = op.jump;
|
||||
bb->fail = UT64_MAX;
|
||||
@ -512,9 +513,8 @@ repeat:
|
||||
recurseAt (op.jump);
|
||||
gotoBeachRet ();
|
||||
} else {
|
||||
if (!r_anal_fcn_xref_add (anal, fcn, op.addr, op.jump,
|
||||
R_ANAL_REF_TYPE_CODE)) {
|
||||
}
|
||||
if (anal->opt.jmpref)
|
||||
(void) r_anal_fcn_xref_add (anal, fcn, op.addr, op.jump, R_ANAL_REF_TYPE_CODE);
|
||||
if (continue_after_jump) {
|
||||
recurseAt (op.jump);
|
||||
recurseAt (op.fail);
|
||||
|
@ -1240,6 +1240,20 @@ static int cb_anal_jmptbl(void *user, void *data) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static int cb_anal_cjmpref(void *user, void *data) {
|
||||
RCore *core = (RCore*) user;
|
||||
RConfigNode *node = (RConfigNode*) data;
|
||||
core->anal->opt.cjmpref = node->i_value;
|
||||
return true;
|
||||
}
|
||||
|
||||
static int cb_anal_jmpref(void *user, void *data) {
|
||||
RCore *core = (RCore*) user;
|
||||
RConfigNode *node = (RConfigNode*) data;
|
||||
core->anal->opt.jmpref = node->i_value;
|
||||
return true;
|
||||
}
|
||||
|
||||
#define SLURP_LIMIT (10*1024*1024)
|
||||
R_API int r_core_config_init(RCore *core) {
|
||||
int i;
|
||||
@ -1281,6 +1295,9 @@ R_API int r_core_config_init(RCore *core) {
|
||||
|
||||
SETCB("anal.jmptbl", "false", &cb_anal_jmptbl, "Analyze jump tables in switch statements");
|
||||
|
||||
SETCB("anal.cjmpref", "false", &cb_anal_cjmpref, "Create references for conditional jumps");
|
||||
SETCB("anal.jmpref", "true", &cb_anal_jmpref, "Create references for unconditional jumps");
|
||||
|
||||
SETPREF("esil.prestep", "true", "Step before esil evaluation in `de` commands");
|
||||
SETCB("esil.debug", "false", &cb_esildebug, "Show ESIL debug info");
|
||||
SETICB("esil.gotolimit", core->anal->esil_goto_limit, &cb_gotolimit, "Maximum number of gotos per ESIL expression");
|
||||
|
@ -567,6 +567,7 @@ typedef struct r_anal_callbacks_t {
|
||||
|
||||
typedef struct r_anal_options_t {
|
||||
int cjmpref;
|
||||
int jmpref;
|
||||
int afterjmp; // continue analysis after jmp eax or forward jmp // option
|
||||
int recont; // continue on recurse analysis mode
|
||||
int eobjmp; // option
|
||||
|
Loading…
x
Reference in New Issue
Block a user