Browse code

bb#9858 - added target 14 for binary (unidentified) files

Kevin Lin authored on 2015/07/24 05:37:15
Showing 3 changed files
... ...
@@ -110,6 +110,8 @@ typedef enum {
110 110
     CL_TYPE_XDP,
111 111
     CL_TYPE_XML_WORD,
112 112
     CL_TYPE_XML_XL,
113
+
114
+    CL_TYPE_OTHER, /* on-the-fly, used for target 14 (OTHER) */
113 115
     CL_TYPE_IGNORED /* please don't add anything below */
114 116
 } cli_file_t;
115 117
 
... ...
@@ -163,7 +163,7 @@ struct cli_mtarget {
163 163
     uint8_t target_count; /* must be synced with non-zero values in the target array */
164 164
 };
165 165
 
166
-#define CLI_MTARGETS 14
166
+#define CLI_MTARGETS 15
167 167
 static const struct cli_mtarget cli_mtargets[CLI_MTARGETS] =  {
168 168
     { {0, 0},                                   "GENERIC",      0,  0, 1, 1 },
169 169
     { {CL_TYPE_MSEXE, 0},                       "PE",           1,  0, 1, 1 },
... ...
@@ -178,7 +178,8 @@ static const struct cli_mtarget cli_mtargets[CLI_MTARGETS] =  {
178 178
     { {CL_TYPE_PDF, 0},                         "PDF",         10,  1, 0, 1 },
179 179
     { {CL_TYPE_SWF, 0},                         "FLASH",       11,  1, 0, 1 },
180 180
     { {CL_TYPE_JAVA, 0},                        "JAVA",        12,  1, 0, 1 },
181
-    { {CL_TYPE_INTERNAL, 0},                    "INTERNAL",    13,  1, 0, 1 }
181
+    { {CL_TYPE_INTERNAL, 0},                    "INTERNAL",    13,  1, 0, 1 },
182
+    { {CL_TYPE_OTHER, 0},                       "OTHER",       14,  1, 0, 1 }
182 183
 };
183 184
 
184 185
 #define CLI_OFF_ANY         0xffffffff
... ...
@@ -3205,6 +3205,9 @@ static int magic_scandesc(cli_ctx *ctx, cli_file_t type)
3205 3205
 	    }
3206 3206
 	    perf_nested_stop(ctx, PERFT_PE, PERFT_SCAN);
3207 3207
 	    break;
3208
+	case CL_TYPE_BINARY_DATA:
3209
+	    ret = cli_fmap_scandesc(ctx, CL_TYPE_OTHER, 0, NULL, AC_SCAN_VIR, NULL, NULL);
3210
+	    break;
3208 3211
 	default:
3209 3212
 	    break;
3210 3213
     }