Skip to content

Commit

Permalink
Add anal.fcnalign config var ##analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
radare authored and trufae committed Nov 27, 2024
1 parent 0b8d859 commit 0c60e25
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions libr/core/cconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -3526,6 +3526,7 @@ R_API int r_core_config_init(RCore *core) {

/* anal */
SETBPREF ("anal.onchange", "false", "automatically reanalyze function if any byte has changed (EXPERIMENTAL)");
SETI ("anal.fcnalign", 0, "use ArchInfo.funcAlign if zero, otherwise override (used by aap and others)");
SETPREF ("anal.fcnprefix", "fcn", "prefix new function names with this");
const char *analcc = r_anal_cc_default (core->anal);
SETCB ("anal.cc", analcc? analcc: "", (RConfigCallback)&cb_analcc, "specify default calling convention");
Expand Down
9 changes: 6 additions & 3 deletions libr/core/cmd_search.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,12 @@ R_API int r_core_search_prelude(RCore *core, ut64 from, ut64 to, const ut8 *buf,
}
r_search_reset (core->search, R_SEARCH_KEYWORD);
RSearchKeyword *kw = r_search_keyword_new (buf, blen, mask, mlen, NULL);
const int funcali = r_anal_archinfo (core->anal, R_ARCH_INFO_FUNC_ALIGN);
if (funcali > 1) {
kw->align = funcali;
const int afuncali = r_anal_archinfo (core->anal, R_ARCH_INFO_FUNC_ALIGN);
const int ufuncali = r_config_get_i (core->config, "cfg.fcnalign");
if (ufuncali > 1) {
kw->align = ufuncali;
} else if (afuncali > 1) {
kw->align = afuncali;
}
r_search_kw_add (core->search, kw);
r_search_begin (core->search);
Expand Down

0 comments on commit 0c60e25

Please sign in to comment.