Browse code

libclamav: added matchicon dconf

Kevin Lin authored on 2014/03/06 02:47:41
Showing 3 changed files
... ...
@@ -64,7 +64,7 @@ static struct dconf_module modules[] = {
64 64
     { "PE",     "MD5SECT",      PE_CONF_MD5SECT,        1 },
65 65
     { "PE",     "UPX",      PE_CONF_UPX,        1 },
66 66
     { "PE",     "FSG",      PE_CONF_FSG,        1 },
67
-    { "PE",         "SWIZZOR",      PE_CONF_SWIZZOR,        1 },
67
+    { "PE",     "SWIZZOR",      PE_CONF_SWIZZOR,        1 },
68 68
 
69 69
     { "PE",     "PETITE",       PE_CONF_PETITE,     1 },
70 70
     { "PE",     "PESPIN",       PE_CONF_PESPIN,     1 },
... ...
@@ -78,6 +78,7 @@ static struct dconf_module modules[] = {
78 78
     { "PE",     "CATALOG",      PE_CONF_CATALOG,        1 },
79 79
     { "PE",     "DISABLECERT",  PE_CONF_DISABLECERT,    0 },
80 80
     { "PE",     "DUMPCERT",     PE_CONF_DUMPCERT,       0 },
81
+    { "PE",     "MATCHICON",     PE_CONF_MATCHICON,       1 },
81 82
 
82 83
     { "ELF",        NULL,       0x1,            1 },
83 84
 
... ...
@@ -64,6 +64,7 @@ struct cli_dconf {
64 64
 #define PE_CONF_CATALOG	    0x10000
65 65
 #define PE_CONF_DISABLECERT 0x20000
66 66
 #define PE_CONF_DUMPCERT    0x40000
67
+#define PE_CONF_MATCHICON   0x80000
67 68
 
68 69
 /* Archive flags */
69 70
 #define ARCH_CONF_RAR	    0x1
... ...
@@ -546,7 +546,7 @@ int cli_checkfp(unsigned char *digest, size_t size, cli_ctx *ctx)
546 546
 
547 547
 static int matchicon(cli_ctx *ctx, struct cli_exe_info *exeinfo, const char *grp1, const char *grp2)
548 548
 {
549
-	icon_groupset iconset;
549
+    icon_groupset iconset;
550 550
 
551 551
     if(!ctx ||
552 552
        !ctx->engine ||
... ...
@@ -556,6 +556,9 @@ static int matchicon(cli_ctx *ctx, struct cli_exe_info *exeinfo, const char *grp
556 556
        !exeinfo->res_addr
557 557
     ) return CL_CLEAN;
558 558
 
559
+    if (!(ctx->dconf->pe & PE_CONF_MATCHICON))
560
+        return CL_CLEAN;
561
+
559 562
     cli_icongroupset_init(&iconset);
560 563
     cli_icongroupset_add(grp1 ? grp1 : "*", &iconset, 0, ctx);
561 564
     cli_icongroupset_add(grp2 ? grp2 : "*", &iconset, 1, ctx);