diff -dPNur clamav-0.93/libclamav/clamav.h clamav-0.93-new/libclamav/clamav.h
--- clamav-0.93/libclamav/clamav.h	2008-04-02 22:17:27.000000000 +0200
+++ clamav-0.93-new/libclamav/clamav.h	2008-06-02 10:02:46.000000000 +0200
@@ -65,6 +65,7 @@
 #define CL_ESUPPORT	-125 /* not supported data format */
 #define CL_ELOCKDB	-126 /* can't lock DB directory */
 #define CL_EARJ         -127 /* ARJ handler error */
+#define CL_E7ZIP	-128 /* 7zip  module error */
 
 /* db options */
 #define CL_DB_PHISHING	    0x2
diff -dPNur clamav-0.93/libclamav/filetypes.c clamav-0.93-new/libclamav/filetypes.c
--- clamav-0.93/libclamav/filetypes.c	2008-04-02 22:17:27.000000000 +0200
+++ clamav-0.93-new/libclamav/filetypes.c	2008-06-02 10:20:25.000000000 +0200
@@ -60,6 +60,7 @@
     { "CL_TYPE_ZIP",		CL_TYPE_ZIP		},
     { "CL_TYPE_BZ",		CL_TYPE_BZ		},
     { "CL_TYPE_RAR",		CL_TYPE_RAR		},
+    { "CL_TYPE_7ZIP",		CL_TYPE_7ZIP		},
     { "CL_TYPE_ARJ",		CL_TYPE_ARJ		},
     { "CL_TYPE_MSSZDD",		CL_TYPE_MSSZDD		},
     { "CL_TYPE_MSOLE2",		CL_TYPE_MSOLE2		},
diff -dPNur clamav-0.93/libclamav/filetypes.h clamav-0.93-new/libclamav/filetypes.h
--- clamav-0.93/libclamav/filetypes.h	2008-04-02 22:17:27.000000000 +0200
+++ clamav-0.93-new/libclamav/filetypes.h	2008-06-02 10:02:46.000000000 +0200
@@ -47,6 +47,7 @@
     CL_TYPE_BZ,
     CL_TYPE_RAR,
     CL_TYPE_ARJ,
+    CL_TYPE_7ZIP,
     CL_TYPE_MSSZDD,
     CL_TYPE_MSOLE2,
     CL_TYPE_MSCAB,
diff -dPNur clamav-0.93/libclamav/filetypes_int.h clamav-0.93-new/libclamav/filetypes_int.h
--- clamav-0.93/libclamav/filetypes_int.h	2008-04-02 22:17:28.000000000 +0200
+++ clamav-0.93-new/libclamav/filetypes_int.h	2008-06-02 10:26:41.000000000 +0200
@@ -35,6 +35,7 @@
 */
 
 static const char *ftypes_int[] = {
+  "0:0:377abcaf271c:7ZIP:CL_TYPE_ANY:CL_TYPE_7ZIP",
   "0:0:4d5a:MS-EXE/DLL:CL_TYPE_ANY:CL_TYPE_MSEXE",
   "0:0:7f454c46:ELF:CL_TYPE_ANY:CL_TYPE_ELF",
   "0:0:52617221:RAR:CL_TYPE_ANY:CL_TYPE_RAR",
diff -dPNur clamav-0.93/libclamav/Makefile.am clamav-0.93-new/libclamav/Makefile.am
--- clamav-0.93/libclamav/Makefile.am	2008-03-06 19:41:07.000000000 +0100
+++ clamav-0.93-new/libclamav/Makefile.am	2008-06-02 10:04:18.000000000 +0200
@@ -21,9 +21,9 @@
 AM_CPPFLAGS = -I$(top_srcdir) -I@srcdir@/nsis -I@srcdir@/lzma
 
 if ENABLE_UNRAR
-libclamav_la_LIBADD = @LIBCLAMAV_LIBS@ @THREAD_LIBS@ lzma/liblzma.la $(top_builddir)/libclamunrar_iface/libclamunrar_iface.la
+libclamav_la_LIBADD = @LIBCLAMAV_LIBS@ @THREAD_LIBS@ lzma/liblzma.la $(top_builddir)/libclamunrar_iface/libclamunrar_iface.la -lun7zip
 else
-libclamav_la_LIBADD = @LIBCLAMAV_LIBS@ @THREAD_LIBS@ lzma/liblzma.la
+libclamav_la_LIBADD = @LIBCLAMAV_LIBS@ @THREAD_LIBS@ lzma/liblzma.la -lun7zip
 endif
 
 libclamav_la_LDFLAGS = @TH_SAFE@ -version-info @LIBCLAMAV_VERSION@ -no-undefined
@@ -60,6 +60,8 @@
 	textdet.h \
 	filetypes.c \
 	filetypes.h \
+	un7zip.c \
+	un7zip.h \
 	filetypes_int.h \
 	rtf.c \
 	rtf.h \
diff -dPNur clamav-0.93/libclamav/others.c clamav-0.93-new/libclamav/others.c
--- clamav-0.93/libclamav/others.c	2008-04-09 17:40:51.000000000 +0200
+++ clamav-0.93-new/libclamav/others.c	2008-06-02 10:02:46.000000000 +0200
@@ -150,6 +150,8 @@
 	    return "File size limit exceeded";
 	case CL_EMAXFILES:
 	    return "Files number limit exceeded";
+	case CL_E7ZIP:
+	    return "7zip module failure";
 	case CL_ERAR:
 	    return "RAR module failure";
 	case CL_EZIP:
diff -dPNur clamav-0.93/libclamav/readdb.c clamav-0.93-new/libclamav/readdb.c
--- clamav-0.93/libclamav/readdb.c	2008-04-02 22:17:28.000000000 +0200
+++ clamav-0.93-new/libclamav/readdb.c	2008-06-02 11:39:15.000000000 +0200
@@ -684,6 +684,9 @@
 		break;
 	    strncpy(buffer, ftypes_int[line], sizeof(buffer));
 	} else {
+	    if (line < 1) {
+		strcpy(buffer, ftypes_int[0]);
+	    } else
 	    if(!cli_dbgets(buffer, FILEBUFF, fs, gzs, &gzrsize))
 		break;
 	    cli_chomp(buffer);
diff -dPNur clamav-0.93/libclamav/scanners.c clamav-0.93-new/libclamav/scanners.c
--- clamav-0.93/libclamav/scanners.c	2008-04-02 22:53:44.000000000 +0200
+++ clamav-0.93-new/libclamav/scanners.c	2008-06-02 10:35:20.000000000 +0200
@@ -98,6 +98,8 @@
 #include "libclamunrar_iface/unrar_iface.h"
 #endif
 
+#include "un7zip.h"
+
 #if defined(HAVE_READDIR_R_3) || defined(HAVE_READDIR_R_2)
 #include <limits.h>
 #include <stddef.h>
@@ -710,6 +712,40 @@
     return ret;
 }
 
+static int cli_scan7zip(int desc, cli_ctx *ctx) {
+    const char *tmpdir;
+    char *dir;
+    int ret = CL_CLEAN;
+
+
+    cli_dbgmsg("in cli_scan7zip()\n");
+
+    if((tmpdir = getenv("TMPDIR")) == NULL)
+#ifdef P_tmpdir
+        tmpdir = P_tmpdir;
+#else
+        tmpdir = "/tmp";
+#endif
+
+   /* generate temporary directory */
+      dir = cli_gentemp(tmpdir);
+      if(mkdir(dir, 0700)) {
+        cli_errmsg("7zip: Can't create temporary directory %s\n", dir);
+        return CL_ETMPDIR;
+      }
+
+      if((ret = cli_un7zip(dir, desc)))
+        cli_dbgmsg("7zip: %s\n", cl_strerror(ret));
+      else
+        ret = cli_scandir(dir, ctx, 0);
+
+      if(!cli_leavetemps_flag)
+        cli_rmdirs(dir);
+
+      free(dir);
+      return ret;
+}
+
 static int cli_vba_scandir(const char *dirname, cli_ctx *ctx)
 {
 	int ret = CL_CLEAN, i, fd, ofd, data_len;
@@ -1770,7 +1806,12 @@
 	    cli_warnmsg("RAR code not compiled-in\n");
 #endif
 	    break;
-
+	    
+	case CL_TYPE_7ZIP:
+	    if(SCAN_ARCHIVE)
+		ret = cli_scan7zip(desc, ctx);
+	    break;
+	    
 	case CL_TYPE_ZIP:
 	    if(SCAN_ARCHIVE && (DCONF_ARCH & ARCH_CONF_ZIP))
 		ret = cli_unzip(desc, ctx);
diff -dPNur clamav-0.93/libclamav/un7zip.c clamav-0.93-new/libclamav/un7zip.c
--- clamav-0.93/libclamav/un7zip.c	1970-01-01 01:00:00.000000000 +0100
+++ clamav-0.93-new/libclamav/un7zip.c	2008-06-02 10:02:46.000000000 +0200
@@ -0,0 +1,83 @@
+/*
+ *  Copyright (C) 2005 McMCC <mcmcc@mail.ru>
+ *
+ *  Support check archives 7zip
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+static char const rcsid[] = "$Id: un7zip.c,v 1.0 2005/09/05 01:40:44 mcmcc Exp $";
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/param.h>
+#include <u7zip.h>
+#include "clamav.h"
+#include "others.h"
+#include "un7zip.h"
+#include "mbox.h"
+#include "blob.h"
+
+int cli_un7zip(const char *dir, int desc)
+{
+    int fd, s_buff, res;
+    char buff[4096], uname[48];
+    const char *tmpdir;
+    FILE *out;
+
+    if((tmpdir = getenv("TMPDIR")) == NULL)
+#ifdef P_tmpdir
+        tmpdir = P_tmpdir;
+#else
+        tmpdir = "/tmp";
+#endif
+
+    sprintf(uname, "%s/szpXXXXXX", tmpdir);
+
+    if((fd = mkstemp(uname)) < 0 || (out = fdopen(fd, "w+")) == NULL)
+    {
+
+        cli_dbgmsg("cli_un7zip: can't generate temporary file %s or open descriptor %d.\n",
+                    uname, fd);
+        if(fd >= 0)
+            close(fd);
+        unlink(uname);
+        return CL_ETMPFILE;
+    }
+
+    while((s_buff=read(desc, buff, sizeof(buff))) > 0)
+    {
+        if(fwrite(buff, 1, s_buff, out) != s_buff)
+        {
+            cli_dbgmsg("cli_un7zip: can't write to file %s.\n", uname);
+            fclose(out);
+            close(fd);
+            unlink(uname);
+            return CL_EOPEN;
+        }
+    }
+    fclose(out);
+    close(fd);
+
+    res = un7zip(uname, dir, EXTRACT_7Z);
+    unlink(uname);
+    if(res) return CL_E7ZIP;
+    return CL_CLEAN;
+}
diff -dPNur clamav-0.93/libclamav/un7zip.h clamav-0.93-new/libclamav/un7zip.h
--- clamav-0.93/libclamav/un7zip.h	1970-01-01 01:00:00.000000000 +0100
+++ clamav-0.93-new/libclamav/un7zip.h	2008-06-02 10:02:46.000000000 +0200
@@ -0,0 +1,22 @@
+/*
+ *  Copyright (C) 2005 McMCC <mcmcc@mail.ru>
+ *
+ *  Support check archives 7zip
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+int cli_un7zip(const char *dir, int desc);
