Browse code

bb#2544

aCaB authored on 2011/04/09 10:58:23
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Sat Apr  9 03:56:17 CEST 2011 (acab)
2
+------------------------------------
3
+ libclamav/pe.c: reset corrupted status before bytecode hooks
4
+
1 5
 Thu Mar 17 17:46:09 CET 2011 (tk)
2 6
 ---------------------------------
3 7
  * sigtool, freshclam: put .info on top of container to speed up loading
... ...
@@ -518,7 +518,7 @@ int cli_scanpe(cli_ctx *ctx)
518 518
 	uint32_t epsize;
519 519
 	ssize_t bytes, at;
520 520
 	unsigned int i, found, upx_success = 0, min = 0, max = 0, err, overlays = 0;
521
-	unsigned int ssize = 0, dsize = 0, dll = 0, pe_plus = 0;
521
+	unsigned int ssize = 0, dsize = 0, dll = 0, pe_plus = 0, corrupted_cur;
522 522
 	int (*upxfn)(char *, uint32_t, char *, uint32_t *, uint32_t, uint32_t, uint32_t) = NULL;
523 523
 	char *src = NULL, *dest = NULL;
524 524
 	int ndesc, ret = CL_CLEAN, upack = 0, native=0;
... ...
@@ -1346,6 +1346,7 @@ int cli_scanpe(cli_ctx *ctx)
1346 1346
 
1347 1347
 
1348 1348
     /* !!!!!!!!!!!!!!    PACKERS START HERE    !!!!!!!!!!!!!! */
1349
+    corrupted_cur = ctx->corrupted_input;
1349 1350
     ctx->corrupted_input = 2; /* caller will reset on return */
1350 1351
 
1351 1352
 
... ...
@@ -2272,6 +2273,12 @@ int cli_scanpe(cli_ctx *ctx)
2272 2272
 
2273 2273
     /* to be continued ... */
2274 2274
 
2275
+
2276
+
2277
+
2278
+    /* !!!!!!!!!!!!!!    PACKERS END HERE    !!!!!!!!!!!!!! */
2279
+    ctx->corrupted_input = corrupted_cur;
2280
+
2275 2281
     /* Bytecode BC_PE_UNPACKER hook */
2276 2282
     bc_ctx = cli_bytecode_context_alloc();
2277 2283
     if (!bc_ctx) {