Browse code

activate ELF code

git-svn: trunk@1711

Tomasz Kojm authored on 2005/08/30 00:02:38
Showing 6 changed files
... ...
@@ -1,3 +1,7 @@
1
+Mon Aug 29 17:00:36 CEST 2005 (tk)
2
+----------------------------------
3
+  * libclamav: activate ELF code
4
+
1 5
 Mon Aug 29 16:38:06 CEST 2005 (tk)
2 6
 ----------------------------------
3 7
   * libclamav/elf.c: detect file endianness and properly analyse executables on
... ...
@@ -140,7 +140,9 @@ libclamav_la_SOURCES = \
140 140
 	pdf.c \
141 141
 	pdf.h \
142 142
 	spin.c \
143
-	spin.h
143
+	spin.h \
144
+	elf.c \
145
+	elf.h
144 146
 
145 147
 
146 148
 lib_LTLIBRARIES = libclamav.la
... ...
@@ -1,4 +1,4 @@
1
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
1
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4 4
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
... ...
@@ -32,8 +32,6 @@
32 32
 #  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
33 33
 
34 34
 
35
-SOURCES = $(libclamav_la_SOURCES)
36
-
37 35
 srcdir = @srcdir@
38 36
 top_srcdir = @top_srcdir@
39 37
 VPATH = @srcdir@
... ...
@@ -88,7 +86,7 @@ am_libclamav_la_OBJECTS = matcher-ac.lo matcher-bm.lo matcher.lo \
88 88
 	chmunpack.lo rebuildpe.lo petite.lo fsg.lo line.lo untar.lo \
89 89
 	special.lo binhex.lo is_tar.lo tnef.lo unrar15.lo unrarvm.lo \
90 90
 	unrar.lo unrarfilter.lo unrarppm.lo unrar20.lo unrarcmd.lo \
91
-	pdf.lo spin.lo
91
+	pdf.lo spin.lo elf.lo
92 92
 libclamav_la_OBJECTS = $(am_libclamav_la_OBJECTS)
93 93
 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
94 94
 depcomp = $(SHELL) $(top_srcdir)/depcomp
... ...
@@ -336,7 +334,9 @@ libclamav_la_SOURCES = \
336 336
 	pdf.c \
337 337
 	pdf.h \
338 338
 	spin.c \
339
-	spin.h
339
+	spin.h \
340
+	elf.c \
341
+	elf.h
340 342
 
341 343
 lib_LTLIBRARIES = libclamav.la
342 344
 all: all-am
... ...
@@ -414,6 +414,7 @@ distclean-compile:
414 414
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chmunpack.Plo@am__quote@
415 415
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cvd.Plo@am__quote@
416 416
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsig.Plo@am__quote@
417
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf.Plo@am__quote@
417 418
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filetypes.Plo@am__quote@
418 419
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsg.Plo@am__quote@
419 420
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htmlnorm.Plo@am__quote@
... ...
@@ -50,7 +50,7 @@ static const struct cli_magic_s cli_magic[] = {
50 50
     /* Executables */
51 51
 
52 52
     {0,  "MZ",				2,  "DOS/W32 executable/library/driver", CL_TYPE_MSEXE},
53
-
53
+    {0,	 "\177ELF",			4,  "ELF",		CL_TYPE_ELF},
54 54
     /* Archives */
55 55
 
56 56
     {0,	    "Rar!",			4,  "RAR",		CL_TYPE_RAR},
... ...
@@ -27,6 +27,7 @@ typedef enum {
27 27
     CL_TYPE_UNKNOWN_TEXT = CL_TYPENO,
28 28
     CL_TYPE_UNKNOWN_DATA,
29 29
     CL_TYPE_MSEXE,
30
+    CL_TYPE_ELF,
30 31
     CL_TYPE_DATA,
31 32
     CL_TYPE_POSIX_TAR,
32 33
     CL_TYPE_OLD_TAR,
... ...
@@ -1523,6 +1523,10 @@ int cli_magic_scandesc(int desc, const char **virname, long int *scanned, const
1523 1523
 		ret = cli_scanpdf(desc, virname, scanned, root, limits, options, arec, mrec);
1524 1524
 	    break;
1525 1525
 
1526
+	case CL_TYPE_ELF: /* TODO: Add ScanELF option */
1527
+		ret = cli_scanelf(desc, virname, scanned, root, limits, options, arec, mrec);
1528
+	    break;
1529
+
1526 1530
 	case CL_TYPE_DATA:
1527 1531
 	    /* it could be a false positive and a standard DOS .COM file */
1528 1532
 	    {