1
0
mirror of https://github.com/upx/upx synced 2025-10-05 19:20:23 +08:00

all: enhance CMake tests; assorted updates

This commit is contained in:
Markus F.X.J. Oberhumer 2024-04-06 15:47:46 +02:00
parent ed35613d64
commit 97cf29ffbb
22 changed files with 473 additions and 398 deletions

View File

@ -444,7 +444,7 @@ if(NOT UPX_CONFIG_DISABLE_SELF_PACK_TEST)
set(exe "${CMAKE_EXECUTABLE_SUFFIX}")
set(upx_self_exe "$<TARGET_FILE:upx>")
set(fo "--force-overwrite")
upx_add_serial_test(upx-self-pack upx -3 "${upx_self_exe}" ${fo} -o upx-packed${exe})
upx_add_serial_test(upx-self-pack upx -3 --all-filters "${upx_self_exe}" ${fo} -o upx-packed${exe})
upx_add_serial_test(upx-self-pack-n2b upx -3 --nrv2b "${upx_self_exe}" ${fo} -o upx-packed-n2b${exe})
upx_add_serial_test(upx-self-pack-n2d upx -3 --nrv2d "${upx_self_exe}" ${fo} -o upx-packed-n2d${exe})
upx_add_serial_test(upx-self-pack-n2e upx -3 --nrv2e "${upx_self_exe}" ${fo} -o upx-packed-n2e${exe})
@ -452,9 +452,24 @@ if(NOT UPX_CONFIG_DISABLE_SELF_PACK_TEST)
upx_add_serial_test(upx-list upx -l upx-packed${exe} upx-packed-n2b${exe} upx-packed-n2d${exe} upx-packed-n2e${exe} upx-packed-lzma${exe})
upx_add_serial_test(upx-fileinfo upx --fileinfo upx-packed${exe} upx-packed-n2b${exe} upx-packed-n2d${exe} upx-packed-n2e${exe} upx-packed-lzma${exe})
upx_add_serial_test(upx-test upx -t upx-packed${exe} upx-packed-n2b${exe} upx-packed-n2d${exe} upx-packed-n2e${exe} upx-packed-lzma${exe})
upx_add_serial_test(upx-unpack upx -d upx-packed${exe} ${fo} -o upx-unpacked${exe})
upx_add_serial_test(upx-unpack-n2b upx -d upx-packed-n2b${exe} ${fo} -o upx-unpacked-n2b${exe})
upx_add_serial_test(upx-unpack-n2d upx -d upx-packed-n2d${exe} ${fo} -o upx-unpacked-n2d${exe})
upx_add_serial_test(upx-unpack-n2e upx -d upx-packed-n2e${exe} ${fo} -o upx-unpacked-n2e${exe})
upx_add_serial_test(upx-unpack-lzma upx -d upx-packed-lzma${exe} ${fo} -o upx-unpacked-lzma${exe})
upx_add_serial_test(upx-run-unpacked ${emu} ./upx-unpacked${exe} --version-short)
upx_add_serial_test(upx-run-unpacked-n2b ${emu} ./upx-unpacked-n2b${exe} --version-short)
upx_add_serial_test(upx-run-unpacked-n2d ${emu} ./upx-unpacked-n2d${exe} --version-short)
upx_add_serial_test(upx-run-unpacked-n2e ${emu} ./upx-unpacked-n2e${exe} --version-short)
upx_add_serial_test(upx-run-unpacked-lzma ${emu} ./upx-unpacked-lzma${exe} --version-short)
upx_add_serial_test(upx-run-packed ${emu} ./upx-packed${exe} --version-short)
upx_add_serial_test(upx-run-packed-n2b ${emu} ./upx-packed-n2b${exe} --version-short)
upx_add_serial_test(upx-run-packed-n2d ${emu} ./upx-packed-n2d${exe} --version-short)
upx_add_serial_test(upx-run-packed-n2e ${emu} ./upx-packed-n2e${exe} --version-short)
upx_add_serial_test(upx-run-packed-lzma ${emu} ./upx-packed-lzma${exe} --version-short)
endif() # UPX_CONFIG_DISABLE_SELF_PACK_TEST
endif()

View File

@ -37,6 +37,8 @@ Charles W. Sandmann <sandmann@clio.rice.edu>
for the idea with the stubless decompressor in djgpp2/coff
Ice
for debugging the PE headersize problem down
Jens Medoch <jssg@users.sourceforge.net>
for the ps1/exe format
Joergen Ibsen <jibz@hotmail.com> and d'b
for the relocation & address optimization ideas
John S. Fine <johnfine@erols.com>

6
doc/upx-doc.html generated
View File

@ -779,9 +779,7 @@ http://www.oberhumer.com
Laszlo Molnar &lt;ezerotven+github@gmail.com&gt;
John F. Reiser &lt;jreiser@BitWagon.com&gt;
Jens Medoch &lt;jssg@users.sourceforge.net&gt;</code></pre>
John F. Reiser &lt;jreiser@BitWagon.com&gt;</code></pre>
<h1 id="COPYRIGHT">COPYRIGHT</h1>
@ -791,8 +789,6 @@ Jens Medoch &lt;jssg@users.sourceforge.net&gt;</code></pre>
<p>Copyright (C) 2000-2024 John F. Reiser</p>
<p>Copyright (C) 2002-2024 Jens Medoch</p>
<p><b>UPX</b> is distributed with full source code under the terms of the GNU General Public License v2+; either under the pure GPLv2+ (see the file COPYING), or (at your option) under the GPLv+2 with special exceptions and restrictions granting the free usage for all binaries including commercial programs (see the file LICENSE).</p>
<p>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.</p>

4
doc/upx-doc.txt generated
View File

@ -815,8 +815,6 @@ AUTHORS
John F. Reiser <jreiser@BitWagon.com>
Jens Medoch <jssg@users.sourceforge.net>
COPYRIGHT
Copyright (C) 1996-2024 Markus Franz Xaver Johannes Oberhumer
@ -824,8 +822,6 @@ COPYRIGHT
Copyright (C) 2000-2024 John F. Reiser
Copyright (C) 2002-2024 Jens Medoch
UPX is distributed with full source code under the terms of the GNU
General Public License v2+; either under the pure GPLv2+ (see the file
COPYING), or (at your option) under the GPLv+2 with special exceptions

4
doc/upx.1 generated
View File

@ -936,8 +936,6 @@ Please report all bugs immediately to the authors.
\& Laszlo Molnar <ezerotven+github@gmail.com>
\&
\& John F. Reiser <jreiser@BitWagon.com>
\&
\& Jens Medoch <jssg@users.sourceforge.net>
.Ve
.SH COPYRIGHT
.IX Header "COPYRIGHT"
@ -947,8 +945,6 @@ Copyright (C) 1996\-2024 Laszlo Molnar
.PP
Copyright (C) 2000\-2024 John F. Reiser
.PP
Copyright (C) 2002\-2024 Jens Medoch
.PP
\&\fBUPX\fR is distributed with full source code under the terms of the
GNU General Public License v2+; either under the pure GPLv2+ (see
the file COPYING), or (at your option) under the GPLv+2 with special

View File

@ -926,8 +926,6 @@ Please report all bugs immediately to the authors.
John F. Reiser <jreiser@BitWagon.com>
Jens Medoch <jssg@users.sourceforge.net>
=head1 COPYRIGHT
@ -938,8 +936,6 @@ Copyright (C) 1996-2024 Laszlo Molnar
Copyright (C) 2000-2024 John F. Reiser
Copyright (C) 2002-2024 Jens Medoch
B<UPX> is distributed with full source code under the terms of the
GNU General Public License v2+; either under the pure GPLv2+ (see
the file COPYING), or (at your option) under the GPLv+2 with special

View File

@ -14,11 +14,11 @@ RUN dpkg --add-architecture i386 \
# the following packages are not required for rebuilding the stubs, but
# they do make the image *much* more convenient and also allow building
# the full UPX binary inside the container via CMake:
7zip bfs busybox bzip2 cabextract ccache chrpath cmake cpio curl elfutils fd-find file fzf \
7zip bfs busybox bzip2 cabextract ccache chrpath cmake cpio curl elfutils fd-find file fish fzf \
g++ gawk gdb gojq ht htop hyperfine jq libzstd-dev lsb-release lz4 lzip lzop \
mksh moreutils ninja-build p7zip parallel patch patchelf patchutils pax-utils \
minify mksh moreutils neovim ninja-build p7zip parallel patch patchelf patchutils pax-utils \
python3 python3-pyasn1 python3-pycryptodome python3-zstd \
re2c ripgrep rsync screen universal-ctags unzip vim yash zip zlib1g-dev zsh zstd \
re2c ripgrep rsync screen universal-ctags unzip yash yq zip zlib1g-dev zsh zstd \
# extra packages for compiling with "gcc -m32" and "gcc -mx32":
g++-multilib gcc-multilib \
&& true
@ -74,6 +74,9 @@ RUN useradd upx -U --uid 2000 --shell /bin/bash -m \
&& for d in bin include lib share state; do mkdir -p .local/$d; done \
&& ln -s .cache/wine .wine && ln -s .cache/tmp tmp \
&& ln -s /usr/local/bin/bin-upx-20221212 .local/bin/bin-upx \
&& echo 'm() { make "$@"; }' >> .bash_aliases \
&& echo 'source /usr/share/bash-completion/completions/make' >> .bash_aliases \
&& echo 'complete -F _make m' >> .bash_aliases \
&& chown -R upx:upx . \
&& true
USER upx

View File

@ -1,5 +1,5 @@
Packages:
+++-============================-=================================-============-================================================================================
+++-=============================-=================================-============-================================================================================
Desired=Unknown/Install/Remove/Purge/Hold
ii 7zip 23.01+dfsg-8 amd64 7-Zip file archiver with a high compression ratio
ii apt 2.7.12 amd64 commandline package manager
@ -12,6 +12,7 @@ ii bfs 3.1.2-1build1 amd64
ii binutils 2.42-4ubuntu2 amd64 GNU assembler, linker and binary utilities
ii binutils-common:amd64 2.42-4ubuntu2 amd64 Common files for the GNU assembler, linker and binary utilities
ii binutils-x86-64-linux-gnu 2.42-4ubuntu2 amd64 GNU binary utilities, for x86-64-linux-gnu target
ii bsdextrautils 2.39.3-9ubuntu4 amd64 extra utilities from 4.4BSD-Lite
ii bsdutils 1:2.39.3-9ubuntu4 amd64 basic utilities from 4.4BSD-Lite
ii busybox 1:1.36.1-6ubuntu1 amd64 Tiny utilities for small and embedded systems
ii bzip2 1.0.8-5ubuntu1 amd64 high-quality block-sorting file compressor - utilities
@ -38,6 +39,8 @@ ii elfutils 0.190-1.1build3 amd64
ii fd-find 9.0.0-1 amd64 Simple, fast and user-friendly alternative to find
ii file 1:5.45-3build1 amd64 Recognize the type of data in a file using "magic" numbers
ii findutils 4.9.0-5 amd64 utilities for finding files--find, xargs
ii fish 3.7.0-1 amd64 friendly interactive shell
ii fish-common 3.7.0-1 all friendly interactive shell (architecture-independent files)
ii fzf 0.44.1-1 amd64 general-purpose command-line fuzzy finder
ii g++ 4:13.2.0-7ubuntu1 amd64 GNU C++ compiler
ii g++-13 13.2.0-23ubuntu3 amd64 GNU C++ compiler
@ -61,6 +64,7 @@ ii git-man 1:2.43.0-1ubuntu6 all
ii gojq 0.12.13-1 amd64 pure Go implementation of jq (program)
ii gpgv 2.4.4-2ubuntu16 amd64 GNU privacy guard - signature verification tool
ii grep 3.11-4 amd64 GNU grep, egrep and fgrep
ii groff-base 1.23.0-3build2 amd64 GNU troff text-formatting system (base system components)
ii gzip 1.12-1ubuntu2 amd64 GNU compression utilities
ii hostname 3.23+nmu2ubuntu1 amd64 utility to set/show the host name or domain name
ii ht 2.1.0+repack1-5 amd64 Viewer/editor/analyser (mostly) for executables
@ -114,7 +118,7 @@ ii libcrypt-dev:amd64 1:4.4.36-4 amd64
ii libcrypt1:amd64 1:4.4.36-4 amd64 libcrypt shared library
ii libctf-nobfd0:amd64 2.42-4ubuntu2 amd64 Compact C Type Format library (runtime, no BFD dependency)
ii libctf0:amd64 2.42-4ubuntu2 amd64 Compact C Type Format library (runtime, BFD dependency)
ii libcurl3-gnutls:amd64 8.5.0-2ubuntu2 amd64 easy-to-use client-side URL transfer library (GnuTLS flavour)
ii libcurl3t64-gnutls:amd64 8.5.0-2ubuntu9 amd64 easy-to-use client-side URL transfer library (GnuTLS flavour)
ii libcurl4t64:amd64 8.5.0-2ubuntu9 amd64 easy-to-use client-side URL transfer library (OpenSSL flavour)
ii libdb5.3t64:amd64 5.3.28+dfsg2-6build1 amd64 Berkeley v5.3 Database Libraries [runtime]
ii libdebconfclient0:amd64 0.271ubuntu3 amd64 Debian Configuration Management System (C-implementation library)
@ -130,16 +134,15 @@ ii libgcc-13-dev:amd64 13.2.0-23ubuntu3 amd64
ii libgcc-s1:amd64 14-20240330-1ubuntu2 amd64 GCC support library
ii libgcc-s1:i386 14-20240330-1ubuntu2 i386 GCC support library
ii libgcrypt20:amd64 1.10.3-2 amd64 LGPL Crypto library - runtime library
ii libgdbm-compat4:amd64 1.23-5 amd64 GNU dbm database routines (legacy support runtime version)
ii libgdbm6:amd64 1.23-5 amd64 GNU dbm database routines (runtime version)
ii libgdbm-compat4t64:amd64 1.23-5.1build1 amd64 GNU dbm database routines (legacy support runtime version)
ii libgdbm6t64:amd64 1.23-5.1build1 amd64 GNU dbm database routines (runtime version)
ii libglib2.0-0t64:amd64 2.80.0-6ubuntu1 amd64 GLib library of C routines
ii libgmp10:amd64 2:6.3.0+dfsg-2ubuntu4 amd64 Multiprecision arithmetic library
ii libgnutls30t64:amd64 3.8.3-1.1ubuntu3 amd64 GNU TLS library - main runtime library
ii libgomp1:amd64 14-20240330-1ubuntu2 amd64 GCC OpenMP (GOMP) support library
ii libgpg-error0:amd64 1.47-3build1 amd64 GnuPG development runtime library
ii libgpm2:amd64 1.20.7-11 amd64 General Purpose Mouse - shared library
ii libgprofng0:amd64 2.42-4ubuntu2 amd64 GNU Next Generation profiler (runtime library)
ii libgssapi-krb5-2:amd64 1.20.1-5build1 amd64 MIT Kerberos runtime libraries - krb5 GSS-API Mechanism
ii libgssapi-krb5-2:amd64 1.20.1-6ubuntu2 amd64 MIT Kerberos runtime libraries - krb5 GSS-API Mechanism
ii libhiredis1.1.0:amd64 1.2.0-6ubuntu3 amd64 minimalistic C client library for Redis
ii libhogweed6t64:amd64 3.9.1-2.2build1 amd64 low level cryptographic library (public-key cryptos)
ii libhwasan0:amd64 14-20240330-1ubuntu2 amd64 AddressSanitizer -- a fast memory error detector
@ -153,12 +156,14 @@ ii libitm1:amd64 14-20240330-1ubuntu2 amd64
ii libjansson4:amd64 2.14-2 amd64 C library for encoding, decoding and manipulating JSON data
ii libjq1:amd64 1.7.1-3build1 amd64 lightweight and flexible command-line JSON processor - shared library
ii libjsoncpp25:amd64 1.9.5-6 amd64 library for reading and writing JSON for C++
ii libk5crypto3:amd64 1.20.1-5build1 amd64 MIT Kerberos runtime libraries - Crypto Library
ii libk5crypto3:amd64 1.20.1-6ubuntu2 amd64 MIT Kerberos runtime libraries - Crypto Library
ii libkeyutils1:amd64 1.6.3-3 amd64 Linux Key Management Utilities (library)
ii libkrb5-3:amd64 1.20.1-5build1 amd64 MIT Kerberos runtime libraries
ii libkrb5support0:amd64 1.20.1-5build1 amd64 MIT Kerberos runtime libraries - Support library
ii libkrb5-3:amd64 1.20.1-6ubuntu2 amd64 MIT Kerberos runtime libraries
ii libkrb5support0:amd64 1.20.1-6ubuntu2 amd64 MIT Kerberos runtime libraries - Support library
ii libldap2:amd64 2.6.7+dfsg-1~exp1ubuntu8 amd64 OpenLDAP libraries
ii liblsan0:amd64 14-20240330-1ubuntu2 amd64 LeakSanitizer -- a memory leak detector (runtime)
ii libluajit-5.1-2:amd64 2.1.0+git20231223.c525bcb+dfsg-1 amd64 Just in time compiler for Lua - library version
ii libluajit-5.1-common 2.1.0+git20231223.c525bcb+dfsg-1 all Just in time compiler for Lua - common files
ii liblz4-1:amd64 1.9.4-1 amd64 Fast LZ compression algorithm library - runtime
ii liblzma5:amd64 5.6.1+really5.4.5-1 amd64 XZ-format compression library
ii liblzo2-2:amd64 2.10-2build3 amd64 data compression library
@ -168,6 +173,7 @@ ii libmd0:amd64 1.1.0-2 amd64
ii libmount1:amd64 2.39.3-9ubuntu4 amd64 device mounting library
ii libmpc3:amd64 1.3.1-1 amd64 multiple precision complex floating-point library
ii libmpfr6:amd64 4.2.1-1 amd64 multiple precision floating-point computation
ii libmsgpackc2:amd64 4.0.0-3 amd64 binary-based efficient object serialization library
ii libmspack0t64:amd64 0.11-1.1build1 amd64 library for Microsoft compression formats (shared library)
ii libncurses6:amd64 6.4+20240113-1ubuntu1 amd64 shared libraries for terminal handling
ii libncursesw6:amd64 6.4+20240113-1ubuntu1 amd64 shared libraries for terminal handling (wide character support)
@ -182,8 +188,10 @@ ii libpam-modules-bin 1.5.3-5ubuntu4 amd64
ii libpam-modules:amd64 1.5.3-5ubuntu4 amd64 Pluggable Authentication Modules for PAM
ii libpam-runtime 1.5.3-5ubuntu4 all Runtime support for the PAM library
ii libpam0g:amd64 1.5.3-5ubuntu4 amd64 Pluggable Authentication Modules library
ii libpcre2-32-0:amd64 10.42-4ubuntu1 amd64 New Perl Compatible Regular Expression Library - 32 bit runtime files
ii libpcre2-8-0:amd64 10.42-4ubuntu1 amd64 New Perl Compatible Regular Expression Library- 8 bit runtime files
ii libperl5.38t64:amd64 5.38.2-3.2build1 amd64 shared Perl library
ii libpipeline1:amd64 1.5.7-2 amd64 Unix process pipeline manipulation library
ii libpopt0:amd64 1.19+dfsg-1 amd64 lib for parsing cmdline parameters
ii libproc2-0:amd64 2:4.0.4-4ubuntu3 amd64 library for accessing process information from /proc
ii libpsl5t64:amd64 0.21.2-1.1build1 amd64 Library for Public Suffix List (shared libraries)
@ -208,9 +216,8 @@ ii libsepol2:amd64 3.5-2 amd64
ii libsframe1:amd64 2.42-4ubuntu2 amd64 Library to handle the SFrame format (runtime library)
ii libsigsegv2:amd64 2.14-1ubuntu1 amd64 Library for handling page faults in a portable way
ii libsmartcols1:amd64 2.39.3-9ubuntu4 amd64 smart column output alignment library
ii libsodium23:amd64 1.0.18-1build2 amd64 Network communication, cryptography and signaturing library
ii libsource-highlight-common 3.1.9-4.3build1 all architecture-independent files for source highlighting library
ii libsource-highlight4v5:amd64 3.1.9-4.2build2 amd64 source highlighting library
ii libsource-highlight4t64:amd64 3.1.9-4.3build1 amd64 source highlighting library
ii libsqlite3-0:amd64 3.45.1-1ubuntu2 amd64 SQLite 3 shared library
ii libss2:amd64 1.47.0-2.4~exp1ubuntu3 amd64 command-line interface parsing library
ii libssh-4:amd64 0.10.6-2build2 amd64 tiny C SSH library (OpenSSL flavor)
@ -220,17 +227,22 @@ ii libstdc++-13-dev:amd64 13.2.0-23ubuntu3 amd64
ii libstdc++6:amd64 14-20240330-1ubuntu2 amd64 GNU Standard C++ Library v3
ii libsystemd0:amd64 255.4-1ubuntu7 amd64 systemd utility library
ii libtasn1-6:amd64 4.19.0-3 amd64 Manage ASN.1 structures (runtime)
ii libtermkey1:amd64 0.22-1 amd64 library for processing keyboard input
ii libtime-duration-perl 1.21-2 all module for rounded or exact English expression of durations
ii libtimedate-perl 2.3300-2 all collection of modules to manipulate date/time information
ii libtinfo6:amd64 6.4+20240113-1ubuntu1 amd64 shared low-level terminfo library for terminal handling
ii libtree-sitter0:amd64 0.20.8-2 amd64 incremental parsing system for programming tools
ii libtsan2:amd64 14-20240330-1ubuntu2 amd64 ThreadSanitizer -- a Valgrind-based detector of data races (runtime)
ii libubsan1:amd64 14-20240330-1ubuntu2 amd64 UBSan -- undefined behaviour sanitizer (runtime)
ii libuchardet0:amd64 0.0.8-1 amd64 universal charset detection library - shared library
ii libudev1:amd64 255.4-1ubuntu7 amd64 libudev shared library
ii libunibilium4:amd64 2.1.0-3 amd64 simple, self-contained terminfo library
ii libunistring5:amd64 1.1-2 amd64 Unicode string library for C
ii liburing2:amd64 2.5-1 amd64 Linux kernel io_uring access library - shared library
ii libutempter0:amd64 1.2.1-3 amd64 privileged helper for utmp/wtmp updates (runtime)
ii libuuid1:amd64 2.39.3-9ubuntu4 amd64 Universally Unique ID library
ii libuv1t64:amd64 1.48.0-1.1build1 amd64 asynchronous event notification library - runtime library
ii libvterm0:amd64 0.3.3-2build1 amd64 abstract terminal library
ii libx11-6:amd64 2:1.8.7-1 amd64 X11 client-side library
ii libx11-data 2:1.8.7-1 all X11 client-side library
ii libx32asan8 14-20240330-1ubuntu2 amd64 AddressSanitizer -- a fast memory error detector (x32)
@ -255,18 +267,23 @@ ii linux-libc-dev:amd64 6.8.0-11.11 amd64
ii login 1:4.13+dfsg1-4ubuntu1 amd64 system login tools
ii logsave 1.47.0-2.4~exp1ubuntu3 amd64 save the output of a command in a log file
ii lsb-release 12.0-2 all Linux Standard Base version reporting utility (minimal implementation)
ii lua-luv:amd64 1.48.0-2-2build1 amd64 libuv bindings for Lua
ii lz4 1.9.4-1 amd64 Fast LZ compression algorithm library - tool
ii lzip 1.24.1-1build1 amd64 lossless data compressor based on the LZMA algorithm
ii lzop 1.04-2build2 amd64 fast compression program
ii make 4.3-4.1build1 amd64 utility for directing compilation
ii man-db 2.12.0-4build1 amd64 tools for reading manual pages
ii mawk 1.3.4.20240123-1 amd64 Pattern scanning and text processing language
ii media-types 10.1.0 all List of standard media types and their usual file extension
ii minify 2.20.17-1 amd64 CLI implementation of the Go minify library package
ii mksh 59c-34 amd64 MirBSD Korn Shell
ii moreutils 0.69-1 amd64 additional Unix utilities
ii mount 2.39.3-9ubuntu4 amd64 tools for mounting and manipulating filesystems
ii ncurses-base 6.4+20240113-1ubuntu1 all basic terminal type definitions
ii ncurses-bin 6.4+20240113-1ubuntu1 amd64 terminal-related programs and man pages
ii ncurses-term 6.4+20240113-1ubuntu1 all additional terminal type definitions
ii neovim 0.9.5-6ubuntu2 amd64 heavily refactored vim fork
ii neovim-runtime 0.9.5-6ubuntu2 all heavily refactored vim fork (runtime files)
ii netbase 6.4 all Basic TCP/IP networking system
ii ninja-build 1.11.1-2 amd64 small build system closest in spirit to Make
ii openssl 3.0.13-0ubuntu3 amd64 Secure Sockets Layer toolkit - cryptographic utility
@ -283,10 +300,14 @@ ii perl-modules-5.38 5.38.2-3.2build1 all
ii procps 2:4.0.4-4ubuntu3 amd64 /proc file system utilities
ii python2.7-minimal 2.7.18-8+deb11u1 amd64 Minimal subset of the Python language (version 2.7)
ii python3 3.12.2-0ubuntu2 amd64 interactive high-level object-oriented language (default python3 version)
ii python3-argcomplete 3.1.4-1 all bash tab completion for argparse (for Python 3)
ii python3-minimal 3.12.2-0ubuntu2 amd64 minimal subset of the Python language (default python3 version)
ii python3-pyasn1 0.4.8-4 all ASN.1 library for Python (Python 3 module)
ii python3-pycryptodome 3.20.0+dfsg-1 amd64 cryptographic Python library (Python 3)
ii python3-pyelftools 0.30-1 all pure-python3 library for parsing ELF and DWARF
ii python3-toml 0.10.2-1 all library for Tom's Obvious, Minimal Language - Python 3.x
ii python3-xmltodict 0.13.0-1 all Makes working with XML feel like you are working with JSON (Python 3)
ii python3-yaml 6.0.1-2build2 amd64 YAML parser and emitter for Python3
ii python3-zstd 1.5.5.1-1 amd64 python bindings to Yann Collet ZSTD compression library
ii python3.12 3.12.2-4build4 amd64 Interactive high-level object-oriented language (version 3.12)
ii python3.12-minimal 3.12.2-4build4 amd64 Minimal subset of the Python language (version 3.12)
@ -308,12 +329,10 @@ ii ucf 3.0043+nmu1 all
ii universal-ctags 5.9.20210829.0-1 amd64 build tag file indexes of source code definitions
ii unzip 6.0-28ubuntu3 amd64 De-archiver for .zip files
ii util-linux 2.39.3-9ubuntu4 amd64 miscellaneous system utilities
ii vim 2:9.1.0016-1ubuntu7 amd64 Vi IMproved - enhanced vi editor
ii vim-common 2:9.1.0016-1ubuntu7 all Vi IMproved - Common files
ii vim-runtime 2:9.1.0016-1ubuntu7 all Vi IMproved - Runtime files
ii wget 1.21.4-1ubuntu3 amd64 retrieves files from the web
ii xz-utils 5.6.1+really5.4.5-1 amd64 XZ-format compression utilities
ii yash 2.55-2 amd64 yet another shell
ii yq 3.1.0-3 all Command-line YAML processor - jq wrapper for YAML documents
ii zip 3.0-13 amd64 Archiver for .zip files
ii zlib1g-dev:amd64 1:1.3.dfsg-3.1ubuntu2 amd64 compression library - development
ii zlib1g:amd64 1:1.3.dfsg-3.1ubuntu2 amd64 compression library - runtime
@ -327,14 +346,14 @@ rc libgnutls30:amd64 3.8.3-1ubuntu1 amd64
||/ Name Version Architecture Description
Packages sorted by Installed-Size:
854360 ===== TOTAL (321 packages)
870769 ===== TOTAL (340 packages)
72237 gcc-13-x86-64-linux-gnu amd64
37833 g++-13-x86-64-linux-gnu amd64
36529 vim-runtime all
36493 cmake amd64
35919 libicu74 amd64
35023 cpp-13-x86-64-linux-gnu amd64
29327 libperl5.38t64 amd64
21815 neovim-runtime all
21684 git amd64
20517 libstdc++-13-dev amd64
19159 perl-modules-5.38 all
@ -343,6 +362,7 @@ Packages sorted by Installed-Size:
13430 libc6 amd64
13111 libc6-dev amd64
12695 gdb amd64
12321 fish-common all
12296 libc6 i386
12003 libc6-x32 amd64
11992 libc6-i386 amd64
@ -363,6 +383,7 @@ Packages sorted by Installed-Size:
7162 linux-libc-dev amd64
6946 libc6-dev-i386 amd64
6936 coreutils amd64
6775 neovim amd64
6743 lib32stdc++-13-dev amd64
6607 libssl3t64 amd64
6433 libx32stdc++-13-dev amd64
@ -372,15 +393,17 @@ Packages sorted by Installed-Size:
5169 libpython3.12-minimal amd64
4873 libhwasan0 amd64
4341 ncurses-term all
4130 vim amd64
4244 minify amd64
4104 apt amd64
3983 gojq amd64
3956 python3-pycryptodome amd64
3949 libglib2.0-0t64 amd64
3849 libgprofng0 amd64
3795 liblsan0 amd64
3721 groff-base amd64
3627 fzf amd64
3605 python2.7-minimal amd64
3443 fish amd64
3437 util-linux amd64
3429 re2c amd64
3403 libaria2-0 amd64
@ -393,6 +416,7 @@ Packages sorted by Installed-Size:
2995 parallel all
2966 lib32stdc++6 amd64
2957 elfutils amd64
2928 man-db amd64
2785 libpython2.7-minimal amd64
2770 libx32stdc++6 amd64
2431 zsh amd64
@ -409,7 +433,6 @@ Packages sorted by Installed-Size:
1980 aria2 amd64
1900 bash amd64
1884 openssl amd64
1852 vim-common all
1796 procps amd64
1778 zstd amd64
1761 libdb5.3t64 amd64
@ -437,16 +460,17 @@ Packages sorted by Installed-Size:
996 screen amd64
924 libcurl4t64 amd64
916 wget amd64
905 libcurl3-gnutls amd64
905 libcurl3t64-gnutls amd64
904 libarchive13t64 amd64
884 login amd64
843 libbrotli1 amd64
828 busybox amd64
812 lua-luv amd64
780 rsync amd64
765 libdw1t64 amd64
755 libsepol2 amd64
749 libzstd1 amd64
742 libsource-highlight4v5 amd64
745 libsource-highlight4t64 amd64
732 xz-utils amd64
729 python3.12 amd64
708 tar amd64
@ -456,8 +480,10 @@ Packages sorted by Installed-Size:
639 libpcre2-8-0 amd64
629 libonig5 amd64
624 python3-pyelftools all
602 libluajit-5.1-2 amd64
560 findutils amd64
560 binutils-common amd64
558 libpcre2-32-0 amd64
556 libtinfo6 amd64
551 libgmp10 amd64
539 gcc-13 amd64
@ -465,6 +491,7 @@ Packages sorted by Installed-Size:
536 zip amd64
536 libldap2 amd64
520 curl amd64
512 python3-yaml amd64
508 libbabeltrace1 amd64
496 libssh-4 amd64
493 debconf all
@ -477,7 +504,6 @@ Packages sorted by Installed-Size:
422 libncursesw6 amd64
416 make amd64
415 libssh2-1t64 amd64
402 libsodium23 amd64
389 python3-pyasn1 all
386 ca-certificates all
384 ncurses-base all
@ -508,6 +534,7 @@ Packages sorted by Installed-Size:
288 libsemanage2 amd64
288 libblkid1 amd64
287 bsdutils amd64
286 bsdextrautils amd64
276 libpam-runtime all
273 patchelf amd64
273 mawk amd64
@ -532,12 +559,15 @@ Packages sorted by Installed-Size:
224 libidn2-0 amd64
224 debianutils amd64
219 patchutils amd64
218 libluajit-5.1-common all
214 ucf all
211 libmagic1t64 amd64
208 libpam0g amd64
207 libuchardet0 amd64
206 libxcb1 amd64
200 libselinux1 amd64
200 libnghttp2-14 amd64
198 libtree-sitter0 amd64
197 libgcc-s1 amd64
196 libelf1t64 amd64
187 dash amd64
@ -553,6 +583,7 @@ Packages sorted by Installed-Size:
159 binutils amd64
157 zlib1g i386
155 liblz4-1 amd64
154 python3-argcomplete all
151 libaudit1 amd64
149 libmpc3 amd64
148 libyaml-0-2 amd64
@ -560,8 +591,8 @@ Packages sorted by Installed-Size:
148 libcc1-0 amd64
143 libseccomp2 amd64
137 librtmp1 amd64
136 libkrb5support0 amd64
136 libhiredis1.1.0 amd64
132 libkrb5support0 amd64
130 init-system-helpers all
127 libipt2 amd64
127 libbsd0 amd64
@ -587,38 +618,45 @@ Packages sorted by Installed-Size:
98 libmspack0t64 amd64
97 libcap2 amd64
95 liburing2 amd64
95 libunibilium4 amd64
95 libbz2-1.0 amd64
93 media-types all
93 libvterm0 amd64
93 libgdbm6t64 amd64
92 libjansson4 amd64
90 libxxhash0 amd64
86 libgdbm6 amd64
83 libuuid1 amd64
82 python3 amd64
82 cabextract amd64
79 libsensors5 amd64
79 libmd0 amd64
77 readline-common all
77 python3-toml all
75 libsasl2-modules-db amd64
74 libasm1t64 amd64
74 libacl1 amd64
72 libffi8 amd64
69 yq all
69 libss2 amd64
69 liberror-perl all
69 libdebuginfod1t64 amd64
67 libpipeline1 amd64
65 python3-zstd amd64
63 sensible-utils all
63 libtermkey1 amd64
63 file amd64
60 libcap-ng0 amd64
60 libattr1 amd64
57 libcom-err2 amd64
53 libnl-genl-3-200 amd64
52 libmsgpackc2 amd64
51 logsave amd64
51 libutempter0 amd64
51 libsigsegv2 amd64
50 libdebuginfod-common all
47 python3-xmltodict all
46 hostname amd64
45 libatomic1 amd64
44 libgpm2 amd64
43 libxdmcp6 amd64
43 libx32atomic1 amd64
41 libkeyutils1 amd64
@ -631,7 +669,7 @@ Packages sorted by Installed-Size:
36 chrpath amd64
35 libxau6 amd64
34 libtime-duration-perl all
31 libgdbm-compat4 amd64
34 libgdbm-compat4t64 amd64
29 ubuntu-keyring all
28 g++-13 amd64
27 libpython3-stdlib amd64

View File

@ -62,7 +62,7 @@ exe=".out"
upx_self_exe=$upx_exe
fo="--force-overwrite"
"${upx_run[@]}" -3 "${upx_self_exe}" ${fo} -o upx-packed${exe}
"${upx_run[@]}" -3 --all-filters "${upx_self_exe}" ${fo} -o upx-packed${exe}
"${upx_run[@]}" -3 --nrv2b "${upx_self_exe}" ${fo} -o upx-packed-n2b${exe}
"${upx_run[@]}" -3 --nrv2d "${upx_self_exe}" ${fo} -o upx-packed-n2d${exe}
"${upx_run[@]}" -3 --nrv2e "${upx_self_exe}" ${fo} -o upx-packed-n2e${exe}
@ -71,10 +71,24 @@ fo="--force-overwrite"
"${upx_run[@]}" -l upx-packed${exe} upx-packed-n2b${exe} upx-packed-n2d${exe} upx-packed-n2e${exe} upx-packed-lzma${exe}
"${upx_run[@]}" --fileinfo upx-packed${exe} upx-packed-n2b${exe} upx-packed-n2d${exe} upx-packed-n2e${exe} upx-packed-lzma${exe}
"${upx_run[@]}" -t upx-packed${exe} upx-packed-n2b${exe} upx-packed-n2d${exe} upx-packed-n2e${exe} upx-packed-lzma${exe}
"${upx_run[@]}" -d upx-packed${exe} ${fo} -o upx-unpacked${exe}
"${upx_run[@]}" -d upx-packed-n2b${exe} ${fo} -o upx-unpacked-n2b${exe}
"${upx_run[@]}" -d upx-packed-n2d${exe} ${fo} -o upx-unpacked-n2d${exe}
"${upx_run[@]}" -d upx-packed-n2e${exe} ${fo} -o upx-unpacked-n2e${exe}
"${upx_run[@]}" -d upx-packed-lzma${exe} ${fo} -o upx-unpacked-lzma${exe}
set -x
"${upx_runner[@]}" ./upx-unpacked${exe} --version-short
"${upx_runner[@]}" ./upx-unpacked-n2b${exe} --version-short
"${upx_runner[@]}" ./upx-unpacked-n2d${exe} --version-short
"${upx_runner[@]}" ./upx-unpacked-n2e${exe} --version-short
"${upx_runner[@]}" ./upx-unpacked-lzma${exe} --version-short
"${upx_runner[@]}" ./upx-packed${exe} --version-short
"${upx_runner[@]}" ./upx-packed-n2b${exe} --version-short
"${upx_runner[@]}" ./upx-packed-n2d${exe} --version-short
"${upx_runner[@]}" ./upx-packed-n2e${exe} --version-short
"${upx_runner[@]}" ./upx-packed-lzma${exe} --version-short
echo "All done."

View File

@ -3,8 +3,8 @@
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
#
# NOTE: this Makefile is deprecated - please directly use
# the top-level CMake build instead.
# NOTE: this Makefile is intended for developers - please use
# the top-level Makefile instead
ifndef srcdir
srcdir := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
@ -14,7 +14,7 @@ ifndef top_srcdir
endif
#***********************************************************************
# redirect to top-level CMake build
# redirect to top-level Makefile
#***********************************************************************
# NOTE that the top-level Makefile .DEFAULT_GOAL is build/release

View File

@ -56,7 +56,7 @@ int upx_doctest_check(int argc, char **argv) {
// default for debug builds: do show the [doctest] summary
minimal = false;
#endif
const char *e = getenv("UPX_DEBUG_DOCTEST_VERBOSE");
const char *e = upx_getenv("UPX_DEBUG_DOCTEST_VERBOSE");
if (e && e[0]) {
if (strcmp(e, "0") == 0) {
minimal = true;
@ -375,8 +375,8 @@ static noinline bool shall_test_float_division_by_zero(void) {
static bool result = false; // default is false
static upx_std_once_flag init_done;
upx_std_call_once(init_done, []() noexcept {
const char envvar[] = "UPX_DEBUG_TEST_FLOAT_DIVISION_BY_ZERO";
const char *e = getenv(envvar);
static const char envvar[] = "UPX_DEBUG_TEST_FLOAT_DIVISION_BY_ZERO";
const char *e = upx_getenv(envvar);
bool force = (e && e[0] && strcmp(e, "2") == 0);
if (force)
result = true;
@ -441,6 +441,8 @@ static noinline void check_basic_floating_point(void) noexcept {
#include "../util/miniacc.h"
void upx_compiler_sanity_check(void) noexcept {
check_basic_floating_point();
if (is_envvar_true("UPX_DEBUG_DOCTEST_DISABLE", "UPX_DEBUG_DISABLE_DOCTEST")) {
// If UPX_DEBUG_DOCTEST_DISABLE is set then we don't want to throw any
// exceptions in order to improve debugging experience.
@ -449,8 +451,6 @@ void upx_compiler_sanity_check(void) noexcept {
check_basic_cxx_exception_handling(throwSomeValue);
}
check_basic_floating_point();
// check_basic_decltype()
{
auto a = +0;
@ -716,6 +716,11 @@ TEST_CASE("ptr_invalidate_and_poison") {
(void) dp;
}
TEST_CASE("upx_getenv") {
CHECK_EQ(upx_getenv(nullptr), nullptr);
CHECK_EQ(upx_getenv(""), nullptr);
}
TEST_CASE("working -fno-strict-aliasing") {
bool ok;
long v = 0;
@ -802,17 +807,22 @@ TEST_CASE("libc qsort") {
assert_noexcept(a->id != b->id); // check not IDENTICAL
return a->value < b->value ? -1 : (a->value == b->value ? 0 : 1);
}
static noinline bool check_sort(upx_sort_func_t sort, Elem *e, size_t n) {
upx_uint32_t x = 5381 + n + (upx_rand() & 0xff);
static noinline bool check_sort(upx_sort_func_t sort, Elem *e, size_t n, bool is_stable) {
upx_uint32_t x = 5381 + (upx_rand() & 255);
for (size_t i = 0; i < n; i++) {
e[i].id = (upx_uint16_t) i;
x = x * 33 + 1 + (i & 255);
e[i].value = (upx_uint16_t) x;
e[i].value = (upx_uint16_t) ((x >> 4) & 15);
}
sort(e, n, sizeof(Elem), Elem::compare);
for (size_t i = 1; i < n; i++)
// verify
for (size_t i = 1; i < n; i++) {
if very_unlikely (e[i - 1].value > e[i].value)
return false;
if (is_stable)
if very_unlikely (e[i - 1].value == e[i].value && e[i - 1].id >= e[i].id)
return false;
}
return true;
}
};
@ -820,17 +830,17 @@ TEST_CASE("libc qsort") {
Elem e[N];
for (size_t n = 0; n <= N; n = 2 * n + 1) {
// system sort functions
CHECK(Elem::check_sort(::qsort, e, n)); // libc qsort()
CHECK(Elem::check_sort(::qsort, e, n, false)); // libc qsort()
#if UPX_CONFIG_USE_STABLE_SORT
upx_sort_func_t wrap_stable_sort = [](void *aa, size_t nn, size_t, upx_compare_func_t cc) {
upx_std_stable_sort<sizeof(Elem)>(aa, nn, cc);
};
CHECK(Elem::check_sort(wrap_stable_sort, e, n)); // std::stable_sort()
CHECK(Elem::check_sort(wrap_stable_sort, e, n, true)); // std::stable_sort()
#endif
// UPX sort functions
CHECK(Elem::check_sort(upx_gnomesort, e, n));
CHECK(Elem::check_sort(upx_shellsort_memswap, e, n));
CHECK(Elem::check_sort(upx_shellsort_memcpy, e, n));
// simple UPX sort functions
CHECK(Elem::check_sort(upx_gnomesort, e, n, true));
CHECK(Elem::check_sort(upx_shellsort_memswap, e, n, false));
CHECK(Elem::check_sort(upx_shellsort_memcpy, e, n, false));
}
}

View File

@ -345,7 +345,7 @@ TEST_CASE("upx::noncopyable") {
namespace {
template <class T>
struct TestTriBool {
static void test(bool expect_true) {
static noinline void test(bool expect_true) {
static_assert(std::is_class<T>::value);
static_assert(std::is_nothrow_default_constructible<T>::value);
static_assert(std::is_nothrow_destructible<T>::value);

View File

@ -214,7 +214,7 @@ upx_off_t InputFile::seek(upx_off_t off, int whence) {
upx_off_t InputFile::st_size_orig() const { return _length_orig; }
int InputFile::dup() may_throw {
int InputFile::dupFd() may_throw {
if (!isOpen())
throwIOException("bad dup");
#if defined(HAVE_DUP) && (HAVE_DUP + 0 == 0)

View File

@ -88,7 +88,7 @@ public:
virtual upx_off_t seek(upx_off_t off, int whence) override;
upx_off_t st_size_orig() const;
noinline int dup() may_throw;
noinline int dupFd() may_throw;
protected:
upx_off_t _length_orig = 0;

View File

@ -430,8 +430,6 @@ void show_version(bool one_line) {
fprintf(f, "Copyright (C) 1996-2024 Markus Franz Xaver Johannes Oberhumer\n");
fprintf(f, "Copyright (C) 1996-2024 Laszlo Molnar\n");
fprintf(f, "Copyright (C) 2000-2024 John F. Reiser\n");
// Jens contributed the ps1/exe format; no need to list as main author
// fprintf(f, "Copyright (C) 2002-2024 Jens Medoch\n");
#if (WITH_ZLIB)
// see vendor/zlib/LICENSE
fprintf(f, "Copyright (C) 1995" "-2024 Jean-loup Gailly and Mark Adler\n");
@ -591,7 +589,7 @@ void show_sysinfo(const char *options_var) {
#endif
if (options_var && options_var[0]) {
const char *e = getenv(options_var);
const char *e = upx_getenv(options_var);
con_fprintf(f, "\n");
if (e && e[0])
con_fprintf(f, "Contents of environment variable %s: '%s'\n\n", options_var, e);

View File

@ -37,6 +37,9 @@
**************************************************************************/
#ifndef OPTIONS_VAR
// historical note: "UPX_OPTIONS" would be a better name, but back in the old
// days environment variables used to be short; and we cannot change that now
// because of backward compatibility issues
#define OPTIONS_VAR "UPX"
#endif
@ -1086,7 +1089,7 @@ void main_get_envoptions() {
static const char sep[] = " \t";
char shortopts[256];
var = getenv(OPTIONS_VAR);
var = upx_getenv(OPTIONS_VAR);
if (var == nullptr || !var[0])
return;
env = strdup(var);

View File

@ -66,7 +66,7 @@ void Options::reset() noexcept {
#endif
// support NO_COLOR, see https://no-color.org/
// "... when present and not an empty string (regardless of its value)"
const char *e = getenv("NO_COLOR");
const char *e = upx_getenv("NO_COLOR");
if (e && e[0])
o->console = CON_FILE;

View File

@ -267,7 +267,7 @@ int PackVmlinuzI386::decompressKernel()
fd_pos = -1;
// open
fi->seek(gzoff, SEEK_SET);
fd = fi->dup();
fd = fi->dupFd();
if (fd < 0)
break;
gzFile zf = gzdopen(fd, "rb");
@ -849,7 +849,7 @@ int PackVmlinuzARMEL::decompressKernel()
fd_pos = -1;
// open
fi->seek(gzoff, SEEK_SET);
fd = fi->dup();
fd = fi->dupFd();
if (fd < 0)
break;
gzFile zf = gzdopen(fd, "rb");

View File

@ -30,7 +30,7 @@
#if defined(__has_include)
#if __has_include(<features.h>)
#include <features.h> // for __GLIBC__
#include <features.h> // for __GLIBC__ and __GLIBC_MINOR__
#endif
#endif
@ -42,8 +42,8 @@
#endif
#endif // _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
#if 0 // TODO later
// libc++ hardenining
#if defined(__cplusplus) && 0 // TODO later
#if defined(__clang__) && defined(__clang_major__) && (__clang_major__ + 0 >= 18)
#if DEBUG
#define _LIBCPP_HARDENING_MODE _LIBCPP_HARDENING_MODE_DEBUG

View File

@ -29,7 +29,7 @@
#include "system_defs.h"
#if !(__cplusplus + 0 >= 201703L)
#error "C++17 is required"
#error "FATAL ERROR: C++17 is required"
#endif
// check expected defines

View File

@ -254,6 +254,12 @@ TEST_CASE("ptr_check_no_overlap 3") {
// stdlib
**************************************************************************/
const char *upx_getenv(const char *envvar) noexcept {
if (envvar != nullptr && envvar[0])
return ::getenv(envvar);
return nullptr;
}
int upx_rand(void) noexcept { return ::rand(); }
void *upx_calloc(size_t n, size_t element_size) may_throw {
@ -430,7 +436,7 @@ struct TestSortAllPermutations {
memcpy(a, perm, sizeof(*a) * n);
sort(a, n, sizeof(*a), CompareFunc);
for (size_t i = 0; i < n; i++)
assert_noexcept((a[i] == 255 + i));
assert_noexcept(a[i] == 255 + i);
num_perms += 1;
} while (std::next_permutation(perm, perm + n));
return num_perms;
@ -774,11 +780,11 @@ int fn_strcmp(const char *n1, const char *n2) {
// UPX convention: any environment variable that is set and is not strictly equal to "0" is true
bool is_envvar_true(const char *envvar, const char *alternate_name) noexcept {
const char *e = getenv(envvar);
const char *e = upx_getenv(envvar);
if (e != nullptr && e[0])
return strcmp(e, "0") != 0;
if (alternate_name != nullptr) {
e = getenv(alternate_name);
e = upx_getenv(alternate_name);
if (e != nullptr && e[0])
return strcmp(e, "0") != 0;
}

View File

@ -145,6 +145,8 @@ inline void ptr_invalidate_and_poison(T *(&ptr)) noexcept {
noinline void *upx_calloc(size_t n, size_t element_size) may_throw;
noinline const char *upx_getenv(const char *envvar) noexcept;
void upx_memswap(void *a, void *b, size_t bytes) noexcept;
noinline int upx_rand(void) noexcept;