aboutsummaryrefslogtreecommitdiffstats
path: root/archivers
diff options
context:
space:
mode:
Diffstat (limited to 'archivers')
-rw-r--r--archivers/Makefile1
-rw-r--r--archivers/upx/Makefile47
-rw-r--r--archivers/upx/distinfo4
-rw-r--r--archivers/upx/files/freebsd.h229
-rw-r--r--archivers/upx/files/l_b_n2b.h157
-rw-r--r--archivers/upx/files/l_b_n2d.h158
-rw-r--r--archivers/upx/files/l_b_n2e.h159
-rw-r--r--archivers/upx/files/patch-Makefile40
-rw-r--r--archivers/upx/files/patch-Makefile.inc11
-rw-r--r--archivers/upx/files/patch-conf.h19
-rw-r--r--archivers/upx/files/patch-help.cpp12
-rw-r--r--archivers/upx/files/patch-p_unix.cpp98
-rw-r--r--archivers/upx/files/patch-p_unix.h28
-rw-r--r--archivers/upx/files/patch-packmast.cpp11
-rw-r--r--archivers/upx/files/patch-stub-Makefile70
-rw-r--r--archivers/upx/files/patch-stub-l_linux.c150
-rw-r--r--archivers/upx/files/patch-stub-linux.hh54
-rw-r--r--archivers/upx/pkg-descr12
-rw-r--r--archivers/upx/pkg-message1
19 files changed, 1261 insertions, 0 deletions
diff --git a/archivers/Makefile b/archivers/Makefile
index 2a887c70a39..3d650278f12 100644
--- a/archivers/Makefile
+++ b/archivers/Makefile
@@ -70,6 +70,7 @@
SUBDIR += unrar
SUBDIR += untar
SUBDIR += unzip
+ SUBDIR += upx
SUBDIR += wzip
SUBDIR += xdms
SUBDIR += xmill
diff --git a/archivers/upx/Makefile b/archivers/upx/Makefile
new file mode 100644
index 00000000000..2fcf0b01a9a
--- /dev/null
+++ b/archivers/upx/Makefile
@@ -0,0 +1,47 @@
+# New ports collection makefile for: upx
+# Date created: 17 Feb 2004
+# Whom: Max Khon <fjoe@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= upx
+PORTVERSION= 1.24
+CATEGORIES= archivers
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
+MASTER_SITE_SUBDIR= upx/
+DISTNAME= ${PORTNAME}-${PORTVERSION}-src
+
+MAINTAINER= fjoe@FreeBSD.org
+COMMENT= The Ultimate Packer for eXecutables
+
+LIB_DEPENDS= ucl.1:${PORTSDIR}/archivers/ucl
+
+USE_GMAKE= yes
+USE_PERL5_BUILD=yes
+WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}/src
+MAKE_ENV= UCLDIR=${LOCALBASE} target=freebsd
+
+PORTDOCS= BUGS COPYING LICENSE NEWS README THANKS
+MAN1= upx.1
+PLIST_FILES= bin/upx
+
+post-patch:
+ @${CP} ${FILESDIR}/freebsd.h ${WRKSRC}/config_h
+ @${CP} ${FILESDIR}/l_b_n2?.h ${WRKSRC}/stub
+
+post-build:
+ @cd ${WRKSRC}/../doc && ${GMAKE}
+
+do-install:
+ @${INSTALL_PROGRAM} ${WRKSRC}/upx ${PREFIX}/bin
+ @${INSTALL_MAN} ${WRKSRC}/../doc/upx.1 ${MANPREFIX}/man/man1
+.if !defined(NOPORTDOCS)
+ @${MKDIR} ${DOCSDIR}
+ @for i in ${PORTDOCS}; do \
+ ${INSTALL_DATA} ${WRKSRC}/../$$i ${DOCSDIR}; \
+ done
+.endif
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.mk>
diff --git a/archivers/upx/distinfo b/archivers/upx/distinfo
new file mode 100644
index 00000000000..d4c0638def7
--- /dev/null
+++ b/archivers/upx/distinfo
@@ -0,0 +1,4 @@
+MD5 (upx-1.24-src.tar.gz) = c7addf22766bdc9878e0a191855eec16
+SIZE (upx-1.24-src.tar.gz) = 222976
+MD5 (ucl-1.02.tar.gz) = e35efd120104c522acfd0e1a5c3ec091
+SIZE (ucl-1.02.tar.gz) = 513433
diff --git a/archivers/upx/files/freebsd.h b/archivers/upx/files/freebsd.h
new file mode 100644
index 00000000000..eb94e286dd8
--- /dev/null
+++ b/archivers/upx/files/freebsd.h
@@ -0,0 +1,229 @@
+/* pseudo <config.h> for Linux */
+
+#ifndef __UPX_CONFIG_H
+#define __UPX_CONFIG_H
+
+/* $TOP$ */
+
+/* Define to empty if the keyword does not work. */
+/* #undef const */
+
+/* Define if your C compiler doesn't accept -c and -o together. */
+/* #undef NO_MINUS_C_MINUS_O */
+
+/* Define as the return type of signal handlers (int or void). */
+#define RETSIGTYPE void
+
+/* Define to `unsigned' if <sys/types.h> doesn't define. */
+/* #undef size_t */
+
+/* Define if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+
+/* Define if your memcmp is broken. */
+/* #undef NO_MEMCMP */
+
+/* Define to `long' if <stddef.h> doesn't define. */
+/* #undef ptrdiff_t */
+
+/* Define when using the dmalloc package. */
+/* #undef WITH_DMALLOC */
+
+/* Define if you have the access function. */
+#define HAVE_ACCESS 1
+
+/* Define if you have the atoi function. */
+#define HAVE_ATOI 1
+
+/* Define if you have the chmod function. */
+#define HAVE_CHMOD 1
+
+/* Define if you have the chown function. */
+#define HAVE_CHOWN 1
+
+/* Define if you have the ctime function. */
+#define HAVE_CTIME 1
+
+/* Define if you have the difftime function. */
+#define HAVE_DIFFTIME 1
+
+/* Define if you have the fchmod function. */
+#define HAVE_FCHMOD 1
+
+/* Define if you have the fileno function. */
+#define HAVE_FILENO 1
+
+/* Define if you have the fstat function. */
+#define HAVE_FSTAT 1
+
+/* Define if you have the XXX function. */
+#define HAVE_GETPID 1
+
+/* Define if you have the XXX function. */
+#define HAVE_GETTIMEOFDAY 1
+
+/* Define if you have the getumask function. */
+/* #undef HAVE_GETUMASK */
+
+/* Define if you have the gmtime function. */
+#define HAVE_GMTIME 1
+
+/* Define if you have the index function. */
+#define HAVE_INDEX 1
+
+/* Define if you have the isatty function. */
+#define HAVE_ISATTY 1
+
+/* Define if you have the lstat function. */
+#define HAVE_LSTAT 1
+
+/* Define if you have the localtime function. */
+#define HAVE_LOCALTIME 1
+
+/* Define if you have the memcmp function. */
+#define HAVE_MEMCMP 1
+
+/* Define if you have the memcpy function. */
+#define HAVE_MEMCPY 1
+
+/* Define if you have the memmove function. */
+#define HAVE_MEMMOVE 1
+
+/* Define if you have the memset function. */
+#define HAVE_MEMSET 1
+
+/* Define if you have the mktime function. */
+#define HAVE_MKTIME 1
+
+/* Define if you have the setmode function. */
+/* #undef HAVE_SETMODE */
+
+/* Define if you have the stat function. */
+#define HAVE_STAT 1
+
+/* Define if you have the strcasecmp function. */
+#define HAVE_STRCASECMP 1
+
+/* Define if you have the strchr function. */
+#define HAVE_STRCHR 1
+
+/* Define if you have the strdup function. */
+#define HAVE_STRDUP 1
+
+/* Define if you have the strftime function. */
+#define HAVE_STRFTIME 1
+
+/* Define if you have the stricmp function. */
+/* #undef HAVE_STRICMP */
+
+/* Define if you have the strncasecmp function. */
+#define HAVE_STRNCASECMP 1
+
+/* Define if you have the strnicmp function. */
+/* #undef HAVE_STRNICMP */
+
+/* Define if you have the strstr function. */
+#define HAVE_STRSTR 1
+
+/* Define if you have the tzset function. */
+#define HAVE_TZSET 1
+
+/* Define if you have the umask function. */
+#define HAVE_UMASK 1
+
+/* Define if you have the utime function. */
+#define HAVE_UTIME 1
+
+/* Define if you have the vsnprintf function. */
+#define HAVE_VSNPRINTF 1
+
+/* Define if you have the <assert.h> header file. */
+#define HAVE_ASSERT_H 1
+
+/* Define if you have the <ctype.h> header file. */
+#define HAVE_CTYPE_H 1
+
+/* Define if you have the <curses.h> header file. */
+#define HAVE_CURSES_H 1
+
+/* Define if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define if you have the <linux/kd.h> header file. */
+#define HAVE_LINUX_KD_H 1
+
+/* Define if you have the <linux/kdev_t.h> header file. */
+#define HAVE_LINUX_KDEV_T_H 1
+
+/* Define if you have the <linux/major.h> header file. */
+#define HAVE_LINUX_MAJOR_H 1
+
+/* Define if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define if you have the <ncurses.h> header file. */
+#define HAVE_NCURSES_H 1
+
+/* Define if you have the <signal.h> header file. */
+#define HAVE_SIGNAL_H 1
+
+/* Define if you have the <stddef.h> header file. */
+#define HAVE_STDDEF_H 1
+
+/* Define if you have the <stdint.h> header file. */
+/* #undef HAVE_STDINT_H */
+
+/* Define if you have the <sys/param.h> header file. */
+#define HAVE_SYS_PARAM_H 1
+
+/* Define if you have the <sys/resource.h> header file. */
+#define HAVE_SYS_RESOURCE_H 1
+
+/* Define if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define if you have the <sys/times.h> header file. */
+#define HAVE_SYS_TIMES_H 1
+
+/* Define if you have the <sys/utime.h> header file. */
+/* #undef HAVE_SYS_UTIME_H */
+
+/* Define if you have the <time.h> header file. */
+#define HAVE_TIME_H 1
+
+/* Define if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define if you have the <utime.h> header file. */
+#define HAVE_UTIME_H 1
+
+/* $BOTTOM$ */
+
+#if defined(HAVE_GMTIME) && !defined(TIME_WITH_SYS_TIME)
+# undef /**/ HAVE_GMTIME
+#endif
+
+#if defined(HAVE_LOCALTIME) && !defined(TIME_WITH_SYS_TIME)
+# undef /**/ HAVE_LOCALTIME
+#endif
+
+#if defined(HAVE_STRFTIME) && !defined(TIME_WITH_SYS_TIME)
+# undef /**/ HAVE_STRFTIME
+#endif
+
+#if defined(HAVE_SYS_RESOURCE_H) && !defined(TIME_WITH_SYS_TIME)
+# undef /**/ HAVE_SYS_RESOURCE_H
+#endif
+
+#if defined(HAVE_SYS_TIMES_H) && !defined(TIME_WITH_SYS_TIME)
+# undef /**/ HAVE_SYS_TIMES_H
+#endif
+
+#endif /* already included */
+
+/*
+vi:ts=4
+*/
diff --git a/archivers/upx/files/l_b_n2b.h b/archivers/upx/files/l_b_n2b.h
new file mode 100644
index 00000000000..f14a4c71dc6
--- /dev/null
+++ b/archivers/upx/files/l_b_n2b.h
@@ -0,0 +1,157 @@
+/* l_b_n2b.h -- created from l_b_n2b.bin, 1980 (0x7bc) bytes
+
+ This file is part of the UPX executable compressor.
+
+ Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1996-2002 Laszlo Molnar
+ All Rights Reserved.
+
+ UPX and the UCL library are free software; you can redistribute them
+ and/or modify them 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; see the file COPYING.
+ If not, write to the Free Software Foundation, Inc.,
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ Markus F.X.J. Oberhumer Laszlo Molnar
+ <mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
+ */
+
+
+#define FREEBSD_I386_NRV2B_LOADER_ADLER32 0x6722f524
+#define FREEBSD_I386_NRV2B_LOADER_CRC32 0xbd6617db
+
+unsigned char freebsd_i386_nrv2b_loader[1980] = {
+127, 69, 76, 70, 1, 1, 1, 9, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */
+ 2, 0, 3, 0, 1, 0, 0, 0,128,128, 4, 8, 52, 0, 0, 0, /* 0x 10 */
+ 0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 32, 0, 2, 0, 0, 0, /* 0x 20 */
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,128, 4, 8, /* 0x 30 */
+ 0,128, 4, 8,164, 7, 0, 0,164, 7, 0, 0, 5, 0, 0, 0, /* 0x 40 */
+ 0, 16, 0, 0, 1, 0, 0, 0,164, 7, 0, 0,164,151, 4, 8, /* 0x 50 */
+164,151, 4, 8, 24, 0, 0, 0, 28, 0, 0, 0, 6, 0, 0, 0, /* 0x 60 */
+ 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 70 */
+ 49,237, 88,137,225,141, 84,129, 4, 80,131,228,248, 82, 81,232, /* 0x 80 */
+ 36, 2, 0, 0,244, 10, 0, 36, 73,110,102,111, 58, 32, 84,104, /* 0x 90 */
+105,115, 32,102,105,108,101, 32,105,115, 32,112, 97, 99,107,101, /* 0x a0 */
+100, 32,119,105,116,104, 32,116,104,101, 32, 85, 80, 88, 32,101, /* 0x b0 */
+120,101, 99,117,116, 97, 98,108,101, 32,112, 97, 99,107,101,114, /* 0x c0 */
+ 32,104,116,116,112, 58, 47, 47,117,112,120, 46,115,102, 46,110, /* 0x d0 */
+101,116, 32, 36, 10, 0, 36, 73,100, 58, 32, 85, 80, 88, 32, 49, /* 0x e0 */
+ 46, 50, 52, 32, 67,111,112,121,114,105,103,104,116, 32, 40, 67, /* 0x f0 */
+ 41, 32, 49, 57, 57, 54, 45, 50, 48, 48, 50, 32,116,104,101, 32, /* 0x 100 */
+ 85, 80, 88, 32, 84,101, 97,109, 46, 32, 65,108,108, 32, 82,105, /* 0x 110 */
+103,104,116,115, 32, 82,101,115,101,114,118,101,100, 46, 32, 36, /* 0x 120 */
+ 10, 0, 85, 87, 86, 83, 81, 82,252,139,116, 36, 28,139,124, 36, /* 0x 130 */
+ 36,131,205,255,235, 12,144,144,138, 6, 70,136, 7, 71, 1,219, /* 0x 140 */
+117, 7,139, 30,131,238,252, 17,219,138, 7,114,235,184, 1, 0, /* 0x 150 */
+ 0, 0, 1,219,117, 7,139, 30,131,238,252, 17,219, 17,192, 1, /* 0x 160 */
+219,115,239,117, 9,139, 30,131,238,252, 17,219,115,228, 49,201, /* 0x 170 */
+131,232, 3,114, 13,193,224, 8,138, 6, 70,131,240,255,116,118, /* 0x 180 */
+137,197, 1,219,117, 7,139, 30,131,238,252, 17,219, 17,201, 1, /* 0x 190 */
+219,117, 7,139, 30,131,238,252, 17,219, 17,201,117, 32, 65, 1, /* 0x 1a0 */
+219,117, 7,139, 30,131,238,252, 17,219, 17,201, 1,219,115,239, /* 0x 1b0 */
+117, 9,139, 30,131,238,252, 17,219,115,228,131,193, 2,129,253, /* 0x 1c0 */
+ 0,243,255,255,131,209, 1,141, 20, 47,131,253,252,138, 4, 15, /* 0x 1d0 */
+118, 14,138, 2, 66,136, 7, 71, 73,117,247,233, 94,255,255,255, /* 0x 1e0 */
+139, 2,131,194, 4,137, 7,131,199, 4,131,233, 4,119,241, 1, /* 0x 1f0 */
+207,233, 72,255,255,255,139, 84, 36, 28, 3, 84, 36, 32, 57,214, /* 0x 200 */
+116, 1, 72, 43,124, 36, 36,139, 84, 36, 40,137, 58, 90, 89, 91, /* 0x 210 */
+ 94, 95, 93,195, 85,137,229, 87, 86, 83,139,125, 12,139,117, 16, /* 0x 220 */
+ 86, 87,255,117, 8,232, 42, 4, 0, 0,131,196, 12,133,192,137, /* 0x 230 */
+195,121, 10,232, 56, 3, 0, 0,131, 56, 4,116, 8,133,219,126, /* 0x 240 */
+ 8, 1,223, 41,222,133,246,127,215,141,101,244, 91,137,240, 94, /* 0x 250 */
+ 95,201,195,144, 85,137,229, 87, 86,139,117, 12, 83,137,241,139, /* 0x 260 */
+ 93, 8,186, 10, 0, 0, 0,137,200,137,215, 49,210,247,247, 67, /* 0x 270 */
+133,192,137,193,117,236,137,217,198, 3, 0,137,242,137,208,190, /* 0x 280 */
+ 10, 0, 0, 0, 49,210,247,246,131,194, 48, 75,133,192,136, 19, /* 0x 290 */
+137,194,117,233, 91, 94,137,200, 95,201,195,144, 85,137,229,255, /* 0x 2a0 */
+117, 8,232,213, 2, 0, 0,144, 85,137,229, 87, 86, 83,131,236, /* 0x 2b0 */
+112,232, 38, 3, 0, 0, 80,137,199,141, 69,170, 80,199, 69,164, /* 0x 2c0 */
+ 47,112,114,111,102,199, 69,168, 99, 47,232,133,255,255,255,198, /* 0x 2d0 */
+ 0, 47,199, 64, 1,102,105,108,101,106, 0,106, 0,141, 93,164, /* 0x 2e0 */
+ 83,232, 70, 3, 0, 0,106, 0,106, 0,104, 85, 80, 88, 49, 80, /* 0x 2f0 */
+137, 69,140,232, 40, 4, 0, 0,131,196, 36,133,210, 15,136,211, /* 0x 300 */
+ 1, 0, 0,106, 12,141, 69,228, 80,255,117,140,232, 3,255,255, /* 0x 310 */
+255,131,196, 12,133,192, 15,133,186, 1, 0, 0,139, 77,228,129, /* 0x 320 */
+249, 85, 80, 88, 50, 15,133,171, 1, 0, 0,190,183,151, 4, 8, /* 0x 330 */
+186, 4, 0, 0, 0,137,251,136,216,131,224, 31, 60, 25,118, 3, /* 0x 340 */
+131,232, 43, 78, 0, 6,193,235, 5, 74,117,235,106, 0,141, 69, /* 0x 350 */
+156, 80, 49,203,232, 71, 2, 0, 0,139, 69,160,193,224, 12, 51, /* 0x 360 */
+ 93,156, 95, 49,195,190,179,151, 4, 8,186, 7, 0, 0, 0, 88, /* 0x 370 */
+136,216,131,224, 31, 60, 25,118, 3,131,232, 43, 78, 0, 6,193, /* 0x 380 */
+235, 5, 74,117,235,104,164,151, 4, 8,232, 97, 2, 0, 0,133, /* 0x 390 */
+192, 91,121, 13,131, 61,188,151, 4, 8, 2, 15,133, 53, 1, 0, /* 0x 3a0 */
+ 0,104,192, 1, 0, 0,104, 2, 10, 0, 0,104,164,151, 4, 8, /* 0x 3b0 */
+232,119, 2, 0, 0, 49,210, 82,137, 69,136,139, 69,232, 80,255, /* 0x 3c0 */
+117,136,232,185, 2, 0, 0,131,196, 24,133,192, 15,133,249, 0, /* 0x 3d0 */
+ 0, 0,106, 0,106, 0,255,117,136,106, 2,106, 3,255, 53,184, /* 0x 3e0 */
+151, 4, 8,106, 0,232,214, 2, 0, 0,131,196, 28, 61, 0,240, /* 0x 3f0 */
+255,255,137, 69,132, 15,135,208, 0, 0, 0,106, 8,141, 69,148, /* 0x 400 */
+ 80,255,117,140,232, 11,254,255,255,131,196, 12,133,192, 15,133, /* 0x 410 */
+183, 0, 0, 0,139, 77,148,133,201,117, 28,129,125,152, 85, 80, /* 0x 420 */
+ 88, 33, 15,133,163, 0, 0, 0,131,125,232, 0, 15,132,182, 0, /* 0x 430 */
+ 0, 0,233,148, 0, 0, 0,139, 85,152,133,210, 15,142,137, 0, /* 0x 440 */
+ 0, 0, 57,202, 15,143,129, 0, 0, 0,139, 69,236, 57,193,127, /* 0x 450 */
+122, 41,208,141,152, 0, 8, 0, 0,139,117,132, 82, 1,222, 86, /* 0x 460 */
+255,117,140,232,172,253,255,255,131,196, 12,133,192,117, 92,139, /* 0x 470 */
+ 85,152, 59, 85,148,125, 31,141, 69,144, 80,255,117,132, 82, 86, /* 0x 480 */
+232,157,252,255,255,131,196, 16,133,192,137,195,117, 61,139, 69, /* 0x 490 */
+148, 57, 69,144,117, 53,139,125,132, 1,223,139,117,148, 86, 87, /* 0x 4a0 */
+255,117,136,232,152, 1, 0, 0,131,196, 12,133,192,137,195,121, /* 0x 4b0 */
+ 10,232,186, 0, 0, 0,131, 56, 4,116, 8,133,219,126, 8, 1, /* 0x 4c0 */
+223, 41,222,133,246,127,215,133,246,116, 15,104,164,151, 4, 8, /* 0x 4d0 */
+232, 27, 1, 0, 0, 89,106,127,235,101,139, 69,232, 43, 69,148, /* 0x 4e0 */
+137, 69,232,233, 19,255,255,255,255, 53,184,151, 4, 8,255,117, /* 0x 4f0 */
+132,232,190, 0, 0, 0,255,117,136,232, 26, 1, 0, 0,131,196, /* 0x 500 */
+ 12,133,192,117,198,255,117,140,232, 11, 1, 0, 0,133,192, 90, /* 0x 510 */
+117,185,232, 81, 1, 0, 0,133,192,117, 41,232, 72, 1, 0, 0, /* 0x 520 */
+133,192,117, 25,106, 0,104,156,135, 4, 8,232, 92, 0, 0, 0, /* 0x 530 */
+104,164,151, 4, 8,232,182, 0, 0, 0,131,196, 12,106, 0,232, /* 0x 540 */
+ 88,253,255,255,106, 0,106, 0,106, 0,106,255,232,179, 0, 0, /* 0x 550 */
+ 0,255,117, 12,255,117, 8,104,164,151, 4, 8,232,103, 0, 0, /* 0x 560 */
+ 0,131,196, 28,233, 98,255,255,255,144,144,144,144,144,144,144, /* 0x 570 */
+ 85,137,229,184,188,151, 4, 8, 93,195,144,144,184, 1, 0, 0, /* 0x 580 */
+ 0,205,128,195,233,219, 1, 0, 0,141,118, 0,184,240, 0, 0, /* 0x 590 */
+ 0,205,128,114,239,195,144,144,233,199, 1, 0, 0,141,118, 0, /* 0x 5a0 */
+184,116, 0, 0, 0,205,128,114,239,195,144,144,233,179, 1, 0, /* 0x 5b0 */
+ 0,141,118, 0,184, 73, 0, 0, 0,205,128,114,239,195,144,144, /* 0x 5c0 */
+233,159, 1, 0, 0,141,118, 0,184, 59, 0, 0, 0,205,128,114, /* 0x 5d0 */
+239,195,144,144,233,139, 1, 0, 0,141,118, 0,184, 20, 0, 0, /* 0x 5e0 */
+ 0,205,128,114,239,195,144,144,233,119, 1, 0, 0,141,118, 0, /* 0x 5f0 */
+184, 10, 0, 0, 0,205,128,114,239,195,144,144,233, 99, 1, 0, /* 0x 600 */
+ 0,141,118, 0,184, 7, 0, 0, 0,205,128,114,239,195,144,144, /* 0x 610 */
+233, 79, 1, 0, 0,141,118, 0,184, 6, 0, 0, 0,205,128,114, /* 0x 620 */
+239,195,144,144,233, 59, 1, 0, 0,141,118, 0,184, 5, 0, 0, /* 0x 630 */
+ 0,205,128,114,239,195,144,144,233, 39, 1, 0, 0,141,118, 0, /* 0x 640 */
+184, 4, 0, 0, 0,205,128,114,239,195,144,144,233, 19, 1, 0, /* 0x 650 */
+ 0,141,118, 0,184, 3, 0, 0, 0,205,128,114,239,195,144,144, /* 0x 660 */
+233,255, 0, 0, 0,141,118, 0,184, 2, 0, 0, 0,205,128,114, /* 0x 670 */
+239,195,144,144,144,144,144,144,144,144,144,144,144,144,144,144, /* 0x 680 */
+ 85,137,229,131,236, 24,139, 69, 12,139, 85, 16,137, 68, 36, 16, /* 0x 690 */
+137, 84, 36, 20,199, 68, 36, 12, 0, 0, 0, 0,139, 69, 8,137, /* 0x 6a0 */
+ 68, 36, 8,199, 4, 36,201, 0, 0, 0,199, 68, 36, 4, 0, 0, /* 0x 6b0 */
+ 0, 0,232,201, 0, 0, 0,137,236, 93,195,144,144,144,144,144, /* 0x 6c0 */
+ 85,137,229,131,236, 40,139, 69, 28,139, 85, 32,137, 68, 36, 32, /* 0x 6d0 */
+137, 84, 36, 36,199, 68, 36, 28, 0, 0, 0, 0,139, 69, 24,137, /* 0x 6e0 */
+ 68, 36, 24,139, 69, 20,137, 68, 36, 20,139, 69, 16,137, 68, 36, /* 0x 6f0 */
+ 16,139, 69, 12,137, 68, 36, 12,139, 69, 8,137, 68, 36, 8,199, /* 0x 700 */
+ 4, 36,197, 0, 0, 0,199, 68, 36, 4, 0, 0, 0, 0,232,109, /* 0x 710 */
+ 0, 0, 0,137,236, 93,195,144,144,144,144,144,144,144,144,144, /* 0x 720 */
+ 85,137,229,131,236, 40,139, 69, 20,137, 68, 36, 24,139, 69, 12, /* 0x 730 */
+139, 85, 16,137, 68, 36, 16,137, 84, 36, 20,199, 68, 36, 12, 0, /* 0x 740 */
+ 0, 0, 0,139, 69, 8,137, 68, 36, 8,199, 4, 36,199, 0, 0, /* 0x 750 */
+ 0,199, 68, 36, 4, 0, 0, 0, 0,232, 34, 0, 0, 0,137,236, /* 0x 760 */
+ 93,195,144,144, 80,232, 6,254,255,255, 89,137, 8,184,255,255, /* 0x 770 */
+255,255,186,255,255,255,255,195,233,231,255,255,255,141,118, 0, /* 0x 780 */
+184,198, 0, 0, 0,205,128,114,239,195, 0, 0, 85, 80, 88, 52, /* 0x 790 */
+ 0, 0, 0, 0, 47,116,109,112, 47,117,112,120, 65, 65, 65, 65, /* 0x 7a0 */
+ 65, 65, 65, 65, 65, 65, 65, 0, 85, 80, 88, 53 /* 0x 7b0 */
+};
diff --git a/archivers/upx/files/l_b_n2d.h b/archivers/upx/files/l_b_n2d.h
new file mode 100644
index 00000000000..b57a527a143
--- /dev/null
+++ b/archivers/upx/files/l_b_n2d.h
@@ -0,0 +1,158 @@
+/* l_b_n2d.h -- created from l_b_n2d.bin, 1996 (0x7cc) bytes
+
+ This file is part of the UPX executable compressor.
+
+ Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1996-2002 Laszlo Molnar
+ All Rights Reserved.
+
+ UPX and the UCL library are free software; you can redistribute them
+ and/or modify them 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; see the file COPYING.
+ If not, write to the Free Software Foundation, Inc.,
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ Markus F.X.J. Oberhumer Laszlo Molnar
+ <mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
+ */
+
+
+#define FREEBSD_I386_NRV2D_LOADER_ADLER32 0x1734fcc8
+#define FREEBSD_I386_NRV2D_LOADER_CRC32 0x72ba6bab
+
+unsigned char freebsd_i386_nrv2d_loader[1996] = {
+127, 69, 76, 70, 1, 1, 1, 9, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */
+ 2, 0, 3, 0, 1, 0, 0, 0,128,128, 4, 8, 52, 0, 0, 0, /* 0x 10 */
+ 0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 32, 0, 2, 0, 0, 0, /* 0x 20 */
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,128, 4, 8, /* 0x 30 */
+ 0,128, 4, 8,180, 7, 0, 0,180, 7, 0, 0, 5, 0, 0, 0, /* 0x 40 */
+ 0, 16, 0, 0, 1, 0, 0, 0,180, 7, 0, 0,180,151, 4, 8, /* 0x 50 */
+180,151, 4, 8, 24, 0, 0, 0, 28, 0, 0, 0, 6, 0, 0, 0, /* 0x 60 */
+ 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 70 */
+ 49,237, 88,137,225,141, 84,129, 4, 80,131,228,248, 82, 81,232, /* 0x 80 */
+ 56, 2, 0, 0,244, 10, 0, 36, 73,110,102,111, 58, 32, 84,104, /* 0x 90 */
+105,115, 32,102,105,108,101, 32,105,115, 32,112, 97, 99,107,101, /* 0x a0 */
+100, 32,119,105,116,104, 32,116,104,101, 32, 85, 80, 88, 32,101, /* 0x b0 */
+120,101, 99,117,116, 97, 98,108,101, 32,112, 97, 99,107,101,114, /* 0x c0 */
+ 32,104,116,116,112, 58, 47, 47,117,112,120, 46,115,102, 46,110, /* 0x d0 */
+101,116, 32, 36, 10, 0, 36, 73,100, 58, 32, 85, 80, 88, 32, 49, /* 0x e0 */
+ 46, 50, 52, 32, 67,111,112,121,114,105,103,104,116, 32, 40, 67, /* 0x f0 */
+ 41, 32, 49, 57, 57, 54, 45, 50, 48, 48, 50, 32,116,104,101, 32, /* 0x 100 */
+ 85, 80, 88, 32, 84,101, 97,109, 46, 32, 65,108,108, 32, 82,105, /* 0x 110 */
+103,104,116,115, 32, 82,101,115,101,114,118,101,100, 46, 32, 36, /* 0x 120 */
+ 10, 0, 85, 87, 86, 83, 81, 82,252,139,116, 36, 28,139,124, 36, /* 0x 130 */
+ 36,131,205,255,235, 12,144,144,138, 6, 70,136, 7, 71, 1,219, /* 0x 140 */
+117, 7,139, 30,131,238,252, 17,219,138, 7,114,235,184, 1, 0, /* 0x 150 */
+ 0, 0, 1,219,117, 7,139, 30,131,238,252, 17,219, 17,192, 1, /* 0x 160 */
+219,115, 11,117, 25,139, 30,131,238,252, 17,219,114, 16, 72, 1, /* 0x 170 */
+219,117, 7,139, 30,131,238,252, 17,219, 17,192,235,212, 49,201, /* 0x 180 */
+131,232, 3,114, 17,193,224, 8,138, 6, 70,131,240,255,116,122, /* 0x 190 */
+209,248,137,197,235, 11, 1,219,117, 7,139, 30,131,238,252, 17, /* 0x 1a0 */
+219, 17,201, 1,219,117, 7,139, 30,131,238,252, 17,219, 17,201, /* 0x 1b0 */
+117, 32, 65, 1,219,117, 7,139, 30,131,238,252, 17,219, 17,201, /* 0x 1c0 */
+ 1,219,115,239,117, 9,139, 30,131,238,252, 17,219,115,228,131, /* 0x 1d0 */
+193, 2,129,253, 0,251,255,255,131,209, 1,141, 20, 47,131,253, /* 0x 1e0 */
+252,138, 4, 15,118, 14,138, 2, 66,136, 7, 71, 73,117,247,233, /* 0x 1f0 */
+ 74,255,255,255,139, 2,131,194, 4,137, 7,131,199, 4,131,233, /* 0x 200 */
+ 4,119,241, 1,207,233, 52,255,255,255,139, 84, 36, 28, 3, 84, /* 0x 210 */
+ 36, 32, 57,214,116, 1, 72, 43,124, 36, 36,139, 84, 36, 40,137, /* 0x 220 */
+ 58, 90, 89, 91, 94, 95, 93,195, 85,137,229, 87, 86, 83,139,125, /* 0x 230 */
+ 12,139,117, 16, 86, 87,255,117, 8,232, 38, 4, 0, 0,131,196, /* 0x 240 */
+ 12,133,192,137,195,121, 10,232, 52, 3, 0, 0,131, 56, 4,116, /* 0x 250 */
+ 8,133,219,126, 8, 1,223, 41,222,133,246,127,215,141,101,244, /* 0x 260 */
+ 91,137,240, 94, 95,201,195,144, 85,137,229, 87, 86,139,117, 12, /* 0x 270 */
+ 83,137,241,139, 93, 8,186, 10, 0, 0, 0,137,200,137,215, 49, /* 0x 280 */
+210,247,247, 67,133,192,137,193,117,236,137,217,198, 3, 0,137, /* 0x 290 */
+242,137,208,190, 10, 0, 0, 0, 49,210,247,246,131,194, 48, 75, /* 0x 2a0 */
+133,192,136, 19,137,194,117,233, 91, 94,137,200, 95,201,195,144, /* 0x 2b0 */
+ 85,137,229,255,117, 8,232,209, 2, 0, 0,144, 85,137,229, 87, /* 0x 2c0 */
+ 86, 83,131,236,112,232, 34, 3, 0, 0, 80,137,199,141, 69,170, /* 0x 2d0 */
+ 80,199, 69,164, 47,112,114,111,102,199, 69,168, 99, 47,232,133, /* 0x 2e0 */
+255,255,255,198, 0, 47,199, 64, 1,102,105,108,101,106, 0,106, /* 0x 2f0 */
+ 0,141, 93,164, 83,232, 66, 3, 0, 0,106, 0,106, 0,104, 85, /* 0x 300 */
+ 80, 88, 49, 80,137, 69,140,232, 36, 4, 0, 0,131,196, 36,133, /* 0x 310 */
+210, 15,136,211, 1, 0, 0,106, 12,141, 69,228, 80,255,117,140, /* 0x 320 */
+232, 3,255,255,255,131,196, 12,133,192, 15,133,186, 1, 0, 0, /* 0x 330 */
+139, 77,228,129,249, 85, 80, 88, 50, 15,133,171, 1, 0, 0,190, /* 0x 340 */
+199,151, 4, 8,186, 4, 0, 0, 0,137,251,136,216,131,224, 31, /* 0x 350 */
+ 60, 25,118, 3,131,232, 43, 78, 0, 6,193,235, 5, 74,117,235, /* 0x 360 */
+106, 0,141, 69,156, 80, 49,203,232, 67, 2, 0, 0,139, 69,160, /* 0x 370 */
+193,224, 12, 51, 93,156, 95, 49,195,190,195,151, 4, 8,186, 7, /* 0x 380 */
+ 0, 0, 0, 88,136,216,131,224, 31, 60, 25,118, 3,131,232, 43, /* 0x 390 */
+ 78, 0, 6,193,235, 5, 74,117,235,104,180,151, 4, 8,232, 93, /* 0x 3a0 */
+ 2, 0, 0,133,192, 91,121, 13,131, 61,204,151, 4, 8, 2, 15, /* 0x 3b0 */
+133, 53, 1, 0, 0,104,192, 1, 0, 0,104, 2, 10, 0, 0,104, /* 0x 3c0 */
+180,151, 4, 8,232,115, 2, 0, 0, 49,210, 82,137, 69,136,139, /* 0x 3d0 */
+ 69,232, 80,255,117,136,232,181, 2, 0, 0,131,196, 24,133,192, /* 0x 3e0 */
+ 15,133,249, 0, 0, 0,106, 0,106, 0,255,117,136,106, 2,106, /* 0x 3f0 */
+ 3,255, 53,200,151, 4, 8,106, 0,232,210, 2, 0, 0,131,196, /* 0x 400 */
+ 28, 61, 0,240,255,255,137, 69,132, 15,135,208, 0, 0, 0,106, /* 0x 410 */
+ 8,141, 69,148, 80,255,117,140,232, 11,254,255,255,131,196, 12, /* 0x 420 */
+133,192, 15,133,183, 0, 0, 0,139, 77,148,133,201,117, 28,129, /* 0x 430 */
+125,152, 85, 80, 88, 33, 15,133,163, 0, 0, 0,131,125,232, 0, /* 0x 440 */
+ 15,132,182, 0, 0, 0,233,148, 0, 0, 0,139, 85,152,133,210, /* 0x 450 */
+ 15,142,137, 0, 0, 0, 57,202, 15,143,129, 0, 0, 0,139, 69, /* 0x 460 */
+236, 57,193,127,122, 41,208,141,152, 0, 8, 0, 0,139,117,132, /* 0x 470 */
+ 82, 1,222, 86,255,117,140,232,172,253,255,255,131,196, 12,133, /* 0x 480 */
+192,117, 92,139, 85,152, 59, 85,148,125, 31,141, 69,144, 80,255, /* 0x 490 */
+117,132, 82, 86,232,137,252,255,255,131,196, 16,133,192,137,195, /* 0x 4a0 */
+117, 61,139, 69,148, 57, 69,144,117, 53,139,125,132, 1,223,139, /* 0x 4b0 */
+117,148, 86, 87,255,117,136,232,148, 1, 0, 0,131,196, 12,133, /* 0x 4c0 */
+192,137,195,121, 10,232,182, 0, 0, 0,131, 56, 4,116, 8,133, /* 0x 4d0 */
+219,126, 8, 1,223, 41,222,133,246,127,215,133,246,116, 15,104, /* 0x 4e0 */
+180,151, 4, 8,232, 23, 1, 0, 0, 89,106,127,235,101,139, 69, /* 0x 4f0 */
+232, 43, 69,148,137, 69,232,233, 19,255,255,255,255, 53,200,151, /* 0x 500 */
+ 4, 8,255,117,132,232,186, 0, 0, 0,255,117,136,232, 22, 1, /* 0x 510 */
+ 0, 0,131,196, 12,133,192,117,198,255,117,140,232, 7, 1, 0, /* 0x 520 */
+ 0,133,192, 90,117,185,232, 77, 1, 0, 0,133,192,117, 41,232, /* 0x 530 */
+ 68, 1, 0, 0,133,192,117, 25,106, 0,104,172,135, 4, 8,232, /* 0x 540 */
+ 88, 0, 0, 0,104,180,151, 4, 8,232,178, 0, 0, 0,131,196, /* 0x 550 */
+ 12,106, 0,232, 88,253,255,255,106, 0,106, 0,106, 0,106,255, /* 0x 560 */
+232,175, 0, 0, 0,255,117, 12,255,117, 8,104,180,151, 4, 8, /* 0x 570 */
+232, 99, 0, 0, 0,131,196, 28,233, 98,255,255,255,144,144,144, /* 0x 580 */
+ 85,137,229,184,204,151, 4, 8, 93,195,144,144,184, 1, 0, 0, /* 0x 590 */
+ 0,205,128,195,233,219, 1, 0, 0,141,118, 0,184,240, 0, 0, /* 0x 5a0 */
+ 0,205,128,114,239,195,144,144,233,199, 1, 0, 0,141,118, 0, /* 0x 5b0 */
+184,116, 0, 0, 0,205,128,114,239,195,144,144,233,179, 1, 0, /* 0x 5c0 */
+ 0,141,118, 0,184, 73, 0, 0, 0,205,128,114,239,195,144,144, /* 0x 5d0 */
+233,159, 1, 0, 0,141,118, 0,184, 59, 0, 0, 0,205,128,114, /* 0x 5e0 */
+239,195,144,144,233,139, 1, 0, 0,141,118, 0,184, 20, 0, 0, /* 0x 5f0 */
+ 0,205,128,114,239,195,144,144,233,119, 1, 0, 0,141,118, 0, /* 0x 600 */
+184, 10, 0, 0, 0,205,128,114,239,195,144,144,233, 99, 1, 0, /* 0x 610 */
+ 0,141,118, 0,184, 7, 0, 0, 0,205,128,114,239,195,144,144, /* 0x 620 */
+233, 79, 1, 0, 0,141,118, 0,184, 6, 0, 0, 0,205,128,114, /* 0x 630 */
+239,195,144,144,233, 59, 1, 0, 0,141,118, 0,184, 5, 0, 0, /* 0x 640 */
+ 0,205,128,114,239,195,144,144,233, 39, 1, 0, 0,141,118, 0, /* 0x 650 */
+184, 4, 0, 0, 0,205,128,114,239,195,144,144,233, 19, 1, 0, /* 0x 660 */
+ 0,141,118, 0,184, 3, 0, 0, 0,205,128,114,239,195,144,144, /* 0x 670 */
+233,255, 0, 0, 0,141,118, 0,184, 2, 0, 0, 0,205,128,114, /* 0x 680 */
+239,195,144,144,144,144,144,144,144,144,144,144,144,144,144,144, /* 0x 690 */
+ 85,137,229,131,236, 24,139, 69, 12,139, 85, 16,137, 68, 36, 16, /* 0x 6a0 */
+137, 84, 36, 20,199, 68, 36, 12, 0, 0, 0, 0,139, 69, 8,137, /* 0x 6b0 */
+ 68, 36, 8,199, 4, 36,201, 0, 0, 0,199, 68, 36, 4, 0, 0, /* 0x 6c0 */
+ 0, 0,232,201, 0, 0, 0,137,236, 93,195,144,144,144,144,144, /* 0x 6d0 */
+ 85,137,229,131,236, 40,139, 69, 28,139, 85, 32,137, 68, 36, 32, /* 0x 6e0 */
+137, 84, 36, 36,199, 68, 36, 28, 0, 0, 0, 0,139, 69, 24,137, /* 0x 6f0 */
+ 68, 36, 24,139, 69, 20,137, 68, 36, 20,139, 69, 16,137, 68, 36, /* 0x 700 */
+ 16,139, 69, 12,137, 68, 36, 12,139, 69, 8,137, 68, 36, 8,199, /* 0x 710 */
+ 4, 36,197, 0, 0, 0,199, 68, 36, 4, 0, 0, 0, 0,232,109, /* 0x 720 */
+ 0, 0, 0,137,236, 93,195,144,144,144,144,144,144,144,144,144, /* 0x 730 */
+ 85,137,229,131,236, 40,139, 69, 20,137, 68, 36, 24,139, 69, 12, /* 0x 740 */
+139, 85, 16,137, 68, 36, 16,137, 84, 36, 20,199, 68, 36, 12, 0, /* 0x 750 */
+ 0, 0, 0,139, 69, 8,137, 68, 36, 8,199, 4, 36,199, 0, 0, /* 0x 760 */
+ 0,199, 68, 36, 4, 0, 0, 0, 0,232, 34, 0, 0, 0,137,236, /* 0x 770 */
+ 93,195,144,144, 80,232, 6,254,255,255, 89,137, 8,184,255,255, /* 0x 780 */
+255,255,186,255,255,255,255,195,233,231,255,255,255,141,118, 0, /* 0x 790 */
+184,198, 0, 0, 0,205,128,114,239,195, 0, 0, 85, 80, 88, 52, /* 0x 7a0 */
+ 0, 0, 0, 0, 47,116,109,112, 47,117,112,120, 65, 65, 65, 65, /* 0x 7b0 */
+ 65, 65, 65, 65, 65, 65, 65, 0, 85, 80, 88, 53 /* 0x 7c0 */
+};
diff --git a/archivers/upx/files/l_b_n2e.h b/archivers/upx/files/l_b_n2e.h
new file mode 100644
index 00000000000..8c239f8334d
--- /dev/null
+++ b/archivers/upx/files/l_b_n2e.h
@@ -0,0 +1,159 @@
+/* l_b_n2e.h -- created from l_b_n2e.bin, 2012 (0x7dc) bytes
+
+ This file is part of the UPX executable compressor.
+
+ Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1996-2002 Laszlo Molnar
+ All Rights Reserved.
+
+ UPX and the UCL library are free software; you can redistribute them
+ and/or modify them 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; see the file COPYING.
+ If not, write to the Free Software Foundation, Inc.,
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ Markus F.X.J. Oberhumer Laszlo Molnar
+ <mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
+ */
+
+
+#define FREEBSD_I386_NRV2E_LOADER_ADLER32 0xfd390733
+#define FREEBSD_I386_NRV2E_LOADER_CRC32 0x9b19cafb
+
+unsigned char freebsd_i386_nrv2e_loader[2012] = {
+127, 69, 76, 70, 1, 1, 1, 9, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */
+ 2, 0, 3, 0, 1, 0, 0, 0,128,128, 4, 8, 52, 0, 0, 0, /* 0x 10 */
+ 0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 32, 0, 2, 0, 0, 0, /* 0x 20 */
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,128, 4, 8, /* 0x 30 */
+ 0,128, 4, 8,196, 7, 0, 0,196, 7, 0, 0, 5, 0, 0, 0, /* 0x 40 */
+ 0, 16, 0, 0, 1, 0, 0, 0,196, 7, 0, 0,196,151, 4, 8, /* 0x 50 */
+196,151, 4, 8, 24, 0, 0, 0, 28, 0, 0, 0, 6, 0, 0, 0, /* 0x 60 */
+ 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 70 */
+ 49,237, 88,137,225,141, 84,129, 4, 80,131,228,248, 82, 81,232, /* 0x 80 */
+ 72, 2, 0, 0,244, 10, 0, 36, 73,110,102,111, 58, 32, 84,104, /* 0x 90 */
+105,115, 32,102,105,108,101, 32,105,115, 32,112, 97, 99,107,101, /* 0x a0 */
+100, 32,119,105,116,104, 32,116,104,101, 32, 85, 80, 88, 32,101, /* 0x b0 */
+120,101, 99,117,116, 97, 98,108,101, 32,112, 97, 99,107,101,114, /* 0x c0 */
+ 32,104,116,116,112, 58, 47, 47,117,112,120, 46,115,102, 46,110, /* 0x d0 */
+101,116, 32, 36, 10, 0, 36, 73,100, 58, 32, 85, 80, 88, 32, 49, /* 0x e0 */
+ 46, 50, 52, 32, 67,111,112,121,114,105,103,104,116, 32, 40, 67, /* 0x f0 */
+ 41, 32, 49, 57, 57, 54, 45, 50, 48, 48, 50, 32,116,104,101, 32, /* 0x 100 */
+ 85, 80, 88, 32, 84,101, 97,109, 46, 32, 65,108,108, 32, 82,105, /* 0x 110 */
+103,104,116,115, 32, 82,101,115,101,114,118,101,100, 46, 32, 36, /* 0x 120 */
+ 10, 0, 85, 87, 86, 83, 81, 82,252,139,116, 36, 28,139,124, 36, /* 0x 130 */
+ 36,131,205,255,235, 12,144,144,138, 6, 70,136, 7, 71, 1,219, /* 0x 140 */
+117, 7,139, 30,131,238,252, 17,219,138, 7,114,235,184, 1, 0, /* 0x 150 */
+ 0, 0, 1,219,117, 7,139, 30,131,238,252, 17,219, 17,192, 1, /* 0x 160 */
+219,115, 11,117, 40,139, 30,131,238,252, 17,219,114, 31, 72, 1, /* 0x 170 */
+219,117, 7,139, 30,131,238,252, 17,219, 17,192,235,212, 1,219, /* 0x 180 */
+117, 7,139, 30,131,238,252, 17,219, 17,201,235, 82, 49,201,131, /* 0x 190 */
+232, 3,114, 17,193,224, 8,138, 6, 70,131,240,255,116,123,209, /* 0x 1a0 */
+248,137,197,235, 11, 1,219,117, 7,139, 30,131,238,252, 17,219, /* 0x 1b0 */
+114,204, 65, 1,219,117, 7,139, 30,131,238,252, 17,219,114,190, /* 0x 1c0 */
+ 1,219,117, 7,139, 30,131,238,252, 17,219, 17,201, 1,219,115, /* 0x 1d0 */
+239,117, 9,139, 30,131,238,252, 17,219,115,228,131,193, 2,129, /* 0x 1e0 */
+253, 0,251,255,255,131,209, 2,141, 20, 47,131,253,252,138, 4, /* 0x 1f0 */
+ 15,118, 17,138, 2, 66,136, 7, 71, 73,117,247,233, 61,255,255, /* 0x 200 */
+255,144,144,144,139, 2,131,194, 4,137, 7,131,199, 4,131,233, /* 0x 210 */
+ 4,119,241, 1,207,233, 36,255,255,255,139, 84, 36, 28, 3, 84, /* 0x 220 */
+ 36, 32, 57,214,116, 1, 72, 43,124, 36, 36,139, 84, 36, 40,137, /* 0x 230 */
+ 58, 90, 89, 91, 94, 95, 93,195, 85,137,229, 87, 86, 83,139,125, /* 0x 240 */
+ 12,139,117, 16, 86, 87,255,117, 8,232, 38, 4, 0, 0,131,196, /* 0x 250 */
+ 12,133,192,137,195,121, 10,232, 52, 3, 0, 0,131, 56, 4,116, /* 0x 260 */
+ 8,133,219,126, 8, 1,223, 41,222,133,246,127,215,141,101,244, /* 0x 270 */
+ 91,137,240, 94, 95,201,195,144, 85,137,229, 87, 86,139,117, 12, /* 0x 280 */
+ 83,137,241,139, 93, 8,186, 10, 0, 0, 0,137,200,137,215, 49, /* 0x 290 */
+210,247,247, 67,133,192,137,193,117,236,137,217,198, 3, 0,137, /* 0x 2a0 */
+242,137,208,190, 10, 0, 0, 0, 49,210,247,246,131,194, 48, 75, /* 0x 2b0 */
+133,192,136, 19,137,194,117,233, 91, 94,137,200, 95,201,195,144, /* 0x 2c0 */
+ 85,137,229,255,117, 8,232,209, 2, 0, 0,144, 85,137,229, 87, /* 0x 2d0 */
+ 86, 83,131,236,112,232, 34, 3, 0, 0, 80,137,199,141, 69,170, /* 0x 2e0 */
+ 80,199, 69,164, 47,112,114,111,102,199, 69,168, 99, 47,232,133, /* 0x 2f0 */
+255,255,255,198, 0, 47,199, 64, 1,102,105,108,101,106, 0,106, /* 0x 300 */
+ 0,141, 93,164, 83,232, 66, 3, 0, 0,106, 0,106, 0,104, 85, /* 0x 310 */
+ 80, 88, 49, 80,137, 69,140,232, 36, 4, 0, 0,131,196, 36,133, /* 0x 320 */
+210, 15,136,211, 1, 0, 0,106, 12,141, 69,228, 80,255,117,140, /* 0x 330 */
+232, 3,255,255,255,131,196, 12,133,192, 15,133,186, 1, 0, 0, /* 0x 340 */
+139, 77,228,129,249, 85, 80, 88, 50, 15,133,171, 1, 0, 0,190, /* 0x 350 */
+215,151, 4, 8,186, 4, 0, 0, 0,137,251,136,216,131,224, 31, /* 0x 360 */
+ 60, 25,118, 3,131,232, 43, 78, 0, 6,193,235, 5, 74,117,235, /* 0x 370 */
+106, 0,141, 69,156, 80, 49,203,232, 67, 2, 0, 0,139, 69,160, /* 0x 380 */
+193,224, 12, 51, 93,156, 95, 49,195,190,211,151, 4, 8,186, 7, /* 0x 390 */
+ 0, 0, 0, 88,136,216,131,224, 31, 60, 25,118, 3,131,232, 43, /* 0x 3a0 */
+ 78, 0, 6,193,235, 5, 74,117,235,104,196,151, 4, 8,232, 93, /* 0x 3b0 */
+ 2, 0, 0,133,192, 91,121, 13,131, 61,220,151, 4, 8, 2, 15, /* 0x 3c0 */
+133, 53, 1, 0, 0,104,192, 1, 0, 0,104, 2, 10, 0, 0,104, /* 0x 3d0 */
+196,151, 4, 8,232,115, 2, 0, 0, 49,210, 82,137, 69,136,139, /* 0x 3e0 */
+ 69,232, 80,255,117,136,232,181, 2, 0, 0,131,196, 24,133,192, /* 0x 3f0 */
+ 15,133,249, 0, 0, 0,106, 0,106, 0,255,117,136,106, 2,106, /* 0x 400 */
+ 3,255, 53,216,151, 4, 8,106, 0,232,210, 2, 0, 0,131,196, /* 0x 410 */
+ 28, 61, 0,240,255,255,137, 69,132, 15,135,208, 0, 0, 0,106, /* 0x 420 */
+ 8,141, 69,148, 80,255,117,140,232, 11,254,255,255,131,196, 12, /* 0x 430 */
+133,192, 15,133,183, 0, 0, 0,139, 77,148,133,201,117, 28,129, /* 0x 440 */
+125,152, 85, 80, 88, 33, 15,133,163, 0, 0, 0,131,125,232, 0, /* 0x 450 */
+ 15,132,182, 0, 0, 0,233,148, 0, 0, 0,139, 85,152,133,210, /* 0x 460 */
+ 15,142,137, 0, 0, 0, 57,202, 15,143,129, 0, 0, 0,139, 69, /* 0x 470 */
+236, 57,193,127,122, 41,208,141,152, 0, 8, 0, 0,139,117,132, /* 0x 480 */
+ 82, 1,222, 86,255,117,140,232,172,253,255,255,131,196, 12,133, /* 0x 490 */
+192,117, 92,139, 85,152, 59, 85,148,125, 31,141, 69,144, 80,255, /* 0x 4a0 */
+117,132, 82, 86,232,121,252,255,255,131,196, 16,133,192,137,195, /* 0x 4b0 */
+117, 61,139, 69,148, 57, 69,144,117, 53,139,125,132, 1,223,139, /* 0x 4c0 */
+117,148, 86, 87,255,117,136,232,148, 1, 0, 0,131,196, 12,133, /* 0x 4d0 */
+192,137,195,121, 10,232,182, 0, 0, 0,131, 56, 4,116, 8,133, /* 0x 4e0 */
+219,126, 8, 1,223, 41,222,133,246,127,215,133,246,116, 15,104, /* 0x 4f0 */
+196,151, 4, 8,232, 23, 1, 0, 0, 89,106,127,235,101,139, 69, /* 0x 500 */
+232, 43, 69,148,137, 69,232,233, 19,255,255,255,255, 53,216,151, /* 0x 510 */
+ 4, 8,255,117,132,232,186, 0, 0, 0,255,117,136,232, 22, 1, /* 0x 520 */
+ 0, 0,131,196, 12,133,192,117,198,255,117,140,232, 7, 1, 0, /* 0x 530 */
+ 0,133,192, 90,117,185,232, 77, 1, 0, 0,133,192,117, 41,232, /* 0x 540 */
+ 68, 1, 0, 0,133,192,117, 25,106, 0,104,188,135, 4, 8,232, /* 0x 550 */
+ 88, 0, 0, 0,104,196,151, 4, 8,232,178, 0, 0, 0,131,196, /* 0x 560 */
+ 12,106, 0,232, 88,253,255,255,106, 0,106, 0,106, 0,106,255, /* 0x 570 */
+232,175, 0, 0, 0,255,117, 12,255,117, 8,104,196,151, 4, 8, /* 0x 580 */
+232, 99, 0, 0, 0,131,196, 28,233, 98,255,255,255,144,144,144, /* 0x 590 */
+ 85,137,229,184,220,151, 4, 8, 93,195,144,144,184, 1, 0, 0, /* 0x 5a0 */
+ 0,205,128,195,233,219, 1, 0, 0,141,118, 0,184,240, 0, 0, /* 0x 5b0 */
+ 0,205,128,114,239,195,144,144,233,199, 1, 0, 0,141,118, 0, /* 0x 5c0 */
+184,116, 0, 0, 0,205,128,114,239,195,144,144,233,179, 1, 0, /* 0x 5d0 */
+ 0,141,118, 0,184, 73, 0, 0, 0,205,128,114,239,195,144,144, /* 0x 5e0 */
+233,159, 1, 0, 0,141,118, 0,184, 59, 0, 0, 0,205,128,114, /* 0x 5f0 */
+239,195,144,144,233,139, 1, 0, 0,141,118, 0,184, 20, 0, 0, /* 0x 600 */
+ 0,205,128,114,239,195,144,144,233,119, 1, 0, 0,141,118, 0, /* 0x 610 */
+184, 10, 0, 0, 0,205,128,114,239,195,144,144,233, 99, 1, 0, /* 0x 620 */
+ 0,141,118, 0,184, 7, 0, 0, 0,205,128,114,239,195,144,144, /* 0x 630 */
+233, 79, 1, 0, 0,141,118, 0,184, 6, 0, 0, 0,205,128,114, /* 0x 640 */
+239,195,144,144,233, 59, 1, 0, 0,141,118, 0,184, 5, 0, 0, /* 0x 650 */
+ 0,205,128,114,239,195,144,144,233, 39, 1, 0, 0,141,118, 0, /* 0x 660 */
+184, 4, 0, 0, 0,205,128,114,239,195,144,144,233, 19, 1, 0, /* 0x 670 */
+ 0,141,118, 0,184, 3, 0, 0, 0,205,128,114,239,195,144,144, /* 0x 680 */
+233,255, 0, 0, 0,141,118, 0,184, 2, 0, 0, 0,205,128,114, /* 0x 690 */
+239,195,144,144,144,144,144,144,144,144,144,144,144,144,144,144, /* 0x 6a0 */
+ 85,137,229,131,236, 24,139, 69, 12,139, 85, 16,137, 68, 36, 16, /* 0x 6b0 */
+137, 84, 36, 20,199, 68, 36, 12, 0, 0, 0, 0,139, 69, 8,137, /* 0x 6c0 */
+ 68, 36, 8,199, 4, 36,201, 0, 0, 0,199, 68, 36, 4, 0, 0, /* 0x 6d0 */
+ 0, 0,232,201, 0, 0, 0,137,236, 93,195,144,144,144,144,144, /* 0x 6e0 */
+ 85,137,229,131,236, 40,139, 69, 28,139, 85, 32,137, 68, 36, 32, /* 0x 6f0 */
+137, 84, 36, 36,199, 68, 36, 28, 0, 0, 0, 0,139, 69, 24,137, /* 0x 700 */
+ 68, 36, 24,139, 69, 20,137, 68, 36, 20,139, 69, 16,137, 68, 36, /* 0x 710 */
+ 16,139, 69, 12,137, 68, 36, 12,139, 69, 8,137, 68, 36, 8,199, /* 0x 720 */
+ 4, 36,197, 0, 0, 0,199, 68, 36, 4, 0, 0, 0, 0,232,109, /* 0x 730 */
+ 0, 0, 0,137,236, 93,195,144,144,144,144,144,144,144,144,144, /* 0x 740 */
+ 85,137,229,131,236, 40,139, 69, 20,137, 68, 36, 24,139, 69, 12, /* 0x 750 */
+139, 85, 16,137, 68, 36, 16,137, 84, 36, 20,199, 68, 36, 12, 0, /* 0x 760 */
+ 0, 0, 0,139, 69, 8,137, 68, 36, 8,199, 4, 36,199, 0, 0, /* 0x 770 */
+ 0,199, 68, 36, 4, 0, 0, 0, 0,232, 34, 0, 0, 0,137,236, /* 0x 780 */
+ 93,195,144,144, 80,232, 6,254,255,255, 89,137, 8,184,255,255, /* 0x 790 */
+255,255,186,255,255,255,255,195,233,231,255,255,255,141,118, 0, /* 0x 7a0 */
+184,198, 0, 0, 0,205,128,114,239,195, 0, 0, 85, 80, 88, 52, /* 0x 7b0 */
+ 0, 0, 0, 0, 47,116,109,112, 47,117,112,120, 65, 65, 65, 65, /* 0x 7c0 */
+ 65, 65, 65, 65, 65, 65, 65, 0, 85, 80, 88, 53 /* 0x 7d0 */
+};
diff --git a/archivers/upx/files/patch-Makefile b/archivers/upx/files/patch-Makefile
new file mode 100644
index 00000000000..13b05efe403
--- /dev/null
+++ b/archivers/upx/files/patch-Makefile
@@ -0,0 +1,40 @@
+--- Makefile.orig Mon Oct 28 16:43:34 2002
++++ Makefile Tue Feb 17 08:20:39 2004
+@@ -3,6 +3,7 @@
+ #
+ # usage:
+ # `make target=linux' # linux
++# `make target=freebsd' # freebsd
+ # `make target=djggp2' # dos32 - djggp2 2.03
+ # `make target=cygwin' # win32 - cygwin 1.3.x
+ # `make target=mingw32' # win32 - mingw32
+@@ -221,6 +222,29 @@
+
+ endif # linux
+
++
++###
++### FreeBSD
++###
++
++ifeq ($(target),freebsd)
++override arch := $(shell uname -m | sed -e 's/^i[3456789]86$$/i386/')
++DEFS += '-DUPX_CONFIG_H="config_h/freebsd.h"'
++
++ifeq ($(DEBUG),1)
++ ##CFLAGS += -O0 -gstabs+3
++ ##CFLAGS += -O0 -gdwarf-2
++ CFLAGS += -O0 -g
++else
++ ##LDFLAGS += -static
++ STUBEDIT_EXE = objcopy -S -R .comment -R .note $@
++ ifeq ($(arch),i386)
++# STUBIFY_EXE = perl $(srcdir)/stub/scripts/brandelf.pl $@
++ CHMOD_EXE = chmod 755 $@
++ endif
++endif
++
++endif # freebsd
+
+ ###
+ ### Linux cross compilers
diff --git a/archivers/upx/files/patch-Makefile.inc b/archivers/upx/files/patch-Makefile.inc
new file mode 100644
index 00000000000..599f7caee29
--- /dev/null
+++ b/archivers/upx/files/patch-Makefile.inc
@@ -0,0 +1,11 @@
+--- Makefile.inc.orig Tue Feb 17 08:55:35 2004
++++ Makefile.inc Tue Feb 17 08:54:46 2004
+@@ -22,7 +22,7 @@
+ LIBDIRS += $(UDIR)/build/src/.libs
+ endif
+ ifneq ($(strip $(wildcard $(UDIR))),)
+-LIBDIRS += $(UDIR)
++LIBDIRS += $(UDIR)/lib
+ DOS_LIBDIRS := $(DOS_LIBDIRS);$(UDIR)
+ endif
+
diff --git a/archivers/upx/files/patch-conf.h b/archivers/upx/files/patch-conf.h
new file mode 100644
index 00000000000..9c6f6f0d752
--- /dev/null
+++ b/archivers/upx/files/patch-conf.h
@@ -0,0 +1,19 @@
+--- conf.h.orig Wed Jan 28 02:49:57 2004
++++ conf.h Tue Feb 17 06:24:41 2004
+@@ -109,7 +109,7 @@
+ # define UPX_E_OK UCL_E_OK
+ # define UPX_E_ERROR UCL_E_ERROR
+ # define UPX_E_OUT_OF_MEMORY UCL_E_OUT_OF_MEMORY
+-# define __UPX_ENTRY __UCL_ENTRY
++# define __UPX_ENTRY
+ # endif
+ #endif
+ #if defined(WITH_NRV)
+@@ -518,6 +518,7 @@
+ #define UPX_F_BVMLINUZ_i386 16
+ #define UPX_F_ELKS_8086 17
+ #define UPX_F_PS1_EXE 18
++#define UPX_F_FREEBSD_i386 19
+ #define UPX_F_ATARI_TOS 129
+ #define UPX_F_SOLARIS_SPARC 130
+
diff --git a/archivers/upx/files/patch-help.cpp b/archivers/upx/files/patch-help.cpp
new file mode 100644
index 00000000000..c12660d6657
--- /dev/null
+++ b/archivers/upx/files/patch-help.cpp
@@ -0,0 +1,12 @@
+--- help.cpp.orig Tue Feb 17 07:09:52 2004
++++ help.cpp Tue Feb 17 07:10:39 2004
+@@ -191,7 +191,8 @@
+ " file.. executables to (de)compress\n"
+ "\n"
+ "This version supports: dos/exe, dos/com, dos/sys, djgpp2/coff, watcom/le,\n"
+- " win32/pe, rtm32/pe, tmt/adam, atari/tos, linux/386\n"
++ " win32/pe, rtm32/pe, tmt/adam, atari/tos, linux/386,\n"
++ " FreeBSD/386\n"
+ "\n"
+ "UPX comes with ABSOLUTELY NO WARRANTY; for details type `upx -L'.\n"
+ "");
diff --git a/archivers/upx/files/patch-p_unix.cpp b/archivers/upx/files/patch-p_unix.cpp
new file mode 100644
index 00000000000..022f2c6aef7
--- /dev/null
+++ b/archivers/upx/files/patch-p_unix.cpp
@@ -0,0 +1,98 @@
+--- p_unix.cpp.orig Wed Sep 4 00:18:07 2002
++++ p_unix.cpp Tue Feb 17 08:44:07 2004
+@@ -380,6 +380,8 @@
+ // now check the ELF header
+ if (memcmp(buf+8, "FreeBSD", 7) == 0) // branded
+ exetype = 0;
++ if (buf[7] == 9) // FreeBSD
++ exetype = 0;
+ if (get_le16(buf+16) != 2) // e_type - executable
+ exetype = 0;
+ if (get_le16(buf+18) != 3) // e_machine - Intel 80386
+@@ -404,8 +406,8 @@
+ // FIXME: N_TRSIZE, N_DRSIZE
+ // FIXME: check for aout shared libraries
+ }
+-#if defined(__linux__)
+- // only compress scripts when running under Linux
++#if defined(__linux__) || defined(__FreeBSD__)
++ // only compress scripts when running under Linux or FreeBSD
+ else if (!memcmp(buf, "#!/", 3)) // #!/bin/sh
+ exetype = -1;
+ else if (!memcmp(buf, "#! /", 4)) // #! /bin/sh
+@@ -431,7 +433,8 @@
+ // also, we sleep much longer when compressing a script.
+ patch_le32(loader,lsize,"UPX5",mmapsize);
+ patch_le32(loader,lsize,"UPX4",exetype > 0 ? 3 : 15); // sleep time
+- patch_le32(loader,lsize,"UPX3",exetype > 0 ? 0 : 0x7fffffff);
++ if (exetype != 3)
++ patch_le32(loader,lsize,"UPX3",exetype > 0 ? 0 : 0x7fffffff);
+ patch_le32(loader,lsize,"UPX2",progid);
+ patch_le32(loader,lsize,"UPX1",lsize);
+
+@@ -457,6 +460,65 @@
+ set_le32(loader + 116, adler);
+ }
+
++/*************************************************************************
++// FreeBSD/i386 specific
++**************************************************************************/
++
++static const
++#include "stub/l_b_n2b.h"
++static const
++#include "stub/l_b_n2d.h"
++static const
++#include "stub/l_b_n2e.h"
++
++
++const upx_byte *PackFreeBSDI386::getLoader() const
++{
++ if (M_IS_NRV2B(opt->method))
++ return freebsd_i386_nrv2b_loader;
++ if (M_IS_NRV2D(opt->method))
++ return freebsd_i386_nrv2d_loader;
++ if (M_IS_NRV2E(opt->method))
++ return freebsd_i386_nrv2e_loader;
++ return NULL;
++}
++
++int PackFreeBSDI386::getLoaderSize() const
++{
++ if (M_IS_NRV2B(opt->method))
++ return sizeof(freebsd_i386_nrv2b_loader);
++ if (M_IS_NRV2D(opt->method))
++ return sizeof(freebsd_i386_nrv2d_loader);
++ if (M_IS_NRV2E(opt->method))
++ return sizeof(freebsd_i386_nrv2e_loader);
++ return 0;
++}
++
++bool PackFreeBSDI386::canPack()
++{
++ unsigned char buf[52]; // sizeof(ELF_LE32_Ehdr)
++ exetype = 0;
++
++ fi->readx(buf,sizeof(buf));
++ fi->seek(0, SEEK_SET);
++ if (!memcmp(buf, "\x7f\x45\x4c\x46\x01\x01\x01", 7)) // ELF 32-bit LSB
++ {
++ exetype = 3;
++ // now check the ELF header
++ if (buf[7] != 9) // FreeBSD
++ exetype = 0;
++ if (get_le16(buf+16) != 2) // e_type - executable
++ exetype = 0;
++ if (get_le16(buf+18) != 3) // e_machine - Intel 80386
++ exetype = 0;
++ if (get_le32(buf+20) != 1) // e_version
++ exetype = 0;
++ if (get_le16(buf+44) < 1) // e_phnum
++ exetype = 0;
++ }
++
++ return PackUnix::canPack();
++}
+
+ /*
+ vi:ts=4:et
diff --git a/archivers/upx/files/patch-p_unix.h b/archivers/upx/files/patch-p_unix.h
new file mode 100644
index 00000000000..7a6feafd869
--- /dev/null
+++ b/archivers/upx/files/patch-p_unix.h
@@ -0,0 +1,28 @@
+--- p_unix.h.orig Tue Feb 17 06:22:27 2004
++++ p_unix.h Tue Feb 17 06:52:01 2004
+@@ -131,6 +131,25 @@
+ };
+ };
+
++/*************************************************************************
++// FreeBSD/i386
++**************************************************************************/
++
++class PackFreeBSDI386 : public PackLinuxI386
++{
++ typedef PackLinuxI386 super;
++public:
++ PackFreeBSDI386(InputFile *f) : super(f) { }
++ virtual int getFormat() const { return UPX_F_FREEBSD_i386; }
++ virtual const char *getName() const { return "FreeBSD/386"; }
++
++ virtual bool canPack();
++
++protected:
++ virtual const upx_byte *getLoader() const;
++ virtual int getLoaderSize() const;
++};
++
+
+ /*************************************************************************
+ // solaris/sparc
diff --git a/archivers/upx/files/patch-packmast.cpp b/archivers/upx/files/patch-packmast.cpp
new file mode 100644
index 00000000000..dd6aee41998
--- /dev/null
+++ b/archivers/upx/files/patch-packmast.cpp
@@ -0,0 +1,11 @@
+--- packmast.cpp.orig Tue Feb 17 06:32:00 2004
++++ packmast.cpp Tue Feb 17 06:35:56 2004
+@@ -145,6 +145,8 @@
+ return p;
+ if ((p = func(new PackLinuxI386(f),f)) != NULL)
+ return p;
++ if ((p = func(new PackFreeBSDI386(f),f)) != NULL)
++ return p;
+ if ((p = func(new PackSys(f),f)) != NULL)
+ return p;
+ if ((p = func(new PackCom(f),f)) != NULL)
diff --git a/archivers/upx/files/patch-stub-Makefile b/archivers/upx/files/patch-stub-Makefile
new file mode 100644
index 00000000000..117d0728f0d
--- /dev/null
+++ b/archivers/upx/files/patch-stub-Makefile
@@ -0,0 +1,70 @@
+--- stub/Makefile.orig Wed Jan 28 03:28:03 2004
++++ stub/Makefile Tue Feb 17 07:22:01 2004
+@@ -27,6 +27,7 @@
+ l_djgpp2.h stubify.h \
+ l_exe.h \
+ l_lx_n2b.h l_lx_n2d.h l_lx_n2e.h \
++ l_b_n2b.h l_b_n2d.h l_b_n2e.h \
+ l_sys.h \
+ l_t_n2b.h l_t_n2bs.h l_t_n2d.h l_t_n2ds.h l_t_n2e.h l_t_n2es.h \
+ l_tmt.h \
+@@ -81,6 +82,13 @@
+ CC_LINUX_I386 += -funsigned-char
+ ###CC_LINUX_I386 += -fwritable-strings -save-temps
+
++# Compiler for the FreeBSD/386 stubs.
++CC_FREEBSD_I386 = gcc -march=i386 -mcpu=i386 -Os -fno-strict-aliasing
++CC_FREEBSD_I386 += -falign-functions=0 -falign-jumps=0 -falign-loops=0
++CC_FREEBSD_I386 += -Werror
++CC_FREEBSD_I386 += -Wall -W -Wcast-align -Wcast-qual -Wwrite-strings
++CC_FREEBSD_I386 += -funsigned-char
++
+ # Preprocessor for the a68k 68000-assembler.
+ CPP_M68K = gcc -I$(UCL_UPX) -E -x assembler-with-cpp -Wall -Wp,-P,-C,-traditional,-nostdinc -D__A68K__
+ ASM_M68K = a68k -q -x
+@@ -255,6 +263,31 @@
+
+
+ # /***********************************************************************
++# // FreeBSD rules
++# ************************************************************************/
++
++l_b_n2b.h: l_linux.c l_xe_n2b.o
++ $(CC_FREEBSD_I386) -DNRV2B -s -o $T.o -c $<
++ ld -s -Map $T.map -o $T.bin l_xe_n2b.o $T.o -static -lc
++ objcopy -S -R .comment -R .note $T.bin
++ $(STRIPELF) $T.bin
++ $(BIN2H) $T.bin freebsd_i386_nrv2b_loader $@
++
++l_b_n2d.h: l_linux.c l_xe_n2d.o
++ $(CC_FREEBSD_I386) -DNRV2D -s -o $T.o -c $<
++ ld -s -Map $T.map -o $T.bin l_xe_n2d.o $T.o -static -lc
++ objcopy -S -R .comment -R .note $T.bin
++ $(STRIPELF) $T.bin
++ $(BIN2H) $T.bin freebsd_i386_nrv2d_loader $@
++
++l_b_n2e.h: l_linux.c l_xe_n2e.o
++ $(CC_FREEBSD_I386) -DNRV2E -s -o $T.o -c $<
++ ld -s -Map $T.map -o $T.bin l_xe_n2e.o $T.o -static -lc
++ objcopy -S -R .comment -R .note $T.bin
++ $(STRIPELF) $T.bin
++ $(BIN2H) $T.bin freebsd_i386_nrv2e_loader $@
++
++# /***********************************************************************
+ # // dependencies
+ # ************************************************************************/
+
+@@ -274,10 +307,13 @@
+ l_djgpp2.h: n2b_d32.asy n2d_d32.asy n2e_d32.asy $(DEPS2)
+ l_exe.h: n2b_d8e.asy n2d_d8e.asy n2e_d8e.asy $(DEPS2)
+ l_lx_n2b.h: n2b_d32.ash $(DEPS1)
++l_b_n2b.h: n2b_d32.ash $(DEPS1)
+ l_xe_n2b.o: n2b_d32.ash $(DEPS1)
+ l_lx_n2d.h: n2d_d32.ash $(DEPS1)
++l_b_n2d.h: n2d_d32.ash $(DEPS1)
+ l_xe_n2d.o: n2d_d32.ash $(DEPS1)
+ l_lx_n2e.h: n2e_d32.ash $(DEPS1)
++l_b_n2e.h: n2e_d32.ash $(DEPS1)
+ l_xe_n2e.o: n2e_d32.ash $(DEPS1)
+ l_sys.h: n2b_d16.asy $(DEPS2)
+ l_t_n2b.h: n2b_d.ash bits.ash $(DEPS1)
diff --git a/archivers/upx/files/patch-stub-l_linux.c b/archivers/upx/files/patch-stub-l_linux.c
new file mode 100644
index 00000000000..6f436cddde1
--- /dev/null
+++ b/archivers/upx/files/patch-stub-l_linux.c
@@ -0,0 +1,150 @@
+--- stub/l_linux.c.orig Wed Jan 28 03:36:25 2004
++++ stub/l_linux.c Tue Feb 17 07:27:42 2004
+@@ -51,7 +51,11 @@
+ // note: we can assert(count > 0);
+ do {
+ int n = read(fd, buf, count);
++#if defined(__FreeBSD__)
++ if (n < 0 && errno == EINTR)
++#else
+ if (n == -EINTR)
++#endif
+ continue;
+ if (n <= 0)
+ break;
+@@ -71,7 +75,11 @@
+ // note: we can assert(count > 0);
+ do {
+ int n = write(fd, buf, count);
++#if defined(__FreeBSD__)
++ if (n < 0 && errno == EINTR)
++#else
+ if (n == -EINTR)
++#endif
+ continue;
+ if (n <= 0)
+ break;
+@@ -154,6 +162,16 @@
+ #define nrv2e_decompress nrv2e_decompress_asm_fast
+ #endif /* __i386__ */
+
++#if defined(__FreeBSD__)
++#undef errno
++int errno;
++
++void
++exit(int status)
++{
++ _exit(status);
++}
++#endif
+
+ /*************************************************************************
+ // upx_main - called by our entry code
+@@ -184,9 +202,13 @@
+ // decompression buffer
+ #if defined(USE_MALLOC)
+ unsigned char *buf;
++#if defined(__FreeBSD__)
++ static int mmapsize = UPX5;
++#else
+ static int malloc_args[6] = {
+ 0, UPX5, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0
+ };
++#endif
+ #else
+ static unsigned char buf[BLOCKSIZE + OVERHEAD];
+ #endif
+@@ -207,6 +229,10 @@
+ // ----- Step 1: prepare input file -----
+ //
+
++#if defined(__FreeBSD__)
++ SET4(procself, 'f', 'i', 'l', 'e');
++ fdi = open(procself_buf, O_RDONLY, 0);
++#else
+ // Open the exe.
+ SET3(procself, 'e', 'x', 'e');
+ fdi = open(procself_buf, O_RDONLY, 0);
+@@ -218,6 +244,7 @@
+ fdi = open(procself_buf, O_RDONLY, 0);
+ }
+ #endif
++#endif
+ #if 0
+ // Save some bytes of code - the lseek() below will fail anyway.
+ if (fdi < 0)
+@@ -294,12 +321,20 @@
+ // Just in case, remove the file.
+ {
+ int err = unlink(tmpname);
++#if defined(__FreeBSD__)
++ if (err < 0 && errno != ENOENT)
++#else
+ if (err != -ENOENT && err != 0)
++#endif
+ goto error1;
+ }
+
+ // Create the temporary output file.
++#if defined(__FreeBSD__)
++ fdo = open(tmpname, O_RDWR | O_CREAT | O_EXCL, 0700);
++#else
+ fdo = open(tmpname, O_WRONLY | O_CREAT | O_EXCL, 0700);
++#endif
+ #if 0
+ // Save some bytes of code - the ftruncate() below will fail anyway.
+ if (fdo < 0)
+@@ -316,7 +351,11 @@
+ //
+
+ #if defined(USE_MALLOC)
++#if defined(__FreeBSD__)
++ buf = mmap(0, mmapsize, PROT_READ | PROT_WRITE, MAP_PRIVATE, fdo, 0);
++#else
+ buf = mmap(malloc_args);
++#endif
+ if ((unsigned long) buf >= (unsigned long) -4095)
+ goto error;
+ #else
+@@ -403,8 +442,12 @@
+ //
+
+ #if defined(USE_MALLOC)
++#if defined(__FreeBSD__)
++ munmap(buf, mmapsize);
++#else
+ munmap(buf, malloc_args[1]);
+ #endif
++#endif
+
+ if (close(fdo) != 0)
+ goto error;
+@@ -416,6 +459,7 @@
+ // ----- Step 6: try to start program via /proc/self/fd/X -----
+ //
+
++#if !defined(__FreeBSD__)
+ // Many thanks to Andi Kleen <ak@muc.de> and
+ // Jamie Lokier <nospam@cern.ch> for this nice idea.
+
+@@ -446,6 +490,7 @@
+
+ // The proc filesystem isn't working. No problem.
+ close(fdi);
++#endif
+
+
+ //
+@@ -472,7 +517,11 @@
+ }
+
+ // Wait for the first fork()'d process to die.
++#if defined(__FreeBSD__)
++ wait4(-1, 0, 0, 0);
++#else
+ waitpid(-1, (int *)0, 0);
++#endif
+
+ // Execute the original program.
+ execve(tmpname, argv, envp);
diff --git a/archivers/upx/files/patch-stub-linux.hh b/archivers/upx/files/patch-stub-linux.hh
new file mode 100644
index 00000000000..868fa38c96a
--- /dev/null
+++ b/archivers/upx/files/patch-stub-linux.hh
@@ -0,0 +1,54 @@
+--- stub/linux.hh.orig Tue Feb 17 01:31:35 2004
++++ stub/linux.hh Tue Feb 17 07:30:02 2004
+@@ -26,8 +26,8 @@
+ */
+
+
+-#if !defined(__linux__) || !defined(__i386__)
+-# error "this stub must be compiled under linux/i386"
++#if (!defined(__linux__) || !defined(__i386__)) && !defined(__FreeBSD__)
++# error "this stub must be compiled under linux/i386 or FreeBSD"
+ #endif
+
+
+@@ -35,6 +35,16 @@
+ // includes
+ **************************************************************************/
+
++#if defined(__FreeBSD__)
++#include <sys/types.h>
++#include <sys/mman.h>
++#include <sys/time.h>
++#include <sys/wait.h>
++#include <errno.h>
++#include <fcntl.h>
++#include <time.h>
++#include <unistd.h>
++#else
+ struct timex;
+
+ #define __need_timeval
+@@ -54,6 +64,7 @@
+
+ #define CONST_CAST(type, var) \
+ ((type) ((unsigned long) (var)))
++#endif
+
+
+ /*************************************************************************
+@@ -122,6 +133,7 @@
+ #define PAGE_SIZE ( 1u<<12)
+
+
++#if !defined(__FreeBSD__)
+ /*************************************************************************
+ // syscalls
+ //
+@@ -312,6 +324,7 @@
+
+ #undef Z0
+ #undef Z1
++#endif
+
+
+ /*
diff --git a/archivers/upx/pkg-descr b/archivers/upx/pkg-descr
new file mode 100644
index 00000000000..359b68e0eb6
--- /dev/null
+++ b/archivers/upx/pkg-descr
@@ -0,0 +1,12 @@
+UPX is a free, portable, extendable, high-performance executable
+packer for several different executable formats. It achieves an
+excellent compression ratio and offers very fast decompression.
+Your executables suffer no memory overhead or other drawbacks
+because of in-place decompression.
+
+UPX is copyrighted software distributed under the terms of the
+GNU General Public License, with special exceptions granting
+the free usage for commercial programs as stated in the
+UPX License Agreement.
+
+WWW: http://upx.sourceforge.net/
diff --git a/archivers/upx/pkg-message b/archivers/upx/pkg-message
new file mode 100644
index 00000000000..8ed7e2be26a
--- /dev/null
+++ b/archivers/upx/pkg-message
@@ -0,0 +1 @@
+NOTE: UPX-compressed executables require procfs to be mounted on /proc.