bbs_alignment

This commit is contained in:
Dima Turchenkov 2015-12-10 17:46:10 +03:00 committed by pancake
parent 6dc0bd41c1
commit c7fdb730ee
3 changed files with 10 additions and 1 deletions

View File

@ -786,7 +786,7 @@ R_API int r_anal_fcn(RAnal *anal, RAnalFunction *fcn, ut64 addr, ut8 *buf, ut64
// set function size as length of continuous sequence of bbs
r_list_sort (fcn->bbs, &cmpaddr);
r_list_foreach (fcn->bbs, iter, bb) {
if (endaddr != bb->addr) break;
if (endaddr < bb->addr - anal->opt.bbs_alignment) break;
endaddr += bb->size;
}
r_anal_fcn_resize(fcn, endaddr - fcn->addr);

View File

@ -1290,6 +1290,13 @@ static int cb_anal_followbrokenfcnsrefs(void *user, void *data) {
return true;
}
static int cb_anal_bbs_alignment(void *user, void *data) {
RCore *core = (RCore*) user;
RConfigNode *node = (RConfigNode*) data;
core->anal->opt.bbs_alignment = node->i_value;
return true;
}
#define SLURP_LIMIT (10*1024*1024)
R_API int r_core_config_init(RCore *core) {
int i;
@ -1339,6 +1346,7 @@ R_API int r_core_config_init(RCore *core) {
SETCB("anal.followbrokenfcnsrefs", "false", &cb_anal_followbrokenfcnsrefs, "Follow function references as well if function analysis was failed");
SETCB("anal.searchstringrefs", "false", &cb_anal_searchstringrefs, "Search string references in data references");
SETCB("anal.bbs_alignment", "0x10", &cb_anal_bbs_alignment, "Possible space between basic blocks");
SETPREF("esil.prestep", "true", "Step before esil evaluation in `de` commands");
SETCB("esil.debug", "false", &cb_esildebug, "Show ESIL debug info");

View File

@ -572,6 +572,7 @@ typedef struct r_anal_options_t {
int followdatarefs;
int searchstringrefs;
int followbrokenfcnsrefs;
int bbs_alignment;
int afterjmp; // continue analysis after jmp eax or forward jmp // option
int recont; // continue on recurse analysis mode
int eobjmp; // option