Browse code

share aplib code

git-svn: trunk@2156

aCaB authored on 2006/07/31 21:25:29
Showing 9 changed files
... ...
@@ -1,3 +1,7 @@
1
+Mon Jul 31 14:23:30 CEST 2006 (acab)
2
+------------------------------------
3
+  * libclamav: share aPLib code
4
+
1 5
 Mon Jul 31 12:59:30 CEST 2006 (acab)
2 6
 ------------------------------------
3 7
   * libclamav: packers review
... ...
@@ -139,6 +139,7 @@ EGREP = @EGREP@
139 139
 EXEEXT = @EXEEXT@
140 140
 FRESHCLAM_LIBS = @FRESHCLAM_LIBS@
141 141
 GETENT = @GETENT@
142
+GREP = @GREP@
142 143
 HAVE_MILTER_FALSE = @HAVE_MILTER_FALSE@
143 144
 HAVE_MILTER_TRUE = @HAVE_MILTER_TRUE@
144 145
 INSTALL_DATA = @INSTALL_DATA@
... ...
@@ -172,8 +173,6 @@ STRIP = @STRIP@
172 172
 TH_SAFE = @TH_SAFE@
173 173
 VERSION = @VERSION@
174 174
 ac_ct_CC = @ac_ct_CC@
175
-ac_ct_RANLIB = @ac_ct_RANLIB@
176
-ac_ct_STRIP = @ac_ct_STRIP@
177 175
 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
178 176
 am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
179 177
 am__include = @am__include@
... ...
@@ -189,23 +188,29 @@ build_os = @build_os@
189 189
 build_vendor = @build_vendor@
190 190
 datadir = @datadir@
191 191
 datarootdir = @datarootdir@
192
+docdir = @docdir@
193
+dvidir = @dvidir@
192 194
 exec_prefix = @exec_prefix@
193 195
 host = @host@
194 196
 host_alias = @host_alias@
195 197
 host_cpu = @host_cpu@
196 198
 host_os = @host_os@
197 199
 host_vendor = @host_vendor@
200
+htmldir = @htmldir@
198 201
 includedir = @includedir@
199 202
 infodir = @infodir@
200 203
 install_sh = @install_sh@
201 204
 libdir = @libdir@
202 205
 libexecdir = @libexecdir@
206
+localedir = @localedir@
203 207
 localstatedir = @localstatedir@
204 208
 mandir = @mandir@
205 209
 mkdir_p = @mkdir_p@
206 210
 oldincludedir = @oldincludedir@
211
+pdfdir = @pdfdir@
207 212
 prefix = @prefix@
208 213
 program_transform_name = @program_transform_name@
214
+psdir = @psdir@
209 215
 sbindir = @sbindir@
210 216
 sendmailprog = @sendmailprog@
211 217
 sharedstatedir = @sharedstatedir@
... ...
@@ -1,6 +1,6 @@
1 1
 #! /bin/sh
2 2
 # Guess values for system-dependent variables and create Makefiles.
3
-# Generated by GNU Autoconf 2.59e.
3
+# Generated by GNU Autoconf 2.60.
4 4
 #
5 5
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
6 6
 # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
... ...
@@ -230,8 +230,8 @@ IFS=$as_save_IFS
230 230
 
231 231
 
232 232
       for as_shell in $as_candidate_shells $SHELL; do
233
-	 # Try only shells which exist, to save several forks.
234
-	 if test -f "$as_shell" &&
233
+	 # Try only shells that exist, to save several forks.
234
+	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
235 235
 		{ ("$as_shell") 2> /dev/null <<\_ASEOF
236 236
 # Be Bourne compatible
237 237
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
... ...
@@ -1574,7 +1574,7 @@ test -n "$ac_init_help" && exit $ac_status
1574 1574
 if $ac_init_version; then
1575 1575
   cat <<\_ACEOF
1576 1576
 configure
1577
-generated by GNU Autoconf 2.59e
1577
+generated by GNU Autoconf 2.60
1578 1578
 
1579 1579
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
1580 1580
 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
... ...
@@ -1588,7 +1588,7 @@ This file contains any messages produced by compilers while
1588 1588
 running configure, to aid debugging if configure makes a mistake.
1589 1589
 
1590 1590
 It was created by $as_me, which was
1591
-generated by GNU Autoconf 2.59e.  Invocation command line was
1591
+generated by GNU Autoconf 2.60.  Invocation command line was
1592 1592
 
1593 1593
   $ $0 $@
1594 1594
 
... ...
@@ -2505,7 +2505,7 @@ done
2505 2505
 
2506 2506
 { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
2507 2507
 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
2508
-set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/^a-zA-Z0-9_/_/g'`
2508
+set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
2509 2509
 if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
2510 2510
   echo $ECHO_N "(cached) $ECHO_C" >&6
2511 2511
 else
... ...
@@ -3409,7 +3409,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
3409 3409
 	ac_compiler_gnu=no
3410 3410
 fi
3411 3411
 
3412
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
3412
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3413 3413
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
3414 3414
 
3415 3415
 fi
... ...
@@ -3595,13 +3595,13 @@ sed 's/^/| /' conftest.$ac_ext >&5
3595 3595
 
3596 3596
 fi
3597 3597
 
3598
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
3598
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3599 3599
 fi
3600 3600
 
3601
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
3601
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3602 3602
 fi
3603 3603
 
3604
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
3604
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3605 3605
    ac_c_werror_flag=$ac_save_c_werror_flag
3606 3606
 fi
3607 3607
 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
... ...
@@ -3666,6 +3666,11 @@ static char *f (char * (*g) (char **, int), char **p, ...)
3666 3666
    that's true only with -std.  */
3667 3667
 int osf4_cc_array ['\x00' == 0 ? 1 : -1];
3668 3668
 
3669
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
3670
+   inside strings and character constants.  */
3671
+#define FOO(x) 'x'
3672
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
3673
+
3669 3674
 int test (int i, double x);
3670 3675
 struct s1 {int (*f) (int a);};
3671 3676
 struct s2 {int (*f) (double a);};
... ...
@@ -3726,7 +3731,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
3726 3726
 
3727 3727
 fi
3728 3728
 
3729
-rm -f conftest.err conftest.$ac_objext
3729
+rm -f core conftest.err conftest.$ac_objext
3730 3730
   test "x$ac_cv_prog_cc_c89" != "xno" && break
3731 3731
 done
3732 3732
 rm -f conftest.$ac_ext
... ...
@@ -4021,7 +4026,7 @@ fi
4021 4021
 
4022 4022
 { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
4023 4023
 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
4024
-set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/^a-zA-Z0-9_/_/g'`
4024
+set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
4025 4025
 if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
4026 4026
   echo $ECHO_N "(cached) $ECHO_C" >&6
4027 4027
 else
... ...
@@ -5149,7 +5154,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
5149 5149
 	ac_cv_header_stdc=no
5150 5150
 fi
5151 5151
 
5152
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
5152
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5153 5153
 
5154 5154
 if test $ac_cv_header_stdc = yes; then
5155 5155
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
... ...
@@ -5345,7 +5350,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
5345 5345
 	eval "$as_ac_Header=no"
5346 5346
 fi
5347 5347
 
5348
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
5348
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5349 5349
 fi
5350 5350
 ac_res=`eval echo '${'$as_ac_Header'}'`
5351 5351
 	       { echo "$as_me:$LINENO: result: $ac_res" >&5
... ...
@@ -5428,7 +5433,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
5428 5428
 	ac_header_compiler=no
5429 5429
 fi
5430 5430
 
5431
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
5431
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5432 5432
 { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
5433 5433
 echo "${ECHO_T}$ac_header_compiler" >&6; }
5434 5434
 
... ...
@@ -5875,7 +5880,7 @@ test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
5875 5875
 case $host in
5876 5876
 *-*-irix6*)
5877 5877
   # Find out which ABI we are using.
5878
-  echo '#line 5878 "configure"' > conftest.$ac_ext
5878
+  echo '#line 5883 "configure"' > conftest.$ac_ext
5879 5879
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
5880 5880
   (eval $ac_compile) 2>&5
5881 5881
   ac_status=$?
... ...
@@ -5987,7 +5992,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
5987 5987
 	lt_cv_cc_needs_belf=no
5988 5988
 fi
5989 5989
 
5990
-rm -f conftest.err conftest.$ac_objext \
5990
+rm -f core conftest.err conftest.$ac_objext \
5991 5991
       conftest$ac_exeext conftest.$ac_ext
5992 5992
      ac_ext=c
5993 5993
 ac_cpp='$CPP $CPPFLAGS'
... ...
@@ -6365,7 +6370,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
6365 6365
 
6366 6366
 fi
6367 6367
 
6368
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
6368
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6369 6369
     CFLAGS="$save_CFLAGS"
6370 6370
 
6371 6371
 fi
... ...
@@ -6463,7 +6468,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
6463 6463
 
6464 6464
 fi
6465 6465
 
6466
-rm -f conftest.err conftest.$ac_objext \
6466
+rm -f core conftest.err conftest.$ac_objext \
6467 6467
       conftest$ac_exeext conftest.$ac_ext
6468 6468
   LDFLAGS="$save_LDFLAGS"
6469 6469
 
... ...
@@ -6508,7 +6513,7 @@ chmod -w .
6508 6508
 save_CFLAGS="$CFLAGS"
6509 6509
 CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
6510 6510
 compiler_c_o=no
6511
-if { (eval echo configure:6511: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
6511
+if { (eval echo configure:6516: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
6512 6512
   # The compiler can only warn and ignore the option if not recognized
6513 6513
   # So say no if there are warnings
6514 6514
   if test -s out/conftest.err; then
... ...
@@ -6612,7 +6617,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
6612 6612
 
6613 6613
 fi
6614 6614
 
6615
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
6615
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6616 6616
   ac_objext="$save_objext"
6617 6617
   CFLAGS="$save_CFLAGS"
6618 6618
 
... ...
@@ -6728,7 +6733,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
6728 6728
 
6729 6729
 fi
6730 6730
 
6731
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
6731
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6732 6732
   CFLAGS="$save_CFLAGS"
6733 6733
   { echo "$as_me:$LINENO: result: $compiler_rtti_exceptions" >&5
6734 6734
 echo "${ECHO_T}$compiler_rtti_exceptions" >&6; }
... ...
@@ -8069,7 +8074,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
8069 8069
 	ac_cv_func_shl_load=no
8070 8070
 fi
8071 8071
 
8072
-rm -f conftest.err conftest.$ac_objext \
8072
+rm -f core conftest.err conftest.$ac_objext \
8073 8073
       conftest$ac_exeext conftest.$ac_ext
8074 8074
 fi
8075 8075
 { echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
... ...
@@ -8148,7 +8153,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
8148 8148
 	ac_cv_lib_dld_shl_load=no
8149 8149
 fi
8150 8150
 
8151
-rm -f conftest.err conftest.$ac_objext \
8151
+rm -f core conftest.err conftest.$ac_objext \
8152 8152
       conftest$ac_exeext conftest.$ac_ext
8153 8153
 LIBS=$ac_check_lib_save_LIBS
8154 8154
 fi
... ...
@@ -8249,7 +8254,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
8249 8249
 	ac_cv_func_dlopen=no
8250 8250
 fi
8251 8251
 
8252
-rm -f conftest.err conftest.$ac_objext \
8252
+rm -f core conftest.err conftest.$ac_objext \
8253 8253
       conftest$ac_exeext conftest.$ac_ext
8254 8254
 fi
8255 8255
 { echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
... ...
@@ -8328,7 +8333,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
8328 8328
 	ac_cv_lib_dl_dlopen=no
8329 8329
 fi
8330 8330
 
8331
-rm -f conftest.err conftest.$ac_objext \
8331
+rm -f core conftest.err conftest.$ac_objext \
8332 8332
       conftest$ac_exeext conftest.$ac_ext
8333 8333
 LIBS=$ac_check_lib_save_LIBS
8334 8334
 fi
... ...
@@ -8408,7 +8413,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
8408 8408
 	ac_cv_lib_svld_dlopen=no
8409 8409
 fi
8410 8410
 
8411
-rm -f conftest.err conftest.$ac_objext \
8411
+rm -f core conftest.err conftest.$ac_objext \
8412 8412
       conftest$ac_exeext conftest.$ac_ext
8413 8413
 LIBS=$ac_check_lib_save_LIBS
8414 8414
 fi
... ...
@@ -8488,7 +8493,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
8488 8488
 	ac_cv_lib_dld_dld_link=no
8489 8489
 fi
8490 8490
 
8491
-rm -f conftest.err conftest.$ac_objext \
8491
+rm -f core conftest.err conftest.$ac_objext \
8492 8492
       conftest$ac_exeext conftest.$ac_ext
8493 8493
 LIBS=$ac_check_lib_save_LIBS
8494 8494
 fi
... ...
@@ -8544,7 +8549,7 @@ else
8544 8544
     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
8545 8545
   lt_status=$lt_dlunknown
8546 8546
   cat > conftest.$ac_ext <<EOF
8547
-#line 8547 "configure"
8547
+#line 8552 "configure"
8548 8548
 #include "confdefs.h"
8549 8549
 
8550 8550
 #if HAVE_DLFCN_H
... ...
@@ -8642,7 +8647,7 @@ else
8642 8642
     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
8643 8643
   lt_status=$lt_dlunknown
8644 8644
   cat > conftest.$ac_ext <<EOF
8645
-#line 8645 "configure"
8645
+#line 8650 "configure"
8646 8646
 #include "confdefs.h"
8647 8647
 
8648 8648
 #if HAVE_DLFCN_H
... ...
@@ -9455,7 +9460,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
9455 9455
 	ac_cv_header_stdc=no
9456 9456
 fi
9457 9457
 
9458
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
9458
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9459 9459
 
9460 9460
 if test $ac_cv_header_stdc = yes; then
9461 9461
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
... ...
@@ -9669,7 +9674,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
9669 9669
 	ac_header_compiler=no
9670 9670
 fi
9671 9671
 
9672
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
9672
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9673 9673
 { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
9674 9674
 echo "${ECHO_T}$ac_header_compiler" >&6; }
9675 9675
 
... ...
@@ -9828,7 +9833,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
9828 9828
 	ac_header_compiler=no
9829 9829
 fi
9830 9830
 
9831
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
9831
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9832 9832
 { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
9833 9833
 echo "${ECHO_T}$ac_header_compiler" >&6; }
9834 9834
 
... ...
@@ -9990,7 +9995,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
9990 9990
 	ac_cv_type_off_t=no
9991 9991
 fi
9992 9992
 
9993
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
9993
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9994 9994
 fi
9995 9995
 { echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
9996 9996
 echo "${ECHO_T}$ac_cv_type_off_t" >&6; }
... ...
@@ -10070,7 +10075,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
10070 10070
 
10071 10071
 fi
10072 10072
 
10073
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
10073
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10074 10074
   if test x$ac_cv_sizeof_short != x ; then break; fi
10075 10075
 done
10076 10076
 
... ...
@@ -10155,7 +10160,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
10155 10155
 
10156 10156
 fi
10157 10157
 
10158
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
10158
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10159 10159
   if test x$ac_cv_sizeof_int != x ; then break; fi
10160 10160
 done
10161 10161
 
... ...
@@ -10240,7 +10245,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
10240 10240
 
10241 10241
 fi
10242 10242
 
10243
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
10243
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10244 10244
   if test x$ac_cv_sizeof_long != x ; then break; fi
10245 10245
 done
10246 10246
 
... ...
@@ -10325,7 +10330,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
10325 10325
 
10326 10326
 fi
10327 10327
 
10328
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
10328
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10329 10329
   if test x$ac_cv_sizeof_long_long != x ; then break; fi
10330 10330
 done
10331 10331
 
... ...
@@ -10416,7 +10421,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
10416 10416
 	ac_cv_lib_socket_bind=no
10417 10417
 fi
10418 10418
 
10419
-rm -f conftest.err conftest.$ac_objext \
10419
+rm -f core conftest.err conftest.$ac_objext \
10420 10420
       conftest$ac_exeext conftest.$ac_ext
10421 10421
 LIBS=$ac_check_lib_save_LIBS
10422 10422
 fi
... ...
@@ -10497,7 +10502,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
10497 10497
 	ac_cv_lib_nsl_gethostent=no
10498 10498
 fi
10499 10499
 
10500
-rm -f conftest.err conftest.$ac_objext \
10500
+rm -f core conftest.err conftest.$ac_objext \
10501 10501
       conftest$ac_exeext conftest.$ac_ext
10502 10502
 LIBS=$ac_check_lib_save_LIBS
10503 10503
 fi
... ...
@@ -10615,7 +10620,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
10615 10615
 	eval "$as_ac_var=no"
10616 10616
 fi
10617 10617
 
10618
-rm -f conftest.err conftest.$ac_objext \
10618
+rm -f core conftest.err conftest.$ac_objext \
10619 10619
       conftest$ac_exeext conftest.$ac_ext
10620 10620
 fi
10621 10621
 ac_res=`eval echo '${'$as_ac_var'}'`
... ...
@@ -10698,7 +10703,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
10698 10698
 	ac_header_compiler=no
10699 10699
 fi
10700 10700
 
10701
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
10701
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10702 10702
 { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
10703 10703
 echo "${ECHO_T}$ac_header_compiler" >&6; }
10704 10704
 
... ...
@@ -10890,7 +10895,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
10890 10890
 	eval "$as_ac_var=no"
10891 10891
 fi
10892 10892
 
10893
-rm -f conftest.err conftest.$ac_objext \
10893
+rm -f core conftest.err conftest.$ac_objext \
10894 10894
       conftest$ac_exeext conftest.$ac_ext
10895 10895
 fi
10896 10896
 ac_res=`eval echo '${'$as_ac_var'}'`
... ...
@@ -11154,7 +11159,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
11154 11154
 
11155 11155
 fi
11156 11156
 
11157
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
11157
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11158 11158
   cat >conftest.$ac_ext <<_ACEOF
11159 11159
 /* confdefs.h.  */
11160 11160
 _ACEOF
... ...
@@ -11213,7 +11218,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
11213 11213
 
11214 11214
 fi
11215 11215
 
11216
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
11216
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11217 11217
   break
11218 11218
 done
11219 11219
 fi
... ...
@@ -11293,7 +11298,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
11293 11293
 	ac_cv_func_fseeko=no
11294 11294
 fi
11295 11295
 
11296
-rm -f conftest.err conftest.$ac_objext \
11296
+rm -f core conftest.err conftest.$ac_objext \
11297 11297
       conftest$ac_exeext conftest.$ac_ext
11298 11298
 fi
11299 11299
 { echo "$as_me:$LINENO: result: $ac_cv_func_fseeko" >&5
... ...
@@ -11439,7 +11444,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
11439 11439
 	ac_header_compiler=no
11440 11440
 fi
11441 11441
 
11442
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
11442
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11443 11443
 { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
11444 11444
 echo "${ECHO_T}$ac_header_compiler" >&6; }
11445 11445
 
... ...
@@ -11689,7 +11694,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
11689 11689
 	ac_cv_lib_z_inflateEnd=no
11690 11690
 fi
11691 11691
 
11692
-rm -f conftest.err conftest.$ac_objext \
11692
+rm -f core conftest.err conftest.$ac_objext \
11693 11693
       conftest$ac_exeext conftest.$ac_ext
11694 11694
 LIBS=$ac_check_lib_save_LIBS
11695 11695
 fi
... ...
@@ -11779,7 +11784,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
11779 11779
 	ac_cv_lib_z_inflateEnd=no
11780 11780
 fi
11781 11781
 
11782
-rm -f conftest.err conftest.$ac_objext \
11782
+rm -f core conftest.err conftest.$ac_objext \
11783 11783
       conftest$ac_exeext conftest.$ac_ext
11784 11784
 LIBS=$ac_check_lib_save_LIBS
11785 11785
 fi
... ...
@@ -11881,7 +11886,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
11881 11881
 	ac_cv_lib_bz2_bzReadOpen=no
11882 11882
 fi
11883 11883
 
11884
-rm -f conftest.err conftest.$ac_objext \
11884
+rm -f core conftest.err conftest.$ac_objext \
11885 11885
       conftest$ac_exeext conftest.$ac_ext
11886 11886
 LIBS=$ac_check_lib_save_LIBS
11887 11887
 fi
... ...
@@ -11958,7 +11963,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
11958 11958
 	ac_header_compiler=no
11959 11959
 fi
11960 11960
 
11961
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
11961
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11962 11962
 { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
11963 11963
 echo "${ECHO_T}$ac_header_compiler" >&6; }
11964 11964
 
... ...
@@ -12139,7 +12144,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
12139 12139
 	ac_cv_lib_sn_sigscan_sn_sigscan_initdb=no
12140 12140
 fi
12141 12141
 
12142
-rm -f conftest.err conftest.$ac_objext \
12142
+rm -f core conftest.err conftest.$ac_objext \
12143 12143
       conftest$ac_exeext conftest.$ac_ext
12144 12144
 LIBS=$ac_check_lib_save_LIBS
12145 12145
 fi
... ...
@@ -12214,7 +12219,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
12214 12214
 	ac_header_compiler=no
12215 12215
 fi
12216 12216
 
12217
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
12217
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12218 12218
 { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
12219 12219
 echo "${ECHO_T}$ac_header_compiler" >&6; }
12220 12220
 
... ...
@@ -12395,7 +12400,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
12395 12395
 	ac_cv_lib_resolv___dn_expand=no
12396 12396
 fi
12397 12397
 
12398
-rm -f conftest.err conftest.$ac_objext \
12398
+rm -f core conftest.err conftest.$ac_objext \
12399 12399
       conftest$ac_exeext conftest.$ac_ext
12400 12400
 LIBS=$ac_check_lib_save_LIBS
12401 12401
 fi
... ...
@@ -12477,7 +12482,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
12477 12477
 	ac_cv_lib_resolv_dn_expand=no
12478 12478
 fi
12479 12479
 
12480
-rm -f conftest.err conftest.$ac_objext \
12480
+rm -f core conftest.err conftest.$ac_objext \
12481 12481
       conftest$ac_exeext conftest.$ac_ext
12482 12482
 LIBS=$ac_check_lib_save_LIBS
12483 12483
 fi
... ...
@@ -12551,7 +12556,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
12551 12551
 	ac_header_compiler=no
12552 12552
 fi
12553 12553
 
12554
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
12554
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12555 12555
 { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
12556 12556
 echo "${ECHO_T}$ac_header_compiler" >&6; }
12557 12557
 
... ...
@@ -12908,7 +12913,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
12908 12908
 	ac_cv_lib_gmp___gmpz_init=no
12909 12909
 fi
12910 12910
 
12911
-rm -f conftest.err conftest.$ac_objext \
12911
+rm -f core conftest.err conftest.$ac_objext \
12912 12912
       conftest$ac_exeext conftest.$ac_ext
12913 12913
 LIBS=$ac_check_lib_save_LIBS
12914 12914
 fi
... ...
@@ -12992,7 +12997,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
12992 12992
 	ac_cv_lib_gmp_mpz_init=no
12993 12993
 fi
12994 12994
 
12995
-rm -f conftest.err conftest.$ac_objext \
12995
+rm -f core conftest.err conftest.$ac_objext \
12996 12996
       conftest$ac_exeext conftest.$ac_ext
12997 12997
 LIBS=$ac_check_lib_save_LIBS
12998 12998
 fi
... ...
@@ -13867,7 +13872,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
13867 13867
 	ac_cv_lib_milter_mi_stop=no
13868 13868
 fi
13869 13869
 
13870
-rm -f conftest.err conftest.$ac_objext \
13870
+rm -f core conftest.err conftest.$ac_objext \
13871 13871
       conftest$ac_exeext conftest.$ac_ext
13872 13872
 LIBS=$ac_check_lib_save_LIBS
13873 13873
 fi
... ...
@@ -13954,7 +13959,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
13954 13954
 
13955 13955
 fi
13956 13956
 
13957
-rm -f conftest.err conftest.$ac_objext \
13957
+rm -f core conftest.err conftest.$ac_objext \
13958 13958
       conftest$ac_exeext
13959 13959
   if test "${ac_cv_search_strlcpy+set}" = set; then
13960 13960
   break
... ...
@@ -14049,7 +14054,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
14049 14049
 	ac_cv_lib_milter_mi_stop=no
14050 14050
 fi
14051 14051
 
14052
-rm -f conftest.err conftest.$ac_objext \
14052
+rm -f core conftest.err conftest.$ac_objext \
14053 14053
       conftest$ac_exeext conftest.$ac_ext
14054 14054
 LIBS=$ac_check_lib_save_LIBS
14055 14055
 fi
... ...
@@ -14137,7 +14142,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
14137 14137
 	ac_header_compiler=no
14138 14138
 fi
14139 14139
 
14140
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
14140
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14141 14141
 { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
14142 14142
 echo "${ECHO_T}$ac_header_compiler" >&6; }
14143 14143
 
... ...
@@ -14368,7 +14373,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
14368 14368
 	eval "$as_ac_var=no"
14369 14369
 fi
14370 14370
 
14371
-rm -f conftest.err conftest.$ac_objext \
14371
+rm -f core conftest.err conftest.$ac_objext \
14372 14372
       conftest$ac_exeext conftest.$ac_ext
14373 14373
 fi
14374 14374
 ac_res=`eval echo '${'$as_ac_var'}'`
... ...
@@ -14623,7 +14628,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
14623 14623
 	ac_header_compiler=no
14624 14624
 fi
14625 14625
 
14626
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
14626
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14627 14627
 { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
14628 14628
 echo "${ECHO_T}$ac_header_compiler" >&6; }
14629 14629
 
... ...
@@ -14859,11 +14864,11 @@ echo "${ECHO_T}no" >&6; }
14859 14859
                 LIBS=$save_LIBS
14860 14860
 fi
14861 14861
 
14862
-rm -f conftest.err conftest.$ac_objext \
14862
+rm -f core conftest.err conftest.$ac_objext \
14863 14863
       conftest$ac_exeext conftest.$ac_ext
14864 14864
 fi
14865 14865
 
14866
-rm -f conftest.err conftest.$ac_objext \
14866
+rm -f core conftest.err conftest.$ac_objext \
14867 14867
       conftest$ac_exeext conftest.$ac_ext
14868 14868
 else
14869 14869
   have_wrappers=no
... ...
@@ -14958,7 +14963,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
14958 14958
 
14959 14959
 fi
14960 14960
 
14961
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
14961
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14962 14962
 fi
14963 14963
 if test -z "$ac_cv_gethostbyname_args"; then
14964 14964
 cat >conftest.$ac_ext <<_ACEOF
... ...
@@ -15027,7 +15032,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
15027 15027
 
15028 15028
 fi
15029 15029
 
15030
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
15030
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15031 15031
 fi
15032 15032
 if test -z "$ac_cv_gethostbyname_args"; then
15033 15033
 cat >conftest.$ac_ext <<_ACEOF
... ...
@@ -15099,7 +15104,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
15099 15099
 
15100 15100
 fi
15101 15101
 
15102
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
15102
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15103 15103
 fi
15104 15104
 
15105 15105
 # Check whether --enable-gethostbyname_r was given.
... ...
@@ -15206,7 +15211,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
15206 15206
 
15207 15207
 fi
15208 15208
 
15209
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
15209
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15210 15210
 fi
15211 15211
 if test -z "$ac_cv_readdir_args"; then
15212 15212
     cat >conftest.$ac_ext <<_ACEOF
... ...
@@ -15274,7 +15279,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
15274 15274
 
15275 15275
 fi
15276 15276
 
15277
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
15277
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15278 15278
 fi
15279 15279
 
15280 15280
 # Check whether --enable-readdir_r was given.
... ...
@@ -15389,7 +15394,7 @@ _ACEOF
15389 15389
 
15390 15390
 fi
15391 15391
 
15392
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
15392
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15393 15393
 
15394 15394
     { echo "$as_me:$LINENO: result: yes, and it takes $ac_cv_ctime_args arguments" >&5
15395 15395
 echo "${ECHO_T}yes, and it takes $ac_cv_ctime_args arguments" >&6; }
... ...
@@ -15603,7 +15608,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
15603 15603
 	ac_cv_c_const=no
15604 15604
 fi
15605 15605
 
15606
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
15606
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15607 15607
 fi
15608 15608
 { echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
15609 15609
 echo "${ECHO_T}$ac_cv_c_const" >&6; }
... ...
@@ -15677,7 +15682,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
15677 15677
 
15678 15678
 fi
15679 15679
 
15680
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
15680
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15681 15681
   test "$ac_cv_c_inline" != no && break
15682 15682
 done
15683 15683
 
... ...
@@ -15824,7 +15829,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
15824 15824
 	ac_cv_c_bigendian=no
15825 15825
 fi
15826 15826
 
15827
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
15827
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15828 15828
 else
15829 15829
   echo "$as_me: failed program was:" >&5
15830 15830
 sed 's/^/| /' conftest.$ac_ext >&5
... ...
@@ -15905,7 +15910,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
15905 15905
 
15906 15906
 fi
15907 15907
 
15908
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
15908
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15909 15909
 else
15910 15910
   cat >conftest.$ac_ext <<_ACEOF
15911 15911
 /* confdefs.h.  */
... ...
@@ -15966,7 +15971,7 @@ fi
15966 15966
 
15967 15967
 fi
15968 15968
 
15969
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
15969
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15970 15970
 fi
15971 15971
 { echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
15972 15972
 echo "${ECHO_T}$ac_cv_c_bigendian" >&6; }
... ...
@@ -16064,7 +16069,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
16064 16064
 	have_attrib_packed=no
16065 16065
 fi
16066 16066
 
16067
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
16067
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16068 16068
 
16069 16069
 fi
16070 16070
 
... ...
@@ -16204,7 +16209,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
16204 16204
 	have_attrib_aligned=no
16205 16205
 fi
16206 16206
 
16207
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
16207
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16208 16208
 
16209 16209
 fi
16210 16210
 
... ...
@@ -16292,7 +16297,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
16292 16292
 	have_fd_set=no
16293 16293
 fi
16294 16294
 
16295
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
16295
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16296 16296
 if test $have_fd_set = yes; then
16297 16297
     { echo "$as_me:$LINENO: result: yes, found in sys/types.h" >&5
16298 16298
 echo "${ECHO_T}yes, found in sys/types.h" >&6; }
... ...
@@ -16817,7 +16822,7 @@ exec 6>&1
16817 16817
 # values after options handling.
16818 16818
 ac_log="
16819 16819
 This file was extended by $as_me, which was
16820
-generated by GNU Autoconf 2.59e.  Invocation command line was
16820
+generated by GNU Autoconf 2.60.  Invocation command line was
16821 16821
 
16822 16822
   CONFIG_FILES    = $CONFIG_FILES
16823 16823
   CONFIG_HEADERS  = $CONFIG_HEADERS
... ...
@@ -16870,7 +16875,7 @@ _ACEOF
16870 16870
 cat >>$CONFIG_STATUS <<_ACEOF
16871 16871
 ac_cs_version="\\
16872 16872
 config.status
16873
-configured by $0, generated by GNU Autoconf 2.59e,
16873
+configured by $0, generated by GNU Autoconf 2.60,
16874 16874
   with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
16875 16875
 
16876 16876
 Copyright (C) 2006 Free Software Foundation, Inc.
... ...
@@ -17507,6 +17512,7 @@ $ac_datarootdir_hack
17507 17507
 
17508 17508
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
17509 17509
   { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
17510
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
17510 17511
   { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
17511 17512
 which seems to be undefined.  Please make sure it is defined." >&5
17512 17513
 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
... ...
@@ -94,6 +94,8 @@ libclamav_la_SOURCES = \
94 94
 	petite.h \
95 95
 	wwunpack.c \
96 96
 	wwunpack.h \
97
+	packlibs.c \
98
+	packlibs.h \
97 99
 	fsg.c \
98 100
 	fsg.h \
99 101
 	line.c \
... ...
@@ -82,11 +82,11 @@ am_libclamav_la_OBJECTS = matcher-ac.lo matcher-bm.lo matcher.lo \
82 82
 	filetypes.lo blob.lo mbox.lo message.lo snprintf.lo table.lo \
83 83
 	text.lo ole2_extract.lo vba_extract.lo msexpand.lo pe.lo \
84 84
 	cabd.lo lzxd.lo mszipd.lo qtmd.lo system.lo upx.lo htmlnorm.lo \
85
-	chmunpack.lo rebuildpe.lo petite.lo wwunpack.lo fsg.lo line.lo \
86
-	untar.lo unzip.lo special.lo binhex.lo is_tar.lo tnef.lo \
87
-	unrar15.lo unrarvm.lo unrar.lo unrarfilter.lo unrarppm.lo \
88
-	unrar20.lo unrarcmd.lo pdf.lo spin.lo yc.lo elf.lo sis.lo \
89
-	uuencode.lo pst.lo
85
+	chmunpack.lo rebuildpe.lo petite.lo wwunpack.lo packlibs.lo \
86
+	fsg.lo line.lo untar.lo unzip.lo special.lo binhex.lo \
87
+	is_tar.lo tnef.lo unrar15.lo unrarvm.lo unrar.lo \
88
+	unrarfilter.lo unrarppm.lo unrar20.lo unrarcmd.lo pdf.lo \
89
+	spin.lo yc.lo elf.lo sis.lo uuencode.lo pst.lo
90 90
 libclamav_la_OBJECTS = $(am_libclamav_la_OBJECTS)
91 91
 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
92 92
 depcomp = $(SHELL) $(top_srcdir)/depcomp
... ...
@@ -293,6 +293,8 @@ libclamav_la_SOURCES = \
293 293
 	petite.h \
294 294
 	wwunpack.c \
295 295
 	wwunpack.h \
296
+	packlibs.c \
297
+	packlibs.h \
296 298
 	fsg.c \
297 299
 	fsg.h \
298 300
 	line.c \
... ...
@@ -432,6 +434,7 @@ distclean-compile:
432 432
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mszipd.Plo@am__quote@
433 433
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ole2_extract.Plo@am__quote@
434 434
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/others.Plo@am__quote@
435
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/packlibs.Plo@am__quote@
435 436
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pdf.Plo@am__quote@
436 437
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe.Plo@am__quote@
437 438
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/petite.Plo@am__quote@
... ...
@@ -48,155 +48,14 @@
48 48
 #include "pe.h"
49 49
 #include "rebuildpe.h"
50 50
 #include "others.h"
51
+#include "packlibs.h"
51 52
 
52 53
 
53
-static int doubledl(char **scur, uint8_t *mydlptr, char *buffer, uint32_t buffersize)
54
-{
55
-  unsigned char mydl = *mydlptr;
56
-  unsigned char olddl = mydl;
57
-
58
-  mydl*=2;
59
-  if ( !(olddl & 0x7f)) {
60
-    if ( *scur < buffer || *scur >= buffer+buffersize-1 )
61
-      return -1;
62
-    olddl = **scur;
63
-    mydl = olddl*2+1;
64
-    *scur=*scur + 1;
65
-  }
66
-  *mydlptr = mydl;
67
-  return (olddl>>7)&1;
68
-}
69
-
70
-static int unfsg(char *source, char *dest, int ssize, int dsize, char **endsrc, char **enddst) {
71
-  uint8_t mydl=0x80;
72
-  uint32_t backbytes, backsize, oldback = 0;
73
-  char *csrc = source, *cdst = dest;
74
-  int oob, lostbit = 1;
75
-
76
-  /* I assume buffers size is >0 - No checking! */
77
-  *cdst++=*csrc++;
78
-
79
-  while ( 1 ) {
80
-    if ((oob=doubledl(&csrc, &mydl, source, ssize))) {
81
-      if (oob == -1)
82
-	return -1;
83
-      /* 164 */
84
-      backsize = 0;
85
-      if ((oob=doubledl(&csrc, &mydl, source, ssize))) {
86
-	if (oob == -1)
87
-	  return -1;
88
-	/* 16a */
89
-	backbytes = 0;
90
-	if ((oob=doubledl(&csrc, &mydl, source, ssize))) {
91
-	  if (oob == -1)
92
-	    return -1;
93
-	  /* 170 */
94
-	  lostbit = 1;
95
-	  backsize++;
96
-	  backbytes = 0x10;
97
-	  while ( backbytes < 0x100 ) {
98
-	    if ((oob=doubledl(&csrc, &mydl, source, ssize)) == -1)
99
-	      return -1;
100
-	    backbytes = backbytes*2+oob;
101
-	  }
102
-	  backbytes &= 0xff;
103
-	  if ( ! backbytes ) {
104
-	    if (cdst >= dest+dsize)
105
-	      return -1;
106
-	    *cdst++=0x00;
107
-	    continue;
108
-	  }
109
-	} else {
110
-	  /* 18f */
111
-	  if (csrc >= source+ssize)
112
-	    return -1;
113
-	  backbytes = *(unsigned char*)csrc;
114
-	  backsize = backsize * 2 + (backbytes & 1);
115
-	  backbytes = (backbytes & 0xff)>>1;
116
-	  csrc++;
117
-	  if (! backbytes)
118
-	    break;
119
-	  backsize+=2;
120
-	  oldback = backbytes;
121
-	  lostbit = 0;
122
-	}
123
-      } else {
124
-	/* 180 */
125
-	backsize = 1;
126
-	do {
127
-	  if ((oob=doubledl(&csrc, &mydl, source, ssize)) == -1)
128
-	    return -1;
129
-	  backsize = backsize*2+oob;
130
-	  if ((oob=doubledl(&csrc, &mydl, source, ssize)) == -1)
131
-	    return -1;
132
-	} while (oob);
133
-
134
-	backsize = backsize - 1 - lostbit;
135
-	if (! backsize) {
136
-	  /* 18a */
137
-	  backsize = 1;
138
-	  do {
139
-	    if ((oob=doubledl(&csrc, &mydl, source, ssize)) == -1)
140
-	      return -1;
141
-	    backsize = backsize*2+oob;
142
-	    if ((oob=doubledl(&csrc, &mydl, source, ssize)) == -1)
143
-	      return -1;
144
-	  } while (oob);
145
-
146
-	  backbytes = oldback;
147
-	} else {
148
-	  /* 198 */
149
-	  if (csrc >= source+ssize)
150
-	    return -1;
151
-	  backbytes = *(unsigned char*)csrc;
152
-	  backbytes += (backsize-1)<<8;
153
-	  backsize = 1;
154
-	  csrc++;
155
-	  do {
156
-	    if ((oob=doubledl(&csrc, &mydl, source, ssize)) == -1)
157
-	      return -1;
158
-	    backsize = backsize*2+oob;
159
-	    if ((oob=doubledl(&csrc, &mydl, source, ssize)) == -1)
160
-	      return -1;
161
-	  } while (oob);
162
-
163
-          if (backbytes >= 0x7d00)
164
-            backsize++;
165
-          if (backbytes >= 0x500)
166
-            backsize++;
167
-          if (backbytes <= 0x7f)
168
-            backsize += 2;
169
-
170
-	  oldback = backbytes;
171
-	}
172
-	lostbit = 0;
173
-      }
174
-      if (!CLI_ISCONTAINED(dest, dsize, cdst, backsize) || !CLI_ISCONTAINED(dest, dsize, cdst-backbytes, backsize))
175
-	return -1;
176
-      while(backsize--) {
177
-	*cdst=*(cdst-backbytes);
178
-	cdst++;
179
-      }
180
-
181
-    } else {
182
-      /* 15d */
183
-      if (cdst < dest || cdst >= dest+dsize || csrc < source || csrc >= source+ssize)
184
-	return -1;
185
-      *cdst++=*csrc++;
186
-      lostbit=1;
187
-    }
188
-  }
189
-
190
-  *endsrc = csrc;
191
-  *enddst = cdst;
192
-  return 0;
193
-}
194
-
195 54
 int unfsg_200(char *source, char *dest, int ssize, int dsize, uint32_t rva, uint32_t base, uint32_t ep, int file) {
196
-  char *fake, *tsrc;
55
+  char *tsrc;
197 56
   struct SECTION section; /* Yup, just one ;) */
198 57
   
199
-  if ( unfsg(source, dest, ssize, dsize, &fake, &fake) ) return -1;
58
+  if ( cli_unfsg(source, dest, ssize, dsize, NULL, NULL) ) return -1;
200 59
   
201 60
   section.raw=0;
202 61
   section.rsz = dsize;
... ...
@@ -222,7 +81,7 @@ int unfsg_133(char *source, char *dest, int ssize, int dsize, struct SECTION *se
222 222
 
223 223
   for (i = 0 ; i <= sectcount ; i++) {
224 224
     char *startd=tdst;
225
-    if ( unfsg(tsrc, tdst, ssize - (tsrc - source), dsize - (tdst - dest), &tsrc, &tdst) == -1 )
225
+    if ( cli_unfsg(tsrc, tdst, ssize - (tsrc - source), dsize - (tdst - dest), &tsrc, &tdst) == -1 )
226 226
       return -1;
227 227
 
228 228
     /* RVA has been filled already in pe.c */
229 229
new file mode 100644
... ...
@@ -0,0 +1,168 @@
0
+/*
1
+ *  Copyright (C) 2006 aCaB <acab@clamav.net>
2
+ *
3
+ *  This program is free software; you can redistribute it and/or modify
4
+ *  it under the terms of the GNU General Public License as published by
5
+ *  the Free Software Foundation; either version 2 of the License, or
6
+ *  (at your option) any later version.
7
+ *
8
+ *  This program is distributed in the hope that it will be useful,
9
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
+ *  GNU General Public License for more details.
12
+ *
13
+ *  You should have received a copy of the GNU General Public License
14
+ *  along with this program; if not, write to the Free Software
15
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
16
+ *  MA 02110-1301, USA.
17
+ */
18
+
19
+
20
+#if HAVE_CONFIG_H
21
+#include "clamav-config.h"
22
+#endif
23
+
24
+#include "others.h"
25
+
26
+static int doubledl(char **scur, uint8_t *mydlptr, char *buffer, uint32_t buffersize)
27
+{
28
+  unsigned char mydl = *mydlptr;
29
+  unsigned char olddl = mydl;
30
+
31
+  mydl*=2;
32
+  if ( !(olddl & 0x7f)) {
33
+    if ( *scur < buffer || *scur >= buffer+buffersize-1 )
34
+      return -1;
35
+    olddl = **scur;
36
+    mydl = olddl*2+1;
37
+    *scur=*scur + 1;
38
+  }
39
+  *mydlptr = mydl;
40
+  return (olddl>>7)&1;
41
+}
42
+
43
+
44
+int cli_unfsg(char *source, char *dest, int ssize, int dsize, char **endsrc, char **enddst) {
45
+  uint8_t mydl=0x80;
46
+  uint32_t backbytes, backsize, oldback = 0;
47
+  char *csrc = source, *cdst = dest;
48
+  int oob, lostbit = 1;
49
+
50
+  /* I assume buffers size is >0 - No checking! */
51
+  *cdst++=*csrc++;
52
+
53
+  while ( 1 ) {
54
+    if ((oob=doubledl(&csrc, &mydl, source, ssize))) {
55
+      if (oob == -1)
56
+	return -1;
57
+      /* 164 */
58
+      backsize = 0;
59
+      if ((oob=doubledl(&csrc, &mydl, source, ssize))) {
60
+	if (oob == -1)
61
+	  return -1;
62
+	/* 16a */
63
+	backbytes = 0;
64
+	if ((oob=doubledl(&csrc, &mydl, source, ssize))) {
65
+	  if (oob == -1)
66
+	    return -1;
67
+	  /* 170 */
68
+	  lostbit = 1;
69
+	  backsize++;
70
+	  backbytes = 0x10;
71
+	  while ( backbytes < 0x100 ) {
72
+	    if ((oob=doubledl(&csrc, &mydl, source, ssize)) == -1)
73
+	      return -1;
74
+	    backbytes = backbytes*2+oob;
75
+	  }
76
+	  backbytes &= 0xff;
77
+	  if ( ! backbytes ) {
78
+	    if (cdst >= dest+dsize)
79
+	      return -1;
80
+	    *cdst++=0x00;
81
+	    continue;
82
+	  }
83
+	} else {
84
+	  /* 18f */
85
+	  if (csrc >= source+ssize)
86
+	    return -1;
87
+	  backbytes = *(unsigned char*)csrc;
88
+	  backsize = backsize * 2 + (backbytes & 1);
89
+	  backbytes = (backbytes & 0xff)>>1;
90
+	  csrc++;
91
+	  if (! backbytes)
92
+	    break;
93
+	  backsize+=2;
94
+	  oldback = backbytes;
95
+	  lostbit = 0;
96
+	}
97
+      } else {
98
+	/* 180 */
99
+	backsize = 1;
100
+	do {
101
+	  if ((oob=doubledl(&csrc, &mydl, source, ssize)) == -1)
102
+	    return -1;
103
+	  backsize = backsize*2+oob;
104
+	  if ((oob=doubledl(&csrc, &mydl, source, ssize)) == -1)
105
+	    return -1;
106
+	} while (oob);
107
+
108
+	backsize = backsize - 1 - lostbit;
109
+	if (! backsize) {
110
+	  /* 18a */
111
+	  backsize = 1;
112
+	  do {
113
+	    if ((oob=doubledl(&csrc, &mydl, source, ssize)) == -1)
114
+	      return -1;
115
+	    backsize = backsize*2+oob;
116
+	    if ((oob=doubledl(&csrc, &mydl, source, ssize)) == -1)
117
+	      return -1;
118
+	  } while (oob);
119
+
120
+	  backbytes = oldback;
121
+	} else {
122
+	  /* 198 */
123
+	  if (csrc >= source+ssize)
124
+	    return -1;
125
+	  backbytes = *(unsigned char*)csrc;
126
+	  backbytes += (backsize-1)<<8;
127
+	  backsize = 1;
128
+	  csrc++;
129
+	  do {
130
+	    if ((oob=doubledl(&csrc, &mydl, source, ssize)) == -1)
131
+	      return -1;
132
+	    backsize = backsize*2+oob;
133
+	    if ((oob=doubledl(&csrc, &mydl, source, ssize)) == -1)
134
+	      return -1;
135
+	  } while (oob);
136
+
137
+          if (backbytes >= 0x7d00)
138
+            backsize++;
139
+          if (backbytes >= 0x500)
140
+            backsize++;
141
+          if (backbytes <= 0x7f)
142
+            backsize += 2;
143
+
144
+	  oldback = backbytes;
145
+	}
146
+	lostbit = 0;
147
+      }
148
+      if (!CLI_ISCONTAINED(dest, dsize, cdst, backsize) || !CLI_ISCONTAINED(dest, dsize, cdst-backbytes, backsize))
149
+	return -1;
150
+      while(backsize--) {
151
+	*cdst=*(cdst-backbytes);
152
+	cdst++;
153
+      }
154
+
155
+    } else {
156
+      /* 15d */
157
+      if (cdst < dest || cdst >= dest+dsize || csrc < source || csrc >= source+ssize)
158
+	return -1;
159
+      *cdst++=*csrc++;
160
+      lostbit=1;
161
+    }
162
+  }
163
+
164
+  if (endsrc) *endsrc = csrc;
165
+  if (enddst) *enddst = cdst;
166
+  return 0;
167
+}
0 168
new file mode 100644
... ...
@@ -0,0 +1,25 @@
0
+/*
1
+ *  Copyright (C) 2005 aCaB <acab@clamav.net>
2
+ *
3
+ *  This program is free software; you can redistribute it and/or modify
4
+ *  it under the terms of the GNU General Public License as published by
5
+ *  the Free Software Foundation; either version 2 of the License, or
6
+ *  (at your option) any later version.
7
+ *
8
+ *  This program is distributed in the hope that it will be useful,
9
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
+ *  GNU General Public License for more details.
12
+ *
13
+ *  You should have received a copy of the GNU General Public License
14
+ *  along with this program; if not, write to the Free Software
15
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
16
+ *  MA 02110-1301, USA.
17
+ */
18
+
19
+#ifndef __SPIN_H
20
+#define __SPIN_H
21
+
22
+cli_unfsg(char *, char *, int, int, char **, char **);
23
+
24
+#endif
... ...
@@ -63,6 +63,7 @@
63 63
 #include "rebuildpe.h"
64 64
 #include "others.h"
65 65
 #include "spin.h"
66
+#include "packlibs.h"
66 67
 
67 68
 #define EC32(x) le32_to_host(x) /* Convert little endian to host */
68 69
 
... ...
@@ -130,150 +131,6 @@ static char exec86(uint8_t aelle, uint8_t cielle, char *curremu) {
130 130
 }
131 131
 
132 132
 
133
-static int doubledl(char **scur, uint8_t *mydlptr, char *buffer, int buffersize)
134
-{
135
-  unsigned char mydl = *mydlptr;
136
-  unsigned char olddl = mydl;
137
-
138
-  mydl*=2;
139
-  if ( !(olddl & 0x7f)) {
140
-    if ( *scur < buffer || *scur >= buffer+buffersize-1 )
141
-      return -1;
142
-    olddl = **scur;
143
-    mydl = olddl*2+1;
144
-    *scur=*scur + 1;
145
-  }
146
-  *mydlptr = mydl;
147
-  return (olddl>>7)&1;
148
-}
149
-
150
-
151
-static int unfsg(char *source, char *dest, int ssize, int dsize) {
152
-  uint8_t mydl=0x80;
153
-  uint32_t backbytes, backsize, oldback = 0;
154
-  char *csrc = source, *cdst = dest;
155
-  int oob, lostbit = 1;
156
-
157
-  /* I assume buffers size is >0 - No checking! */
158
-  *cdst++=*csrc++;
159
-
160
-  while ( 1 ) {
161
-    if ((oob=doubledl(&csrc, &mydl, source, ssize))) {
162
-      if (oob == -1)
163
-	return -1;
164
-      /* 164 */
165
-      backsize = 0;
166
-      if ((oob=doubledl(&csrc, &mydl, source, ssize))) {
167
-	if (oob == -1)
168
-	  return -1;
169
-	/* 16a */
170
-	backbytes = 0;
171
-	if ((oob=doubledl(&csrc, &mydl, source, ssize))) {
172
-	  if (oob == -1)
173
-	    return -1;
174
-	  /* 170 */
175
-	  lostbit = 1;
176
-	  backsize++;
177
-	  backbytes = 0x10;
178
-	  while ( backbytes < 0x100 ) {
179
-	    if ((oob=doubledl(&csrc, &mydl, source, ssize)) == -1)
180
-	      return -1;
181
-	    backbytes = backbytes*2+oob;
182
-	  }
183
-	  backbytes &= 0xff;
184
-	  if ( ! backbytes ) {
185
-	    if (cdst >= dest+dsize)
186
-	      return -1;
187
-	    *cdst++=0x00;
188
-	    continue;
189
-	  } else {
190
-	    /* repne movsb - FIXME dont remove for now */
191
-	  }
192
-	} else {
193
-	  /* 18f */
194
-	  if (csrc >= source+ssize)
195
-	    return -1;
196
-	  backbytes = *(unsigned char*)csrc;
197
-	  backsize = backsize * 2 + (backbytes & 1);
198
-	  backbytes = (backbytes & 0xff)>>1;
199
-	  csrc++;
200
-	  if (! backbytes)
201
-	    break;
202
-	  backsize+=2;
203
-	  oldback = backbytes;
204
-	  lostbit = 0;
205
-	}
206
-      } else {
207
-	/* 180 */
208
-	backsize = 1;
209
-	do {
210
-	  if ((oob=doubledl(&csrc, &mydl, source, ssize)) == -1)
211
-	    return -1;
212
-	  backsize = backsize*2+oob;
213
-	  if ((oob=doubledl(&csrc, &mydl, source, ssize)) == -1)
214
-	    return -1;
215
-	} while (oob);
216
-
217
-	backsize = backsize - 1 - lostbit;
218
-	if (! backsize) {
219
-	  /* 18a */
220
-	  backsize = 1;
221
-	  do {
222
-	    if ((oob=doubledl(&csrc, &mydl, source, ssize)) == -1)
223
-	      return -1;
224
-	    backsize = backsize*2+oob;
225
-	    if ((oob=doubledl(&csrc, &mydl, source, ssize)) == -1)
226
-	      return -1;
227
-	  } while (oob);
228
-
229
-	  backbytes = oldback;
230
-	} else {
231
-	  /* 198 */
232
-	  if (csrc >= source+ssize)
233
-	    return -1;
234
-	  backbytes = *(unsigned char*)csrc;
235
-	  backbytes += (backsize-1)<<8;
236
-	  backsize = 1;
237
-	  csrc++;
238
-	  do {
239
-	    if ((oob=doubledl(&csrc, &mydl, source, ssize)) == -1)
240
-	      return -1;
241
-	    backsize = backsize*2+oob;
242
-	    if ((oob=doubledl(&csrc, &mydl, source, ssize)) == -1)
243
-	      return -1;
244
-	  } while (oob);
245
-
246
-          if (backbytes >= 0x7d00)
247
-            backsize++;
248
-          if (backbytes >= 0x500)
249
-            backsize++;
250
-          if (backbytes <= 0x7f)
251
-            backsize += 2;
252
-
253
-	  oldback = backbytes;
254
-	}
255
-	lostbit = 0;
256
-      }
257
-      if ((backsize > (uint32_t)(dest + dsize - cdst)) || (backbytes > (uint32_t)(cdst - dest)))
258
-	return -1;
259
-      while(backsize--) {
260
-	*cdst=*(cdst-backbytes);
261
-	cdst++;
262
-      }
263
-
264
-    } else {
265
-      /* 15d */
266
-      if (cdst < dest || cdst >= dest+dsize || csrc < source || csrc >= source+ssize)
267
-	return -1;
268
-      *cdst++=*csrc++;
269
-      lostbit=1;
270
-    }
271
-  }
272
-
273
-  return 0;
274
-}
275
-
276
-
277 133
 static uint32_t summit (char *src, int size) 
278 134
 {
279 135
   uint32_t eax=0xffffffff, ebx=0xffffffff;
... ...
@@ -519,7 +376,7 @@ int unspin(char *src, int ssize, struct pe_image_section_hdr *sections, int sect
519 519
        blobsz+=EC32(sections[j].VirtualSize);
520 520
        memset(sects[j], 0, EC32(sections[j].VirtualSize));
521 521
        cli_dbgmsg("spin: Growing sect%d: was %x will be %x\n", j, EC32(sections[j].SizeOfRawData), EC32(sections[j].VirtualSize));
522
-       if ( unfsg(src + EC32(sections[j].PointerToRawData), sects[j], EC32(sections[j].SizeOfRawData), EC32(sections[j].VirtualSize)) == -1 ) {
522
+       if ( cli_unfsg(src + EC32(sections[j].PointerToRawData), sects[j], EC32(sections[j].SizeOfRawData), EC32(sections[j].VirtualSize), NULL, NULL) == -1 ) {
523 523
 	 len++;
524 524
          cli_dbgmsg("spin: Unpack failure\n");
525 525
        }
... ...
@@ -560,7 +417,7 @@ int unspin(char *src, int ssize, struct pe_image_section_hdr *sections, int sect
560 560
       if ( (curr=(char *)cli_malloc(EC32(sections[j].VirtualSize))) != NULL ) {
561 561
 	memcpy(curr, src + EC32(sections[j].PointerToRawData), key32 - EC32(sections[j].VirtualAddress)); /* Uncompressed part */
562 562
 	memset(curr + key32 - EC32(sections[j].VirtualAddress), 0, EC32(sections[j].VirtualSize) - (key32 - EC32(sections[j].VirtualAddress))); /* bzero */
563
-	if ( unfsg(src + EC32(sections[j].PointerToRawData) + key32 - EC32(sections[j].VirtualAddress), curr + key32 - EC32(sections[j].VirtualAddress), EC32(sections[j].SizeOfRawData) - (key32 - EC32(sections[j].VirtualAddress)), EC32(sections[j].VirtualSize) - (key32 - EC32(sections[j].VirtualAddress))) ) {
563
+	if ( cli_unfsg(src + EC32(sections[j].PointerToRawData) + key32 - EC32(sections[j].VirtualAddress), curr + key32 - EC32(sections[j].VirtualAddress), EC32(sections[j].SizeOfRawData) - (key32 - EC32(sections[j].VirtualAddress)), EC32(sections[j].VirtualSize) - (key32 - EC32(sections[j].VirtualAddress)), NULL, NULL) ) {
564 564
       
565 565
 	  free(curr);
566 566
 	  cli_dbgmsg("spin: Failed to grow resources, continuing anyway\n");