Browse code

Fixed debug spam logic Fixed unaligned raw data: this will require more testing on NT and 9x but should work for now

git-svn: trunk@2644

aCaB authored on 2007/01/27 21:59:30
Showing 2 changed files
... ...
@@ -1,3 +1,8 @@
1
+Sat Jan 27 13:54:35 CET 2007 (acab)
2
+-----------------------------------
3
+  * libclamav/pe.c: fix debug message logic, fixed handling of non aligned raw
4
+  		    data
5
+
1 6
 Fri Jan 26 20:49:07 CET 2007 (acab)
2 7
 -----------------------------------
3 8
   * libclamav/mew.c: fix align logic, added some sanity checks
... ...
@@ -474,8 +474,8 @@ int cli_scanpe(int desc, cli_ctx *ctx)
474 474
 		    *ctx->virname = "Broken.Executable";
475 475
 		return CL_VIRUS;
476 476
 	    }
477
+	    cli_dbgmsg("9x compatibility mode\n");
477 478
 	}
478
-	cli_dbgmsg("9x compatibility mode\n");
479 479
     }
480 480
 
481 481
     if(!pe_plus) { /* PE */
... ...
@@ -628,7 +628,7 @@ int cli_scanpe(int desc, cli_ctx *ctx)
628 628
     
629 629
     for(i = 0; falign!=0x200 && i<nsections; i++) {
630 630
 	/* file alignment fallback mode - blah */
631
-	if (section_hdr[i].SizeOfRawData && EC32(section_hdr[i].PointerToRawData)%falign && !(EC32(section_hdr[i].PointerToRawData)%0x200)) {
631
+	if (falign && section_hdr[i].SizeOfRawData && EC32(section_hdr[i].PointerToRawData)%falign && !(EC32(section_hdr[i].PointerToRawData)%0x200)) {
632 632
 	    cli_dbgmsg("Found misaligned section, using 0x200\n");
633 633
 	    falign = 0x200;
634 634
 	}