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

3354 Commits

Author SHA1 Message Date
John Reiser
77ba43328b Use my_page_size, which is 0x4000 (16KiB) on arm64
https://github.com/upx/upx/issues/628
	modified:   p_mach.cpp
2022-12-31 20:55:34 +01:00
John Reiser
01a30752c7 Mach-O: allow 256 ncmds and 32768 sizeofcmds
https://github.com/upx/upx/issues/642
	modified:   p_mach.cpp
	modified:   stub/src/i386-darwin.macho-upxmain.c
	modified:   stub/src/powerpc-darwin.macho-upxmain.c
2022-12-29 14:02:42 -08:00
John Reiser
e56b748435 WIP fixing "upx -t" of shared library
modified:   p_lx_elf.cpp
2022-12-23 11:23:41 -08:00
Markus F.X.J. Oberhumer
bb4cbdff44 src: fix m68k-atari build, prepare for std::atomic, port John's MemBuffer debug 2022-12-22 16:06:25 +01:00
Markus F.X.J. Oberhumer
0b47e474a7 make: update src/Makefile 2022-12-22 15:52:50 +01:00
John Reiser
fefce0d5c4 Cleanup "PT_LOAD gap recovery" during upx -d
https://github.com/upx/upx/issues/635
	modified:   p_lx_elf.cpp
2022-12-21 06:53:37 -08:00
Markus F.X.J. Oberhumer
708ab1dcd7 src: p_xxx_enum.h: trailing commas in enums are allowed since C++11 2022-12-20 23:34:36 +01:00
Markus F.X.J. Oberhumer
6cf85cee6e src: minor compatibility fix 2022-12-20 11:40:22 +01:00
Markus F.X.J. Oberhumer
1eb6a40fdd src: restore lseek() error check in file.cpp 2022-12-20 11:51:31 +01:00
John Reiser
1bed77e4d3 'sizeof' returns size_t, which on i386 is not as wide as off_t
https://github.com/upx/upx/issues/629
https://github.com/upx/upx/issues/635
	modified:   p_lx_elf.cpp
2022-12-20 07:21:02 -08:00
John Reiser
f2a68023fa MSVC error C4146: unary minus operator applied to unsigned type, result still unsigned
modified:   p_lx_elf.cpp
2022-12-19 16:14:48 -08:00
John Reiser
8ccffc40e3 A real typo that caused an error in "upx -d" de-compressing
modified:   p_lx_elf.cpp
	modified:   ../.github/travis_testsuite_1-expected_sha256sums.sh
2022-12-19 15:45:27 -08:00
John Reiser
dd8c1d0441 clang alignment
modified:   p_lx_elf.cpp
2022-12-19 14:31:26 -08:00
John Reiser
f9f28ff176 More work on "upx -d" de-compression
https://github.com/upx/upx/issues/629
https://github.com/upx/upx/issues/635
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   p_unix.cpp
2022-12-19 13:49:43 -08:00
John Reiser
3649041195 Return value of FileBase::seek(, SEEK_CUR) was not FileBase::tell()
modified:   file.cpp
2022-12-19 13:37:24 -08:00
Markus F.X.J. Oberhumer
c23c7a9379 all: minor updates 2022-12-15 16:20:22 +01:00
Markus F.X.J. Oberhumer
9934e33b99 src: pacify a clang scan-build warning in p_mach.cpp 2022-12-12 21:27:34 +01:00
Markus F.X.J. Oberhumer
9e75fdda66 src: pacify a -Wcast-align warning 2022-12-12 20:07:27 +01:00
Markus F.X.J. Oberhumer
d873a26f41 all: clang-format-15.0.6 2022-12-12 19:25:31 +01:00
Markus F.X.J. Oberhumer
91aa5b55ab all: upgrade to upx-stubtools v20221212 2022-12-12 19:25:28 +01:00
Markus F.X.J. Oberhumer
3f460a76ce src: fix typo in options.cpp 2022-12-12 05:38:51 +01:00
John Reiser
4cdf77e16f Stupid MSVC 14.2, 14.3; obtuse clang 14.0.5 (and MemBuffer vs alignment)
MSVC: cannot say "if (0)" to get "check symtax+semantics, but do not emit code"
clang+MemBuffer: must fight too much to get pointer to wider-than-char
	modified:   src/p_lx_elf.cpp
2022-12-11 14:41:38 -08:00
John Reiser
d89813e911 Implement de-compress of --android-shlib
64-bit (arm64, aarch64) only for now.  NYI: 32-bit (armv7).
(Also: implied catch-up with all changes by Markus in the meantime.)
https://github.com/upx/upx/issues/599

	modified:   src/p_lx_elf.cpp
	modified:   src/p_lx_elf.h
2022-12-11 13:46:44 -08:00
Markus F.X.J. Oberhumer
7c57b10cae all: minor cleanups 2022-12-02 16:46:16 +01:00
Markus F.X.J. Oberhumer
65a2da4b40 src: more clang-format 2022-11-27 22:03:20 +01:00
Markus F.X.J. Oberhumer
02f6786b2a src: new ACC version 2022-11-27 21:56:30 +01:00
Markus F.X.J. Oberhumer
9da4f7a6dc src: clang-format more files; cleanups; NFCI 2022-11-27 12:34:15 +01:00
John Reiser
510505a85c p_tmt: more sanity of input, cleanup MemBuffer usage
https://github.com/upx/upx/issues/632
	modified:   src/p_tmt.cpp
2022-11-24 10:28:03 -08:00
Markus F.X.J. Oberhumer
9f5d67e27c src: clang-format various packers 2022-11-26 17:45:25 +01:00
Markus F.X.J. Oberhumer
93c6496ba8 src: add a xspan check to p_tmt.cpp and clang-format 2022-11-24 09:11:25 +01:00
John Reiser
779b648c5f invert_pt_dynamic: fix thinko; PackLinuxElf64help1 insist on ELF
https://github.com/upx/upx/issues/631
	modified:   src/p_lx_elf.cpp
2022-11-23 19:49:28 -08:00
Markus F.X.J. Oberhumer
b221c44466 src: re-add non-working PackMachPPC32 to PackMaster 2022-11-22 21:24:33 +01:00
Markus F.X.J. Oberhumer
665296f7cf src/util: minor xspan improvements 2022-11-22 21:21:26 +01:00
Markus F.X.J. Oberhumer
0af9bbb623 all: post-release version bump 2022-11-22 20:51:56 +01:00
Markus F.X.J. Oberhumer
fdec47a83d all: prepare for release 2022-11-16 23:15:38 +01:00
Markus F.X.J. Oberhumer
7ff913bbd2 src: remove non-working PackMachPPC32 from PackMaster 2022-11-16 22:24:39 +01:00
Markus F.X.J. Oberhumer
94775bef9f src: remove non-working PackMachPPC64 from PackMaster; see issue #626 2022-11-16 20:41:31 +01:00
Markus F.X.J. Oberhumer
3cf102334f src: add option '--force-overwrite' 2022-11-16 12:52:53 +01:00
Markus F.X.J. Oberhumer
627e733a30 src: minor compress_lzma.cpp cleanups 2022-11-15 11:59:22 +01:00
Markus F.X.J. Oberhumer
eb231b65f3 src: clang-format compress_*.cpp; minor cleanup 2022-11-14 11:35:13 +01:00
John Reiser
4199a44bef armeb stub: b_method as arg5 is 32-bit unsigned
https://github.com/upx/upx/issues/618
	modified:   src/stub/src/arch/arm/v4a/lzma_d.S

	modified:   .github/travis_testsuite_1-expected_sha256sums.sh
        also src/stub/arm*-linux*.h, src/stub/tmp/*.bin.dump
2022-11-10 08:04:35 -08:00
Markus F.X.J. Oberhumer
777392c0fe src: add some compress doctest checks 2022-11-10 16:26:36 +01:00
Markus F.X.J. Oberhumer
16de3e78a5 src: try to fix canUnpack() confusion - see packer.h 2022-11-10 06:00:53 +01:00
Markus F.X.J. Oberhumer
d7508d8c09 src: pefile.cpp: replace "membuffer + x - y" with "membuffer + (x - y)"
This is needed because "membuffer + x" is now bounds-checked, and
the temporary addition would trigger an exception.
2022-11-10 00:40:41 +01:00
John Reiser
2a136c1c1d End users wish to avoid "double packing".
https://github.com/upx/upx/issues/622
	modified:   src/p_lx_elf.cpp
2022-11-09 15:39:16 -08:00
Markus F.X.J. Oberhumer
2578102be9 src: misc cleanups 2022-11-09 22:15:11 +01:00
Markus F.X.J. Oberhumer
28f0bb4e11 src: fix pefile.cpp otls allocation not accounting for alignment. Closes #621. 2022-11-09 19:29:16 +01:00
Markus F.X.J. Oberhumer
824c8a8efb src: introduce raw_index_bytes() 2022-11-08 23:05:34 +01:00
John Reiser
37f27a1262 "gcc -Werror=format-security" is small-minded
... and does not perform constant propagation
	modified:   src/p_vmlinx.cpp
2022-11-08 13:36:28 -08:00
Markus F.X.J. Oberhumer
2b8a7a492a src/util: fix compilation when not using xspan 2022-11-08 20:38:52 +01:00
Markus F.X.J. Oberhumer
db56bbb11b src/util: forward memset() in xspan_fwd.h 2022-11-08 20:34:44 +01:00
John Reiser
82d26f04a4 p_vmlinx was too eager
https://github.com/upx/upx/issues/622
	modified:   src/p_vmlinx.cpp
2022-11-08 10:30:48 -08:00
Markus F.X.J. Oberhumer
2d74298001 make: update Makefiles 2022-11-08 03:52:43 +01:00
Markus F.X.J. Oberhumer
ce21254ed2 all: misc cleanups 2022-11-06 08:35:00 +01:00
John Reiser
c8a3acbba8 Static executable with 4 PT_LOAD has only ELF headers in first PT_LOAD
https://github.com/upx/upx/issues/615
2022-11-02 10:03:25 -07:00
Markus F.X.J. Oberhumer
81e11987a2 all: add UPX_VERSION_GIT_DESCRIBE 2022-11-02 10:35:40 +01:00
Markus F.X.J. Oberhumer
668cefec2f src: mention UPX_CONFIG_DISABLE_GITREV build config 2022-11-02 02:52:20 +01:00
John Reiser
2b9e83256d SELinux execmod requires no PROT_EXEC when PROT_WRITE
modified:   src/stub/src/amd64-linux.elf-main.c

	modified:   src/stub/amd64-linux.elf-fold.h
	modified:   src/stub/arm64-linux.elf-fold.h
	modified:   src/stub/powerpc64-linux.elf-fold.h
	modified:   src/stub/powerpc64le-linux.elf-fold.h
	modified:   src/stub/tmp/amd64-linux.elf-fold.map
	modified:   src/stub/tmp/arm64-linux.elf-fold.map
	modified:   src/stub/tmp/powerpc64-linux.elf-fold.map
	modified:   src/stub/tmp/powerpc64le-linux.elf-fold.map
2022-10-28 13:04:17 -07:00
Markus F.X.J. Oberhumer
bce109ab54 all: post-release version bump 2022-10-28 17:10:52 +02:00
Markus F.X.J. Oberhumer
69ca635c4c all: prepare for 4.0.0 release 2022-10-28 10:38:03 +02:00
Markus F.X.J. Oberhumer
e0bf460993 src: rename membuffer "Uncompression" to "Decompression" 2022-10-28 10:34:31 +02:00
John Reiser
50a6698715 Each PROT_WRITE segment has implicit .bss on end of last page (64-bit only for now);
Also  workaround kernel bug invoking the escape hatch on arm64 (aarch64).
https://github.com/upx/upx/issues/611
2022-10-27 11:01:37 -07:00
Markus F.X.J. Oberhumer
7dd2cdea1e src: deprecate util/bptr.h 2022-10-27 17:52:15 +02:00
Markus F.X.J. Oberhumer
295889023f all: set next version back to 4.0.0, bump tentative release date, update
docs
2022-10-27 17:36:02 +02:00
Markus F.X.J. Oberhumer
feef2e38cf all: final tweaks for release 2022-10-27 16:53:16 +02:00
Markus F.X.J. Oberhumer
e910a9dc3e all: change version back to 3.99; docs: warn about know regressions and
clarify GPLv2+ COPYING
2022-10-27 16:00:25 +02:00
Markus F.X.J. Oberhumer
e5c0d998b7 src: fully deprecate src/Makefile; minor doc and CI cleanups 2022-10-25 01:48:45 +02:00
Markus F.X.J. Oberhumer
63f6fef964 all: don't use egrep or fgrep 2022-10-25 01:47:42 +02:00
Markus F.X.J. Oberhumer
983eb6d676 src: improve error message when using doctest options like '--dt-help'; add
doctest info to help.cpp
2022-10-25 01:47:38 +02:00
Markus F.X.J. Oberhumer
75a769759d src/stub: sync stubs 2022-10-24 12:56:49 +02:00
John Reiser
2354b01bad Adapt to libbfd: "no Shdrs" requires 0==.e_shentsize and 0==.e_shnum
modified:   p_lx_elf.cpp
2022-10-24 12:56:49 +02:00
John Reiser
c331b9f1e2 Zero the tail of last RW page, even when variable page size
https://github.com/upx/upx/issues/611
	modified:   stub/src/amd64-linux.elf-main.c
2022-10-24 12:56:49 +02:00
John Reiser
afeaeeddec munmap(, Phdr[C_TEXT=1].p_memsz); // not .p_vaddr
modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
2022-10-24 12:56:49 +02:00
John Reiser
ab7ef9f511 Document the value of "brk #0" instruction
modified:   stub/src/arm64-linux.elf-entry.S
2022-10-24 12:56:49 +02:00
John Reiser
d3ad6d25d8 PackLinuxElf64::asl_pack2_Shdrs() for better fit in logical flow
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2022-10-24 12:56:49 +02:00
John Reiser
2e29f9fa5f pack2() fixes for --android-shlib
WIP for https://github.com/upx/upx/issues/599
	modified:   p_lx_elf.cpp
2022-10-24 12:56:49 +02:00
John Reiser
5d9f71bb13 asl_pack1_Shdrs()
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2022-10-24 12:56:49 +02:00
John Reiser
82ed25bb44 Major fix 64-bit un_shlib_1() and unpack(), but not --android-shlib
Also canUnpack() is really a 'bool' which sets overlay_offset
when 'true'; confusing!
        https://github.com/upx/upx/issues/599 (partial)
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   p_unix.h
2022-10-24 12:56:49 +02:00
Markus F.X.J. Oberhumer
f57393c0e8 all: simplify include path handling; update src/Makefile 2022-10-24 12:56:35 +02:00
Markus F.X.J. Oberhumer
b54cced19c src: add some tests for compress_zlib 2022-10-24 12:18:25 +02:00
Markus F.X.J. Oberhumer
60a0544314 all: bump tentative release date 2022-10-23 23:15:00 +02:00
Markus F.X.J. Oberhumer
283c1cf931 src: add --version-short option; support doctest --dt-XXX options; cleanups 2022-10-23 23:09:13 +02:00
Markus F.X.J. Oberhumer
fff53efc05 src: add some more xspan tests 2022-10-20 14:06:20 +02:00
Markus F.X.J. Oberhumer
07d368adca all: misc cleanups 2022-10-20 02:09:05 +02:00
Markus F.X.J. Oberhumer
13276d93fa all: bump tentative release date 2022-10-18 21:07:48 +02:00
John Reiser
72613d06a5 Look for PackHeader in the right place.
https://github.com/upx/upx/issues/606
	modified:   p_mach.cpp
2022-10-11 08:08:55 -07:00
John Reiser
48ad5513ff un_shlib_1() allows test mode ("-t") which has (nullptr == fo)
modified:   p_lx_elf.cpp
2022-10-07 12:52:21 -07:00
John Reiser
201d9f1346 Fix length when stub unmaps compressed input for main program
https://github.com/upx/upx/issues/606
	modified:   ../.github/travis_testsuite_1-expected_sha256sums.sh
	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/tmp/amd64-linux.elf-fold.map
2022-10-07 09:53:29 +02:00
John Reiser
1e8f1f49d0 is_bad_linker_command() ignores LC_REQ_DYLD
https://github.com/upx/upx/issues/606
	modified:   p_mach.cpp
2022-10-06 10:15:10 -07:00
Markus F.X.J. Oberhumer
65707900bc src: remove more traces of fictional powerpc64le-darwin 2022-10-06 15:53:50 +02:00
Markus F.X.J. Oberhumer
c4437cb293 all: add support for a basic "make test" 2022-10-06 14:10:35 +02:00
Markus F.X.J. Oberhumer
e2b86a49db src: fix recently introduced bug in unoptimzeReloc 2022-10-06 14:09:45 +02:00
John Reiser
05ff7e35a1 Warn for big shell scripts, and send them to --force-execve.
Also propagte error code when execve() fails for compressed shell,
to avoid confusion of `hlt` ==> SIGSEGV.
https://github.com/upx/upx/issues/604
2022-10-05 01:30:32 +02:00
Markus F.X.J. Oberhumer
f67cec4752 submodules: update for new version 2022-10-04 15:33:27 +02:00
Markus F.X.J. Oberhumer
0f42579e68 src: fix djgpp and musl builds 2022-10-02 20:00:30 +02:00
Markus F.X.J. Oberhumer
7398d8f68f src: enable -Wsuggest-override in src/conf.h 2022-09-27 18:17:28 +02:00
John Reiser
ec33109b22 clang-10 requires the use of 'override'
Discovered during gitlab auto-build for https://github.com/upx/upx/issues/595
	modified:   Makefile
	modified:   p_armpe.h
	modified:   p_djgpp2.h
	modified:   p_lx_elf.h
	modified:   p_lx_exc.h
	modified:   p_lx_interp.h
	modified:   p_lx_sh.h
	modified:   p_mach.h
	modified:   p_ps1.h
	modified:   p_tmt.h
	modified:   p_unix.h
	modified:   p_vmlinx.h
	modified:   p_vmlinz.h
	modified:   p_w32pe.h
	modified:   p_w64pep.h
	modified:   pefile.h
2022-09-27 18:15:48 +02:00
John Reiser
a13b4d10d9 After upx-3.96, the de-compressing stub for ELF moved
... so unpack() of newly-compressed ELF by upx-3.96 now says
"CantUnpackException: need a newer version of UPX"
        https://github.com/upx/upx/issues/595
	modified:   p_lx_elf.h
	modified:   packer.h
2022-09-27 18:09:20 +02:00
Markus F.X.J. Oberhumer
36e94e58d0 stub: add mising powerpc64-darwin tmp dump files 2022-09-27 18:09:20 +02:00
John Reiser
d0a52bd483 More cleanup of stubs for powerpc64le-darwin* which does not exist.
Only powerpc64-darwin (BigEndian, no suffix) exists.
https://github.com/upx/upx/issues/596
2022-09-27 15:58:35 +02:00