Browse code

update

git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@1251 77e5149b-7576-45b1-b177-96237e5ba77b

Tomasz Kojm authored on 2005/01/18 07:30:45
Showing 1 changed files
... ...
@@ -154,7 +154,7 @@ int cli_scanpe(int desc, const char **virname, long int *scanned, const struct c
154 154
 	struct pe_image_section_hdr *section_hdr;
155 155
 	struct stat sb;
156 156
 	char sname[9], buff[4096], *tempfile;
157
-	int i, found, upx_success = 0, min = 0, max = 0, ret, dll = 0;
157
+	int i, found, upx_success = 0, min = 0, max = 0, ret;
158 158
 	int (*upxfn)(char *, int , char *, int *, uint32_t, uint32_t, uint32_t) = NULL;
159 159
 	char *src = NULL, *dest = NULL;
160 160
 	int ssize = -1, dsize = -1, ndesc;
... ...
@@ -207,13 +207,6 @@ int cli_scanpe(int desc, const char **virname, long int *scanned, const struct c
207 207
 	return CL_CLEAN;
208 208
     }
209 209
 
210
-    if(EC16(file_hdr.Characteristics) & 0x01) {
211
-	cli_dbgmsg("File type: Executable\n");
212
-    } else if(EC16(file_hdr.Characteristics) & 0x100) {
213
-	cli_dbgmsg("File type: DLL\n");
214
-	dll = 1;
215
-    }
216
-
217 210
     switch(EC16(file_hdr.Machine)) {
218 211
 	case 0x14c:
219 212
 	    cli_dbgmsg("Machine type: 80386\n");
... ...
@@ -447,8 +440,8 @@ int cli_scanpe(int desc, const char **virname, long int *scanned, const struct c
447 447
     /* Attempt to detect some popular polymorphic viruses */
448 448
 
449 449
     /* W32.Parite.B */
450
-    if(ep == EC32(section_hdr[nsections - 1].PointerToRawData) || dll) {
451
-	lseek(desc, EC32(section_hdr[nsections - 1].PointerToRawData), SEEK_SET);
450
+    if(ep == EC32(section_hdr[nsections - 1].PointerToRawData)) {
451
+	lseek(desc, ep, SEEK_SET);
452 452
 	if(read(desc, buff, 4096) == 4096) {
453 453
 		char *pt = cli_memstr(buff, 4040, "\x47\x65\x74\x50\x72\x6f\x63\x41\x64\x64\x72\x65\x73\x73\x00", 15);
454 454
 	    if(pt) {