From e7da4f65686881ffdc3c690a0acff369f4dd2eb6 Mon Sep 17 00:00:00 2001 From: Kevin Lin Date: Wed, 5 Mar 2014 12:47:41 -0500 Subject: [PATCH] libclamav: added matchicon dconf --- libclamav/dconf.c | 3 ++- libclamav/dconf.h | 1 + libclamav/matcher.c | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libclamav/dconf.c b/libclamav/dconf.c index a1cd57e3e..7c47bf34c 100644 --- a/libclamav/dconf.c +++ b/libclamav/dconf.c @@ -64,7 +64,7 @@ static struct dconf_module modules[] = { { "PE", "MD5SECT", PE_CONF_MD5SECT, 1 }, { "PE", "UPX", PE_CONF_UPX, 1 }, { "PE", "FSG", PE_CONF_FSG, 1 }, - { "PE", "SWIZZOR", PE_CONF_SWIZZOR, 1 }, + { "PE", "SWIZZOR", PE_CONF_SWIZZOR, 1 }, { "PE", "PETITE", PE_CONF_PETITE, 1 }, { "PE", "PESPIN", PE_CONF_PESPIN, 1 }, @@ -78,6 +78,7 @@ static struct dconf_module modules[] = { { "PE", "CATALOG", PE_CONF_CATALOG, 1 }, { "PE", "DISABLECERT", PE_CONF_DISABLECERT, 0 }, { "PE", "DUMPCERT", PE_CONF_DUMPCERT, 0 }, + { "PE", "MATCHICON", PE_CONF_MATCHICON, 1 }, { "ELF", NULL, 0x1, 1 }, diff --git a/libclamav/dconf.h b/libclamav/dconf.h index 7e6ed3575..900f6226b 100644 --- a/libclamav/dconf.h +++ b/libclamav/dconf.h @@ -64,6 +64,7 @@ struct cli_dconf { #define PE_CONF_CATALOG 0x10000 #define PE_CONF_DISABLECERT 0x20000 #define PE_CONF_DUMPCERT 0x40000 +#define PE_CONF_MATCHICON 0x80000 /* Archive flags */ #define ARCH_CONF_RAR 0x1 diff --git a/libclamav/matcher.c b/libclamav/matcher.c index 14d6901a9..0e9b5aea9 100644 --- a/libclamav/matcher.c +++ b/libclamav/matcher.c @@ -546,7 +546,7 @@ int cli_checkfp(unsigned char *digest, size_t size, cli_ctx *ctx) static int matchicon(cli_ctx *ctx, struct cli_exe_info *exeinfo, const char *grp1, const char *grp2) { - icon_groupset iconset; + icon_groupset iconset; if(!ctx || !ctx->engine || @@ -556,6 +556,9 @@ static int matchicon(cli_ctx *ctx, struct cli_exe_info *exeinfo, const char *grp !exeinfo->res_addr ) return CL_CLEAN; + if (!(ctx->dconf->pe & PE_CONF_MATCHICON)) + return CL_CLEAN; + cli_icongroupset_init(&iconset); cli_icongroupset_add(grp1 ? grp1 : "*", &iconset, 0, ctx); cli_icongroupset_add(grp2 ? grp2 : "*", &iconset, 1, ctx);