This commit is contained in:
aCaB 2011-04-09 03:58:23 +02:00
parent 47762e70f5
commit f5933780cc
2 changed files with 12 additions and 1 deletions

View file

@ -1,3 +1,7 @@
Sat Apr 9 03:56:17 CEST 2011 (acab)
------------------------------------
libclamav/pe.c: reset corrupted status before bytecode hooks
Thu Apr 7 18:17:56 CEST 2011 (tk) Thu Apr 7 18:17:56 CEST 2011 (tk)
---------------------------------- ----------------------------------
* libclamav: add PNG validator based on pngcheck * libclamav: add PNG validator based on pngcheck

View file

@ -518,7 +518,7 @@ int cli_scanpe(cli_ctx *ctx)
uint32_t epsize; uint32_t epsize;
ssize_t bytes, at; ssize_t bytes, at;
unsigned int i, found, upx_success = 0, min = 0, max = 0, err, overlays = 0; unsigned int i, found, upx_success = 0, min = 0, max = 0, err, overlays = 0;
unsigned int ssize = 0, dsize = 0, dll = 0, pe_plus = 0; unsigned int ssize = 0, dsize = 0, dll = 0, pe_plus = 0, corrupted_cur;
int (*upxfn)(char *, uint32_t, char *, uint32_t *, uint32_t, uint32_t, uint32_t) = NULL; int (*upxfn)(char *, uint32_t, char *, uint32_t *, uint32_t, uint32_t, uint32_t) = NULL;
char *src = NULL, *dest = NULL; char *src = NULL, *dest = NULL;
int ndesc, ret = CL_CLEAN, upack = 0, native=0; int ndesc, ret = CL_CLEAN, upack = 0, native=0;
@ -1346,6 +1346,7 @@ int cli_scanpe(cli_ctx *ctx)
/* !!!!!!!!!!!!!! PACKERS START HERE !!!!!!!!!!!!!! */ /* !!!!!!!!!!!!!! PACKERS START HERE !!!!!!!!!!!!!! */
corrupted_cur = ctx->corrupted_input;
ctx->corrupted_input = 2; /* caller will reset on return */ ctx->corrupted_input = 2; /* caller will reset on return */
@ -2272,6 +2273,12 @@ int cli_scanpe(cli_ctx *ctx)
/* to be continued ... */ /* to be continued ... */
/* !!!!!!!!!!!!!! PACKERS END HERE !!!!!!!!!!!!!! */
ctx->corrupted_input = corrupted_cur;
/* Bytecode BC_PE_UNPACKER hook */ /* Bytecode BC_PE_UNPACKER hook */
bc_ctx = cli_bytecode_context_alloc(); bc_ctx = cli_bytecode_context_alloc();
if (!bc_ctx) { if (!bc_ctx) {