From owner-freebsd-ports-bugs@FreeBSD.ORG Thu May 10 06:30:06 2007 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4607716A409 for ; Thu, 10 May 2007 06:30:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 21C5D13C459 for ; Thu, 10 May 2007 06:30:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l4A6U50o044300 for ; Thu, 10 May 2007 06:30:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l4A6U5M6044297; Thu, 10 May 2007 06:30:05 GMT (envelope-from gnats) Resent-Date: Thu, 10 May 2007 06:30:05 GMT Resent-Message-Id: <200705100630.l4A6U5M6044297@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Peter Johnson Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B9CAF16A400 for ; Thu, 10 May 2007 06:24:33 +0000 (UTC) (envelope-from pete@tortall.net) Received: from cvs.tortall.net (cvs.tortall.net [69.55.238.110]) by mx1.freebsd.org (Postfix) with ESMTP id 8EAC513C458 for ; Thu, 10 May 2007 06:24:33 +0000 (UTC) (envelope-from pete@tortall.net) Received: from localhost (cvs [69.55.238.110]) by cvs.tortall.net (Postfix) with ESMTP id 04E0D1708A for ; Wed, 9 May 2007 23:24:33 -0700 (PDT) Received: from cvs.tortall.net ([69.55.238.110]) by localhost (cvs.tortall.net [69.55.238.110]) (amavisd-new, port 10024) with ESMTP id 4sqEiAqh60RH for ; Wed, 9 May 2007 23:24:30 -0700 (PDT) Received: by cvs.tortall.net (Postfix, from userid 1000) id 8F1D7170A0; Wed, 9 May 2007 23:24:30 -0700 (PDT) Message-Id: <20070510062430.8F1D7170A0@cvs.tortall.net> Date: Wed, 9 May 2007 23:24:30 -0700 (PDT) From: Peter Johnson To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/112560: [PATCH] archivers/upx: Update to 3.00 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Peter Johnson List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 May 2007 06:30:06 -0000 >Number: 112560 >Category: ports >Synopsis: [PATCH] archivers/upx: Update to 3.00 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Thu May 10 06:30:05 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Peter Johnson >Release: FreeBSD 6.2-STABLE i386 >Organization: >Environment: >Description: archivers/upx is significantly out of date. The latest version of UPX, 3.00, has FreeBSD/i386 executable support built in that supports execution both with and without the /proc filesystem being available. It also cleanly builds on at least amd64 as well as i386; although UPX doesn't support compression of non-i386 FreeBSD executables at the moment, it's always possible to use it for cross-compression. The only issue I've found so far in testing is that compressed FreeBSD/i386 executables coredump in the i386 emulation environment on FreeBSD/amd64. I haven't tried to track down why. >How-To-Repeat: >Fix: Patch attached for the port. Note this removes the FreeBSD hand-hacked UPX support as this has now been implemented upstream. --- upx-3.00.patch begins here --- Index: Makefile =================================================================== RCS file: /home/ncvs/ports/archivers/upx/Makefile,v retrieving revision 1.3 diff -u -r1.3 Makefile --- Makefile 23 Feb 2007 07:52:53 -0000 1.3 +++ Makefile 10 May 2007 06:16:01 -0000 @@ -6,10 +6,9 @@ # PORTNAME= upx -PORTVERSION= 1.25 +PORTVERSION= 3.00 CATEGORIES= archivers -MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} -MASTER_SITE_SUBDIR= upx/ +MASTER_SITES= http://upx.sourceforge.net/download/ DISTNAME= ${PORTNAME}-${PORTVERSION}-src MAINTAINER= fjoe@FreeBSD.org @@ -17,32 +16,23 @@ LIB_DEPENDS= ucl.1:${PORTSDIR}/archivers/ucl -ONLY_FOR_ARCHS= i386 - +USE_BZIP2= yes USE_GMAKE= yes USE_PERL5_BUILD=yes -WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}/src -MAKE_ENV= UCLDIR=${LOCALBASE} target=freebsd +MAKE_ENV= UPX_UCLDIR=${LOCALBASE} target=freebsd PORTDOCS= BUGS COPYING LICENSE NEWS README THANKS MAN1= upx.1 PLIST_FILES= bin/upx -post-patch: - @${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 + @${INSTALL_PROGRAM} ${WRKSRC}/src/upx.out ${PREFIX}/bin/upx + @${INSTALL_MAN} ${WRKSRC}/doc/upx.1 ${MANPREFIX}/man/man1 .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR} @for i in ${PORTDOCS}; do \ - ${INSTALL_DATA} ${WRKSRC}/../$$i ${DOCSDIR}; \ + ${INSTALL_DATA} ${WRKSRC}/$$i ${DOCSDIR}; \ done .endif - @${CAT} ${PKGMESSAGE} .include Index: distinfo =================================================================== RCS file: /home/ncvs/ports/archivers/upx/distinfo,v retrieving revision 1.3 diff -u -r1.3 distinfo --- distinfo 17 Nov 2005 19:10:31 -0000 1.3 +++ distinfo 10 May 2007 06:16:01 -0000 @@ -1,3 +1,3 @@ -MD5 (upx-1.25-src.tar.gz) = 6f20a62999a46a1864652454b3c8a5d8 -SHA256 (upx-1.25-src.tar.gz) = c0bf0b2eccd5766a1171733323ab79c9e4d21d66f4ef2ad8ea7387c72adeb6ed -SIZE (upx-1.25-src.tar.gz) = 250849 +MD5 (upx-3.00-src.tar.bz2) = 9edb9e1b563a8ef306060028460a13b7 +SHA256 (upx-3.00-src.tar.bz2) = ed00a772b22925c5bdf6551b011a79eccd5df544f01244a11d2cf675264de92f +SIZE (upx-3.00-src.tar.bz2) = 709899 Index: pkg-message =================================================================== RCS file: pkg-message diff -N pkg-message --- pkg-message 17 Feb 2004 03:05:13 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1 +0,0 @@ -NOTE: UPX-compressed executables require procfs to be mounted on /proc. Index: files/l_b_n2b.h =================================================================== RCS file: files/l_b_n2b.h diff -N files/l_b_n2b.h --- files/l_b_n2b.h 8 Jan 2005 11:16:50 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,147 +0,0 @@ -/* l_b_n2b.h -- created from l_b_n2b.bin, 1820 (0x71c) bytes - - This file is part of the UPX executable compressor. - - Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer - Copyright (C) 1996-2004 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 - - */ - - -#define FREEBSD_I386_NRV2B_LOADER_ADLER32 0xa3a5bd8e -#define FREEBSD_I386_NRV2B_LOADER_CRC32 0x77221c07 - -unsigned char freebsd_i386_nrv2b_loader[1820] = { -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, 4, 7, 0, 0, 4, 7, 0, 0, 5, 0, 0, 0, /* 0x 40 */ - 0, 16, 0, 0, 1, 0, 0, 0, 4, 7, 0, 0, 4,151, 4, 8, /* 0x 50 */ - 4,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 */ -224, 1, 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, 53, 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, 52, 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, 81,137,215,137, 69,240, /* 0x 220 */ -139,117, 8, 86, 87,255,117,240,232, 7, 4, 0, 0,131,196, 12, /* 0x 230 */ -133,192,137,195,121, 10,232, 21, 3, 0, 0,131, 56, 4,116, 8, /* 0x 240 */ -133,219,126, 8, 1,223, 41,222,133,246,127,215,141,101,244, 91, /* 0x 250 */ -137,240, 94, 95,201,195,137,246, 85,137,229,255,117, 8,232,249, /* 0x 260 */ - 2, 0, 0,144, 85,137,229, 87, 86, 83,131,236,112,232, 74, 3, /* 0x 270 */ - 0, 0,137,199,199, 69,164, 47,112,114,111,102,199, 69,168, 99, /* 0x 280 */ - 47,141, 93,170,137,193,186, 10, 0, 0, 0,137,200,137,214, 49, /* 0x 290 */ -210,247,246, 67,133,192,137,193,117,236,137,217,198, 3, 0,137, /* 0x 2a0 */ -250,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,198, 1, 47,199, 65, 1,102,105, /* 0x 2c0 */ -108,101,106, 0,106, 0,141, 69,164, 80,232, 61, 3, 0, 0,106, /* 0x 2d0 */ - 0,106, 0,104, 85, 80, 88, 49, 80,137, 69,140,232,211, 3, 0, /* 0x 2e0 */ - 0,131,196, 28,133,210, 15,136,208, 1, 0, 0,141, 85,228,106, /* 0x 2f0 */ - 12,139, 69,140,232, 27,255,255,255,133,192, 90, 15,133,186, 1, /* 0x 300 */ - 0, 0,129,125,228, 85, 80, 88, 50, 15,133,173, 1, 0, 0,190, /* 0x 310 */ - 23,151, 4, 8,186, 4, 0, 0, 0,137,251,136,216,131,224, 31, /* 0x 320 */ - 60, 25,118, 3,131,232, 43, 78, 0, 6,193,235, 5, 74,117,235, /* 0x 330 */ -106, 0,141, 69,156, 80,232, 69, 2, 0, 0,129,243, 85, 80, 88, /* 0x 340 */ - 50,139, 69,160,193,224, 12, 51, 93,156, 95, 49,195,190, 19,151, /* 0x 350 */ - 4, 8,186, 7, 0, 0, 0, 88,136,216,131,224, 31, 60, 25,118, /* 0x 360 */ - 3,131,232, 43, 78, 0, 6,193,235, 5, 74,117,235,104, 4,151, /* 0x 370 */ - 4, 8,232, 89, 2, 0, 0,133,192, 89,121, 13,131, 61, 28,151, /* 0x 380 */ - 4, 8, 2, 15,133, 51, 1, 0, 0,104,192, 1, 0, 0,104, 2, /* 0x 390 */ - 10, 0, 0,104, 4,151, 4, 8,232,111, 2, 0, 0, 49,210, 82, /* 0x 3a0 */ -137, 69,136,139, 69,232, 80,255,117,136,232,229, 2, 0, 0,131, /* 0x 3b0 */ -196, 24,133,192, 15,133,247, 0, 0, 0,106, 0,106, 0,106,255, /* 0x 3c0 */ -104, 2, 16, 0, 0,106, 3,255, 53, 24,151, 4, 8,106, 0,232, /* 0x 3d0 */ -128, 2, 0, 0,131,196, 28, 61, 0,240,255,255,137, 69,132, 15, /* 0x 3e0 */ -135,204, 0, 0, 0,106, 8,141, 85,148,139, 69,140,232, 34,254, /* 0x 3f0 */ -255,255,133,192, 90, 15,133,182, 0, 0, 0,139, 77,148,133,201, /* 0x 400 */ -117, 28,129,125,152, 85, 80, 88, 33, 15,133,162, 0, 0, 0,131, /* 0x 410 */ -125,232, 0, 15,132,181, 0, 0, 0,233,147, 0, 0, 0,139, 85, /* 0x 420 */ -152,133,210, 15,142,136, 0, 0, 0, 57,202, 15,143,128, 0, 0, /* 0x 430 */ - 0,139, 69,236, 57,193,127,121, 41,208,141,152, 0, 8, 0, 0, /* 0x 440 */ -139,117,132, 1,222, 82,139, 69,140,137,242,232,196,253,255,255, /* 0x 450 */ -133,192, 95,117, 92,139, 85,152, 59, 85,148,125, 31,141, 69,144, /* 0x 460 */ - 80,255,117,132, 82, 86,232,183,252,255,255,131,196, 16,133,192, /* 0x 470 */ -137,195,117, 61,139, 69,148, 57, 69,144,117, 53,139,125,132, 1, /* 0x 480 */ -223,139,117,148, 86, 87,255,117,136,232,146, 1, 0, 0,131,196, /* 0x 490 */ - 12,133,192,137,195,121, 10,232,180, 0, 0, 0,131, 56, 4,116, /* 0x 4a0 */ - 8,133,219,126, 8, 1,223, 41,222,133,246,127,215,133,246,116, /* 0x 4b0 */ - 15,104, 4,151, 4, 8,232, 21, 1, 0, 0, 94,106,127,235,101, /* 0x 4c0 */ -139, 69,232, 43, 69,148,137, 69,232,233, 23,255,255,255,255, 53, /* 0x 4d0 */ - 24,151, 4, 8,255,117,132,232,184, 0, 0, 0,255,117,136,232, /* 0x 4e0 */ - 20, 1, 0, 0,131,196, 12,133,192,117,198,255,117,140,232, 5, /* 0x 4f0 */ - 1, 0, 0,133,192, 91,117,185,232, 75, 1, 0, 0,133,192,117, /* 0x 500 */ - 41,232, 66, 1, 0, 0,133,192,117, 25,106, 0,104,252,134, 4, /* 0x 510 */ - 8,232, 86, 0, 0, 0,104, 4,151, 4, 8,232,176, 0, 0, 0, /* 0x 520 */ -131,196, 12,106, 0,232, 46,253,255,255,106, 0,106, 0,106, 0, /* 0x 530 */ -106,255,232,173, 0, 0, 0,255,117, 12,255,117, 8,104, 4,151, /* 0x 540 */ - 4, 8,232, 97, 0, 0, 0,131,196, 28,233, 98,255,255,255,144, /* 0x 550 */ - 85,137,229,184, 28,151, 4, 8,201,195,144,144,184, 1, 0, 0, /* 0x 560 */ - 0,205,128,195,233, 23, 1, 0, 0,141,118, 0,184,240, 0, 0, /* 0x 570 */ - 0,205,128,114,239,195,144,144,233, 3, 1, 0, 0,141,118, 0, /* 0x 580 */ -184,116, 0, 0, 0,205,128,114,239,195,144,144,233,239, 0, 0, /* 0x 590 */ - 0,141,118, 0,184, 73, 0, 0, 0,205,128,114,239,195,144,144, /* 0x 5a0 */ -233,219, 0, 0, 0,141,118, 0,184, 59, 0, 0, 0,205,128,114, /* 0x 5b0 */ -239,195,144,144,233,199, 0, 0, 0,141,118, 0,184, 20, 0, 0, /* 0x 5c0 */ - 0,205,128,114,239,195,144,144,233,179, 0, 0, 0,141,118, 0, /* 0x 5d0 */ -184, 10, 0, 0, 0,205,128,114,239,195,144,144,233,159, 0, 0, /* 0x 5e0 */ - 0,141,118, 0,184, 7, 0, 0, 0,205,128,114,239,195,144,144, /* 0x 5f0 */ -233,139, 0, 0, 0,141,118, 0,184, 6, 0, 0, 0,205,128,114, /* 0x 600 */ -239,195,144,144,233,119, 0, 0, 0,141,118, 0,184, 5, 0, 0, /* 0x 610 */ - 0,205,128,114,239,195,144,144,233, 99, 0, 0, 0,141,118, 0, /* 0x 620 */ -184, 4, 0, 0, 0,205,128,114,239,195,144,144,233, 79, 0, 0, /* 0x 630 */ - 0,141,118, 0,184, 3, 0, 0, 0,205,128,114,239,195,144,144, /* 0x 640 */ -233, 59, 0, 0, 0,141,118, 0,184, 2, 0, 0, 0,205,128,114, /* 0x 650 */ -239,195,144,144, 85,137,229,131,236, 16,255,117, 32,255,117, 28, /* 0x 660 */ -106, 0,255,117, 24,255,117, 20,255,117, 16,255,117, 12,255,117, /* 0x 670 */ - 8,106, 0,104,197, 0, 0, 0,232, 99, 0, 0, 0,201,195,144, /* 0x 680 */ - 80,232,202,254,255,255, 89,137, 8,184,255,255,255,255,186,255, /* 0x 690 */ -255,255,255,195, 85,137,229,131,236, 16,255,117, 16,255,117, 12, /* 0x 6a0 */ -106, 0,255,117, 8,106, 0,104,201, 0, 0, 0,232, 47, 0, 0, /* 0x 6b0 */ - 0,201,195,144, 85,137,229,131,236, 12,255,117, 20,255,117, 16, /* 0x 6c0 */ -255,117, 12,106, 0,255,117, 8,106, 0,104,199, 0, 0, 0,232, /* 0x 6d0 */ - 12, 0, 0, 0,201,195,144,144,233,163,255,255,255,141,118, 0, /* 0x 6e0 */ -184,198, 0, 0, 0,205,128,114,239,195, 0, 0, 85, 80, 88, 52, /* 0x 6f0 */ - 0, 0, 0, 0, 47,116,109,112, 47,117,112,120, 65, 65, 65, 65, /* 0x 700 */ - 65, 65, 65, 65, 65, 65, 65, 0, 85, 80, 88, 53 /* 0x 710 */ -}; Index: files/l_b_n2d.h =================================================================== RCS file: files/l_b_n2d.h diff -N files/l_b_n2d.h --- files/l_b_n2d.h 8 Jan 2005 11:16:50 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,148 +0,0 @@ -/* l_b_n2d.h -- created from l_b_n2d.bin, 1840 (0x730) bytes - - This file is part of the UPX executable compressor. - - Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer - Copyright (C) 1996-2004 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 - - */ - - -#define FREEBSD_I386_NRV2D_LOADER_ADLER32 0xcde2c713 -#define FREEBSD_I386_NRV2D_LOADER_CRC32 0xcfaeba24 - -unsigned char freebsd_i386_nrv2d_loader[1840] = { -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, 24, 7, 0, 0, 24, 7, 0, 0, 5, 0, 0, 0, /* 0x 40 */ - 0, 16, 0, 0, 1, 0, 0, 0, 24, 7, 0, 0, 24,151, 4, 8, /* 0x 50 */ - 24,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 */ -244, 1, 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, 53, 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, 52, 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, 81,137, /* 0x 230 */ -215,137, 69,240,139,117, 8, 86, 87,255,117,240,232, 7, 4, 0, /* 0x 240 */ - 0,131,196, 12,133,192,137,195,121, 10,232, 21, 3, 0, 0,131, /* 0x 250 */ - 56, 4,116, 8,133,219,126, 8, 1,223, 41,222,133,246,127,215, /* 0x 260 */ -141,101,244, 91,137,240, 94, 95,201,195,137,246, 85,137,229,255, /* 0x 270 */ -117, 8,232,249, 2, 0, 0,144, 85,137,229, 87, 86, 83,131,236, /* 0x 280 */ -112,232, 74, 3, 0, 0,137,199,199, 69,164, 47,112,114,111,102, /* 0x 290 */ -199, 69,168, 99, 47,141, 93,170,137,193,186, 10, 0, 0, 0,137, /* 0x 2a0 */ -200,137,214, 49,210,247,246, 67,133,192,137,193,117,236,137,217, /* 0x 2b0 */ -198, 3, 0,137,250,137,208,190, 10, 0, 0, 0, 49,210,247,246, /* 0x 2c0 */ -131,194, 48, 75,133,192,136, 19,137,194,117,233,198, 1, 47,199, /* 0x 2d0 */ - 65, 1,102,105,108,101,106, 0,106, 0,141, 69,164, 80,232, 61, /* 0x 2e0 */ - 3, 0, 0,106, 0,106, 0,104, 85, 80, 88, 49, 80,137, 69,140, /* 0x 2f0 */ -232,211, 3, 0, 0,131,196, 28,133,210, 15,136,208, 1, 0, 0, /* 0x 300 */ -141, 85,228,106, 12,139, 69,140,232, 27,255,255,255,133,192, 90, /* 0x 310 */ - 15,133,186, 1, 0, 0,129,125,228, 85, 80, 88, 50, 15,133,173, /* 0x 320 */ - 1, 0, 0,190, 43,151, 4, 8,186, 4, 0, 0, 0,137,251,136, /* 0x 330 */ -216,131,224, 31, 60, 25,118, 3,131,232, 43, 78, 0, 6,193,235, /* 0x 340 */ - 5, 74,117,235,106, 0,141, 69,156, 80,232, 69, 2, 0, 0,129, /* 0x 350 */ -243, 85, 80, 88, 50,139, 69,160,193,224, 12, 51, 93,156, 95, 49, /* 0x 360 */ -195,190, 39,151, 4, 8,186, 7, 0, 0, 0, 88,136,216,131,224, /* 0x 370 */ - 31, 60, 25,118, 3,131,232, 43, 78, 0, 6,193,235, 5, 74,117, /* 0x 380 */ -235,104, 24,151, 4, 8,232, 89, 2, 0, 0,133,192, 89,121, 13, /* 0x 390 */ -131, 61, 48,151, 4, 8, 2, 15,133, 51, 1, 0, 0,104,192, 1, /* 0x 3a0 */ - 0, 0,104, 2, 10, 0, 0,104, 24,151, 4, 8,232,111, 2, 0, /* 0x 3b0 */ - 0, 49,210, 82,137, 69,136,139, 69,232, 80,255,117,136,232,229, /* 0x 3c0 */ - 2, 0, 0,131,196, 24,133,192, 15,133,247, 0, 0, 0,106, 0, /* 0x 3d0 */ -106, 0,106,255,104, 2, 16, 0, 0,106, 3,255, 53, 44,151, 4, /* 0x 3e0 */ - 8,106, 0,232,128, 2, 0, 0,131,196, 28, 61, 0,240,255,255, /* 0x 3f0 */ -137, 69,132, 15,135,204, 0, 0, 0,106, 8,141, 85,148,139, 69, /* 0x 400 */ -140,232, 34,254,255,255,133,192, 90, 15,133,182, 0, 0, 0,139, /* 0x 410 */ - 77,148,133,201,117, 28,129,125,152, 85, 80, 88, 33, 15,133,162, /* 0x 420 */ - 0, 0, 0,131,125,232, 0, 15,132,181, 0, 0, 0,233,147, 0, /* 0x 430 */ - 0, 0,139, 85,152,133,210, 15,142,136, 0, 0, 0, 57,202, 15, /* 0x 440 */ -143,128, 0, 0, 0,139, 69,236, 57,193,127,121, 41,208,141,152, /* 0x 450 */ - 0, 8, 0, 0,139,117,132, 1,222, 82,139, 69,140,137,242,232, /* 0x 460 */ -196,253,255,255,133,192, 95,117, 92,139, 85,152, 59, 85,148,125, /* 0x 470 */ - 31,141, 69,144, 80,255,117,132, 82, 86,232,163,252,255,255,131, /* 0x 480 */ -196, 16,133,192,137,195,117, 61,139, 69,148, 57, 69,144,117, 53, /* 0x 490 */ -139,125,132, 1,223,139,117,148, 86, 87,255,117,136,232,146, 1, /* 0x 4a0 */ - 0, 0,131,196, 12,133,192,137,195,121, 10,232,180, 0, 0, 0, /* 0x 4b0 */ -131, 56, 4,116, 8,133,219,126, 8, 1,223, 41,222,133,246,127, /* 0x 4c0 */ -215,133,246,116, 15,104, 24,151, 4, 8,232, 21, 1, 0, 0, 94, /* 0x 4d0 */ -106,127,235,101,139, 69,232, 43, 69,148,137, 69,232,233, 23,255, /* 0x 4e0 */ -255,255,255, 53, 44,151, 4, 8,255,117,132,232,184, 0, 0, 0, /* 0x 4f0 */ -255,117,136,232, 20, 1, 0, 0,131,196, 12,133,192,117,198,255, /* 0x 500 */ -117,140,232, 5, 1, 0, 0,133,192, 91,117,185,232, 75, 1, 0, /* 0x 510 */ - 0,133,192,117, 41,232, 66, 1, 0, 0,133,192,117, 25,106, 0, /* 0x 520 */ -104, 16,135, 4, 8,232, 86, 0, 0, 0,104, 24,151, 4, 8,232, /* 0x 530 */ -176, 0, 0, 0,131,196, 12,106, 0,232, 46,253,255,255,106, 0, /* 0x 540 */ -106, 0,106, 0,106,255,232,173, 0, 0, 0,255,117, 12,255,117, /* 0x 550 */ - 8,104, 24,151, 4, 8,232, 97, 0, 0, 0,131,196, 28,233, 98, /* 0x 560 */ -255,255,255,144, 85,137,229,184, 48,151, 4, 8,201,195,144,144, /* 0x 570 */ -184, 1, 0, 0, 0,205,128,195,233, 23, 1, 0, 0,141,118, 0, /* 0x 580 */ -184,240, 0, 0, 0,205,128,114,239,195,144,144,233, 3, 1, 0, /* 0x 590 */ - 0,141,118, 0,184,116, 0, 0, 0,205,128,114,239,195,144,144, /* 0x 5a0 */ -233,239, 0, 0, 0,141,118, 0,184, 73, 0, 0, 0,205,128,114, /* 0x 5b0 */ -239,195,144,144,233,219, 0, 0, 0,141,118, 0,184, 59, 0, 0, /* 0x 5c0 */ - 0,205,128,114,239,195,144,144,233,199, 0, 0, 0,141,118, 0, /* 0x 5d0 */ -184, 20, 0, 0, 0,205,128,114,239,195,144,144,233,179, 0, 0, /* 0x 5e0 */ - 0,141,118, 0,184, 10, 0, 0, 0,205,128,114,239,195,144,144, /* 0x 5f0 */ -233,159, 0, 0, 0,141,118, 0,184, 7, 0, 0, 0,205,128,114, /* 0x 600 */ -239,195,144,144,233,139, 0, 0, 0,141,118, 0,184, 6, 0, 0, /* 0x 610 */ - 0,205,128,114,239,195,144,144,233,119, 0, 0, 0,141,118, 0, /* 0x 620 */ -184, 5, 0, 0, 0,205,128,114,239,195,144,144,233, 99, 0, 0, /* 0x 630 */ - 0,141,118, 0,184, 4, 0, 0, 0,205,128,114,239,195,144,144, /* 0x 640 */ -233, 79, 0, 0, 0,141,118, 0,184, 3, 0, 0, 0,205,128,114, /* 0x 650 */ -239,195,144,144,233, 59, 0, 0, 0,141,118, 0,184, 2, 0, 0, /* 0x 660 */ - 0,205,128,114,239,195,144,144, 85,137,229,131,236, 16,255,117, /* 0x 670 */ - 32,255,117, 28,106, 0,255,117, 24,255,117, 20,255,117, 16,255, /* 0x 680 */ -117, 12,255,117, 8,106, 0,104,197, 0, 0, 0,232, 99, 0, 0, /* 0x 690 */ - 0,201,195,144, 80,232,202,254,255,255, 89,137, 8,184,255,255, /* 0x 6a0 */ -255,255,186,255,255,255,255,195, 85,137,229,131,236, 16,255,117, /* 0x 6b0 */ - 16,255,117, 12,106, 0,255,117, 8,106, 0,104,201, 0, 0, 0, /* 0x 6c0 */ -232, 47, 0, 0, 0,201,195,144, 85,137,229,131,236, 12,255,117, /* 0x 6d0 */ - 20,255,117, 16,255,117, 12,106, 0,255,117, 8,106, 0,104,199, /* 0x 6e0 */ - 0, 0, 0,232, 12, 0, 0, 0,201,195,144,144,233,163,255,255, /* 0x 6f0 */ -255,141,118, 0,184,198, 0, 0, 0,205,128,114,239,195, 0, 0, /* 0x 700 */ - 85, 80, 88, 52, 0, 0, 0, 0, 47,116,109,112, 47,117,112,120, /* 0x 710 */ - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 0, 85, 80, 88, 53 /* 0x 720 */ -}; Index: files/l_b_n2e.h =================================================================== RCS file: files/l_b_n2e.h diff -N files/l_b_n2e.h --- files/l_b_n2e.h 8 Jan 2005 11:16:50 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,149 +0,0 @@ -/* l_b_n2e.h -- created from l_b_n2e.bin, 1856 (0x740) bytes - - This file is part of the UPX executable compressor. - - Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer - Copyright (C) 1996-2004 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 - - */ - - -#define FREEBSD_I386_NRV2E_LOADER_ADLER32 0xa652d070 -#define FREEBSD_I386_NRV2E_LOADER_CRC32 0xd90063b2 - -unsigned char freebsd_i386_nrv2e_loader[1856] = { -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, 40, 7, 0, 0, 40, 7, 0, 0, 5, 0, 0, 0, /* 0x 40 */ - 0, 16, 0, 0, 1, 0, 0, 0, 40, 7, 0, 0, 40,151, 4, 8, /* 0x 50 */ - 40,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 */ - 4, 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, 53, 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, 52, 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, 81,137, /* 0x 240 */ -215,137, 69,240,139,117, 8, 86, 87,255,117,240,232, 7, 4, 0, /* 0x 250 */ - 0,131,196, 12,133,192,137,195,121, 10,232, 21, 3, 0, 0,131, /* 0x 260 */ - 56, 4,116, 8,133,219,126, 8, 1,223, 41,222,133,246,127,215, /* 0x 270 */ -141,101,244, 91,137,240, 94, 95,201,195,137,246, 85,137,229,255, /* 0x 280 */ -117, 8,232,249, 2, 0, 0,144, 85,137,229, 87, 86, 83,131,236, /* 0x 290 */ -112,232, 74, 3, 0, 0,137,199,199, 69,164, 47,112,114,111,102, /* 0x 2a0 */ -199, 69,168, 99, 47,141, 93,170,137,193,186, 10, 0, 0, 0,137, /* 0x 2b0 */ -200,137,214, 49,210,247,246, 67,133,192,137,193,117,236,137,217, /* 0x 2c0 */ -198, 3, 0,137,250,137,208,190, 10, 0, 0, 0, 49,210,247,246, /* 0x 2d0 */ -131,194, 48, 75,133,192,136, 19,137,194,117,233,198, 1, 47,199, /* 0x 2e0 */ - 65, 1,102,105,108,101,106, 0,106, 0,141, 69,164, 80,232, 61, /* 0x 2f0 */ - 3, 0, 0,106, 0,106, 0,104, 85, 80, 88, 49, 80,137, 69,140, /* 0x 300 */ -232,211, 3, 0, 0,131,196, 28,133,210, 15,136,208, 1, 0, 0, /* 0x 310 */ -141, 85,228,106, 12,139, 69,140,232, 27,255,255,255,133,192, 90, /* 0x 320 */ - 15,133,186, 1, 0, 0,129,125,228, 85, 80, 88, 50, 15,133,173, /* 0x 330 */ - 1, 0, 0,190, 59,151, 4, 8,186, 4, 0, 0, 0,137,251,136, /* 0x 340 */ -216,131,224, 31, 60, 25,118, 3,131,232, 43, 78, 0, 6,193,235, /* 0x 350 */ - 5, 74,117,235,106, 0,141, 69,156, 80,232, 69, 2, 0, 0,129, /* 0x 360 */ -243, 85, 80, 88, 50,139, 69,160,193,224, 12, 51, 93,156, 95, 49, /* 0x 370 */ -195,190, 55,151, 4, 8,186, 7, 0, 0, 0, 88,136,216,131,224, /* 0x 380 */ - 31, 60, 25,118, 3,131,232, 43, 78, 0, 6,193,235, 5, 74,117, /* 0x 390 */ -235,104, 40,151, 4, 8,232, 89, 2, 0, 0,133,192, 89,121, 13, /* 0x 3a0 */ -131, 61, 64,151, 4, 8, 2, 15,133, 51, 1, 0, 0,104,192, 1, /* 0x 3b0 */ - 0, 0,104, 2, 10, 0, 0,104, 40,151, 4, 8,232,111, 2, 0, /* 0x 3c0 */ - 0, 49,210, 82,137, 69,136,139, 69,232, 80,255,117,136,232,229, /* 0x 3d0 */ - 2, 0, 0,131,196, 24,133,192, 15,133,247, 0, 0, 0,106, 0, /* 0x 3e0 */ -106, 0,106,255,104, 2, 16, 0, 0,106, 3,255, 53, 60,151, 4, /* 0x 3f0 */ - 8,106, 0,232,128, 2, 0, 0,131,196, 28, 61, 0,240,255,255, /* 0x 400 */ -137, 69,132, 15,135,204, 0, 0, 0,106, 8,141, 85,148,139, 69, /* 0x 410 */ -140,232, 34,254,255,255,133,192, 90, 15,133,182, 0, 0, 0,139, /* 0x 420 */ - 77,148,133,201,117, 28,129,125,152, 85, 80, 88, 33, 15,133,162, /* 0x 430 */ - 0, 0, 0,131,125,232, 0, 15,132,181, 0, 0, 0,233,147, 0, /* 0x 440 */ - 0, 0,139, 85,152,133,210, 15,142,136, 0, 0, 0, 57,202, 15, /* 0x 450 */ -143,128, 0, 0, 0,139, 69,236, 57,193,127,121, 41,208,141,152, /* 0x 460 */ - 0, 8, 0, 0,139,117,132, 1,222, 82,139, 69,140,137,242,232, /* 0x 470 */ -196,253,255,255,133,192, 95,117, 92,139, 85,152, 59, 85,148,125, /* 0x 480 */ - 31,141, 69,144, 80,255,117,132, 82, 86,232,147,252,255,255,131, /* 0x 490 */ -196, 16,133,192,137,195,117, 61,139, 69,148, 57, 69,144,117, 53, /* 0x 4a0 */ -139,125,132, 1,223,139,117,148, 86, 87,255,117,136,232,146, 1, /* 0x 4b0 */ - 0, 0,131,196, 12,133,192,137,195,121, 10,232,180, 0, 0, 0, /* 0x 4c0 */ -131, 56, 4,116, 8,133,219,126, 8, 1,223, 41,222,133,246,127, /* 0x 4d0 */ -215,133,246,116, 15,104, 40,151, 4, 8,232, 21, 1, 0, 0, 94, /* 0x 4e0 */ -106,127,235,101,139, 69,232, 43, 69,148,137, 69,232,233, 23,255, /* 0x 4f0 */ -255,255,255, 53, 60,151, 4, 8,255,117,132,232,184, 0, 0, 0, /* 0x 500 */ -255,117,136,232, 20, 1, 0, 0,131,196, 12,133,192,117,198,255, /* 0x 510 */ -117,140,232, 5, 1, 0, 0,133,192, 91,117,185,232, 75, 1, 0, /* 0x 520 */ - 0,133,192,117, 41,232, 66, 1, 0, 0,133,192,117, 25,106, 0, /* 0x 530 */ -104, 32,135, 4, 8,232, 86, 0, 0, 0,104, 40,151, 4, 8,232, /* 0x 540 */ -176, 0, 0, 0,131,196, 12,106, 0,232, 46,253,255,255,106, 0, /* 0x 550 */ -106, 0,106, 0,106,255,232,173, 0, 0, 0,255,117, 12,255,117, /* 0x 560 */ - 8,104, 40,151, 4, 8,232, 97, 0, 0, 0,131,196, 28,233, 98, /* 0x 570 */ -255,255,255,144, 85,137,229,184, 64,151, 4, 8,201,195,144,144, /* 0x 580 */ -184, 1, 0, 0, 0,205,128,195,233, 23, 1, 0, 0,141,118, 0, /* 0x 590 */ -184,240, 0, 0, 0,205,128,114,239,195,144,144,233, 3, 1, 0, /* 0x 5a0 */ - 0,141,118, 0,184,116, 0, 0, 0,205,128,114,239,195,144,144, /* 0x 5b0 */ -233,239, 0, 0, 0,141,118, 0,184, 73, 0, 0, 0,205,128,114, /* 0x 5c0 */ -239,195,144,144,233,219, 0, 0, 0,141,118, 0,184, 59, 0, 0, /* 0x 5d0 */ - 0,205,128,114,239,195,144,144,233,199, 0, 0, 0,141,118, 0, /* 0x 5e0 */ -184, 20, 0, 0, 0,205,128,114,239,195,144,144,233,179, 0, 0, /* 0x 5f0 */ - 0,141,118, 0,184, 10, 0, 0, 0,205,128,114,239,195,144,144, /* 0x 600 */ -233,159, 0, 0, 0,141,118, 0,184, 7, 0, 0, 0,205,128,114, /* 0x 610 */ -239,195,144,144,233,139, 0, 0, 0,141,118, 0,184, 6, 0, 0, /* 0x 620 */ - 0,205,128,114,239,195,144,144,233,119, 0, 0, 0,141,118, 0, /* 0x 630 */ -184, 5, 0, 0, 0,205,128,114,239,195,144,144,233, 99, 0, 0, /* 0x 640 */ - 0,141,118, 0,184, 4, 0, 0, 0,205,128,114,239,195,144,144, /* 0x 650 */ -233, 79, 0, 0, 0,141,118, 0,184, 3, 0, 0, 0,205,128,114, /* 0x 660 */ -239,195,144,144,233, 59, 0, 0, 0,141,118, 0,184, 2, 0, 0, /* 0x 670 */ - 0,205,128,114,239,195,144,144, 85,137,229,131,236, 16,255,117, /* 0x 680 */ - 32,255,117, 28,106, 0,255,117, 24,255,117, 20,255,117, 16,255, /* 0x 690 */ -117, 12,255,117, 8,106, 0,104,197, 0, 0, 0,232, 99, 0, 0, /* 0x 6a0 */ - 0,201,195,144, 80,232,202,254,255,255, 89,137, 8,184,255,255, /* 0x 6b0 */ -255,255,186,255,255,255,255,195, 85,137,229,131,236, 16,255,117, /* 0x 6c0 */ - 16,255,117, 12,106, 0,255,117, 8,106, 0,104,201, 0, 0, 0, /* 0x 6d0 */ -232, 47, 0, 0, 0,201,195,144, 85,137,229,131,236, 12,255,117, /* 0x 6e0 */ - 20,255,117, 16,255,117, 12,106, 0,255,117, 8,106, 0,104,199, /* 0x 6f0 */ - 0, 0, 0,232, 12, 0, 0, 0,201,195,144,144,233,163,255,255, /* 0x 700 */ -255,141,118, 0,184,198, 0, 0, 0,205,128,114,239,195, 0, 0, /* 0x 710 */ - 85, 80, 88, 52, 0, 0, 0, 0, 47,116,109,112, 47,117,112,120, /* 0x 720 */ - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 0, 85, 80, 88, 53 /* 0x 730 */ -}; Index: files/patch-Makefile =================================================================== RCS file: files/patch-Makefile diff -N files/patch-Makefile --- files/patch-Makefile 8 Jan 2005 11:16:50 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,10 +0,0 @@ ---- Makefile.orig Tue Feb 3 15:50:45 2004 -+++ Makefile Wed Jan 5 13:44:11 2005 -@@ -3,6 +3,7 @@ - # - # usage: - # `make target=linux' # linux -+# `make target=freebsd' # freebsd - # `make target=dos32-djggp2' # dos32 - djggp2 - # `make target=win32-cygwin' # win32 - cygwin - # `make target=win32-mingw32' # win32 - mingw32 Index: files/patch-Makefile.bld =================================================================== RCS file: files/patch-Makefile.bld diff -N files/patch-Makefile.bld --- files/patch-Makefile.bld 8 Jan 2005 11:16:50 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,40 +0,0 @@ ---- Makefile.bld.orig Fri Jun 25 01:35:14 2004 -+++ Makefile.bld Wed Jan 5 14:23:51 2005 -@@ -125,7 +125,7 @@ - - override tmp := -Wl,--rpath, - LDRPATH := $(addprefix $(tmp),$(LIBDIRS)) --LIBDIRS += . -+LIBDIRS += . $(UCLDIR)/lib - LDLIBDIRS := $(addprefix -L,$(LIBDIRS)) - - ##LDFLAGS += $(LDRPATH) -@@ -168,6 +168,28 @@ - endif - CHMOD_EXE = chmod 755 $@ - endif # linux -+ -+ -+### -+### FreeBSD -+### -+ -+ifeq ($(target),freebsd) -+include $(srcdir)/Makedefs.gcc -+override arch := $(shell uname -m | sed -e 's/^i[3456789]86$$/i386/') -+DEFS += -D_FILE_OFFSET_BITS=64 -+##CFLAGS_WERROR = -Werror -+ifeq ($(DEBUG),1) -+else -+ ##LDFLAGS += -static -+ STUBEDIT_EXE = objcopy -S -R .comment -R .note $@ -+ ifeq ($(arch),i386) -+## STUBIFY_EXE = perl $(srcdir)/stub/scripts/brandelf.pl $@ -+ endif -+CHMOD_EXE = chmod 755 $@ -+endif -+ -+endif # freebsd - - - ### Index: files/patch-conf.h =================================================================== RCS file: files/patch-conf.h diff -N files/patch-conf.h --- files/patch-conf.h 8 Jan 2005 11:16:50 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,10 +0,0 @@ ---- conf.h.orig Wed Jan 28 02:49:57 2004 -+++ conf.h Tue Feb 17 06:24:41 2004 -@@ -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 - Index: files/patch-help.cpp =================================================================== RCS file: files/patch-help.cpp diff -N files/patch-help.cpp --- files/patch-help.cpp 17 Feb 2004 03:05:13 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ ---- 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" - ""); Index: files/patch-p_unix.cpp =================================================================== RCS file: files/patch-p_unix.cpp diff -N files/patch-p_unix.cpp --- files/patch-p_unix.cpp 17 Feb 2004 03:05:13 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,98 +0,0 @@ ---- 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 Index: files/patch-p_unix.h =================================================================== RCS file: files/patch-p_unix.h diff -N files/patch-p_unix.h --- files/patch-p_unix.h 17 Feb 2004 03:05:13 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,28 +0,0 @@ ---- 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 Index: files/patch-packmast.cpp =================================================================== RCS file: files/patch-packmast.cpp diff -N files/patch-packmast.cpp --- files/patch-packmast.cpp 17 Feb 2004 03:05:13 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,11 +0,0 @@ ---- 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) Index: files/patch-src-Makefile =================================================================== RCS file: files/patch-src-Makefile diff -N files/patch-src-Makefile --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-src-Makefile 10 May 2007 06:16:01 -0000 @@ -0,0 +1,11 @@ +--- src/Makefile.orig Fri Apr 27 15:00:00 2007 ++++ src/Makefile Wed May 9 22:55:18 2007 +@@ -52,7 +52,7 @@ + # we need UCL and zlib - you can set envvar UPX_UCLDIR + ifneq ($(wildcard $(UPX_UCLDIR)/include/ucl/ucl.h),) + INCLUDES += -I$(UPX_UCLDIR)/include +-LIBS += $(addprefix -L,$(dir $(wildcard $(UPX_UCLDIR)/libucl$(libext) $(UPX_UCLDIR)/src/.libs/libucl$(libext)))) ++LIBS += -L$(UPX_UCLDIR)/lib + endif + LIBS += -lucl -lz + # you should set envvar UPX_LZMADIR to point to your unpacked lzma443.tar.bz2 Index: files/patch-stub-Makefile =================================================================== RCS file: files/patch-stub-Makefile diff -N files/patch-stub-Makefile --- files/patch-stub-Makefile 8 Jan 2005 11:16:50 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,74 +0,0 @@ ---- stub/Makefile.orig Fri Jun 25 01:35:35 2004 -+++ stub/Makefile Wed Jan 5 13:56:16 2005 -@@ -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 \ -@@ -103,6 +104,17 @@ - - - ### -+### FreeBSD/i386 -+### -+ -+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 -+ -+ -+### - ### Motorola 68000 - ### - -@@ -292,6 +304,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 - # ************************************************************************/ - -@@ -316,10 +353,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) Index: files/patch-stub-l_linux.c =================================================================== RCS file: files/patch-stub-l_linux.c diff -N files/patch-stub-l_linux.c --- files/patch-stub-l_linux.c 8 Jan 2005 11:16:50 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,150 +0,0 @@ ---- stub/l_linux.c.orig Wed Jan 21 00:32:56 2004 -+++ stub/l_linux.c Wed Jan 5 14:43:57 2005 -@@ -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 = (unsigned char *) mmap(0, mmapsize, PROT_READ | PROT_WRITE, MAP_PRIVATE, fdo, 0); -+#else - buf = (unsigned char *) 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 and - // Jamie Lokier 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); Index: files/patch-stub-linux.hh =================================================================== RCS file: files/patch-stub-linux.hh diff -N files/patch-stub-linux.hh --- files/patch-stub-linux.hh 8 Jan 2005 11:16:50 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,30 +0,0 @@ ---- stub/linux.hh.orig Wed Jan 5 14:42:03 2005 -+++ stub/linux.hh Wed Jan 5 14:43:40 2005 -@@ -35,6 +35,19 @@ - // - **************************************************************************/ - -+#if defined(__FreeBSD__) -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#else -+ - // - typedef long ptrdiff_t; - typedef unsigned long size_t; -@@ -412,6 +425,7 @@ - #define PT_INTERP 3 - #define PT_PHDR 6 - -+#endif /* __FreeBSD__ */ - - /************************************************************************* - // UPX stuff --- upx-3.00.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: