Honor Anal.Archinfo.Align for search.align in aav to bring back some true negatives

This commit is contained in:
pancake 2017-12-03 20:10:47 +01:00
parent 0828e5d429
commit 7e5c635e08
2 changed files with 4 additions and 3 deletions

View File

@ -5872,7 +5872,8 @@ static void cmd_anal_aav(RCore *core, const char *input) {
bool is_debug = r_config_get_i (core->config, "cfg.debug");
// pre
seti ("search.align", 4);
int archAlign = r_anal_archinfo (core->anal, R_ANAL_ARCHINFO_ALIGN);
seti ("search.align", archAlign);
int vsize = 4; // 32bit dword
if (core->assembler->bits == 64) {

View File

@ -2620,10 +2620,10 @@ R_API int r_core_search_value_in_range(RCore *core, RAddrInterval search_itv, ut
}
if (match) {
bool isValidMatch = true;
if (value % align) {
if (align && (value % align)) {
// ignored .. unless we are analyzing arm/thumb and lower bit is 1
isValidMatch = false;
if (maybeThumb && value & 1) {
if (maybeThumb && (value & 1)) {
isValidMatch = true;
}
}