Fix all-match mode bug in PE section hash scans

The PE section hash scanning code didn't implement the all-match check.
While this check isn't the ideal implementation for all-match mode...
(see the commit message for the previous commit)
...it's simple enough to add the all-match check here for now.
This commit is contained in:
Micah Snyder 2021-10-11 16:40:20 -07:00 committed by Micah Snyder
parent eee290a69e
commit c24654d244

View file

@ -2847,13 +2847,17 @@ int cli_scanpe(cli_ctx *ctx)
if ((DCONF & PE_CONF_MD5SECT) && ctx->engine->hm_mdb) { if ((DCONF & PE_CONF_MD5SECT) && ctx->engine->hm_mdb) {
ret = scan_pe_mdb(ctx, &(peinfo->sections[i])); ret = scan_pe_mdb(ctx, &(peinfo->sections[i]));
if (ret != CL_CLEAN) { if (ret != CL_CLEAN) {
// TODO Handle allmatch if (ret == CL_VIRUS && !SCAN_ALLMATCHES) {
if (ret != CL_VIRUS) cli_dbgmsg("------------------------------------\n");
cli_exe_info_destroy(peinfo);
return ret;
} else if (ret != CL_VIRUS) {
cli_errmsg("cli_scanpe: scan_pe_mdb failed: %s!\n", cl_strerror(ret)); cli_errmsg("cli_scanpe: scan_pe_mdb failed: %s!\n", cl_strerror(ret));
cli_dbgmsg("------------------------------------\n"); cli_dbgmsg("------------------------------------\n");
cli_exe_info_destroy(peinfo); cli_exe_info_destroy(peinfo);
return ret; return ret;
}
} }
} }
} }