Skip to content

Commit 0c60e25

Browse files
radaretrufae
authored andcommitted
Add anal.fcnalign config var ##analysis
1 parent 0b8d859 commit 0c60e25

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

libr/core/cconfig.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3526,6 +3526,7 @@ R_API int r_core_config_init(RCore *core) {
35263526

35273527
/* anal */
35283528
SETBPREF ("anal.onchange", "false", "automatically reanalyze function if any byte has changed (EXPERIMENTAL)");
3529+
SETI ("anal.fcnalign", 0, "use ArchInfo.funcAlign if zero, otherwise override (used by aap and others)");
35293530
SETPREF ("anal.fcnprefix", "fcn", "prefix new function names with this");
35303531
const char *analcc = r_anal_cc_default (core->anal);
35313532
SETCB ("anal.cc", analcc? analcc: "", (RConfigCallback)&cb_analcc, "specify default calling convention");

libr/core/cmd_search.inc.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,12 @@ R_API int r_core_search_prelude(RCore *core, ut64 from, ut64 to, const ut8 *buf,
428428
}
429429
r_search_reset (core->search, R_SEARCH_KEYWORD);
430430
RSearchKeyword *kw = r_search_keyword_new (buf, blen, mask, mlen, NULL);
431-
const int funcali = r_anal_archinfo (core->anal, R_ARCH_INFO_FUNC_ALIGN);
432-
if (funcali > 1) {
433-
kw->align = funcali;
431+
const int afuncali = r_anal_archinfo (core->anal, R_ARCH_INFO_FUNC_ALIGN);
432+
const int ufuncali = r_config_get_i (core->config, "cfg.fcnalign");
433+
if (ufuncali > 1) {
434+
kw->align = ufuncali;
435+
} else if (afuncali > 1) {
436+
kw->align = afuncali;
434437
}
435438
r_search_kw_add (core->search, kw);
436439
r_search_begin (core->search);

0 commit comments

Comments
 (0)