Compare commits

...

504 Commits

Author SHA1 Message Date
Markus F.X.J. Oberhumer d7ba31cab8 Bump release date. 2020-01-22 22:29:58 +01:00
John Reiser 342b1b7d6c EM_PPC64 forgot get_te16(&...) for ehdri.e_machine
So compression on big-endian host was not correct.
https://github.com/upx/upx/issues/334
	modified:   p_lx_elf.cpp
2020-01-19 18:48:50 -08:00
John Reiser 936013f60c Decompression escape hatch for ELF can require a new page.
If not enough room on last page of .text, and ElfXX_Ehdr not PF_X,
then the escape hatch must use a new page.
https://github.com/upx/upx/issues/308
	modified:   ../.github/travis_testsuite_1-expected_sha256sums.sh
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/i386-linux.elf-main.c
    Plus stub/*-linux.elf-fold.h and stub/tmp/*-linux.elf-fold.map
2020-01-19 13:25:55 -08:00
Markus F.X.J. Oberhumer fdf2eddc73 Update Travis. 2020-01-16 13:38:30 +01:00
Markus F.X.J. Oberhumer 4409753014 Update Travis. 2020-01-16 01:54:41 +01:00
Markus F.X.J. Oberhumer 9172ae3d19 New ACC version. 2020-01-16 01:53:55 +01:00
John Reiser e2f60adc95 Detect 0==DT_SYMTAB in invert_pt_dynamic()
https://github.com/upx/upx/issues/333
	modified:   p_lx_elf.cpp
2020-01-14 18:45:52 -08:00
John Reiser 1bb93d4fce Detect bad e_shstrtab better.
https://github.com/upx/upx/issues/332
	modified:   p_lx_elf.cpp
2020-01-13 17:26:31 -08:00
John Reiser eb90eab632 Detect bogus DT_SYMENT.
https://github.com/upx/upx/issues/331
	modified:   p_lx_elf.cpp
2020-01-13 17:10:02 -08:00
Markus F.X.J. Oberhumer 0f4975fd7f Update Travis. 2020-01-08 17:30:03 +01:00
Markus F.X.J. Oberhumer b5b1f06a11 Avoid some compilation warnings. 2020-01-08 06:04:21 +01:00
Markus F.X.J. Oberhumer 86f8eb0930 Fix shadowing global symbols. 2020-01-08 05:44:06 +01:00
Markus F.X.J. Oberhumer 91ad0e7572 Revert "Cleanup legacy symbols: basename, index"
This reverts commit 47ddace96a.
2020-01-08 05:41:56 +01:00
Markus F.X.J. Oberhumer b034ee98fe Revert "Mention --assume-execute-permission"
This reverts commit 29fa358077.
2020-01-08 05:40:40 +01:00
Markus F.X.J. Oberhumer ded07f8781 Revert "MSVC lacks S_IXUSR"
This reverts commit 62a07df45e.
2020-01-08 05:38:44 +01:00
Markus F.X.J. Oberhumer 849bdd87e1 Revert "Option --assume-execute-permission"
This reverts commit 4484acf9d6.
2020-01-08 05:38:19 +01:00
Markus F.X.J. Oberhumer 643e48efd7 Update Travis. 2020-01-08 05:18:43 +01:00
Markus F.X.J. Oberhumer 92f072cf70 Silence some compiler warnings. 2020-01-08 04:49:27 +01:00
Markus F.X.J. Oberhumer 95bf2e2e41 Update testsuite checksums caused by version date bump. 2020-01-08 04:37:59 +01:00
Markus F.X.J. Oberhumer 6a6c6d84eb Rebuild stubs. 2020-01-08 04:30:08 +01:00
Markus F.X.J. Oberhumer 08a689c81e Bump tentative release date. 2020-01-08 04:21:30 +01:00
Markus F.X.J. Oberhumer d1174385ef Welcome 2020. 2020-01-08 04:13:28 +01:00
John Reiser cb5f590e10 More hacking Android shlib.
https://github.com/upx/upx/issues/318
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
2019-12-12 20:23:33 -08:00
John Reiser 5ed9c66ed9 Hack Android shared libraries on arm64.
https://github.com/upx/upx/issues/318
	modified:   p_lx_elf.cpp
2019-12-12 17:05:50 -08:00
John Reiser b8f52d14f4 user_init_va on AARCH64
https://github.com/upx/upx/issues/318  (work-in-progress)
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
2019-12-04 14:26:46 -08:00
John Reiser 5d295c24f0 DT_NEEDED can be duplicated
modified:   p_lx_elf.cpp
2019-11-26 19:33:27 -08:00
John Reiser 8be9da8280 Avoid bogus values in PT_DYNAMIC segment.
Detect duplicate DT_*.
Detect out-of-bounds hashtab and gashtab.
Detect missing DT_REL, DT_RELA.
Detect out-of-bounds d_val.
https://github.com/upx/upx/issues/317
	modified:   p_lx_elf.cpp
2019-11-23 20:06:14 -08:00
John Reiser 819c33fee2 Detect malformed Mach-o file in ::canUnpack()
https://github.com/upx/upx/issues/314
https://github.com/upx/upx/issues/315
	modified:   p_mach.cpp
2019-11-15 21:32:06 -08:00
John Reiser 75a2cc4ecb Sync testsuite (amd64, 32-bit ARM, 64-bit ARM)
modified:   ../.github/travis_testsuite_1-expected_sha256sums.sh
	modified:   Makefile
2019-10-27 21:56:30 -07:00
John Reiser e2833cf303 Message when /proc/self/exe lacks Read permission
Done: amd64, 32-bit ARM, 64-bit ARM.  TODO: mips, PowerpC
https://github.com/upx/upx/issues/302
	modified:   stub/amd64-linux.elf-entry.h
	modified:   stub/arm.v4a-linux.elf-entry.h
	modified:   stub/arm.v5a-linux.elf-entry.h
	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/armeb.v4a-linux.elf-entry.h
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/tmp/amd64-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm.v4a-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm.v5a-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
	modified:   stub/tmp/armeb.v4a-linux.elf-entry.bin.dump
2019-10-27 21:30:41 -07:00
John Reiser 801de73dbe random assembler?
modified:   ../stub/arm64-linux.elf-entry.h
2019-10-27 21:15:15 -07:00
John Reiser 6a53c0b3d4 [Append to previous commit message.]
https://github.com/upx/upx/issues/286
	modified:   p_vmlinx.cpp
2019-07-21 10:51:59 -07:00
John Reiser 58b122d97d Better checking for malformed input
https://github.com/upx/upx/issues
	modified:   p_vmlinx.cpp
2019-07-21 10:48:50 -07:00
John Reiser 276b748aa6 Ignore malformed ElfXX_Shdr in search for .text or .note
https://github.com/upx/upx/issues/287
	modified:   p_vmlinx.cpp
2019-07-21 07:40:21 -07:00
John Reiser 23570097cf MSVC barfs on {unsigned == long int) [because sizeof() is the same!]
https://github.com/upx/upx/issues/283
	modified:   p_lx_elf.cpp
2019-07-14 13:39:09 -07:00
John Reiser 62a07df45e MSVC lacks S_IXUSR
modified:   p_unix.cpp
2019-07-14 13:38:51 -07:00
John Reiser 593a69ce25 PT_LOAD[0] with ElfXX.Ehdr only
https://github.com/upx/upx/issues/283
	modified:   p_lx_elf.cpp
2019-07-14 13:08:56 -07:00
John Reiser c33603e324 'bound' register was clobbered
modified:   stub/src/arch/arm64/v8/lzma_d-arm.S
2019-07-14 13:05:52 -07:00
John Reiser 29fa358077 Mention --assume-execute-permission
for MSYS2 and other permission-poor OS.
	modified:   NEWS
2019-05-10 07:03:51 -07:00
John Reiser 49766388bc Fix compression and de-compression of Android shared libraries
Handle relocation (and DT_INIT_ARRAY[0]==NULL) when !DT_INIT.
Warn about missing --android-shlib if (ET_DYN && !DF_1_PIE && Arm*).
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
https://github.com/upx/upx/issues/265
https://github.com/upx/upx/issues/262
https://github.com/upx/upx/issues/259
https://github.com/upx/upx/issues/243
https://github.com/upx/upx/issues/229
https://github.com/upx/upx/issues/220
2019-04-14 19:59:08 -07:00
John Reiser f23267bddd Fix rotate+lop of PT_INTERP in shared library
Found while working on https://github.com/upx/upx/issues/262
but probably does not help that bug.
	modified:   p_lx_elf.cpp
2019-04-01 21:35:53 -07:00
John Reiser 4484acf9d6 Option --assume-execute-permission
modified:   main.cpp
	modified:   options.h
	modified:   p_unix.cpp
https://github.com/upx/upx/issues/256
2019-03-31 10:25:06 -07:00
John Reiser 47ddace96a Cleanup legacy symbols: basename, index
modified:   conf.h
https://github.com/upx/upx/issues/257
2019-03-31 10:12:41 -07:00
John Reiser 8aadbcd786 Enable standalone compiling, to investigate size of compiled code
modified:   stub/src/arch/arm64/v8/lzma_d-arm.S
	modified:   stub/src/arch/arm64/v8/lzma_d.S
	modified:   stub/src/arch/arm64/v8/nrv2b_d32.S
	modified:   stub/src/arch/arm64/v8/nrv2d_d32.S
	modified:   stub/src/arch/arm64/v8/nrv2e_d32.S
2019-03-03 14:27:33 -08:00
John Reiser 517bc9db0b PR_SET_MM (previous commit had typo) is from 7 years ago: 2012
modified:   stub/src/include/linux.h
2019-03-03 14:26:20 -08:00
John Reiser 16bfa7b846 PT_SET_MM since 2012
modified:   stub/src/include/linux.h
2019-03-02 16:12:14 -08:00
John Reiser 570b2d0e88 arm64-linux.elf changed when PT_LOAD[1] no longer forces 4KB alignment
modified:   travis_testsuite_1-expected_sha256sums.sh
2019-03-02 16:10:37 -08:00
John Reiser 2653a0749a de-tabify
modified:   stub/src/arch/i386/bxx.S
2019-03-02 15:48:44 -08:00
John Reiser 3de0008543 i386-darwin.macho re-implementation, especially for MacOS <= 10.8.x (Mountain Lion)
[i386 will not be supported by new MacOS beginning fall 2019.]
https://github.com/upx/upx/issues/246
	modified:   p_mach.cpp
	modified:   stub/i386-darwin.macho-entry.h
	modified:   stub/i386-darwin.macho-fold.h
	modified:   stub/i386-darwin.macho-upxmain.exe
	modified:   stub/i386-darwin.macho-upxmain.h
	new file:   stub/src/arch/i386/bxx.S
	new file:   stub/src/arch/i386/nrv2b_d32-easy.S
	new file:   stub/src/arch/i386/nrv2d_d32-easy.S
	new file:   stub/src/arch/i386/nrv2e_d32-easy.S
	modified:   stub/src/i386-darwin.macho-entry.S
	modified:   stub/src/i386-darwin.macho-fold.S
	modified:   stub/src/i386-darwin.macho-main.c
	modified:   stub/src/i386-darwin.macho-upxmain.c
	modified:   stub/tmp/i386-darwin.macho-entry.bin.dump
	modified:   stub/tmp/i386-darwin.macho-fold.map
2019-03-02 15:39:30 -08:00
John Reiser d4e2d7e8a8 arm64 (aarch64) and PAGE_SIZE > 4KiB
Future: use prctl(PR_SET_MM, PR_SET_MM_START_BRK, addr)
https://github.com/upx/upx/issues/254
	modified:   p_lx_elf.cpp
	modified:   stub/src/amd64-linux.elf-main.c
2019-03-01 20:31:41 -08:00
John Reiser a9c08c6f52 __MSYS2__ acts like UNIX but cannot handle --x permission
https://github.com/upx/upx/issues/256
	modified:   p_unix.cpp
2019-03-01 16:46:49 -08:00
Markus F.X.J. Oberhumer c2aa5c35f7 Silence a gcc-4.6 compiler warning. 2019-02-25 13:41:54 +01:00
John Reiser 423f1a8758 pack4() "__TEXT".nsects can differ from prototype to actual
modified:   p_mach.cpp
2019-02-18 14:41:43 -08:00
Markus F.X.J. Oberhumer cc5f684e33 Update testsuite checksums caused by version date bump. 2019-02-15 11:14:18 +01:00
Markus F.X.J. Oberhumer b6646d319a Bump tentative release date. 2019-02-15 11:12:07 +01:00
Markus F.X.J. Oberhumer 3667fa4e44 Welcome 2019. 2019-02-15 11:04:09 +01:00
John Reiser d1c80154f6 SHT_NOTE with ~SHF_ALLOC; as for 'gold' linker version
https://github.com/upx/upx/issues/243
	modified:   p_lx_elf.cpp
2019-02-12 21:13:24 -08:00
John Reiser 3c2bfc742e g++ -Wsign-compare is not as picky as MSVC warning C4018: '<': signed/unsigned mismatch
https://github.com/upx/upx/issues/247
	modified:   p_lx_elf.cpp
2019-02-09 08:04:58 -08:00
John Reiser d60fef753f check_pt_load(); u32_t, u64_t; (off_t) is not unsigned!
https://github.com/upx/upx/issues/247
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2019-02-01 19:31:57 -08:00
John Reiser 70ed2d0d03 Allow Load Configuration directory > 256, with info().
https://github.com/upx/upx/issues/245
	modified:   pefile.cpp
2019-01-26 07:51:16 -08:00
John Reiser 716d203a78 Testsuite checksums
amd64-linux.elf
commit 6b500bc83b
Date:   Wed Aug 22 14:39:14 2018 -0700

arm-linux.elf, armeb-linux.elf:
commit 75c31dff1d
Date:   Thu Dec 13 20:10:57 2018 -0800

	modified:   .github/travis_testsuite_1-expected_sha256sums.sh
2018-12-31 11:08:53 -08:00
John Reiser 9719a7dd56 MSVC pettiness
https://github.com/upx/upx/issues/238
	modified:   p_lx_elf.cpp
2018-12-26 18:38:30 -08:00
John Reiser c097233bf3 Stronger checks for DT_HASH, DT_GNU_HASH
https://github.com/upx/upx/issues/238
	modified:   p_lx_elf.cpp
2018-12-26 13:00:20 -08:00
John Reiser 69a583281f MemBuffer::subref() for 64-bit offsets; better diagnosis for bad .e_shoff
https://github.com/upx/upx/issues/235 (POC14)
	modified:   mem.cpp
	modified:   mem.h
	modified:   p_lx_elf.cpp
2018-12-16 16:00:15 -08:00
John Reiser 8e90c9af2b Corner cases for e_shnum vs e_shstrndx
modified:   p_lx_elf.cpp
2018-12-16 15:36:51 -08:00
John Reiser a784284b7f Check user_init_off. Also remove '\n' from error messages.
https://github.com/upx/upx/issues/235  POC11
	modified:   p_lx_elf.cpp
2018-12-16 12:14:22 -08:00
John Reiser 0509edf08d ElfXX_Sym.st_name is always 32 bits
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2018-12-16 11:32:58 -08:00
John Reiser 7ca20f424f Typos
modified:   p_lx_elf.cpp
2018-12-15 21:17:26 -08:00
John Reiser b74d51c2a8 More checking of e_shstrndx
https://github.com/upx/upx/issues/235  POC6
	modified:   p_lx_elf.cpp
2018-12-15 21:12:15 -08:00
John Reiser 58061cd121 Check .p_offset
https://github.com/upx/upx/issues/235  POC13
	modified:   p_lx_elf.cpp
2018-12-15 20:59:45 -08:00
John Reiser b8f6be5389 More checking of DT_HASH and DT_GNU_HASH
https://github.com/upx/upx/issues/235  POC12
	modified:   p_lx_elf.cpp
2018-12-15 20:43:33 -08:00
John Reiser 7c766b3313 Check e_shstrndx and Shdr.st_name
https://github.com/upx/upx/issues/235  POC10
	modified:   p_lx_elf.cpp
2018-12-15 20:27:20 -08:00
John Reiser 91b81b587b Abandon when outrageous Elf64_Dyn.d_tag
https://github.com/upx/upx/issues/235  POC8
	modified:   p_lx_elf.cpp
2018-12-15 19:35:13 -08:00
John Reiser 780a4347b8 Check DT_HASH and DT_GNU_HASH.
https://github.com/upx/upx/issues/235  POC2,POC4
Also cleanup checking of symbol number and .st_name
in POC1,POC3,POC5,POC7,POC9,POC11
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2018-12-15 19:16:14 -08:00
John Reiser 606ad08dd1 Check symbol number and .st_name
https://github.com/upx/upx/issues/235  POC1,POC3,POC7,POC9
	modified:   p_elf_enum.h
	modified:   p_lx_elf.h
	modified:   p_lx_elf.cpp
2018-12-14 21:32:49 -08:00
John Reiser 75c31dff1d Use THUMB 'ret' when in THUMB mode.
https://github.com/upx/upx/issues/236
https://github.com/upx/upx/issues/229
	modified:   src/arm.v4t-linux.shlib-init.S

	modified:   arm.v5t-linux.shlib-init.h
	modified:   tmp/arm.v5t-linux.shlib-init.bin.dump
2018-12-13 20:14:14 -08:00
John Reiser 473b90419f Mach-o for 'rust' has intermixed LC_SEGMENT64 "__DWARF" with 0==.vmsize
https://github.com/upx/upx/issues/222
	modified:   p_mach.cpp
	modified:   stub/src/amd64-darwin.macho-main.c
	modified:   stub/src/amd64-darwin.macho-upxmain.c
	also *-darwin.macho-fold.{h,map}
2018-10-13 21:06:37 -07:00
John Reiser f88b85e126 MSVC error C4146: unary minus operator applied to unsigned type, result still unsigned
modified:   p_lx_elf.cpp
2018-10-09 20:27:19 -07:00
John Reiser b122f8e9d0 Optimize /proc/self/exe. Sync stubs.
See also commit 78b1da5c00 earlier today
for https://github.com/upx/upx/issues/225 .
	modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/arm.v4a-linux.elf-fold.S
	also *.h, *.map, *.bin.dump
2018-10-09 20:11:34 -07:00
John Reiser cb8b1595a1 Pay more attention to 0==.e_shnum
modified:   p_lx_elf.cpp
2018-10-09 19:38:43 -07:00
John Reiser 1bee919276 cosmetic: developer quality-of-life
modified:   packer.cpp
2018-10-09 19:35:03 -07:00
John Reiser 78b1da5c00 Avoid dcache==>icache trouble with mflg_data; heuristic cache_flush for 32-bit ARM
modified:   arm.v4a-linux.elf-entry.S
	modified:   arm.v4a-linux.elf-fold.S
2018-10-09 19:24:50 -07:00
John Reiser bb8239ccda more DPRINTF
modified:   amd64-linux.elf-main.c
2018-10-09 19:23:06 -07:00
John Reiser 2a594ad0a7 Better return value when de-compression method mismatches.
modified:   arch/amd64/lzma_d.S
	modified:   arch/amd64/nrv2b_d.S
	modified:   arch/amd64/nrv2d_d.S
	modified:   arch/amd64/nrv2e_d.S
2018-10-07 10:15:48 -07:00
John Reiser b05073550c "pop %rcx", not %ecx
modified:   amd64-darwin.macho-entry.S
	modified:   amd64-linux.elf-entry.S
2018-10-07 10:11:45 -07:00
John Reiser 37d6a34e58 MSVC is a nimrod. (All verions 10.0 through 14.1)
"(4074): error C4146: unary minus operator applied to unsigned type, result still unsigned"
So what?  Many programmers are much better than the typical Microsoft coder.
The C standard GUARANTEES that unsigned arithmetic uses two's complement,
ignores overflow, and the result is what the hardware adder produces.
	modified:   p_lx_elf.cpp
2018-09-23 20:45:07 -07:00
John Reiser 4f0cba9bb6 /proc/self/exe mapping had wrong offset in stub for 32-bit ARM
https://github.com/upx/upx/issues/221
	modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/arm.v4a-linux.elf-fold.S
	also arm*.*-linux.elf-*.{h,map}
2018-09-23 20:32:37 -07:00
John Reiser 4d1c754af9 Preserve Mach_segment_header.flags; fix non-PIE main programs on MacOS.
https://github.com/upx/upx/issues/222
	modified:   p_mach.cpp
	modified:   p_mach.h
	modified:   stub/src/amd64-darwin.macho-entry.S
	also *.macho-*.h, *.macho-fold.map, amd64-darwin.macho-entry.bin.dump
2018-09-22 18:50:37 -07:00
John Reiser c1cfde21d7 Map when .vmsize (not .filesize). More debugging DPRINTF;
modified:   stub/src/amd64-darwin.macho-main.c
	also *.macho-fold.h, *.macho-fold.map
2018-09-22 13:06:45 -07:00
John Reiser bb1f9cdecd Propagate pagezero_vmsize; fix overlay_offset.
modified:   p_mach.cpp
2018-09-22 12:11:51 -07:00
John Reiser b259b0ca28 Print failed syscalls to stderr
modified:   stub/src/amd64-darwin.macho-fold.S
2018-09-22 12:09:22 -07:00
John Reiser 0051dfc84f --android-shlib: Relocate ABS _edata etc.
https://github.com/upx/upx/issues/220
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2018-09-16 15:10:40 -07:00
John Reiser 9f294e6ce5 Fix "upx -d" de-compression when input is compressed Android shlib.
https://github.com/upx/upx/issues/220
	modified:   p_lx_elf.cpp
2018-09-16 13:09:43 -07:00
John Reiser 153ea8be03 MSVC signed/unsigned
modified:   p_mach.cpp
2018-09-11 21:13:27 -07:00
John Reiser f3f7f97f8d MSVC signed/unsigned
modified:   p_mach.cpp
2018-09-09 15:58:24 -07:00
John Reiser 9bb6854e64 Fix stub for MacOS El Capitan, which has "pre-linked" /usr/bin/dyld
https://github.com/upx/upx/issues/218
https://github.com/Homebrew/homebrew-core/pull/31846
	modified:   src/amd64-darwin.macho-main.c
	    also *-darwin.mach-fold.{h,map}
2018-09-09 15:37:54 -07:00
John Reiser 4bba1e6cb7 Merge branch 'devel' of https://github.com/upx/upx into devel 2018-09-08 11:43:41 -07:00
John Reiser 597e8fe407 Fix de-compression for Mach-O files (MacOS)
https://github.com/upx/upx/issues/219
	modified:   p_mach.cpp
	modified:   p_mach.h
2018-09-08 11:41:38 -07:00
Markus F.X.J. Oberhumer 556c541ffb Sync with latest upx-testsuite changes. 2018-09-06 13:57:15 +02:00
John Reiser 5963f18f7c Merge branch 'devel' of https://github.com/upx/upx into devel 2018-09-04 20:54:21 -07:00
John Reiser 0dac6b7be3 MacOS de-compression (upx -d)
https://github.com/upx/upx/issues/218
	modified:   p_mach.cpp
2018-09-04 20:52:17 -07:00
Markus F.X.J. Oberhumer 296ede780b Update Travis. 2018-08-29 15:13:46 +02:00
Markus F.X.J. Oberhumer faaa19331a Update Travis. 2018-08-27 16:43:21 +02:00
Markus F.X.J. Oberhumer 88cb5886f3 Update Travis. 2018-08-26 06:42:46 +02:00
Markus F.X.J. Oberhumer 2fcc3f86c0 Introduce environment variable UPX_DISABLE_GITREV_WARNING. 2018-08-26 06:29:58 +02:00
Markus F.X.J. Oberhumer 9362fde9eb Update testsuite checksums caused by version bump. 2018-08-26 06:15:54 +02:00
Markus F.X.J. Oberhumer 56f4d781c1 Post-release version bump. 2018-08-26 06:08:40 +02:00
Markus F.X.J. Oberhumer 7a3637ff5a Update NEWS. 2018-08-26 04:58:09 +02:00
John Reiser 2923c0968e Merge branch 'devel' of https://github.com/upx/upx into devel
Fix Conflicts:
	.github/travis_testsuite_1.sh
2018-08-22 14:58:36 -07:00
John Reiser 98cfe99d65 sync testsuite
modified:   .github/travis_testsuite_1.sh
2018-08-22 14:52:00 -07:00
John Reiser bdd97fe0b2 build stubs
modified:   amd64-linux.elf-fold.h
	modified:   arm64-linux.elf-fold.h
	modified:   i386-bsd.elf-fold.h
	modified:   i386-linux.elf.interp-fold.h
	modified:   i386-netbsd.elf-fold.h
	modified:   i386-openbsd.elf-fold.h
	modified:   powerpc64-linux.elf-fold.h
	modified:   powerpc64le-linux.elf-fold.h
	modified:   tmp/amd64-linux.elf-fold.map
	modified:   tmp/arm64-linux.elf-fold.map
	modified:   tmp/i386-bsd.elf-fold.map
	modified:   tmp/i386-linux.elf.interp-fold.map
	modified:   tmp/i386-netbsd.elf-fold.map
	modified:   tmp/i386-openbsd.elf-fold.map
	modified:   tmp/powerpc64-linux.elf-fold.map
	modified:   tmp/powerpc64le-linux.elf-fold.map
2018-08-22 14:48:15 -07:00
John Reiser 6b500bc83b auxv_up() quit at AT_NULL, especially when AT_BASE has been omitted.
Based on contribution from Brian Geffon 'bgaff'
https://github.com/upx/upx/pull/215 ; bgaff
	modified:   amd64-linux.elf-main.c
	modified:   i386-bsd.elf-main.c
	modified:   i386-linux.elf.interp-main.c
	modified:   i386-openbsd.elf-main.c
2018-08-22 14:39:14 -07:00
Markus F.X.J. Oberhumer 92a12a2ec1 Update testsuite checksums caused by version date bump. 2018-08-22 13:16:39 +02:00
Markus F.X.J. Oberhumer 04d79040f9 Bump tentative release date. 2018-08-22 13:15:50 +02:00
Markus F.X.J. Oberhumer 3201ddc680 Update .editorconfig. 2018-08-22 13:06:39 +02:00
Markus F.X.J. Oberhumer 2f06de54c5 Cosmetic update. 2018-08-22 12:43:23 +02:00
John Reiser 6489ec9bba Fix PT_LOAD for ELF shared library.
modified:   p_lx_elf.cpp
2018-08-20 19:36:27 -07:00
John Reiser 1a5ba22fe7 Highlight changes for upx-3.95.
modified:   NEWS
2018-08-20 17:10:00 -07:00
John Reiser 8f9713ed53 Appease MSVC warning C4018: s/igned/unsigned mismatch
modified:   p_lx_elf.cpp
2018-08-13 18:47:42 -07:00
John Reiser 90eb68b3b9 Adapt to 4 PT_LOAD in binutils-2.31 and gcc-8.2.1 (Fedora 29)
0:        PF_R: .gnu.hash .dynsym .dynstr
1: PF_X | PF_R: .plt .plt.sec .text
2:        PF_R: .rodata .hash
3: PF_W | PF_R: .data.rel.ro .dynamic .got .got.plt .data .bss
	modified:   p_lx_elf.cpp

https://github.com/upx/upx/issues/212 (partial, Fedora 29)
2018-08-13 17:36:56 -07:00
John Reiser 95fcbcb4f2 ::PackLinuxElf64amd() sets lg2_page back to 12.
https://github.com/upx/upx/issues/212 (partial, Fedora 29)
	modified:   p_lx_elf.cpp
2018-08-10 20:28:40 -07:00
John Reiser b97688d119 Stub updates AT_PHDR for 32-bit libmusl, particularly -fPIE
https://github.com/upx/upx/issues/200
	modified:   stub/src/i386-linux.elf-main.c
	  also *.elf-fold.h, *.elf-fold.map for arm, armeb, i386, mips, mipsel, powerpc
	modified:   ../.github/travis_testsuite_1.sh
2018-08-04 18:26:02 -07:00
John Reiser 5ea3627cab --android-shlib, --force-pie
modified:   NEWS
2018-05-19 06:30:23 -07:00
John Reiser d9288213ec More checking of PT_DYNAMIC and its contents.
https://github.com/upx/upx/issues/206
	modified:   p_lx_elf.cpp
2018-05-17 21:48:26 -07:00
John Reiser 614c86fb7d --force-pie inhibits treating as shared library (for 'rust', etc.)
https://github.com/upx/upx/issues/200
	modified:   main.cpp
	modified:   options.h
	modified:   p_lx_elf.cpp
2018-04-26 13:44:17 -07:00
John Reiser 9f651ee40f Ignore ElfXX_Shdr if not CMD_COMPRESS; beware unpack when PT_DYNAMIC in other PT_LOAD
https://github.com/upx/upx/issues/200
	modified:   p_lx_elf.cpp
2018-04-26 08:34:58 -07:00
John Reiser 774c8c3fd4 Fix forgotten get_teXX() in canPack() and invert_pt_dynamic()
https://github.com/upx/upx/issues/200
	modified:   p_lx_elf.cpp
2018-04-25 23:05:17 -07:00
John Reiser b711d2f750 TLS callbacks: one entry only
https://github.com/upx/upx/issues/186  [partial, incomplete]
(Laszlo hints there is more, but meanwhile this does fix some.)
	modified:   pefile.cpp
2018-04-06 13:44:24 -07:00
John Reiser 8a793d5942 ELF shlib when no DT_INIT (especially --android-shlib)
https://github.com/upx/upx/issues/191
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2018-04-04 09:15:18 -07:00
John Reiser 99f52c60ed Merge branch 'Mattiwatti-offset-to-rva-fix' into devel
https://github.com/upx/upx/pull/193
2018-04-02 09:08:57 -07:00
Mattiwatti 2c2e108301 PE: fix comparison against a constant value
... due to size always being assigned to right before this comparison,
and instead check against the RVA and size of the export directory
from the header. (note: this is still stricter than the Windows loader
which ignores all of these except the directory RVA, but if the name RVA
is invalid the PE was probably tampered with).
Change 'offset' to 'RVA' in exception message; this field is always an RVA

  Author:    Mattiwatti <mattiwatti@gmail.com>
	modified:   pefile.cpp
2018-04-02 09:07:29 -07:00
John Reiser 563165e6ae Defensive patches from hints by Sean Williams <rootkit@google.com>
modified:   pefile.cpp
2018-03-29 16:55:21 -07:00
John Reiser f1a31b4793 ELf32::unpack; Elf64 parity with Elf32 for shlib with no DT_INIT
https://github.com/upx/upx/issues/191  [partial, not finished]
	modified:   p_lx_elf.cpp
2018-03-27 19:15:47 -07:00
John Reiser 5e9b6bd69d more ELF shlib when no DT_INIT (especially Android): hook DT_INIT_ARRAY[0]
https://github.com/upx/upx/issues/191  [partial, not finished]
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   stub/src/arm.v4a-linux.shlib-init.S
	modified:   stub/src/arm.v4t-linux.shlib-init.S
2018-03-26 16:30:52 -07:00
John Reiser 9b990c4eae clarity
modified:   p_lx_elf.cpp
2018-03-24 13:52:29 -07:00
John Reiser 7a625a449a ELF shlib without DT_INIT: steal a DT_NULL from PT_DYNAMIC
https://github.com/upx/upx/issues/191  [partial, not finished]
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2018-03-24 09:41:58 -07:00
John Reiser c2b62359d5 arm32 stubs on linux: allow 0==user_DT_INIT as nop; somewhat expensive
modified:   stub/arm.v5a-linux.shlib-init.h
	modified:   stub/arm.v5t-linux.shlib-init.h
	modified:   stub/src/arm.v4a-linux.shlib-init.S
	modified:   stub/src/arm.v4t-linux.shlib-init.S
	modified:   stub/tmp/arm.v5a-linux.shlib-init.bin.dump
	modified:   stub/tmp/arm.v5t-linux.shlib-init.bin.dump
2018-03-24 08:55:04 -07:00
John Reiser 6722e8972e cleanup dead variables: is_big, all_pages
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2018-03-23 08:06:31 -07:00
John Reiser fefe7a3452 Fix segTEXT.vmsize and data for entry to shlib.
https://github.com/upx/upx/issues/57
	modified:   p_mach.cpp
2018-03-19 14:59:20 -07:00
John Reiser 90a1322929 Also check for wrap-around when checking oversize involving e_shoff and e_shnum.
raised by https://github.com/upx/upx/pull/190
	modified:   p_lx_elf.cpp
2018-03-15 21:25:20 -07:00
John Reiser d698eb69e2 Fix decompression stub for arm64 --lzma
https://github.com/upx/upx/issues/181
	modified:   stub/src/arch/arm64/v8/lzma_d.S
2018-02-24 13:04:15 -08:00
John Reiser 0ef00e9b82 Fix --lzma (and so --ultra-brute) for 32-bit ARM
https://github.com/upx/upx/issues/167  (comment #14)
	modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   ../.github/travis_testsuite_1.sh
2018-02-03 15:44:00 -08:00
John Reiser 95cedb6640 upgrade ::unpack for --android-shlib
modified:   p_elf_enum.h
    	modified:   p_lx_elf.cpp
    	modified:   p_lx_elf.h
    	modified:   stub/src/arm64-linux.shlib-init.S
    	modified:   stub/src/arm.v4t-linux.shlib-init.S
2018-02-02 14:50:56 -08:00
John Reiser d736da4208 Elf32, not shared lib: leave alone the hole between .text and .data
In theory Linux might put pages there (and that would be a problem),
but postpone closing the gap until more experience.
	modified:   p_lx_elf.cpp
2018-01-28 13:30:10 -08:00
John Reiser be83788666 --android-shlib for 32-bit ARM
Includes better handling of asl_delta in execution stub.

    	modified:   p_lx_elf.cpp
    	modified:   p_lx_elf.h
    	modified:   stub/src/arm.v4t-linux.shlib-init.S
    	modified:   stub/src/arm64-linux.shlib-init.S
2018-01-27 22:00:16 -08:00
John Reiser 5a28a51abc android shlib: better handling of asl_delta in execution stub
modified:   p_lx_elf.cpp
    	modified:   stub/src/arm64-linux.shlib-init.S
2018-01-26 12:35:06 -08:00
John Reiser 8a84df752c Compiler nit: ptr->ENUM is not always considered a constant
modified:   p_lx_elf.cpp
2018-01-26 11:54:33 -08:00
John Reiser 85f53b210d de-compression of arm64 --android-shlib
modified:   src/p_lx_elf.cpp
	modified:   src/p_lx_elf.h
	modified:   src/stub/src/arm64-linux.shlib-init.S
2018-01-24 15:39:46 -08:00
John Reiser 5d13c6cd01 elfout is unset for shlib in PackLinuxElf64::updateLoader
modified:   p_lx_elf.cpp
2018-01-22 16:15:53 -08:00
John Reiser 98a0d381e9 Merge branch 'devel' into jreiser-android
modified:   p_lx_elf.cpp
2018-01-22 13:55:45 -08:00
John Reiser e1d20fd0b5 Fix wobble in PackLinuxElf64::pack2
modified:   p_lx_elf.cpp
2018-01-22 13:48:26 -08:00
John Reiser d1035ecd8f Fix PLT for --android-shlib
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2018-01-22 13:05:18 -08:00
John Reiser 0e651facdd Fix PLT for --android-shlib
NYI: unpack of PLT, DT_INIT etc.  Also e_entry.
	modified:   p_lx_elf.cpp
2018-01-22 13:01:20 -08:00
John Reiser 9fdddfc332 work in progress: de-compression of --android-shlib
OK except for asl_delta not removed from DT_INIT, DT_INIT_ARRAY,
DT_FINI_ARRAY, DT_PREINIT_ARRAY
	modified:   ../p_lx_elf.cpp
2018-01-21 18:59:21 -08:00
John Reiser 7d2913709c MemBuffer lowmem; for shlib, especially android
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2018-01-21 14:03:52 -08:00
John Reiser 3623199e8d Merge branch 'devel' into jreiser-android 2018-01-21 10:55:56 -08:00
John Reiser e4b23f7a47 Merge branch 'devel' of https://github.com/upx/upx into devel 2018-01-21 10:30:42 -08:00
John Reiser f056ecdcd5 pefile: Allow overlap of MZ header and PE header (h.nexepos==0x10)
https://github.com/upx/upx/issues/169
This means .codebase is aliased to .nexepos, with both equal to 0x10.
	modified:   pefile.cpp
2018-01-21 10:29:17 -08:00
John Reiser 857a03a074 fix sh_offset for new Shdr[e_shstrndx]
modified:   p_lx_elf.cpp
2018-01-20 16:41:32 -08:00
John Reiser a34deee4f5 work in progress for --android-shlib
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2018-01-20 16:34:52 -08:00
John Reiser fc9c8ae482 fix updating of DT_INIT
modified:   p_lx_elf.cpp
2018-01-20 09:48:28 -08:00
John Reiser 08c63f06eb p_lx_elf.h: phdro for --android-shlib
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2018-01-19 22:01:56 -08:00
John Reiser bbff510ef1 Merge branch 'devel' into jreiser-android
Conflicts:
	src/p_lx_elf.cpp
	src/p_lx_elf.h

	modified:   ../.github/travis_testsuite_1.sh
	modified:   p_exe.cpp
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   pefile.cpp
2018-01-19 21:51:49 -08:00
Markus F.X.J. Oberhumer f747435952 For consistency, add missing "virtual". 2018-01-19 20:21:18 +01:00
Markus F.X.J. Oberhumer e6edad8f46 Clean up OptVar handling. 2018-01-19 19:50:28 +01:00
Markus F.X.J. Oberhumer 05e44b9644 Fix powerpc64 cross build. 2018-01-19 15:05:43 +01:00
Markus F.X.J. Oberhumer 16bb7ab841 clang-format files. 2018-01-19 14:18:47 +01:00
Markus F.X.J. Oberhumer 9248f02557 Silence some gcc-8-snapshot compiler warnings. 2018-01-19 14:13:58 +01:00
Markus F.X.J. Oberhumer 9485a56af1 Update Travis. 2018-01-19 11:30:34 +01:00
Markus F.X.J. Oberhumer 021c8db58a Welcome 2018. 2018-01-19 10:55:32 +01:00
John Reiser 8ab180edf8 MS-DOS .exe (not PE): default to file_size when ih.m512 and ih.p512 are zero
https://github.com/upx/upx/issues/169
	modified:   p_exe.cpp
2018-01-18 12:00:38 -08:00
John Reiser ab35b685d4 Fix pefile.cpp bad range checking for reloc type 3 and 10
modified:   pefile.cpp
2018-01-18 11:11:19 -08:00
John Reiser 86745721ee MSVC strikes again
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2018-01-15 16:27:00 -08:00
John Reiser c34fe09a79 Revamp --android-shlib
Android "Oreo" wants to deal with ElfXX_Shdr[].  So splice 4KiB into PT_LOAD[0]
with an "extra" copy of them.  This requires careful relocation processing.
It also costs a page at run time, and an average of a page in the file
(depending on fragmentation at the boundary between r-x and rw- .)

https://github.com/upx/upx/issues/124
https://github.com/upx/upx/issues/139
https://github.com/upx/upx/issues/142

	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   stub/src/arm.v4a-linux.shlib-init.S
	modified:   stub/src/arm.v4t-linux.shlib-init.S
	modified:   stub/src/arm64-linux.shlib-init.S

	modified:   stub/arm.v5a-linux.shlib-init.h
	modified:   stub/arm.v5t-linux.shlib-init.h
	modified:   stub/arm64-linux.shlib-init.h

	modified:   ../.github/travis_testsuite_1.sh
2018-01-15 16:08:34 -08:00
John Reiser 1fa9ff2c05 --android-shlib handles implicit relocation in PLT
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2018-01-15 15:45:37 -08:00
John Reiser e8ef0cf63f Merge branch 'devel' into jreiser-android 2018-01-13 09:25:55 -08:00
John Reiser 8c84efb8fb --android-shlib for Android "Oreo"
Android "Oreo" wants to deal with ElfXX_Shdr[].  So splice 4KiB into PT_LOAD[0]
with an "extra" copy of them.  This requires careful relocation processing.
It also costs a page at run time.
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   stub/src/arm.v4a-linux.shlib-init.S
	modified:   stub/src/arm.v4t-linux.shlib-init.S
	modified:   stub/src/arm64-linux.shlib-init.S
2018-01-13 09:20:04 -08:00
John Reiser f3a7620ae8 ARM: recognize R_ARM_CALL and R_ARM_JUMP24 as equivalent to R_ARM_PC24
modified:   linker.cpp
2018-01-12 08:42:34 -08:00
John Reiser c7969ed5a5 work in progress for --android-shlib
modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   stub/src/arm.v4a-linux.shlib-init.S
	modified:   stub/src/arm.v4t-linux.shlib-init.S
2018-01-12 08:32:24 -08:00
Markus F.X.J. Oberhumer 900926c0ed Avoid a MSVC warning. 2018-01-12 10:19:14 +01:00
John Reiser df94f4288a picky, picky
modified:   p_lx_elf.cpp
2018-01-11 12:09:43 -08:00
John Reiser 969efe687d MSVC pecadillos
modified:   p_lx_elf.cpp
	modified:   pefile.cpp
2018-01-11 12:01:00 -08:00
John Reiser ee3f1292d0 fix editing rot for mach-o .dylib
https://github.com/upx/upx/issues/57
	modified:   p_mach.cpp
2018-01-11 11:33:15 -08:00
John Reiser cacb239040 work in progress for --android-shlib
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   stub/src/arm64-linux.shlib-init.S
2018-01-11 09:39:26 -08:00
John Reiser 28d1789783 work in progress for --android-shlib
modified:   p_lx_elf.cpp
2018-01-08 14:04:38 -08:00
John Reiser 633eb98e34 Merge branch 'devel' into jreiser-android 2018-01-06 09:53:43 -08:00
John Reiser 4854c03096 uint64_t ==> upx_uint64_t
MSVC error C2065: 'uint64_t' : undeclared identifier
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   p_mach.cpp
2018-01-06 09:33:04 -08:00
John Reiser e853119c77 canonicalize bool in OR
MSVC error C4805: '|' : unsafe mix of type 'bool' and type 'unsigned int' in operation
	modified:   p_lx_elf.cpp
2018-01-06 09:20:46 -08:00
John Reiser 161a58bafb work in progress for --android-shlib
modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
2018-01-06 09:18:17 -08:00
John Reiser f5fd94e815 Android shlib: work in progress
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2017-12-31 22:40:57 -08:00
John Reiser edde6210f1 amd64 linux stack align
forgotten as part of 4a35bf32ea
	modified:   stub/src/amd64-linux.elf-fold.S

	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/tmp/amd64-linux.elf-fold.map
	modified:   ../.github/travis_testsuite_1.sh
2017-12-31 10:36:14 -08:00
John Reiser 507e19945e more checking of PT_DYNAMIC
https://github.com/upx/upx/issues/166
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2017-12-30 22:31:50 -08:00
John Reiser 4a35bf32ea static uClibc on amd64 passes entry.%rdx to 'atexit'
https://github.com/upx/upx/issues/166
	modified:   ../.github/travis_testsuite_1.sh
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/src/amd64-linux.elf-main.c
2017-12-30 17:20:01 -08:00
John Reiser e04bf9e4bc more checking of PT_DYNAMIC
https://github.com/upx/upx/issues/164
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2017-12-28 17:40:04 -08:00
John Reiser c384d224c0 Mach-o stubs turn off DEBUG
Branch jreiser-macho has DEBUG 1
	modified:   stub/src/amd64-darwin.macho-main.c
	modified:   stub/src/arm.v5a-darwin.macho-entry.S
	modified:   stub/src/arm.v5a-darwin.macho-fold.S
	modified:   stub/src/arm64-darwin.macho-entry.S
	modified:   stub/src/arm64-darwin.macho-fold.S
2017-12-27 10:23:19 -08:00
John Reiser 35427f998e Mach-o stubs turn off SIMULATE_ON_LINUX_EABI4
modified:   stub/src/amd64-darwin.macho-main.c
	modified:   stub/src/arm.v5a-darwin.macho-entry.S
	modified:   stub/src/arm.v5a-darwin.macho-fold.S
	modified:   stub/src/arm64-darwin.macho-entry.S
	modified:   stub/src/arm64-darwin.macho-fold.S
2017-12-27 09:12:38 -08:00
John Reiser 1174da2bc3 arm64 stubs use NBPW in TRACE etc
modified:   stub/src/arm64-darwin.macho-entry.S
	modified:   stub/src/arm64-darwin.macho-fold.S
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/arm64-linux.shlib-init.S
2017-12-26 16:39:51 -08:00
John Reiser 11e8a47030 DEBUG and TRACE for arm*-darwin.macho-* stubs
modified:   stub/src/amd64-darwin.macho-main.c
	modified:   stub/src/arm.v5a-darwin.macho-entry.S
	modified:   stub/src/arm.v5a-darwin.macho-fold.S
	modified:   stub/src/arm64-darwin.macho-entry.S
	modified:   stub/src/arm64-darwin.macho-fold.S
2017-12-26 15:44:54 -08:00
John Reiser 8c4e9bcf0d typo
modified:   stub/src/arm.v4a-linux.elf-entry.S
2017-12-26 15:43:58 -08:00
John Reiser 9dfd624901 fix TRACE macro
modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
2017-12-26 15:43:01 -08:00
John Reiser 79e65503a9 Merge branch 'devel' into jreiser-macho 2017-12-26 10:41:26 -08:00
John Reiser 59f18b9d9f stash work-in-progress
modified:   stub/src/amd64-darwin.macho-main.c
	modified:   stub/src/arm.v5a-darwin.macho-entry.S
	modified:   stub/src/arm.v5a-darwin.macho-fold.S
	modified:   stub/src/arm64-darwin.macho-entry.S
	modified:   stub/src/arm64-darwin.macho-fold.S
2017-12-22 23:07:03 -08:00
John Reiser fb3699fb89 stash work-in-progress
modified:   stub/src/amd64-darwin.macho-main.c
	modified:   stub/src/amd64-darwin.macho-upxmain.c
	modified:   stub/src/arm.v5a-darwin.macho-entry.S
	modified:   stub/src/arm.v5a-darwin.macho-fold.S
	modified:   stub/src/arm.v5a-darwin.macho-main.c
	modified:   stub/src/arm64-darwin.macho-entry.S
	modified:   stub/src/arm64-darwin.macho-fold.S
	modified:   stub/src/i386-darwin.macho-upxmain.c
2017-12-22 10:20:32 -08:00
John Reiser 9d2d59b5d2 stash work-in-progress
modified:   stub/src/amd64-darwin.macho-main.c
	modified:   stub/src/arm64-darwin.macho-fold.S
2017-12-19 21:19:53 -08:00
John Reiser aefb2fa3c3 bad logic for throwCantUnpack("cmdsize") [simple]
https://github.com/upx/upx/issues/161
	modified:   p_mach.cpp
2017-12-19 17:36:22 -08:00
John Reiser e8aa80f904 stash work-in-progress
modified:   linker.cpp
	modified:   p_mach.cpp
	modified:   p_mach.h
	modified:   packmast.cpp
	modified:   stub/Makefile
	modified:   stub/src/amd64-darwin.macho-main.c
	modified:   stub/src/arm.v5a-darwin.macho-entry.S
	modified:   stub/src/arm64-darwin.macho-entry.S
	modified:   stub/src/arm64-darwin.macho-fold.S
	modified:   stub/src/arm64-darwin.macho-main.c
2017-12-19 17:32:15 -08:00
John Reiser 990988f920 More checking of input Phdr and Shdr
https://github.com/upx/upx/issues/157
	modified:   p_lx_elf.cpp
2017-12-18 10:36:43 -08:00
John Reiser 576d9a4e7e stash work-in-progress
modified:   stub/src/amd64-darwin.macho-entry.S
	modified:   stub/src/arm.v5a-darwin.macho-entry.S
	modified:   stub/src/arm64-darwin.macho-entry.S
2017-12-17 15:02:57 -08:00
John Reiser 1d462ee424 MIPS shlib --lzma stub coding error: wrong register
https://github.com/upx/upx/issues/139 (part2)
	modified:   stub/src/mipsel.r3000-linux.shlib-init.S
2017-12-14 11:17:01 -08:00
John Reiser c9b09555c4 MH_PIE ASLR (Address-Space Layout Randomization)
modified:   stub/src/amd64-darwin.macho-main.c
2017-12-13 11:15:10 -08:00
John Reiser 860b5bf967 MH_EXECUTE diagnose syscall failure
modified:   stub/src/amd64-darwin.macho-fold.S
2017-12-13 10:53:22 -08:00
John Reiser 5063480a38 MH_EXECUTE runs under lldb, fails under shell
mmap  addr=0x100000000  len=0x3003  prot=0x3  flags=0x1012  fd=-1  off=0x0  reloc=0x0
maddr=0xffffffffffffffff  addr=0x100000000
	modified:   p_mach.cpp
	modified:   p_mach_enum.h
	modified:   stub/src/amd64-darwin.macho-entry.S
	modified:   stub/src/amd64-darwin.macho-fold.S
	modified:   stub/src/amd64-darwin.macho-main.c
2017-12-13 09:54:44 -08:00
John Reiser 3400ae9dbe MH_EXECUTE leave space for thread state command
modified:   p_mach.cpp
2017-12-12 10:53:19 -08:00
John Reiser 3385264eb2 new DPRINTF
modified:   stub/src/amd64-darwin.macho-main.c
2017-12-12 10:52:47 -08:00
John Reiser 34646f1c6a fix braces in comment after #elif
modified:   stub/src/amd64-linux.elf-main.c
2017-12-12 10:51:38 -08:00
John Reiser 50aa63a5a0 declare write()
modified:   stub/src/include/darwin.h
2017-12-12 10:50:50 -08:00
John Reiser 64557bee43 Mach-o MH_EXECUTE rewrite; work-in-progress
The stub for amd64 gets to upx_main()
	modified:   stub/src/amd64-darwin.macho-entry.S
	modified:   stub/src/amd64-darwin.macho-fold.S
	plus .h .bin.dump .map
2017-12-09 20:18:39 -08:00
John Reiser 7c21c4513e Android 64-bit ARM shared library stub: use 4Ki page size until more is known
https://github.com/upx/upx/issues/124
	modified:   p_lx_elf.cpp
	modified:   stub/arm64-linux.shlib-init.h
	modified:   stub/src/arm64-linux.shlib-init.S
	modified:   stub/tmp/arm64-linux.shlib-init.bin.dump
2017-12-08 20:05:21 -08:00
John Reiser c6d6378005 Mach-o MH_EXECUTE rewrite; work-in-progress
The stub for amd64 gets into the de-compressed folded code.
	modified:   p_mach.cpp
	modified:   stub/amd64-darwin.macho-entry.h
	modified:   stub/src/amd64-darwin.macho-entry.S
	modified:   stub/src/amd64-darwin.macho-upxmain.c
	modified:   stub/tmp/amd64-darwin.macho-entry.bin.dump
2017-12-06 17:04:47 -08:00
John Reiser 4f6979967d Mach-o MH_EXECUTE rewrite; work-in-progress
On amd64, otool and lldb accept the results.
The entry point points to the unfilter and uncompress routines.
Somehow _start has been lost.

	modified:   p_mach.cpp
	modified:   p_mach.h
	modified:   p_mach_enum.h
	modified:   stub/amd64-darwin.macho-entry.h
	modified:   stub/src/amd64-darwin.macho-entry.S
	modified:   stub/src/amd64-darwin.macho-upxmain.c
	modified:   stub/src/i386-darwin.macho-upxmain.c
	modified:   stub/src/powerpc-darwin.macho-upxmain.c
	modified:   stub/tmp/amd64-darwin.macho-entry.bin.dump
2017-12-03 23:17:55 -08:00
John Reiser e633c51b50 off_t_upx_stub typedef enables easier use of native #include
... but requires  #define __WORDSIZE
	modified:   p_mach.h
	modified:   stub/amd64-darwin.macho-fold.h
	modified:   stub/src/amd64-darwin.macho-main.c
	modified:   stub/src/arm.v5a-darwin.macho-main.c
	modified:   stub/src/arm64-darwin.macho-main.c
	modified:   stub/src/i386-darwin.macho-main.c
	modified:   stub/src/include/darwin.h
	modified:   stub/src/powerpc-darwin.macho-main.c
	modified:   stub/src/powerpc64le-darwin.macho-main.c
	modified:   stub/tmp/amd64-darwin.macho-fold.map
2017-11-28 14:49:46 -08:00
John Reiser 143f0accef PeFile check MZ offset to PE header
modified:   pefile.cpp
2017-11-21 13:07:42 -08:00
John Reiser b413f3da26 ELF shared library: PT_NOTE can prevent packing
Android build environment post-processing is adding a PT_NOTE
("Android", 21, "r16-beta1") at the high end of PT_LOAD[0],
above the stub; the runtime linker looks there before de-compression.
https://github.com/upx/upx/issues/124
	modified:   p_lx_elf.cpp
2017-11-20 10:08:24 -08:00
John Reiser 6eafa552bb Mach-o defend against bad crafted input
https://github.com/upx/upx/issues/146
	modified:   p_mach.cpp
2017-11-15 13:38:54 -08:00
John Reiser 7a0514d9b4 PeFile more checks for Section table
modified:   pefile.cpp
2017-11-12 21:47:47 -08:00
John Reiser 7e7565299e PeFile check Section table
https://github.com/upx/upx/issues/132
	modified:   pefile.cpp
2017-11-12 21:02:52 -08:00
László Molnár ed34a089c6 minor update for a memory derefencing check 2017-11-12 16:19:40 +01:00
John Reiser d14a2c5282 PeFile fix the recently-added interval checking.
https://github.com/upx/upx/issues/143
	modified:   pefile.cpp
2017-11-09 21:58:25 -08:00
John Reiser f014406b65 MemBuffer.subref(errfmt, skip, take) checks that a subinterval is inside
modified:   mem.cpp
	modified:   mem.h
2017-11-09 21:55:41 -08:00
John Reiser 58771ecca6 PeFile: better checking for import descriptors
modified:   pefile.cpp
2017-11-08 12:38:54 -08:00
John Reiser 5d9dcb634b PeFile: Defend against bad crafted import descriptors
https://github.com/upx/upx/issues/143
	modified:   pefile.cpp
	modified:   pefile.h
2017-11-08 11:07:46 -08:00
John Reiser 19c2c1edcf Android 8.0 (Oreo) wants 0!=.e_shstrndx in a shared library
https://github.com/upx/upx/issues/142
It should not matter what the .sh_name is; only the .sh_type matters.
	modified:   p_lx_elf.cpp
2017-11-07 11:12:23 -08:00
John Reiser 0430e7931e PowerPC64 stub: on syscall, real Linux trashes r13 and below
(except r1, r2, and input args!) So, r12 .e_entry for musl
must copy from a saved register.  [qemu-ppc64 doesn't trash registers!]
	modified:   ../.github/travis_testsuite_1.sh
	modified:   p_lx_elf.cpp
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	also .h  .fold.map
2017-10-27 20:07:32 -07:00
John Reiser bb8e607442 PowerPC64 musl 1.1.16 wants r12= .e_entry
modified:   stub/src/powerpc64le-linux.elf-fold.S
	also .h  .fold.map
2017-10-27 13:19:03 -07:00
John Reiser e61ada944d debug info for shared library on stderr under "-D"
modified:   p_lx_elf.cpp
2017-10-25 21:32:17 -07:00
John Reiser 46730315e3 stub arm64-linux.shlib-init.S saves 1 instr and checks for assembly errors
modified:   arm64-linux.shlib-init.S
	also .h .bin.dump
2017-10-24 12:50:29 -07:00
John Reiser 4869142034 arm64 stub for shared library uses AT_PAGESZ
modified:   stub/src/arm64-linux.shlib-init.S
	also .h .bin.dump
2017-10-23 18:55:28 -07:00
John Reiser 8e42e17bbf typo
modified:   stub/src/amd64-linux.elf-entry.S
2017-10-23 18:53:42 -07:00
John Reiser 38c8b84a26 Align hatch_off.
modified:   p_lx_elf.cpp
2017-10-20 17:23:55 -07:00
John Reiser c652626a37 32-bit shared libs reduce Phdr[1].p_align to 4096, like 64-bit.
This saves space when PAGE_SIZE is larger than 4096: MIPS, etc.
	modified:   p_lx_elf.cpp
2017-10-20 16:35:27 -07:00
John Reiser 06f6e47ebf Fix stub for MIPS shared libraries
https://github.com/upx/upx/issues/135
	modified:   p_lx_elf.cpp
	modified:   stub/src/mipsel.r3000-linux.shlib-init.S
	also .h .bin.dump
2017-10-20 16:16:35 -07:00
John Reiser 403b180b1d Compress shared libraries for mips and mipsel in ELF on Linux
modified:   p_lx_elf.cpp
	modified:   stub/Makefile
	new file:   stub/mips.r3000-linux.shlib-init.h
	new file:   stub/mipsel.r3000-linux.shlib-init.h
	new file:   stub/src/mips.r3000-linux.shlib-init.S
	new file:   stub/src/mipsel.r3000-linux.shlib-init.S
	new file:   stub/tmp/mips.r3000-linux.shlib-init.bin.dump
	new file:   stub/tmp/mipsel.r3000-linux.shlib-init.bin.dump
2017-10-19 13:47:36 -07:00
John Reiser ee008acfbd amd64 implements --is_ptinterp
https://github.com/upx/upx/issues/121
	modified:   ../.github/travis_testsuite_1.sh
	modified:   p_lx_elf.cpp
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/src/amd64-linux.elf-main.c
	also .h, .map, .bin.dump
2017-10-18 13:10:49 -07:00
John Reiser d149092ac0 Reference to external documentation only.
modified:   stub/src/arch/mips/r3000/macros.ash
2017-10-17 14:11:06 -07:00
John Reiser eafa136c69 Appease error C4146 unary minus operator applied to unsigned type, result still unsigned
Microsoft Optimizing Compiler 16.00.40219.01, 19.00.24215.1, 19.11.25507.1; others
	modified:   p_lx_elf.cpp
2017-10-17 08:44:08 -07:00
John Reiser 402c885987 Merge branch 'jreiser-elfstub' into devel
New stub strategy on Linux:  Linux adds too many other segments
to the address space: [vdso], [sigpage], ...; and qemu might
arrange them differently.  Thus the only reliable mappings
are the PT_LOAD of the compressed file itself; all other
address space is unknown!  First, the compressed file uses
.bss to occupy all unused pages up to the original brk(0).
Then at run time, the stub gets another mapping of /proc/self/exe,
and uncompresses the user program on top of the original pages.
[*BSD unchanged for now?]

	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-entry.S
	modified:   stub/src/powerpc64le-darwin.dylib-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/mipsel.r3000-linux.elf-fold.S
	modified:   stub/src/mipsel.r3000-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-main.c
	modified:   stub/src/i386-linux.elf-fold.S
	modified:   stub/src/i386-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-main.c
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm.v4a-linux.elf-fold.S
	modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   p_unix.cpp
	modified:   p_mach.cpp
	modified:   p_lx_sh.cpp
	modified:   p_lx_interp.cpp
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   p_lx_interp.h
	modified:   p_lx_sh.h
	modified:   p_mach.h
	modified:   p_unix.h
	modified:   stub/src/arch/mips/r3000/macros.ash
	modified:   stub/src/arch/powerpc/32/ppc_regs.h
	modified:   stub/src/arch/powerpc/64le/ppc_regs.h
	modified:   stub/src/include/linux.h
	modified:   stub/Makefile
	modified:   ../.github/travis_testsuite_1.sh
	also .h .map .bin.dump
2017-10-14 14:26:11 -07:00
John Reiser 5e7e0508b9 sync stubs for "make run-testsuite"
modified:   ../.github/travis_testsuite_1.sh
2017-10-14 14:19:24 -07:00
John Reiser ff1d5fb794 stub for 64-bit little-endian PowerPC also uses TOC
modified:   stub/src/arch/powerpc/64le/ppc_regs.h
	modified:   stub/src/powerpc64le-linux.elf-fold.S
2017-10-14 13:54:43 -07:00
John Reiser ad3f63b5c4 stubs *.elf-main.c: tighten input to first decompress of ELF headers
modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/i386-linux.elf-main.c
	also .h, .map
2017-10-14 06:21:44 -07:00
John Reiser a3e51e6dee stub for PowerPC 64-bit big endian: accommodate musl bare .func as .e_entry
modified:   stub/src/powerpc64le-linux.elf-fold.S
2017-10-14 06:18:00 -07:00
John Reiser c1b9c79f54 arm,armeb stubs need endian-neutral code to set mflg_subr
modified:   stub/src/arm.v4a-linux.elf-entry.S
	also .h, .bin.dump
2017-10-13 12:27:07 -07:00
John Reiser e0bc040b0a mips stub uses new strategy
modified:   p_lx_elf.cpp
	modified:   stub/src/arch/mips/r3000/macros.ash
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-main.c
	modified:   stub/src/mipsel.r3000-linux.elf-entry.S
	modified:   stub/src/mipsel.r3000-linux.elf-fold.S
	also .h, .bin.dump, .map
2017-10-12 21:04:10 -07:00
John Reiser 85eb4c7537 powerpc stub: used wrong register
modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/arch/powerpc/32/ppc_regs.h
2017-10-11 17:17:45 -07:00
John Reiser 1f929d47d0 x86_64 stub also needs make_hatch()
https://github.com/upx/upx/issues/133
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   ../.github/travis_testsuite_1.sh
	also .h and .map
2017-10-11 09:06:50 -07:00
John Reiser 608662d73b x86_64 stub also needs make_hatch()
https://github.com/upx/upx/issues/133
	modified:   stub/src/amd64-linux.elf-main.c
2017-10-11 08:45:21 -07:00
John Reiser 7841d23e77 arm64: folded stub uses 64-bit TRACEing under DEBUG
modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
2017-10-10 21:39:50 -07:00
John Reiser b72dda4ada arm64 spills a few registers because syscall can trash x18
modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
2017-10-10 20:31:11 -07:00
John Reiser c59c8a1ea2 readability; no functional change
modified:   stub/src/powerpc64le-linux.elf-entry.S
2017-10-10 20:30:41 -07:00
John Reiser 1522293be0 arm64: stub uses new strategy
modified:   p_lx_elf.cpp
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/arm64-linux.elf-main.c
	also .h, .map, .bin.dump
2017-10-10 14:51:03 -07:00
John Reiser b37bc99330 PowerPC64: stub uses new strategy
Needed: expert on TOC for big-endian.  glibc, musl, gcc disagree
on layout (is the .func first?) and usage for .e_entry.
	modified:   p_lx_elf.cpp
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/src/arch/powerpc/64le/ppc_regs.h
	modified:   stub/src/i386-linux.elf-main.c
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc64le-darwin.dylib-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-entry.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/Makefile
	also .h, .bin.dump, .map
2017-10-07 13:43:12 -07:00
John Reiser 7f905724b1 amd64: stub uses new strategy
modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-fold.S
	modified:   p_lx_elf.cpp
	also .h, .bin.dump, .map
2017-10-06 11:15:34 -07:00
John Reiser 2bf5bb1625 arm: stub uses new strategy
modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/arm.v4a-linux.elf-fold.S
	modified:   p_lx_elf.cpp
	plus .h, .bin.dump, .map
2017-10-05 17:07:30 -07:00
John Reiser 08d3376740 Elf i386 stub: get enough space when unfolded code requires another page
modified:   src/i386-linux.elf-entry.S
2017-10-03 11:48:27 -07:00
John Reiser 7bace76176 Protect against bad crafted input.
https://github.com/upx/upx/issues/129
	modified:   p_lx_elf.cpp
2017-10-03 09:55:34 -07:00
John Reiser ef336dbcc6 Protect against bad crafted input.
https://github.com/upx/upx/issues/128
	modified:   p_lx_elf.cpp
2017-10-02 21:47:40 -07:00
John Reiser ca7217e717 powerpc: stub uses new strategy
First mmap must reserve enough space to decompress folded stub.
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	also .h, .map, .dump
2017-10-02 20:03:47 -07:00
John Reiser 3931cb7871 off_t is signed and long; keep the long when discarding the signed.
https://github.com/upx/upx/issues/127
	modified:   p_vmlinx.cpp
2017-10-01 16:14:09 -07:00
John Reiser 9e8de4abe5 i386: new stub strategy to avoid problems with early mmap layout
The stub occupies the same region that execve() would create
for the original progam.  The stub copies everything to a new area,
erases the original region, replaces it with the de-compressed
program, and erases the copy of itself via the escape hatch.
The copy is inexpensive via mmap() of /proc/self/exe.

	modified:   stub/src/i386-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-fold.S
	modified:   stub/src/i386-linux.elf-main.c

	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   p_lx_interp.cpp
	modified:   p_lx_interp.h
	modified:   p_lx_sh.cpp
	modified:   p_lx_sh.h
	modified:   p_mach.cpp
	modified:   p_mach.h
	modified:   p_unix.cpp
	modified:   p_unix.h
	modified:   p_vmlinx.cpp

	plus .h, .map, .dump
2017-10-01 15:56:34 -07:00
John Reiser 26be845563 mips stubs: implement ET_DYN (-pie).
modified:   stub/src/mipsel.r3000-linux.elf-entry.S
	modified:   stub/src/mipsel.r3000-linux.elf-fold.S
	plus associated *.h, *.bin.dump, and ../.github/travis_testsuite_1.sh
2017-09-26 10:05:22 -07:00
John Reiser 2f11a629fa Fix flub: "git --amend" after "git push" is not a good idea.
https://github.com/upx/upx/issues/126# Please enter the commit message for your changes. Lines starting
	modified:   arm64-linux.shlib-init.S
2017-09-25 11:43:38 -07:00
John Reiser a295437e11 Merge branch 'devel' of https://github.com/upx/upx into devel 2017-09-25 11:39:13 -07:00
John Reiser 04597fb804 Fix bug in unfilter for shlib on arm64.
https://github.com/upx/upx/issues/126
	modified:   stub/src/arm64-linux.shlib-init.S
	and associated *.h, *.bin.dump
2017-09-25 11:38:33 -07:00
John Reiser f2f002409b Fix bug in unfilter for shlib on arm64.
https://github.com/upx/upx/issues/126
	modified:   stub/src/arm64-linux.shlib-init.S
	and associated *.h, *.bin.dump
2017-09-25 11:31:44 -07:00
John Reiser 509de877ca Cleanup powerpc64 aux stub files.
modified:   stub/powerpc64-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/tmp/powerpc64-linux.elf-fold.map
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
2017-09-24 20:30:07 -07:00
John Reiser 63aea4a7dc 64-bit Power PC linux uses 64KiB page size, but qemu-ppc64{,le} uses 4KiB.
modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/include/linux.h
	modified:   stub/src/powerpc64le-linux.elf-fold.S
2017-09-24 20:24:46 -07:00
John Reiser 6470c748db Flush ACC_UNUSED(adrc); and its predecessors from stub for MIPS.
modified:   p_lx_elf.cpp
2017-09-24 20:07:31 -07:00
John Reiser 25a6429e6a Merge branch 'devel' of https://github.com/upx/upx into devel 2017-09-23 10:43:14 -07:00
John Reiser 4fa1c2a97e Avoid the stack in stub for PowerPC, especially under qemu-ppc.
modified:   stub/src/powerpc-linux.elf-entry.S

	also travis_testsuite_1.sh, -entry.h, -entry.bin.dump
2017-09-23 10:41:40 -07:00
Markus F.X.J. Oberhumer 9ad39d77cc Update Travis. 2017-09-21 10:15:01 +02:00
John Reiser 92527126a8 Adapt around qemu-arm placement of ET_DYN and stack.
modified:   stub/src/arm.v4a-linux.elf-entry.S

	modified:   ../.github/travis_testsuite_1.sh
	plus arm*.elf-entry.h, arm*.elf-entry.bin.dump
2017-09-20 15:23:12 -07:00
John Reiser 02b4a4c974 Sync testsuite checksums.
modified:   ../.github/travis_testsuite_1.sh
2017-09-20 13:37:38 -07:00
John Reiser ede570be21 Spend 8 instructions to avoid modifying [0xf7000000, +) under qemu-arm.
modified:   src/arm.v4a-linux.elf-entry.S
	modified:   src/arm.v4a-linux.elf-fold.S

	plus arm*.h and tmp/arm*.{dump,map}
2017-09-20 13:31:38 -07:00
John Reiser 08627e9df5 Fix some AT_PHDR problems, at least on x86*.
modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/i386-linux.elf-main.c

	modified:   ../.github/travis_testsuite_1.sh
	plus many *.elf-fold.h and *.elf-fold.map
2017-09-18 19:54:27 -07:00
John Reiser 6d9f3adc86 Escape hatch for Thumb-mode shared library must reside at even address.
https://github.com/upx/upx/issues/122
	modified:   stub/src/arm.v4t-linux.shlib-init.S

	modified:   stub/arm.v5t-linux.shlib-init.h
	modified:   stub/tmp/arm.v5t-linux.shlib-init.bin.dump
2017-09-13 22:38:24 -07:00
John Reiser 96433b4e39 FILTER_ID was wrong for arm64-linux.shlib and arm64-darwin.macho.
https://github.com/upx/upx/issues/100  (partial)
	modified:   stub/src/arm64-darwin.macho-fold.S
	modified:   stub/src/arm64-linux.shlib-init.S
	modified:   p_mach.cpp

	modified:   stub/arm64-darwin.macho-fold.h
	modified:   stub/arm64-linux.shlib-init.h
2017-08-25 12:51:33 -07:00
John Reiser f4947cc2ae Work-around Ubuntu runtime bug loading shlib on ARM.
Use --android-shlib to activate the work-around.
https://bugs.launchpad.net/bugs/1712938
https://github.com/upx/upx/issues/116
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
2017-08-24 19:52:30 -07:00
John Reiser 7b554d4f72 ucl-1.03 needs help for recent gcc and for native on aarch64.
modified:   README.SRC
2017-08-23 05:47:16 -07:00
John Reiser 5b54544438 Fix powerpc64 (BIG_ENDIAN and comments)
modified:   stub/src/arch/powerpc/64/lzma_d.S
	modified:   stub/src/arch/powerpc/64le/lzma_d-common.S
	modified:   stub/src/powerpc64-linux.elf-main.c
	modified:   stub/src/powerpc64le-darwin.dylib-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-entry.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.elf-main.c
	modified:   stub/src/powerpc64le-linux.kernel.vmlinux.S

	plus stub/powerpc64*entry.h and .dump
2017-07-26 11:16:02 -07:00
Markus F.X.J. Oberhumer ef78d23494 Update Travis and check_whitespace.sh. 2017-07-23 02:59:51 +02:00
Markus F.X.J. Oberhumer ef8a7f330d Silence some compiler warnings. 2017-07-23 02:59:51 +02:00
Markus F.X.J. Oberhumer b72e0f3060 Disable debugging section. 2017-07-23 02:59:51 +02:00
Markus F.X.J. Oberhumer 2a0bab938b Rebuild stubs. 2017-07-23 02:20:05 +02:00
Markus F.X.J. Oberhumer cd637629c4 Update stub/src/arch/powerpc Makefiles. 2017-07-23 02:18:39 +02:00
John Reiser b9adfd801d Compile powerpc64 using powerpc64-linux-gcc-4.9.2 from stubtools
modified:   src/arch/powerpc/64/Makefile.extra
2017-07-22 16:14:12 -07:00
Markus F.X.J. Oberhumer 69355514c9 Fix some misspellings. 2017-07-22 12:54:37 +02:00
Markus F.X.J. Oberhumer 33dc947c21 clang-format files. 2017-07-22 12:47:45 +02:00
John Reiser 6de021d8d8 Fix MIPS, at least ET_EXEC.
ET_DYN not tested.  Also /proc/self/exe is not proected [use getenv("   ")]
	modified:   p_lx_elf.cpp
	modified:   stub/src/i386-linux.elf-main.c
	modified:   stub/src/mipsel.r3000-linux.elf-fold.S
	modified:   ../.github/travis_testsuite_1.sh

	also .h .dump .map for mips
2017-06-27 20:53:44 -07:00
John Reiser 9be86621bf PowerPC64 unifies into amd64-linux.elf-main.c
Also reconcile ppc32 and ppc64, especially *.S
	modified:   p_lx_elf.cpp
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/i386-linux.elf-main.c
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.elf-main.c
	modified:   ../.github/travis_testsuite_1.sh

	also corresponding *.h *.map *.dump
2017-06-27 14:58:13 -07:00
John Reiser a7a0876298 /proc/self/exe in powerpc64*.S stub; unify with powerpc*.S.
modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   .github/travis_testsuite_1.sh

	also corresponding *.h *.dump *.map files
2017-06-26 21:40:12 -07:00
John Reiser 31b42345c3 Fix nesting brace in comment on #endif.
modified:   i386-linux.elf-main.c
2017-06-26 21:31:36 -07:00
John Reiser 1b172e729e Fix stub for powerpc64, powerpc64le
modified:   src/powerpc64le-linux.elf-fold.S
2017-06-25 16:03:43 -07:00
John Reiser 3bf387a2d4 PowerPC stub unified with i386; including escape hatch [munmap all extras]
modified:   stub/src/i386-linux.elf-main.c
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc-linux.elf-main.c
	modified:   ../.github/travis_testsuite_1.sh

	{arm.*,i386,mips*.r3000,powerpc}-linux.elf-fold.{h,map}
	powerpc-*-entry.*
2017-06-24 18:37:16 -07:00
John Reiser 9f20bbb046 Fix merge 2017-06-19 16:01:35 -07:00
John Reiser 82af555974 Merge branch 'i386-VDSO' into devel 2017-06-19 15:58:22 -07:00
John Reiser 50638b5213 i386 VDSO may conflict on low side of -pie ET_DYN
https://github.com/upx/upx/issues/105
	modified:   stub/src/i386-linux.elf-entry.S

	modified:   stub/i386-linux.elf-entry.h
	modified:   stub/tmp/i386-linux.elf-entry.bin.dump
2017-06-19 15:49:28 -07:00
John Reiser 650df95b72 Fix thinko in PackMachBase<T>::canUnpack(). Also detect more bad input values.
https://github.com/upx/upx/issues/109
	modified:   p_mach.cpp
2017-06-18 14:24:44 -07:00
John Reiser b2115a4162 i386: clear the stack when leaving (for buggy programs); align esp to 0 mod 8
modified:   stub/src/i386-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-fold.S

	modified:   ../.github/travis_testsuite_1.sh
	modified:   stub/i386-linux.elf-entry.h
	modified:   stub/i386-linux.elf-fold.h
	modified:   stub/tmp/i386-linux.elf-entry.bin.dump
	modified:   stub/tmp/i386-linux.elf-fold.map
2017-06-16 21:36:21 -07:00
John Reiser d67bf16a08 i386: Separate PROT_EXEC and PROT_WRITE
Also affects some arm and mips (via sharing i386-linux.elf-main.c)
	modified:   i386-linux.elf-entry.S
	modified:   i386-linux.elf-main.c

	also .h, .map, .dump
2017-06-16 08:17:44 -07:00
John Reiser a4c9b64224 PowerPC: fix ET_EXEC [merge problems?] Next: -pie
modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc-linux.elf-main.c

	modified:   stub/powerpc-linux.elf-entry.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/tmp/powerpc-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc-linux.elf-fold.map
2017-06-14 20:00:30 -07:00
John Reiser 8f572e5fe6 Rewrite stubs for 32-bit arm and i386 for -pie (Position-Independent Executable)
Coming next: MIPS and PowerPC.
	modified:   p_lx_elf.cpp
	modified:   stub/src/i386-linux.elf-main.c
	modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/arm.v4a-linux.elf-fold.S
	modified:   stub/src/i386-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-fold.S
	modified:   ../.github/travis_testsuite_1.sh

	also associated *.h *.map *.dump files
2017-06-14 09:57:19 -07:00
John Reiser e58873044b Remove unused and obsolete macros do_dcache_flush and do_icache_invalidate
modified:   stub/src/arch/arm64/v8/macros.S
2017-06-14 09:35:05 -07:00
John Reiser 8ada92a69f "Drive-by" typo fix
modified:   stub/src/arm64-darwin.macho-entry.S
	modified:   stub/arm64-darwin.macho-entry.h
2017-06-14 09:33:41 -07:00
John Reiser 3c8ed5c000 Fix typo under "#if 0"
modified:   packer.cpp
2017-06-10 22:11:04 -07:00
John Reiser c127d5b64a o_binfo got in the way
modified:   stub/src/i386-linux.elf-entry.S
2017-06-10 14:03:05 -07:00
John Reiser 2d3bd0809a i386-linux.elf-fold.S avoids mmap() into stack
modified:   stub/src/i386-linux.elf-fold.S
	modified:   ../.github/travis_testsuite_1.sh
	modified:   stub/i386-linux.elf-fold.h
	modified:   stub/tmp/i386-linux.elf-fold.map
2017-06-09 14:38:08 -07:00
John Reiser eef955a9dd Fix arm.v4a-linux.elf-entry.S
modified:   stub/src/arm.v4a-linux.elf-entry.S

	modified:   stub/arm.v4a-linux.elf-entry.h
	modified:   stub/arm.v5a-linux.elf-entry.h
	modified:   stub/armeb.v4a-linux.elf-entry.h
	modified:   stub/tmp/arm.v4a-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm.v5a-linux.elf-entry.bin.dump
	modified:   stub/tmp/armeb.v4a-linux.elf-entry.bin.dump
	modified:   ../.github/travis_testsuite_1.sh
2017-06-08 20:50:57 -07:00
John Reiser e59ce39dc6 Fix arm64-linux.elf-*
modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/arm64-linux.elf-main.c

	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm64-linux.elf-fold.map
2017-06-08 17:23:19 -07:00
John Reiser 62815f5c3c Fix AT_PHDR and AT_ENTRY for amd64-linux.elf (-pie, libmusl)
modified:   stub/src/amd64-linux.elf-main.c

	modified:   ../.github/travis_testsuite_1.sh
	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/tmp/amd64-linux.elf-fold.map
2017-06-07 09:04:02 -07:00
John Reiser f496010273 Fix reloc of stub for amd64-linux.elf
modified:   stub/src/arm64-linux.elf-main.c

	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/tmp/arm64-linux.elf-fold.map
2017-06-07 09:01:37 -07:00
John Reiser 143c4e3322 Fix MH_EXECUTE for amd64-darwin.macho
modified:   p_mach.cpp
	modified:   stub/src/amd64-darwin.macho-entry.S

	modified:   stub/amd64-darwin.macho-entry.h
	modified:   stub/tmp/amd64-darwin.macho-entry.bin.dump
2017-06-07 08:58:20 -07:00
John Reiser e7f1e99a5e Merge branch 'jreiser' into devel
O_BINFO simplifies stubs on linux Elf;
PowerPC64 (big endian: Apple Macintosh G5) and PowerPC* cleanup;
-fpie simplification; shlib for arm64, amd64.

A big merge due to suspending activity on 'devel' branch
during stabilization for release of UPX-3.94.
There were intermediate merges with private branch 'jreiser',
and attempted rebase onto 'devel' did not go well.
Verfication of cases ({ET_EXEC, -fpie, shlib} x {$ARCH}) is in progress.

	modified:   ../.github/travis_testsuite_1.sh
	modified:   conf.h
	modified:   linker.cpp
	modified:   linker.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   p_mach.cpp
	modified:   p_mach.h
	modified:   p_mach_enum.h
	modified:   packmast.cpp
	modified:   stub/Makefile
	modified:   stub/scripts/xstrip.py

	modified:   stub/src/amd64-darwin.dylib-entry.S
	modified:   stub/src/amd64-darwin.macho-entry.S
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/arch/powerpc/32/bxx.S
	modified:   stub/src/arch/powerpc/32/lzma_d.S
	modified:   stub/src/arch/powerpc/32/nrv2b_d.S
	modified:   stub/src/arch/powerpc/32/nrv2d_d.S
	modified:   stub/src/arch/powerpc/32/nrv2e_d.S
	modified:   stub/src/arch/powerpc/32/ppc_regs.h
	new file:   stub/src/arch/powerpc/64/Makefile
	new file:   stub/src/arch/powerpc/64/Makefile.extra
	new file:   stub/src/arch/powerpc/64/bxx.S
	new file:   stub/src/arch/powerpc/64/lzma_d.S
	new file:   stub/src/arch/powerpc/64/lzma_d_cf.S
	new file:   stub/src/arch/powerpc/64/lzma_d_cs.S
	new file:   stub/src/arch/powerpc/64/macros.S
	new file:   stub/src/arch/powerpc/64/nrv2b_d.S
	new file:   stub/src/arch/powerpc/64/nrv2d_d.S
	new file:   stub/src/arch/powerpc/64/nrv2e_d.S
	new file:   stub/src/arch/powerpc/64/ppc_regs.h
	modified:   stub/src/arch/powerpc/64le/bxx.S
	copied:     stub/src/arch/powerpc/64le/lzma_d.S -> stub/src/arch/powerpc/64le/lzma_d-common.S
	modified:   stub/src/arch/powerpc/64le/lzma_d.S
	modified:   stub/src/arch/powerpc/64le/lzma_d_cs.S
	modified:   stub/src/arch/powerpc/64le/nrv2b_d.S
	modified:   stub/src/arch/powerpc/64le/nrv2d_d.S
	modified:   stub/src/arch/powerpc/64le/nrv2e_d.S
	modified:   stub/src/arch/powerpc/64le/ppc_regs.h
	modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/arm.v4a-linux.elf-fold.S
	modified:   stub/src/arm64-darwin.macho-entry.S
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/arm64-linux.shlib-init.S
	modified:   stub/src/i386-bsd.elf-entry.S
	modified:   stub/src/i386-darwin.macho-entry.S
	modified:   stub/src/i386-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-fold.S
	modified:   stub/src/mipsel.r3000-linux.elf-entry.S
	modified:   stub/src/mipsel.r3000-linux.elf-fold.S
	modified:   stub/src/powerpc-darwin.dylib-entry.S
	modified:   stub/src/powerpc-darwin.macho-entry.S
	modified:   stub/src/powerpc-darwin.macho-fold.S
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc-linux.elf-main.c
	new file:   stub/src/powerpc64-darwin.dylib-entry.S
	new file:   stub/src/powerpc64-darwin.macho-entry.S
	new file:   stub/src/powerpc64-darwin.macho-fold.S
	new file:   stub/src/powerpc64-darwin.macho-main.c
	new file:   stub/src/powerpc64-linux.elf-entry.S
	new file:   stub/src/powerpc64-linux.elf-fold.S
	new file:   stub/src/powerpc64-linux.elf-fold.lds
	new file:   stub/src/powerpc64-linux.elf-main.c
	modified:   stub/src/powerpc64-savegpr0.S
	modified:   stub/src/powerpc64le-darwin.dylib-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-fold.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.elf-main.c

	and most stub/*.h and stub/tmp/*.dump
2017-06-05 11:32:25 -07:00
John Reiser 140a031515 arm64-linux.shlib-init
modified:   p_lx_elf.cpp
	modified:   stub/src/arm64-linux.shlib-init.S

	modified:   stub/arm64-linux.shlib-init.h
	modified:   stub/tmp/arm64-linux.shlib-init.bin.dump
2017-06-04 16:52:43 -07:00
John Reiser b7c91941b8 --android-shlib fix Elf64_Shdr.sh_offset
https://github.com/upx/upx/issues/100
	modified:   ../p_lx_elf.cpp
	modified:   ../p_lx_elf.h
2017-05-31 11:04:56 -07:00
John Reiser 33f0b6da67 Merge branch 'devel' of https://github.com/upx/upx into devel 2017-05-31 10:57:19 -07:00
John Reiser ee18fe9bba DF_1_PIE and calls_crt1() to handle part of -pie,-fPIE
https://github.com/upx/upx/issues/106  [partial]
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2017-05-31 10:53:55 -07:00
John Reiser a51330cf07 DF_1_PIE and calls_crt1() to handle part of -pie,-fPIE
https://github.com/upx/upx/issues/106  [partial]
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2017-05-30 13:43:06 -07:00
John Reiser a67aed2744 Merge branch 'devel' of https://github.com/upx/upx into devel 2017-05-30 11:33:39 -07:00
John Reiser d979e19315 fpad8() for --android-shlib in PackLinuxElf64::pack4()
https://github.com/upx/upx/issues/100
	modified:   p_lx_elf.cpp
2017-05-30 11:32:05 -07:00
Markus F.X.J. Oberhumer 4c74d16795 Avoid a compilation warning. clang-format files. 2017-05-28 11:32:12 +02:00
John Reiser 6e541a432f amd64-linux: DF_1_PIE marks a main program; stub juggles AT_PHDR for same
https://github.com/upx/upx/issues/105
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   stub/src/amd64-linux.elf-main.c

	modified:   ../.github/travis_testsuite_1.sh
	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/tmp/amd64-linux.elf-fold.map
2017-05-27 19:54:12 -07:00
John Reiser d8f47e248a Handle old style 8-byte headers for version <= 11
https://github.com/upx/upx/issues/102
	modified:   p_unix.cpp
2017-05-26 13:05:12 -07:00
John Reiser d1a869496b More visibility for PackHeader when debug(-D)
modified:   packhead.cpp
	modified:   packmast.cpp
	modified:   pefile.h
2017-05-26 13:02:32 -07:00
John Reiser f42a37555d Merge branch 'devel' of https://github.com/upx/upx into devel 2017-05-21 20:48:05 -07:00
John Reiser d9e019bd87 amd64-darwin.dylib hacking
modified:   stub/src/amd64-darwin.dylib-entry.S

	modified:   stub/amd64-darwin.dylib-entry.h
	modified:   stub/tmp/amd64-darwin.dylib-entry.bin.dump
2017-05-17 21:36:40 -07:00
John Reiser ce194fa5d8 amd64-darwin.dylib hacking
modified:   p_mach.cpp
	modified:   p_mach.h
	modified:   p_mach_enum.h
	modified:   stub/src/amd64-darwin.dylib-entry.S

	modified:   stub/amd64-darwin.dylib-entry.h
	modified:   stub/tmp/amd64-darwin.dylib-entry.bin.dump
2017-05-17 15:50:34 -07:00
Markus F.X.J. Oberhumer b5bdf57636 Minor cleanups. 2017-05-14 19:21:04 +02:00
Markus F.X.J. Oberhumer a3a81ce7c6 Update NEWS. 2017-05-13 20:44:02 +02:00
Markus F.X.J. Oberhumer 61f347401c Update testsuite checksums caused by version bump. 2017-05-12 15:35:24 +02:00
Markus F.X.J. Oberhumer d985a4c250 Post-release version bump. 2017-05-12 15:28:47 +02:00
Markus F.X.J. Oberhumer d31947e1f0 Update NEWS. 2017-05-12 13:01:20 +02:00
Markus F.X.J. Oberhumer e4659b7d7c Bump release date. 2017-05-12 12:47:14 +02:00
Markus F.X.J. Oberhumer 8827a534db Update Travis. 2017-05-12 12:45:43 +02:00
Markus F.X.J. Oberhumer ddf48b45a5 Update Travis. 2017-05-09 22:50:18 +02:00
John Reiser 8eabb9b02f i386 recover from merge
modified:   p_lx_elf.cpp
2017-05-08 18:54:41 -07:00
John Reiser 8a195a0b35 amd64 recover from merge
modified:   stub/src/amd64-linux.elf-fold.S

	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/tmp/amd64-linux.elf-fold.map
2017-05-08 16:06:02 -07:00
John Reiser 955206aaf0 Merge branch 'devel' into jreiser
Conflicts:
	src/p_lx_elf.cpp
	src/stub/src/amd64-linux.elf-entry.S
	src/stub/src/amd64-linux.elf-main.c
	src/stub/src/arm.v4a-linux.elf-entry.S
	src/stub/src/arm.v4a-linux.elf-fold.S
	src/stub/src/arm64-linux.elf-entry.S
	src/stub/src/arm64-linux.elf-fold.S
	src/stub/src/i386-linux.elf-fold.S
	src/stub/src/powerpc-darwin.macho-entry.S
	src/stub/src/powerpc-linux.elf-fold.S
	src/stub/src/powerpc64le-darwin.macho-entry.S
	src/stub/src/powerpc64le-linux.elf-entry.S
	src/stub/src/powerpc64le-linux.elf-fold.S
	src/stub/src/powerpc64le-linux.elf-main.c

 Changes to be committed:
	modified:   ../.github/ISSUE_TEMPLATE.md
	modified:   ../.github/travis_build.sh
	modified:   ../.github/travis_deploy.sh
	modified:   ../.github/travis_init.sh
	modified:   ../.github/travis_testsuite_1.sh
	modified:   ../.gitignore
	modified:   ../.travis.yml
	modified:   ../NEWS
	modified:   c_screen.cpp
	modified:   file.cpp
	modified:   help.cpp
	modified:   linker.cpp
	modified:   main.cpp
	modified:   p_lx_elf.cpp
	modified:   packer.cpp
	modified:   s_djgpp2.cpp
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/arm.v4a-linux.elf-fold.S
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/i386-linux.elf-main.c
	modified:   stub/src/powerpc-darwin.dylib-entry.S
	modified:   stub/src/powerpc-darwin.macho-entry.S
	modified:   stub/src/powerpc-darwin.macho-fold.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc64le-darwin.dylib-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-fold.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.elf-main.c
	modified:   ui.cpp
	modified:   util.cpp
	modified:   work.cpp
	[plus *.h, *.dump, *.map]
2017-05-08 14:21:31 -07:00
John Reiser 082dd7d5ee arm64 TRACE improvement
modified:   stub/src/arm64-linux.elf-entry.S

	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
2017-05-07 12:07:51 -07:00
John Reiser 90714cf624 arm64 tracing in stub
modified:   ../../linker.cpp
	modified:   ../../p_lx_elf.cpp
	modified:   arm64-linux.elf-entry.S
2017-05-06 19:37:37 -07:00
John Reiser 61798d33f0 Revamp stub on arm, arm64; mmap into stack defeats auto-expansion [kernel bug?]
modified:   stub/src/arm.v4a-linux.elf-fold.S
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S

	modified:   ../.github/travis_testsuite_1.sh
	modified:   stub/arm.v4a-linux.elf-fold.h
	modified:   stub/arm.v5a-linux.elf-fold.h
	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/armeb.v4a-linux.elf-fold.h
	modified:   stub/tmp/arm.v4a-linux.elf-fold.map
	modified:   stub/tmp/arm.v5a-linux.elf-fold.map
	modified:   stub/tmp/arm64-linux.elf-fold.map
	modified:   stub/tmp/armeb.v4a-linux.elf-fold.map
2017-05-05 18:36:44 -07:00
John Reiser 6e2a41cb26 DPRINTF for amd64
modified:   Makefile
	modified:   src/amd64-linux.elf-fold.S
	modified:   src/amd64-linux.elf-main.c

	modified:   amd64-linux.elf-fold.h
	modified:   tmp/amd64-linux.elf-fold.map
2017-05-05 13:32:42 -07:00
John Reiser 515897e180 Allow Elf64_Ehdr::ELFOSABI_NONE on Linux; cater to EM_PPC64.e_flags quirk
modified:   p_lx_elf.cpp
2017-05-04 08:28:03 -07:00
John Reiser fe4a8f33b1 Start on darwin.macho-dylib
modified:   p_mach.cpp
	modified:   p_mach.h
	modified:   packmast.cpp
2017-05-03 08:30:21 -07:00
Markus F.X.J. Oberhumer 304d848f53 Bump version date. 2017-05-03 13:49:22 +02:00
Markus F.X.J. Oberhumer b5f738abf3 Move xxx_le26 from miniacc.h to bele.h. 2017-05-03 13:25:10 +02:00
Markus F.X.J. Oberhumer 7ebed06393 Fix building with recent djgpp2 gcc-6 version. 2017-05-03 13:21:08 +02:00
Markus F.X.J. Oberhumer 2e56fe82bb Update Travis. 2017-05-01 10:37:07 +02:00
John Reiser 32019c61aa dynamic e_phnum for arm
modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/arm.v4a-linux.elf-fold.S

	modified:   ../.github/travis_testsuite_1.sh
	modified:   stub/arm.v4a-linux.elf-entry.h
	modified:   stub/arm.v4a-linux.elf-fold.h
	modified:   stub/arm.v5a-linux.elf-entry.h
	modified:   stub/arm.v5a-linux.elf-fold.h
	modified:   stub/armeb.v4a-linux.elf-entry.h
	modified:   stub/armeb.v4a-linux.elf-fold.h
	modified:   stub/tmp/arm.v4a-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm.v4a-linux.elf-fold.map
	modified:   stub/tmp/arm.v5a-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm.v5a-linux.elf-fold.map
	modified:   stub/tmp/armeb.v4a-linux.elf-entry.bin.dump
	modified:   stub/tmp/armeb.v4a-linux.elf-fold.map
2017-04-30 19:15:17 -07:00
John Reiser f7ffae565c dynamic e_phnum for arm64
modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S

	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
2017-04-30 13:13:53 -07:00
John Reiser cd11bb1606 Update AT_BASE for musl-libc
https://github.com/upx/upx/issues/93
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/i386-linux.elf-main.c
	modified:   stub/src/powerpc64le-linux.elf-main.c

	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/tmp/amd64-linux.elf-fold.map
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
	modified:   ../.github/travis_testsuite_1.sh
2017-04-27 20:55:02 -07:00
John Reiser 24c924d668 Fix size of 'imul'
modified:   src/stub/src/i386-linux.elf-fold.S
	modified:   src/p_lx_elf.cpp

	modified:   .github/travis_testsuite_1.sh
	modified:   src/stub/i386-linux.elf-fold.h
	modified:   src/stub/tmp/i386-linux.elf-fold.map
2017-04-26 15:24:19 -07:00
John Reiser 9be94e4b58 Fix size of 'imul'
modified:   stub/src/amd64-linux.elf-entry.S

	modified:   ../.github/travis_testsuite_1.sh
	modified:   stub/amd64-linux.elf-entry.h
	modified:   stub/tmp/amd64-linux.elf-entry.bin.dump
2017-04-24 17:12:55 -07:00
John Reiser 15e9d8c99d Recognize __libc_init for Android -pie (PositionIndependentExecutable)
based on https://github.com/upx/upx/pull/92/commits/d34887ef60304cb28990c4b99c17b1f91acbbef1
	modified:   p_lx_elf.cpp
2017-04-24 11:04:48 -07:00
John Reiser 391f511094 powerpc-linux.elf-fold.S and -main.c handle /proc/self/exe
modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc-linux.elf-main.c

	modified:   stub/tmp/amd64-linux.elf-fold.map
	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/powerpc-linux.elf-entry.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/tmp/powerpc-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc-linux.elf-fold.map
2017-04-22 20:18:00 -07:00
John Reiser 5b53c11a6b Sync powerpc-linux.elf testsuite
modified:   travis_testsuite_1.sh
2017-04-21 11:30:12 -07:00
John Reiser 9df4b6ea24 Sync SZ_FRAME with devel branch
modified:   src/arch/powerpc/32/ppc_regs.h
	modified:   src/arch/powerpc/64le/ppc_regs.h
	modified:   src/powerpc64le-linux.elf-entry.S
	modified:   src/powerpc64le-linux.elf-fold.S
2017-04-21 10:54:04 -07:00
John Reiser a440564ba4 Fix powerpc64le ABI stack frame omitting spill area for a0-a7
Also use new symbol SZ_FRAME in */ppc_regs.h
	modified:   stub/src/arch/powerpc/32/ppc_regs.h
	modified:   stub/src/arch/powerpc/64le/ppc_regs.h
	modified:   stub/src/powerpc-darwin.dylib-entry.S
	modified:   stub/src/powerpc-darwin.macho-entry.S
	modified:   stub/src/powerpc-darwin.macho-fold.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc64le-darwin.dylib-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-fold.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S

	modified:   stub/powerpc-darwin.dylib-entry.h
	modified:   stub/powerpc-darwin.macho-entry.h
	modified:   stub/powerpc-darwin.macho-fold.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/powerpc64le-darwin.dylib-entry.h
	modified:   stub/powerpc64le-darwin.macho-entry.h
	modified:   stub/powerpc64le-darwin.macho-fold.h
	modified:   stub/powerpc64le-linux.elf-entry.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/tmp/powerpc64le-darwin.macho-fold.map
2017-04-21 08:58:13 -07:00
John Reiser 9583cfcc93 Update NEWS 2017-04-19 19:55:39 -07:00
John Reiser c4a921283a Revamp powerpc{,64le,64}.
Fix 64-bit stack frame (8*8 bytes for spilling a0-a7).  Avoid using r2 (t0).
Prepare for -pie executables.  Prepare for unified strategy in stubs.

	modified:   p_lx_elf.cpp
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/arch/powerpc/32/bxx.S
	modified:   stub/src/arch/powerpc/32/lzma_d.S
	modified:   stub/src/arch/powerpc/32/nrv2b_d.S
	modified:   stub/src/arch/powerpc/32/nrv2d_d.S
	modified:   stub/src/arch/powerpc/32/nrv2e_d.S
	modified:   stub/src/arch/powerpc/32/ppc_regs.h
	new file:   stub/src/arch/powerpc/64/Makefile
	new file:   stub/src/arch/powerpc/64/Makefile.extra
	new file:   stub/src/arch/powerpc/64/lzma_d.S
	new file:   stub/src/arch/powerpc/64/lzma_d_cf.S
	new file:   stub/src/arch/powerpc/64/lzma_d_cs.S
	modified:   stub/src/arch/powerpc/64le/bxx.S
	copied:     stub/src/arch/powerpc/64le/lzma_d.S -> stub/src/arch/powerpc/64le/lzma_d-common.S
	modified:   stub/src/arch/powerpc/64le/lzma_d.S
	modified:   stub/src/arch/powerpc/64le/lzma_d_cs.S
	modified:   stub/src/arch/powerpc/64le/nrv2b_d.S
	modified:   stub/src/arch/powerpc/64le/nrv2d_d.S
	modified:   stub/src/arch/powerpc/64le/nrv2e_d.S
	modified:   stub/src/arch/powerpc/64le/ppc_regs.h
	modified:   stub/src/i386-darwin.macho-entry.S
	modified:   stub/src/powerpc-darwin.dylib-entry.S
	modified:   stub/src/powerpc-darwin.macho-entry.S
	modified:   stub/src/powerpc-darwin.macho-fold.S
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc-linux.elf-main.c
	modified:   stub/src/powerpc64-darwin.dylib-entry.S
	modified:   stub/src/powerpc64-darwin.macho-entry.S
	modified:   stub/src/powerpc64-darwin.macho-fold.S
	modified:   stub/src/powerpc64-darwin.macho-main.c
	modified:   stub/src/powerpc64-linux.elf-main.c
	modified:   stub/src/powerpc64-savegpr0.S
	modified:   stub/src/powerpc64le-darwin.dylib-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-fold.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S

	modified:   stub/i386-darwin.macho-entry.h
	modified:   stub/powerpc-darwin.dylib-entry.h
	modified:   stub/powerpc-darwin.macho-entry.h
	modified:   stub/powerpc-darwin.macho-fold.h
	modified:   stub/powerpc-linux.elf-entry.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/powerpc-linux.kernel.vmlinux.h
	modified:   stub/powerpc64-linux.elf-entry.h
	modified:   stub/powerpc64-linux.elf-fold.h
	modified:   stub/powerpc64le-darwin.dylib-entry.h
	modified:   stub/powerpc64le-darwin.macho-entry.h
	modified:   stub/powerpc64le-darwin.macho-fold.h
	modified:   stub/powerpc64le-linux.elf-entry.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.kernel.vmlinux.h
	modified:   stub/tmp/i386-darwin.macho-entry.bin.dump
	modified:   stub/tmp/powerpc-darwin.dylib-entry.bin.dump
	modified:   stub/tmp/powerpc-darwin.macho-entry.bin.dump
	modified:   stub/tmp/powerpc-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc-linux.elf-fold.map
	modified:   stub/tmp/powerpc64le-darwin.dylib-entry.bin.dump
	modified:   stub/tmp/powerpc64le-darwin.macho-entry.bin.dump
	modified:   stub/tmp/powerpc64le-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
	modified:   stub/tmp/powerpc64le-linux.kernel.vmlinux.bin.dump
2017-04-19 19:25:05 -07:00
John Reiser 4e05f087f9 PowerPC 64-bit big-endian
modified:   conf.h
	modified:   linker.cpp
	modified:   linker.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   packmast.cpp
	modified:   stub/Makefile
	modified:   stub/powerpc-linux.elf-entry.h
	new file:   stub/powerpc64-linux.elf-entry.h
	new file:   stub/powerpc64-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.elf-entry.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/scripts/xstrip.py
	modified:   stub/src/arch/powerpc/64le/nrv2b_d.S
	modified:   stub/src/arch/powerpc/64le/nrv2d_d.S
	modified:   stub/src/arch/powerpc/64le/nrv2e_d.S
	new file:   stub/src/powerpc64-darwin.dylib-entry.S
	new file:   stub/src/powerpc64-darwin.macho-entry.S
	new file:   stub/src/powerpc64-darwin.macho-fold.S
	new file:   stub/src/powerpc64-darwin.macho-main.c
	new file:   stub/src/powerpc64-linux.elf-entry.S
	new file:   stub/src/powerpc64-linux.elf-fold.S
	new file:   stub/src/powerpc64-linux.elf-fold.lds
	new file:   stub/src/powerpc64-linux.elf-main.c
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.elf-main.c
	modified:   stub/tmp/powerpc64le-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
2017-04-11 19:15:43 -07:00
John Reiser 40b506d2e0 Sync arm* stubs
modified:   ../arm.v4a-linux.elf-entry.h
	modified:   ../arm.v4a-linux.elf-fold.h
	modified:   ../arm.v5a-linux.elf-entry.h
	modified:   ../arm.v5a-linux.elf-fold.h
	modified:   ../arm64-darwin.macho-entry.h
	modified:   ../arm64-linux.elf-entry.h
	modified:   ../arm64-linux.elf-fold.h
	modified:   ../armeb.v4a-linux.elf-entry.h
	modified:   ../armeb.v4a-linux.elf-fold.h
	modified:   ../tmp/arm.v4a-linux.elf-entry.bin.dump
	modified:   ../tmp/arm.v4a-linux.elf-fold.map
	modified:   ../tmp/arm.v5a-linux.elf-entry.bin.dump
	modified:   ../tmp/arm.v5a-linux.elf-fold.map
	modified:   ../tmp/arm64-darwin.macho-entry.bin.dump
	modified:   ../tmp/arm64-linux.elf-entry.bin.dump
	modified:   ../tmp/armeb.v4a-linux.elf-entry.bin.dump
	modified:   ../tmp/armeb.v4a-linux.elf-fold.map
2017-04-11 19:13:11 -07:00
John Reiser 263f384810 o_binfo
modified:   arm64-darwin.macho-entry.S
2017-04-11 19:07:38 -07:00
John Reiser d80c145a18 PROT_EXEC for decompressed 'fold'
modified:   powerpc-linux.elf-entry.S
2017-04-10 15:36:43 -07:00
Markus F.X.J. Oberhumer 8848fe35f6 Update Travis. 2017-04-10 16:15:03 +02:00
John Reiser 7a681bd20d Use saved registers for parameters to 'fold'; lzma can clobber others
modified:   arm64-linux.elf-entry.S
	modified:   arm64-linux.elf-fold.S
2017-04-09 21:33:29 -07:00
John Reiser ed31fb184b Replace crumb with b_info
modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/arm.v4a-linux.elf-fold.S
2017-04-09 18:06:16 -07:00
John Reiser 360b94dd6c i386-linux ET_EXEC working
modified:   stub/src/i386-linux.elf-fold.S

	modified:   stub/i386-linux.elf-fold.h
	modified:   stub/tmp/i386-linux.elf-fold.map
2017-04-07 16:08:13 -07:00
John Reiser 8524e73f59 Always a 1-page crumb for i386
modified:   stub/src/i386-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-fold.S

	modified:   stub/i386-linux.elf-entry.h
	modified:   stub/i386-linux.elf-fold.h
	modified:   stub/tmp/i386-linux.elf-entry.bin.dump
2017-04-07 11:17:01 -07:00
John Reiser 940514e5ca Sync stubs
modified:   stub/arm64-darwin.macho-entry.h
	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/arm64-linux.shlib-init.h
	modified:   stub/tmp/arm64-darwin.macho-entry.bin.dump
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm64-linux.shlib-init.bin.dump
2017-04-07 10:09:01 -07:00
John Reiser a4e47625ac Sync stubs
modified:   stub/arm64-darwin.macho-entry.h
	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/arm64-linux.shlib-init.h
	modified:   stub/tmp/arm64-darwin.macho-entry.bin.dump
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm64-linux.shlib-init.bin.dump
2017-04-07 08:23:30 -07:00
John Reiser 7c16872a6e Merge branch 'devel' into jreiser 2017-04-07 08:22:08 -07:00
John Reiser 994c3c3552 Use arm64-linux-objdump-2.25 and arm64-linux-objcopy-2.25
modified:   Makefile.extra

	modified:   lzma_d_cf.S
	modified:   lzma_d_cs.S
2017-04-07 07:20:47 -07:00
John Reiser c34f496600 Avoid incorrect C4319 by Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x64
modified:   p_lx_elf.cpp
2017-04-07 05:36:40 -07:00
John Reiser 8bca8629be Preserve symlink /proc/self/exe by mapping one page into the stack.
modified:   stub/src/amd64-linux.elf-fold.S

	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/tmp/amd64-linux.elf-fold.map
2017-04-06 23:08:35 -07:00
John Reiser 85fdd579d6 Cleanup PackLinuxElf64amd::defineSymbols(): use is_pie; reduce symbols
modified:   p_lx_elf.cpp
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-fold.S

	modified:   stub/amd64-linux.elf-entry.h
	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/tmp/amd64-linux.elf-entry.bin.dump
	modified:   stub/tmp/amd64-linux.elf-fold.map
2017-04-06 17:22:30 -07:00
John Reiser e88d2ff88c Merge branch 'devel' into jreiser
modified:   ../.appveyor.yml
	modified:   ../.github/travis_build.sh
	modified:   Makefile
	modified:   linker.cpp
	modified:   p_lx_elf.cpp
	modified:   packmast.cpp
2017-04-06 14:25:14 -07:00
John Reiser bdf08baebd O_BINFO
modified:   stub/amd64-darwin.macho-entry.h
	modified:   stub/amd64-linux.elf-entry.h
	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/i386-bsd.elf-entry.h
	modified:   stub/i386-darwin.macho-entry.h
	modified:   stub/i386-linux.elf-entry.h
	modified:   stub/i386-linux.elf-fold.h
	modified:   stub/i386-netbsd.elf-entry.h
	modified:   stub/mips.r3000-linux.elf-fold.h
	modified:   stub/mipsel.r3000-linux.elf-fold.h
	modified:   stub/powerpc-darwin.macho-entry.h
	modified:   stub/powerpc-linux.elf-entry.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/powerpc64le-darwin.macho-entry.h
	modified:   stub/powerpc64le-linux.elf-entry.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/src/amd64-darwin.macho-entry.S
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/src/arch/powerpc/32/ppc_regs.h
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/i386-bsd.elf-entry.S
	modified:   stub/src/i386-darwin.macho-entry.S
	modified:   stub/src/i386-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-fold.S
	modified:   stub/src/mipsel.r3000-linux.elf-fold.S
	modified:   stub/src/powerpc-darwin.macho-entry.S
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc-linux.elf-main.c
	modified:   stub/src/powerpc64le-darwin.macho-entry.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.elf-main.c
	modified:   stub/tmp/amd64-darwin.macho-entry.bin.dump
	modified:   stub/tmp/amd64-linux.elf-entry.bin.dump
	modified:   stub/tmp/amd64-linux.elf-fold.map
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
	modified:   stub/tmp/i386-bsd.elf-entry.bin.dump
	modified:   stub/tmp/i386-darwin.macho-entry.bin.dump
	modified:   stub/tmp/i386-linux.elf-entry.bin.dump
	modified:   stub/tmp/i386-linux.elf-fold.map
	modified:   stub/tmp/i386-netbsd.elf-entry.bin.dump
	modified:   stub/tmp/powerpc-darwin.macho-entry.bin.dump
	modified:   stub/tmp/powerpc-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc-linux.elf-fold.map
	modified:   stub/tmp/powerpc64le-darwin.macho-entry.bin.dump
	modified:   stub/tmp/powerpc64le-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
2017-04-06 14:22:47 -07:00
John Reiser 3dcdd25177 re-work -fpie for amd64
modified:   stub/src/amd64-linux.elf-main.c
2017-04-06 14:22:05 -07:00
John Reiser 491e8640b2 is_pie; O_BINFO; remove LUNMP000, LUNMP001
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2017-04-06 14:15:07 -07:00
John Reiser b23b7ef85e DT_FLAGS_1, DF_1_PIE
modified:   p_elf_enum.h
2017-04-06 14:13:02 -07:00
John Reiser b167374f13 R_PPC64_ADDR32
modified:   linker.cpp
2017-04-06 14:12:29 -07:00
John Reiser cd1f6e733f Merge branch 'devel' of https://github.com/upx/upx into devel 2017-04-06 09:05:46 -07:00
John Reiser d3fc7687b8 Fix valgrind error
https://travis-ci.org/upx/upx/jobs/218929378
	modified:   p_lx_elf.cpp
2017-04-06 09:04:13 -07:00
Markus F.X.J. Oberhumer 17a83d58da clang-format files. 2017-04-05 17:15:29 +02:00
Markus F.X.J. Oberhumer 18a8e1b6d6 Update Travis. 2017-04-05 17:02:46 +02:00
Markus F.X.J. Oberhumer 2c23cbb359 Silence some compiler warnings. 2017-04-05 17:02:42 +02:00
Markus F.X.J. Oberhumer cdd58cf757 Use proper UPX types. 2017-04-05 16:31:36 +02:00
John Reiser a0df325659 Merge branch 'devel' of https://github.com/upx/upx into devel 2017-04-03 20:26:23 -07:00
John Reiser a59005e836 Elf propagates NX via PT_GNU_STACK (except MIPS stub is too difficult for now)
https://github.com/upx/upx/issues/81
	modified:   ../.github/travis_testsuite_1.sh
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   stub/amd64-linux.elf-entry.h
	modified:   stub/i386-linux.elf-fold.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-fold.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/tmp/amd64-linux.elf-entry.bin.dump
	modified:   stub/tmp/i386-linux.elf-fold.map
	modified:   stub/tmp/powerpc-linux.elf-fold.map
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
2017-04-03 20:25:57 -07:00
John Reiser 5da6a27e6b Elf propates NX via PT_GNU_STACK (except MIPS stub is too difficult for now)
https://github.com/upx/upx/issues/81
	modified:   ../.github/travis_testsuite_1.sh
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   stub/amd64-linux.elf-entry.h
	modified:   stub/i386-linux.elf-fold.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-fold.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/tmp/amd64-linux.elf-entry.bin.dump
	modified:   stub/tmp/i386-linux.elf-fold.map
	modified:   stub/tmp/powerpc-linux.elf-fold.map
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
2017-04-03 20:11:08 -07:00
John Reiser ef97af71e3 Merge branch 'jreiser' into devel 2017-04-03 12:57:57 -07:00
John Reiser 6ed67f4532 Unpack prefix with appended data; give message, keep backup
https://github.com/upx/upx/issues/4
	modified:   p_mach.cpp
2017-04-03 12:53:27 -07:00
John Reiser 1278d663b4 Merge branch 'jreiser' into devel 2017-04-02 14:56:26 -07:00
John Reiser 0395c7b407 Use stubtools for arm64.
modified:   stub/Makefile
	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/arm64-linux.shlib-init.h
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm64-linux.elf-fold.map
	modified:   stub/tmp/arm64-linux.shlib-init.bin.dump
2017-04-02 14:55:39 -07:00
John Reiser df3d15ffb3 Enable stub for arm64 shlib. Stub is broken, but at least it packs.
modified:   p_lx_elf.cpp
2017-03-31 20:01:14 -07:00
John Reiser 6f673310d2 powerpc64le: lzma compression support
https://github.com/upx/upx/pull/79

Integration based on:
commit c4bde4369f
Author: Thierry Fauck <tfauck@free.fr>
Date:   Fri Mar 24 17:39:30 2017 +0100

    powerpc64le: lzma compression support

    Signed-off-by: Thierry Fauck <tfauck@free.fr>

    	modified:   powerpc64le-darwin.dylib-entry.h
    	modified:   powerpc64le-darwin.macho-entry.h
    	modified:   powerpc64le-linux.elf-entry.h
    	modified:   powerpc64le-linux.kernel.vmlinux.h
    	modified:   src/arch/powerpc/64le/lzma_d.S
    	modified:   tmp/powerpc64le-darwin.dylib-entry.bin.dump
    	modified:   tmp/powerpc64le-darwin.macho-entry.bin.dump
    	modified:   tmp/powerpc64le-linux.elf-entry.bin.dump
    	modified:   tmp/powerpc64le-linux.kernel.vmlinux.bin.dump
2017-03-31 13:42:43 -07:00
John Reiser 978c3eca23 --android-shlib preserves selected Elf64_Shdr
https://github.com/upx/upx/issues/65
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2017-03-31 13:26:27 -07:00
John Reiser 20bc848bd6 --android-shlib preserves selected Elf64_Shdr
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2017-03-31 13:24:36 -07:00
John Reiser ce7f1292dc Merge branch 'devel' into jreiser 2017-03-31 13:10:08 -07:00
John Reiser d97ff8bb40 More cleanup
modified:   p_lx_elf.cpp
2017-03-31 12:57:11 -07:00
John Reiser 8a9b46d82f Cleanup minor bug in unpack ET_EXE
modified:   p_lx_elf.cpp
2017-03-31 12:42:14 -07:00
John Reiser 12e5703541 Stronger test and better message for PT_LOAD[0].p_offset != 0
https://github.com/upx/upx/issues/80
	modified:   p_lx_elf.cpp
2017-03-31 12:20:02 -07:00
John Reiser 1b87fc2ee6 DT_INIT restored for -d on --android-shlib
modified:   p_lx_elf.cpp
2017-03-30 15:55:35 -07:00
John Reiser ebd0c780a1 Unpacking --android-shlib works except for restoring DT_INIT
modified:   p_lx_elf.cpp
2017-03-30 11:05:49 -07:00
John Reiser bd976cd562 Merge branch 'devel' into jreiser
modified:   packmast.cpp
2017-03-30 10:27:54 -07:00
John Reiser 0e511c3e07 visitAllPackers() lists class names when -D
modified:   packmast.cpp
2017-03-30 10:23:27 -07:00
John Reiser 300d489408 --android-shlib preserves selected Elf32_Shdr
32-bit only for now; also in wrong place for unpacking (-d)
	modified:   main.cpp
	modified:   options.h
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2017-03-29 18:31:39 -07:00
John Reiser 024d081167 Fix unpack of ET_DYN
https://github.com/upx/upx/issues/73

	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2017-03-27 16:49:46 -07:00
John Reiser 348173d3f1 Fix editing glitch
modified:   p_lx_elf.cpp
2017-03-27 16:42:26 -07:00
John Reiser 23e3814f8a Fix unpacking of ET_DYN
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2017-03-27 16:10:12 -07:00
John Reiser b818e2c4b8 arm64 (aarch64)
Tested and working: nrv2b and nrv2e for ET_EXE on linux.
NOT TESTED: lzma, ET_DYN on linux; any Mach-O

	modified:   bele.h
	modified:   conf.h
	modified:   filter/ct.h
	modified:   filteri.cpp
	modified:   linker.cpp
	modified:   linker.h
	modified:   miniacc.h
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   packmast.cpp
	modified:   stub/Makefile
	modified:   stub/arm64-darwin.macho-entry.h
	modified:   stub/arm64-darwin.macho-fold.h
	new file:   stub/arm64-linux.elf-entry.h
	new file:   stub/arm64-linux.elf-fold.h
	new file:   stub/arm64-linux.shlib-init.h
	new file:   stub/src/arch/arm64/v8/Makefile.extra
	modified:   stub/src/arch/arm64/v8/lzma_d-arm.S
	modified:   stub/src/arch/arm64/v8/lzma_d.S
	modified:   stub/src/arch/arm64/v8/lzma_d_cf.S
	new file:   stub/src/arch/arm64/v8/lzma_d_cs.S
	modified:   stub/src/arch/arm64/v8/macros.S
	renamed:    stub/src/arch/arm64/v8/nrv2b_d8.S -> stub/src/arch/arm64/v8/nrv2b_d32.S
	renamed:    stub/src/arch/arm64/v8/nrv2d_d8.S -> stub/src/arch/arm64/v8/nrv2d_d32.S
	modified:   stub/src/arch/arm64/v8/nrv2e_d32.S
	deleted:    stub/src/arch/arm64/v8/nrv2e_d8.S
	modified:   stub/src/arm64-darwin.macho-entry.S
	modified:   stub/src/arm64-darwin.macho-fold.S
	new file:   stub/src/arm64-linux.elf-entry.S
	new file:   stub/src/arm64-linux.elf-fold.S
	new file:   stub/src/arm64-linux.elf-fold.lds
	new file:   stub/src/arm64-linux.elf-main.c
	new file:   stub/src/arm64-linux.shlib-init.S
	modified:   stub/src/include/linux.h
	modified:   stub/tmp/arm64-darwin.macho-entry.bin.dump
	modified:   stub/tmp/arm64-darwin.macho-fold.map
	new file:   stub/tmp/arm64-linux.elf-entry.bin.dump
	new file:   stub/tmp/arm64-linux.elf-fold.map
	new file:   stub/tmp/arm64-linux.shlib-init.bin.dump
2017-03-26 13:10:26 -07:00
John Reiser 6adb3dc142 BUILD_TYPE_DEBUG ?= 0 2017-03-26 13:03:49 -07:00
John Reiser 0e154cc759 Hint when need DT_INIT for shared library
https://github.com/upx/upx/issues/74
	modified:   p_lx_elf.cpp
2017-03-25 20:22:04 -07:00
John Reiser 9dce8d9bce Separate from amd64/bxx.S
modified:   stub/src/arch/amd64/bxx.S
2017-03-25 20:14:48 -07:00
John Reiser 0aa3b9c487 Revise comment
modified:   stub/src/arch/amd64/bxx.S
2017-03-25 20:10:50 -07:00
John Reiser dc7ab3ed30 sync git branch
modified:   stub/amd64-win64.pep.h
	modified:   stub/tmp/amd64-win64.pep.bin.dump
2017-03-25 20:08:29 -07:00
John Reiser 254259b354 Fix comment
modified:   stub/src/arch/amd64/bxx.S
2017-03-25 20:05:32 -07:00
John Reiser 9651c70efd Revert powerpc-linux.elf-fold.S
modified:   stub/src/powerpc-linux.elf-fold.S
2017-03-25 17:51:32 -07:00
John Reiser 5840190ed5 Revert xstrip.py
modified:   stub/scripts/xstrip.py
2017-03-25 17:50:06 -07:00
John Reiser a807b88694 BUILD_TYPE_DEBUG ?= 1
modified:   Makefile
2017-03-25 17:40:24 -07:00
John Reiser 0db82e09e9 Suggest fix for missing DT_INIT in shared library.
modified:   p_lx_elf.cpp
2017-03-25 17:39:47 -07:00
John Reiser e5865f171a xstrip.py: *.bindump was unused; clear e_shnum, e_shstrndx
Also allow other compilers for powerpc64le and arm64: loosen checking.
	modified:   stub/Makefile
	modified:   stub/scripts/xstrip.py

	modified:   stub/amd64-darwin.dylib-entry.h
	modified:   stub/amd64-darwin.macho-entry.h
	modified:   stub/amd64-linux.elf-entry.h
	modified:   stub/amd64-linux.kernel.vmlinux.h
	modified:   stub/amd64-linux.shlib-init.h
	modified:   stub/amd64-win64.pep.h
	modified:   stub/arm.v4a-linux.elf-entry.h
	modified:   stub/arm.v4a-wince.pe.h
	modified:   stub/arm.v4t-wince.pe.h
	modified:   stub/arm.v5a-darwin.macho-entry.h
	modified:   stub/arm.v5a-linux.elf-entry.h
	modified:   stub/arm.v5a-linux.kernel.vmlinux.h
	modified:   stub/arm.v5a-linux.kernel.vmlinuz.h
	modified:   stub/arm.v5a-linux.shlib-init.h
	modified:   stub/arm.v5t-linux.shlib-init.h
	modified:   stub/arm64-darwin.macho-entry.h
	modified:   stub/armeb.v4a-linux.elf-entry.h
	modified:   stub/armeb.v5a-linux.kernel.vmlinux.h
	modified:   stub/i086-dos16.com.h
	modified:   stub/i086-dos16.exe.h
	modified:   stub/i086-dos16.sys.h
	modified:   stub/i386-bsd.elf-entry.h
	modified:   stub/i386-bsd.elf.execve-entry.h
	modified:   stub/i386-darwin.dylib-entry.h
	modified:   stub/i386-darwin.macho-entry.h
	modified:   stub/i386-dos32.djgpp2.h
	modified:   stub/i386-dos32.tmt.h
	modified:   stub/i386-dos32.watcom.le.h
	modified:   stub/i386-linux.elf-entry.h
	modified:   stub/i386-linux.elf.execve-entry.h
	modified:   stub/i386-linux.elf.interp-entry.h
	modified:   stub/i386-linux.elf.shell-entry.h
	modified:   stub/i386-linux.kernel.vmlinux.h
	modified:   stub/i386-linux.kernel.vmlinuz.h
	modified:   stub/i386-linux.shlib-init.h
	modified:   stub/i386-netbsd.elf-entry.h
	modified:   stub/i386-win32.pe.h
	modified:   stub/m68k-atari.tos.h
	modified:   stub/mips.r3000-linux.elf-entry.h
	modified:   stub/mipsel.r3000-linux.elf-entry.h
	modified:   stub/mipsel.r3000-ps1.h
	modified:   stub/powerpc-darwin.dylib-entry.h
	modified:   stub/powerpc-darwin.macho-entry.h
	modified:   stub/powerpc-linux.elf-entry.h
	modified:   stub/powerpc-linux.kernel.vmlinux.h
	modified:   stub/powerpc64le-darwin.dylib-entry.h
	modified:   stub/powerpc64le-darwin.macho-entry.h
	modified:   stub/powerpc64le-linux.elf-entry.h
	modified:   stub/powerpc64le-linux.kernel.vmlinux.h
2017-03-25 17:09:16 -07:00
John Reiser 166d198dcb Default BUILD_TYPE_DEBUG
modified:   Makefile
2017-03-25 16:54:26 -07:00
John Reiser 445795f2ec Sync testsuite for 32-bit powerpc lzma
modified:   ../.github/travis_testsuite_1.sh
2017-03-25 16:50:38 -07:00
John Reiser 6be4a87dac Revert "testsuite "set -x""
This reverts commit fbe4d287c7.

	modified:   .github/travis_testsuite_1.sh
2017-03-25 16:38:30 -07:00
John Reiser 17c47053d6 Revert amd64/bxx.S to reduce churn of testsuite
modified:   stub/src/arch/amd64/bxx.S

	modified:   stub/amd64-darwin.dylib-entry.h
	modified:   stub/amd64-darwin.macho-entry.h
	modified:   stub/amd64-darwin.macho-fold.h
	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/amd64-linux.shlib-init.h
	modified:   stub/amd64-win64.pep.h
2017-03-25 16:34:01 -07:00
John Reiser b4e18f7521 Remove debugging straggler.
modified:   src/powerpc-linux.elf-fold.S

	modified:   powerpc-linux.elf-fold.h
	modified:   tmp/powerpc-linux.elf-fold.map
2017-03-25 15:48:18 -07:00
John Reiser fbe4d287c7 testsuite "set -x"
modified:   ../.github/travis_testsuite_1.sh
2017-03-25 14:52:08 -07:00
John Reiser 543fa3ae79 Revert PackLinuxElf32::unpack() for decompression of armeb-linux.elf/upx-3.91
Conflicting with https://github.com/upx/upx/issues/73
	modified:   p_lx_elf.cpp
2017-03-25 12:52:20 -07:00
John Reiser 7cf855413c Sync testuite checksums (powerpc)
modified:   ../.github/travis_testsuite_1.sh
2017-03-25 09:12:56 -07:00
John Reiser f5d65dc0bc arm64 unfilter
modified:   stub/src/arm64-linux.elf-fold.S

	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/tmp/arm64-linux.elf-fold.map
2017-03-24 13:55:54 -07:00
John Reiser 2f6211a1d9 xstrip.py slight improvement for powerpc64le and arm64
modified:   stub/scripts/xstrip.py
2017-03-24 10:54:56 -07:00
John Reiser 513a57330a xstrip.py: *.bindump was unused; clear e_shnum, e_shstrndx
modified:   stub/scripts/xstrip.py
	modified:   stub/Makefile

	modified:   stub/amd64-darwin.dylib-entry.h
	modified:   stub/amd64-darwin.macho-entry.h
	modified:   stub/amd64-linux.elf-entry.h
	modified:   stub/amd64-linux.kernel.vmlinux.h
	modified:   stub/amd64-linux.shlib-init.h
	modified:   stub/amd64-win64.pep.h
	modified:   stub/arm.v4a-linux.elf-entry.h
	modified:   stub/arm.v4a-wince.pe.h
	modified:   stub/arm.v4t-wince.pe.h
	modified:   stub/arm.v5a-darwin.macho-entry.h
	modified:   stub/arm.v5a-linux.elf-entry.h
	modified:   stub/arm.v5a-linux.kernel.vmlinux.h
	modified:   stub/arm.v5a-linux.kernel.vmlinuz.h
	modified:   stub/arm.v5a-linux.shlib-init.h
	modified:   stub/arm.v5t-linux.shlib-init.h
	modified:   stub/arm64-darwin.macho-entry.h
	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/arm64-linux.shlib-init.h
	modified:   stub/armeb.v4a-linux.elf-entry.h
	modified:   stub/armeb.v5a-linux.kernel.vmlinux.h
	modified:   stub/i086-dos16.com.h
	modified:   stub/i086-dos16.exe.h
	modified:   stub/i086-dos16.sys.h
	modified:   stub/i386-bsd.elf-entry.h
	modified:   stub/i386-bsd.elf.execve-entry.h
	modified:   stub/i386-darwin.dylib-entry.h
	modified:   stub/i386-darwin.macho-entry.h
	modified:   stub/i386-dos32.djgpp2.h
	modified:   stub/i386-dos32.tmt.h
	modified:   stub/i386-dos32.watcom.le.h
	modified:   stub/i386-linux.elf-entry.h
	modified:   stub/i386-linux.elf.execve-entry.h
	modified:   stub/i386-linux.elf.interp-entry.h
	modified:   stub/i386-linux.elf.shell-entry.h
	modified:   stub/i386-linux.kernel.vmlinux.h
	modified:   stub/i386-linux.kernel.vmlinuz.h
	modified:   stub/i386-linux.shlib-init.h
	modified:   stub/i386-netbsd.elf-entry.h
	modified:   stub/i386-win32.pe.h
	modified:   stub/m68k-atari.tos.h
	modified:   stub/mips.r3000-linux.elf-entry.h
	modified:   stub/mipsel.r3000-linux.elf-entry.h
	modified:   stub/mipsel.r3000-ps1.h
	modified:   stub/powerpc-darwin.dylib-entry.h
	modified:   stub/powerpc-darwin.macho-entry.h
	modified:   stub/powerpc-linux.elf-entry.h
	modified:   stub/powerpc-linux.kernel.vmlinux.h
	modified:   stub/powerpc64le-darwin.dylib-entry.h
	modified:   stub/powerpc64le-darwin.macho-entry.h
	modified:   stub/powerpc64le-linux.elf-entry.h
	modified:   stub/powerpc64le-linux.kernel.vmlinux.h
2017-03-24 09:26:40 -07:00
John Reiser 715ddf0620 arm64 hacking
modified:   stub/src/arch/arm64/v8/macros.S
	new file:   stub/src/arch/arm64/v8/Makefile.extra
	modified:   stub/src/arch/arm64/v8/lzma_d-arm.S
	modified:   stub/src/arch/arm64/v8/lzma_d.S
	modified:   stub/src/arch/arm64/v8/lzma_d_cf.S
	new file:   stub/src/arch/arm64/v8/lzma_d_cs.S
	modified:   stub/src/arm64-darwin.macho-entry.S

	modified:   stub/arm64-darwin.macho-entry.h
	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/arm64-linux.shlib-init.h
	modified:   stub/tmp/arm64-darwin.macho-entry.bin.dump
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm64-linux.shlib-init.bin.dump
2017-03-23 20:32:41 -07:00
John Reiser 6bb31e276e Merge branch 'devel' into jreiser 2017-03-23 13:27:09 -07:00
John Reiser b10f1df49f Merge branch 'devel' of https://github.com/upx/upx into devel 2017-03-23 13:09:59 -07:00
John Reiser f999519b13 Sync stubs for 32-bit powerpc
modified:   stub/src/arch/powerpc/32/Makefile.extra
	modified:   stub/src/arch/powerpc/32/lzma_d_cf.S
	modified:   stub/src/arch/powerpc/32/lzma_d_cs.S

	modified:   stub/powerpc-darwin.dylib-entry.h
	modified:   stub/powerpc-darwin.macho-entry.h
	modified:   stub/powerpc-linux.elf-entry.h
	modified:   stub/powerpc-linux.kernel.vmlinux.h
2017-03-23 13:08:36 -07:00
Markus F.X.J. Oberhumer aedbf02830 p_lx_elf.cpp: silence a clang-4.0 compilation warning. 2017-03-23 17:43:23 +01:00
John Reiser bd5479b250 arm64 omit "dc zva," while valgrind complains
modified:   src/arm64-linux.elf-entry.S
	modified:   src/arm64-linux.elf-fold.S

	modified:   arm64-linux.elf-entry.h
	modified:   arm64-linux.elf-fold.h
	modified:   tmp/arm64-linux.elf-entry.bin.dump
	modified:   tmp/arm64-linux.elf-fold.map
2017-03-23 09:12:35 -07:00
Markus F.X.J. Oberhumer 9d14715652 Update Travis. 2017-03-23 13:00:42 +01:00
Thierry Fauck 72156fcf1b powerpc64le: support for -fpie compiled binaries
Signed-off-by: Thierry Fauck <tfauck@free.fr>

	modified:   powerpc64le-linux.elf-fold.h
	modified:   src/powerpc64le-linux.elf-fold.S
	modified:   src/powerpc64le-linux.elf-main.c
	modified:   tmp/powerpc64le-linux.elf-fold.map
2017-03-23 11:21:50 +01:00
Markus F.X.J. Oberhumer 1c6eab00d1 Update Travis. 2017-03-23 04:20:29 +01:00
Markus F.X.J. Oberhumer f9738c5b55 New ACC version. 2017-03-23 01:17:33 +01:00
John Reiser 3b63083619 Cleanup powerpc64 stubs
modified:   stub/src/powerpc64le-darwin.macho-fold.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S

	modified:   stub/powerpc64le-darwin.macho-fold.h
	modified:   stub/powerpc64le-linux.elf-entry.h
	modified:   stub/tmp/powerpc64le-darwin.macho-fold.map
	modified:   stub/tmp/powerpc64le-linux.elf-entry.bin.dump
2017-03-22 16:50:52 -07:00
John Reiser d5d7d8bc84 arm64 hacking
modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/arm64-linux.elf-main.c

	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/tmp/arm64-linux.elf-fold.map
2017-03-22 16:45:09 -07:00
John Reiser f26118cf5a lzma for powerpc64le: -Os needs _restgpr0_*
modified:   stub/src/arch/powerpc/64le/Makefile.extra
	modified:   stub/src/arch/powerpc/64le/ppc_regs.h
	modified:   stub/src/powerpc64-savegpr0.S

	modified:   stub/powerpc64le-darwin.dylib-entry.h
	modified:   stub/powerpc64le-darwin.macho-entry.h
	modified:   stub/powerpc64le-linux.elf-entry.h
	modified:   stub/powerpc64le-linux.kernel.vmlinux.h
	modified:   stub/src/arch/powerpc/64le/lzma_d_cf.S
	modified:   stub/src/arch/powerpc/64le/lzma_d_cs.S
	modified:   stub/tmp/powerpc64le-darwin.dylib-entry.bin.dump
	modified:   stub/tmp/powerpc64le-darwin.macho-entry.bin.dump
	modified:   stub/tmp/powerpc64le-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc64le-linux.kernel.vmlinux.bin.dump
2017-03-22 14:17:40 -07:00
John Reiser 5d6c4b475c preloc
modified:   stub/src/arm64-linux.elf-main.c
2017-03-22 09:03:13 -07:00
John Reiser 2c4ef392f6 arm64-linux hacking; returns from upx_main(), only launch remains!
modified:   stub/src/arch/arm64/v8/lzma_d.S
	modified:   stub/src/arch/arm64/v8/nrv2b_d32.S
	modified:   stub/src/arch/arm64/v8/nrv2d_d32.S
	modified:   stub/src/arch/arm64/v8/nrv2e_d32.S
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/arm64-linux.elf-main.c

	modified:   stub/arm64-darwin.macho-entry.h
	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/arm64-linux.shlib-init.h
	modified:   stub/tmp/arm64-darwin.macho-entry.bin.dump
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm64-linux.elf-fold.map
	modified:   stub/tmp/arm64-linux.shlib-init.bin.dump
2017-03-21 21:54:49 -07:00
John Reiser 2a128fe772 Work on arm64 decompression
renamed:    stub/src/arch/arm64/v8/nrv2b_d8.S -> stub/src/arch/arm64/v8/nrv2b_d32.S
	renamed:    stub/src/arch/arm64/v8/nrv2d_d8.S -> stub/src/arch/arm64/v8/nrv2d_d32.S
	modified:   stub/src/arch/arm64/v8/nrv2e_d32.S
	deleted:    stub/src/arch/arm64/v8/nrv2e_d8.S
	modified:   stub/src/arm64-darwin.macho-entry.S
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/arm64-linux.shlib-init.S

	modified:   stub/arm64-darwin.macho-entry.h
	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/arm64-linux.shlib-init.h
	modified:   stub/tmp/arm64-darwin.macho-entry.bin.dump
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm64-linux.elf-fold.map
	modified:   stub/tmp/arm64-linux.shlib-init.bin.dump
2017-03-20 21:23:15 -07:00
John Reiser bb7d3ca3a1 Fix PackLinuxElf32::unpack() for shared library?
modified:   p_lx_elf.cpp
2017-03-20 21:21:46 -07:00
John Reiser a2bdba7eda arm64 cache flogging at initial move
modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
2017-03-14 21:36:18 -07:00
John Reiser e8aabc9980 R_AARCH64_CONDBR19
modified:   linker.cpp
2017-03-14 21:35:01 -07:00
John Reiser 9f554a14fd ARM64 hacking
modified:   p_lx_elf.cpp
	modified:   stub/src/arch/arm64/v8/macros.S
	modified:   stub/src/arm64-darwin.macho-fold.S
	modified:   stub/src/arm64-linux.elf-entry.S

	modified:   stub/arm64-darwin.macho-entry.h
	modified:   stub/arm64-darwin.macho-fold.h
	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/tmp/arm64-darwin.macho-fold.map
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm64-linux.elf-fold.map
2017-03-14 20:08:28 -07:00
John Reiser 68a2b91ccb arm64 filter, relocation, defineSymbols
modified:   Makefile
	modified:   bele.h
	modified:   filter/ct.h
	modified:   filteri.cpp
	modified:   linker.cpp
	modified:   miniacc.h
	modified:   p_lx_elf.cpp
	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/src/arm64-linux.elf-entry.S
2017-03-05 21:05:13 -08:00
John Reiser 4089cc6e6f arm64-linux compiles
modified:   conf.h
	modified:   linker.cpp
	modified:   linker.h
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   packmast.cpp
	modified:   stub/Makefile
	new file:   stub/arm64-linux.shlib-init.h
	new file:   stub/src/arm64-linux.shlib-init.S
	new file:   stub/tmp/arm64-linux.elf-entry.bin.dump
	new file:   stub/tmp/arm64-linux.elf-fold.map
	new file:   stub/tmp/arm64-linux.shlib-init.bin.dump
2017-03-05 18:07:29 -08:00
John Reiser 4e8848eeca Merge branch 'devel' into jreiser
Conflicts:
	src/stub/amd64-win64.pep.h
	src/stub/powerpc-linux.elf-entry.h
	src/stub/powerpc-linux.elf-fold.h
	src/stub/src/amd64-win64.pep.S
	src/stub/src/arch/powerpc/32/ppc_regs.h
	src/stub/src/arch/powerpc/64le/lzma_d.S
	src/stub/src/powerpc-linux.elf-entry.S
	src/stub/src/powerpc64le-darwin.dylib-entry.S
	src/stub/src/powerpc64le-darwin.macho-entry.S
	src/stub/src/powerpc64le-linux.elf-entry.S
	src/stub/src/powerpc64le-linux.kernel.vmlinux.S
	src/stub/tmp/amd64-win64.pep.bin.dump
	src/stub/tmp/powerpc-linux.elf-entry.bin.dump
	src/stub/tmp/powerpc-linux.elf-fold.map

	modified:   ../../.github/travis_testsuite_1.sh
	modified:   ../p_lx_elf.cpp
	modified:   ../p_unix.cpp
	modified:   ../p_unix.h
	modified:   amd64-win64.pep.h
	modified:   arm.v4a-linux.elf-fold.h
	modified:   arm.v5a-linux.elf-fold.h
	modified:   armeb.v4a-linux.elf-fold.h
	modified:   powerpc-darwin.dylib-entry.h
	modified:   powerpc-darwin.macho-entry.h
	copied:     powerpc-darwin.dylib-entry.h -> powerpc-linux.elf-entry.h
	modified:   powerpc-linux.elf-fold.h
	modified:   powerpc-linux.kernel.vmlinux.h
	modified:   powerpc64le-linux.elf-fold.h
	modified:   src/amd64-win64.pep.S
	modified:   src/arch/powerpc/32/bxx.S
	modified:   src/arch/powerpc/32/lzma_d.S
	modified:   src/arch/powerpc/32/nrv2d_d.S
	modified:   src/arch/powerpc/32/nrv2e_d.S
	modified:   src/arch/powerpc/32/ppc_regs.h
	modified:   src/arch/powerpc/64le/bxx.S
	modified:   src/arch/powerpc/64le/lzma_d.S
	modified:   src/arch/powerpc/64le/nrv2b_d.S
	modified:   src/arch/powerpc/64le/nrv2d_d.S
	modified:   src/arch/powerpc/64le/nrv2e_d.S
	modified:   src/arm.v4a-linux.elf-fold.S
	modified:   src/powerpc-darwin.macho-fold.S
	modified:   src/powerpc-linux.elf-entry.S
	modified:   src/powerpc-linux.elf-fold.S
	modified:   src/powerpc64le-darwin.dylib-entry.S
	modified:   src/powerpc64le-darwin.macho-entry.S
	modified:   src/powerpc64le-darwin.macho-fold.S
	modified:   src/powerpc64le-linux.elf-entry.S
	modified:   src/powerpc64le-linux.elf-fold.S
	modified:   src/powerpc64le-linux.kernel.vmlinux.S
	modified:   tmp/amd64-win64.pep.bin.dump
	modified:   tmp/arm.v4a-linux.elf-fold.map
	modified:   tmp/arm.v5a-linux.elf-fold.map
	modified:   tmp/armeb.v4a-linux.elf-fold.map
	modified:   tmp/powerpc-darwin.dylib-entry.bin.dump
	modified:   tmp/powerpc-darwin.macho-entry.bin.dump
	modified:   tmp/powerpc-linux.elf-entry.bin.dump
	modified:   tmp/powerpc-linux.elf-fold.map
	modified:   tmp/powerpc-linux.kernel.vmlinux.bin.dump
2017-03-01 08:14:13 -08:00
John Reiser 8c6133c115 Decompression stubs for arm64-linux (aarch)
modified:   stub/Makefile
	modified:   stub/arm64-darwin.macho-entry.h
	modified:   stub/arm64-darwin.macho-fold.h
	new file:   stub/arm64-linux.elf-entry.h
	new file:   stub/arm64-linux.elf-fold.h
	modified:   stub/scripts/xstrip.py
	modified:   stub/src/arch/arm64/v8/macros.S
	modified:   stub/src/arch/arm64/v8/nrv2b_d8.S
	modified:   stub/src/arch/arm64/v8/nrv2d_d8.S
	modified:   stub/src/arch/arm64/v8/nrv2e_d8.S
	new file:   stub/src/arm64-linux.elf-entry.S
	new file:   stub/src/arm64-linux.elf-fold.S
	new file:   stub/src/arm64-linux.elf-fold.lds
	new file:   stub/src/arm64-linux.elf-main.c
	modified:   stub/src/include/linux.h
2017-03-01 05:47:03 -08:00
John Reiser 483db31acd arm: Preserve 8-byte alignment of stack pointer
https://github.com/upx/upx/issues/60  (partial)
	modified:   stub/src/arm.v4a-linux.elf-fold.S

	modified:   ../.github/travis_testsuite_1.sh
	modified:   stub/arm.v4a-linux.elf-fold.h
	modified:   stub/arm.v5a-linux.elf-fold.h
	modified:   stub/armeb.v4a-linux.elf-fold.h
	modified:   stub/tmp/arm.v4a-linux.elf-fold.map
	modified:   stub/tmp/arm.v5a-linux.elf-fold.map
	modified:   stub/tmp/armeb.v4a-linux.elf-fold.map
2017-02-14 20:36:45 -08:00
John Reiser 35dae3dab7 PowerPC 32-bit lzma stub defends against omitted linkage area.
https://github.com/upx/upx/issues/60
	modified:   stub/src/arch/powerpc/32/lzma_d.S
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S

	modified:   stub/powerpc-darwin.dylib-entry.h
	modified:   stub/powerpc-darwin.macho-entry.h
 [WTF?]	copied:     stub/powerpc-darwin.dylib-entry.h -> stub/powerpc-linux.elf-entry.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/powerpc-linux.kernel.vmlinux.h

	modified:   stub/tmp/powerpc-linux.elf-fold.map
	modified:   stub/tmp/powerpc-darwin.dylib-entry.bin.dump
	modified:   stub/tmp/powerpc-darwin.macho-entry.bin.dump
	modified:   stub/tmp/powerpc-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc-linux.kernel.vmlinux.bin.dump

	modified:   ../.github/travis_testsuite_1.sh
2017-02-12 16:23:57 -08:00
John Reiser 8232aedf78 unpackExtent() segregates rewrite() from write()
Fix the reported output file size when un-compressing.
Part of https://github.com/upx/upx/issues/60
	modified:   p_lx_elf.cpp
	modified:   p_unix.cpp
	modified:   p_unix.h
2017-02-11 15:26:27 -08:00
László Molnár d30a0a2e67 updated filter invocation in win64/pe 2017-02-06 14:31:16 +01:00
John Reiser d913fe508f Remove debugging jig
modified:   ../.github/travis_testsuite_1.sh
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/tmp/powerpc-linux.elf-fold.map
2017-02-05 15:41:52 -08:00
John Reiser 4029903301 Sync testsuite
modified:   ../.github/travis_testsuite_1.sh
2017-02-05 15:14:11 -08:00
John Reiser 5db7e826d3 Find and use AT_PAGESZ; forward from -entry to -fold.
Cleanup the runtime choice of PAGE_SIZE 4K or 64K
	modified:   stub/powerpc-linux.elf-entry.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/src/arch/powerpc/32/ppc_regs.h
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/tmp/powerpc-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc-linux.elf-fold.map
2017-02-05 15:02:31 -08:00
John Reiser 7f3e7da7c7 Stubs LZMA_DEC00 and LZMA_ELF00 fall through; no "+80C" alignment.
https://github.com/upx/upx/issues/60  (partial)
addStubEntrySections() and getDecompressorSections()
	modified:   p_lx_elf.cpp
	modified:   p_mach.cpp
	modified:   packer_c.cpp
2017-02-05 14:52:09 -08:00
John Reiser 93cefde8fc Allow __PAGEZERO.vmsize to be 0x1000 on x86_64, as for "go"-language.
https://github.com/upx/upx/issues/59
	modified:   p_mach.cpp
	modified:   p_mach.h
2017-02-05 14:50:08 -08:00
John Reiser 02e7981e10 Merge and fix conflics
Conflicts:
	src/stub/src/arch/powerpc/64le/lzma_d.S
	src/stub/src/powerpc64le-darwin.dylib-entry.S
	src/stub/src/powerpc64le-darwin.macho-entry.S
	src/stub/src/powerpc64le-linux.elf-entry.S
	src/stub/src/powerpc64le-linux.kernel.vmlinux.S

	modified:   stub/src/arch/powerpc/32/lzma_d.S
2017-02-05 14:41:15 -08:00
John Reiser 0ecec10af0 Sync stubs and testsuite.
modified:   ../.github/travis_testsuite_1.sh
	modified:   stub/powerpc-linux.elf-entry.h
2017-02-05 14:26:18 -08:00
John Reiser 00b8cba987 typos
modified:   stub/src/powerpc-linux.elf-entry.S
2017-02-05 14:18:05 -08:00
John Reiser 8486bff918 PowerPC compare instructions: make cr0 explicit, put width ('w' or 'd') into mnemonic.
Easier to understand, caught a couple bugs in width.
	modified:   stub/powerpc-linux.elf-entry.h
	modified:   stub/powerpc64le-darwin.dylib-entry.h
	modified:   stub/powerpc64le-darwin.macho-entry.h
	modified:   stub/powerpc64le-linux.elf-entry.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.kernel.vmlinux.h
	modified:   stub/src/arch/powerpc/32/bxx.S
	modified:   stub/src/arch/powerpc/32/nrv2d_d.S
	modified:   stub/src/arch/powerpc/32/nrv2e_d.S
	modified:   stub/src/arch/powerpc/64le/bxx.S
	modified:   stub/src/arch/powerpc/64le/lzma_d.S
	modified:   stub/src/arch/powerpc/64le/nrv2b_d.S
	modified:   stub/src/arch/powerpc/64le/nrv2d_d.S
	modified:   stub/src/arch/powerpc/64le/nrv2e_d.S
	modified:   stub/src/powerpc-darwin.macho-fold.S
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc64le-darwin.dylib-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-fold.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.kernel.vmlinux.S
2017-02-05 14:00:19 -08:00
John Reiser 5305eb5b8a Sync stubs
modified:   stub/amd64-darwin.dylib-entry.h
	modified:   stub/amd64-darwin.macho-entry.h
	modified:   stub/amd64-darwin.macho-fold.h
	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/amd64-linux.shlib-init.h
	modified:   stub/amd64-win64.pep.h
	modified:   stub/powerpc-linux.elf-entry.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/powerpc64le-darwin.dylib-entry.h
	modified:   stub/powerpc64le-darwin.macho-entry.h
	modified:   stub/powerpc64le-linux.elf-entry.h
	modified:   stub/powerpc64le-linux.kernel.vmlinux.h
	modified:   stub/src/arch/powerpc/64le/lzma_d.S
	modified:   stub/src/powerpc64le-darwin.dylib-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-entry.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.kernel.vmlinux.S
	modified:   stub/tmp/amd64-win64.pep.bin.dump
	modified:   stub/tmp/powerpc-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc-linux.elf-fold.map
2017-02-05 13:37:01 -08:00
John Reiser 377a3bb7de More register definitions
modified:   stub/src/arch/powerpc/32/ppc_regs.h
2017-02-05 13:32:54 -08:00
John Reiser 5a47e8d2c6 Find and use AT_PAGESZ
modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
2017-02-05 13:31:17 -08:00
John Reiser 71f4cd7c85 Fix register usage conventions for amd64 unfilter
modified:   stub/src/amd64-win64.pep.S
	modified:   stub/src/arch/amd64/bxx.S
2017-02-05 13:29:59 -08:00
John Reiser f7751684af Stubs LZMA_DEC00 and LZMA_ELF00 fall through; no "+80C" alignment.
addStubEntrySections() and getDecompressorSections()
	modified:   p_lx_elf.cpp
	modified:   p_mach.cpp
	modified:   packer_c.cpp
2017-02-05 13:26:02 -08:00
John Reiser 59df1d39b2 Merge pull request #61 from tfauck/devel-thf
Following #51 pull with rerequested changes
2017-02-04 09:10:24 -08:00
John Reiser 7e5933e6a0 Merge branch 'devel' into devel-thf 2017-02-04 08:42:10 -08:00
John Reiser 2cefd34bb7 Allow __PAGEZERO.vmsize to be 0x1000 on x86_64, as for "go"-language.
https://github.com/upx/upx/issues/59
	modified:   p_mach.cpp
	modified:   p_mach.h
2017-02-03 15:12:40 -08:00
Thierry Fauck eac891dc3a Typo in .bss bzeroing
Rebuild of powerpc64le stubs

Signed-off-by: Thierry Fauck <tfauck@free.fr>

	modified:   stub/powerpc64le-darwin.dylib-entry.h
	modified:   stub/powerpc64le-darwin.macho-entry.h
	modified:   stub/powerpc64le-linux.elf-entry.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.kernel.vmlinux.h
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.elf-main.c
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
2017-02-03 10:57:05 +01:00
Thierry Fauck abd3599408 Explicitely specify cmp instructions to be 32 bits or 64bits on powerpc
(Thanks to John Reiser).

Signed-off-by: Thierry Fauck <tfauck@free.fr>

	modified:   src/arch/powerpc/32/bxx.S
	modified:   src/arch/powerpc/32/lzma_d.S
	modified:   src/arch/powerpc/64le/bxx.S
	modified:   src/arch/powerpc/64le/lzma_d.S
	modified:   src/arch/powerpc/64le/nrv2b_d.S
	modified:   src/arch/powerpc/64le/nrv2d_d.S
	modified:   src/arch/powerpc/64le/nrv2e_d.S
	modified:   src/powerpc64le-darwin.dylib-entry.S
	modified:   src/powerpc64le-darwin.macho-entry.S
	modified:   src/powerpc64le-darwin.macho-fold.S
	modified:   src/powerpc64le-linux.elf-entry.S
	modified:   src/powerpc64le-linux.elf-fold.S
	modified:   src/powerpc64le-linux.kernel.vmlinux.S
2017-02-03 10:55:14 +01:00
John Reiser 1bcd259c00 Merge branch 'devel' of https://github.com/upx/upx into devel 2017-02-01 17:17:31 -08:00
Thierry Fauck c4e835266c Typo in .bss bzeroing
Signed-off-by: Thierry Fauck <tfauck@free.fr>

	modified:   src/stub/powerpc64le-linux.elf-fold.h
	modified:   src/stub/src/powerpc64le-linux.elf-fold.S
	modified:   src/stub/src/powerpc64le-linux.elf-main.c
	modified:   src/stub/tmp/powerpc64le-linux.elf-fold.map
2017-01-30 18:53:34 +01:00
Thierry Fauck 685953f6a5 Explicitely specify cmp instructions to be 32 bits or 64bits on powerpc
Signed-off-by: Thierry Fauck <tfauck@free.fr>

	modified:   stub/src/arch/powerpc/32/bxx.S
	modified:   stub/src/arch/powerpc/64le/bxx.S
	modified:   stub/src/arch/powerpc/64le/lzma_d.S
	modified:   stub/src/arch/powerpc/64le/nrv2b_d.S
	modified:   stub/src/arch/powerpc/64le/nrv2d_d.S
	modified:   stub/src/arch/powerpc/64le/nrv2e_d.S
	modified:   stub/src/powerpc64le-darwin.dylib-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-fold.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.kernel.vmlinux.S
2017-01-30 00:34:45 +01:00
John Reiser 03fffbc724 Re-base to upx-3.93
modified:   src/stub/src/arch/amd64/bxx.S
2017-01-29 06:58:03 -08:00
Markus F.X.J. Oberhumer e1a8c932ee Cleanup snprintf.cpp. 2017-01-29 14:11:46 +01:00
Markus F.X.J. Oberhumer 1aa2a6b054 Add missing src/stub/tmp/*.map files to repo. 2017-01-29 14:10:12 +01:00
Markus F.X.J. Oberhumer 1ad96c9c81 Update testsuite checksums caused by version bump. 2017-01-29 14:08:02 +01:00
Markus F.X.J. Oberhumer f69199909f Post-release version bump. 2017-01-29 14:05:00 +01:00
John Reiser d063e77040 Update checksums for testsuite.
modified:   .github/travis_testsuite_1.sh
2017-01-29 14:01:57 +01:00
John Reiser bf3ddeb1eb Rebuild stubs.
modified:   amd64-darwin.dylib-entry.h
	modified:   amd64-darwin.macho-entry.h
	modified:   amd64-darwin.macho-fold.h
	modified:   amd64-linux.elf-fold.h
	modified:   amd64-linux.kernel.vmlinux.h
	modified:   amd64-linux.shlib-init.h
	modified:   amd64-win64.pep.h
	modified:   i386-bsd.elf-entry.h
	modified:   i386-bsd.elf.execve-entry.h
	modified:   i386-darwin.dylib-entry.h
	modified:   i386-darwin.macho-entry.h
	modified:   i386-dos32.djgpp2.h
	modified:   i386-dos32.tmt.h
	modified:   i386-dos32.watcom.le.h
	modified:   i386-linux.elf-entry.h
	modified:   i386-linux.elf.execve-entry.h
	modified:   i386-linux.elf.interp-entry.h
	modified:   i386-linux.kernel.vmlinux.h
	modified:   i386-linux.kernel.vmlinuz.h
	modified:   i386-linux.shlib-init.h
	modified:   i386-netbsd.elf-entry.h
	modified:   i386-win32.pe.h
	modified:   tmp/amd64-darwin.dylib-entry.bin.dump
	modified:   tmp/amd64-darwin.macho-entry.bin.dump
	modified:   tmp/amd64-linux.shlib-init.bin.dump
	modified:   tmp/amd64-win64.pep.bin.dump
2017-01-29 14:01:57 +01:00
John Reiser fc261ad8cd Smaller by 7 bytes; also slower.
https://github.com/upx/upx/issues/43
	modified:   bxx.S
2017-01-29 14:01:56 +01:00
John Reiser 90fc018295 Avoid sigsegv after "patchelf --set-rpath"
https://github.com/upx/upx/issues/47
Enhancement not yet implemented: non-adjacent ElfXX_Ehdr and ElfXX_Phdr.
	modified:   p_unix.cpp
2017-01-29 14:01:56 +01:00
John Reiser cdc01d9a69 linux.sh/i386 interpreter.e_machine must be EM_386; else execve()
https://github.com/upx/upx/issues/53
	modified:   stub/i386-linux.elf.shell-fold.h
	modified:   stub/src/i386-linux.elf.shell-fold.S
	modified:   stub/src/i386-linux.elf.shell-main.c
2017-01-29 14:01:56 +01:00
John Reiser da7e76c07d Document location of checksums for testsuite.
modified:   Makefile
2017-01-29 14:01:56 +01:00
John Reiser ba9118aa58 Bug in unfilter on x86* when region ends in 32-bit displacement.
https://github.com/upx/upx/issues/43
	modified:   stub/src/arch/amd64/bxx.S
	modified:   stub/src/arch/i386/macros.S
	plus all the stubs that use them
2017-01-29 14:01:56 +01:00
519 changed files with 54630 additions and 43704 deletions
+17 -11
View File
@@ -3,6 +3,11 @@
os: Visual Studio 2015 os: Visual Studio 2015
branches:
except:
- /^gitlab.*/
- /^travis.*/
environment: environment:
global: { TRAVIS_OS_NAME: windows, CROSS: "", C: "", B: release, T: "", X: "" } global: { TRAVIS_OS_NAME: windows, CROSS: "", C: "", B: release, T: "", X: "" }
matrix: matrix:
@@ -14,8 +19,10 @@ environment:
- { C: msvc-12.0-x64, CL_VERSION: 18.00, VS_VERSION: 2013 } - { C: msvc-12.0-x64, CL_VERSION: 18.00, VS_VERSION: 2013 }
- { C: msvc-14.0-x86, CL_VERSION: 19.00, VS_VERSION: 2015 } - { C: msvc-14.0-x86, CL_VERSION: 19.00, VS_VERSION: 2015 }
- { C: msvc-14.0-x64, CL_VERSION: 19.00, VS_VERSION: 2015 } - { C: msvc-14.0-x64, CL_VERSION: 19.00, VS_VERSION: 2015 }
# - { C: gcc-4.9-m32, T: SKIP } - { C: msvc-14.1-x86, CL_VERSION: 19.16, VS_VERSION: 2017, APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 }
# - { C: gcc-4.9-m64, T: SKIP } - { C: msvc-14.1-x64, CL_VERSION: 19.16, VS_VERSION: 2017, APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 }
- { C: msvc-14.2-x86, CL_VERSION: 19.24, VS_VERSION: 2019, APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 }
- { C: msvc-14.2-x64, CL_VERSION: 19.24, VS_VERSION: 2019, APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 }
UPX_AUTOMATIC_BUILDS_SSL_KEY: UPX_AUTOMATIC_BUILDS_SSL_KEY:
secure: PZMpVeqnEYe39kK+Zu2/fnmZ6/HG6Lvls0hh9GMVU9vCWsr8xaU7kIbHBS01puUkb4bEWPILKYvSEDuhOhguDjd/P4QdXWipvV/F2GaVax0= secure: PZMpVeqnEYe39kK+Zu2/fnmZ6/HG6Lvls0hh9GMVU9vCWsr8xaU7kIbHBS01puUkb4bEWPILKYvSEDuhOhguDjd/P4QdXWipvV/F2GaVax0=
UPX_AUTOMATIC_BUILDS_SSL_IV: UPX_AUTOMATIC_BUILDS_SSL_IV:
@@ -23,7 +30,7 @@ environment:
init: init:
- git config --global core.autocrlf input - git config --global core.autocrlf input
- where bash & where cat & where chmod & where cp & where curl & where date & where file & where git & where gzip & where mkdir & where mv & where openssl & where readlink & where rm & where rmdir & where sed & where sha256sum & where sort & where ssh & where ssh-add & where ssh-agent & where ssh-keyscan & where tar - where bash & where cat & where chmod & where cmp & where cp & where curl & where date & where file & where git & where gzip & where mkdir & where mv & where openssl & where readlink & where rm & where rmdir & where sed & where sha256sum & where sort & where ssh & where ssh-add & where ssh-agent & where ssh-keyscan & where tar & where touch
# - bash --version & git --version & sed --version & tar --version # - bash --version & git --version & sed --version & tar --version
- git --version & bash --version - git --version & bash --version
# - dir "c:\Program Files\Git\usr\bin" # - dir "c:\Program Files\Git\usr\bin"
@@ -56,15 +63,13 @@ install:
- if "%C%"=="msvc-12.0-x64" ( call "c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64 ) - if "%C%"=="msvc-12.0-x64" ( call "c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64 )
- if "%C%"=="msvc-14.0-x86" ( call "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 ) - if "%C%"=="msvc-14.0-x86" ( call "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 )
- if "%C%"=="msvc-14.0-x64" ( call "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 ) - if "%C%"=="msvc-14.0-x64" ( call "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 )
- if "%C%"=="msvc-14.1-x86" ( call "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86 )
- if "%C%"=="msvc-14.1-x64" ( call "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64 )
- if "%C%"=="msvc-14.2-x86" ( call "c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x86 )
- if "%C%"=="msvc-14.2-x64" ( call "c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64 )
build_script: build_script:
- cd c:\projects\upx - cd c:\projects\upx
- if "%C%"=="gcc-4.9-m32" set PATH=c:\cygwin\bin;%PATH%
- if "%C%"=="gcc-4.9-m32" bash -x ./.github/travis_build.sh
- if "%C%"=="gcc-4.9-m32" exit
- if "%C%"=="gcc-4.9-m64" set PATH=c:\cygwin\bin;%PATH%
- if "%C%"=="gcc-4.9-m64" bash -x ./.github/travis_build.sh
- if "%C%"=="gcc-4.9-m64" exit
# setup directories following the VPATH build in travis_build.sh # setup directories following the VPATH build in travis_build.sh
- where cl & where link - where cl & where link
- set BDIR=c:\projects\build\%C%\%B% - set BDIR=c:\projects\build\%C%\%B%
@@ -85,7 +90,7 @@ build_script:
- set s=c:\projects\upx\src - set s=c:\projects\upx\src
- cat .GITREV.txt - cat .GITREV.txt
- set /p GITREV=<.GITREV.txt - set /p GITREV=<.GITREV.txt
- cl -MT -EHsc -J -O2 -W4 -DUPX_VERSION_GITREV="""%GITREV%""" %DEFS% -DWITH_LZMA=0x443 -DUCL_NO_ASM -I%s%\lzma-sdk -Ic:\projects\deps\ucl-1.03\include -Ic:\projects\deps\zlib-1.2.8 -Feupx.exe %s%\*.cpp %BDIR%\ucl-1.03\ucl.lib %BDIR%\zlib-1.2.8\zlib.lib - cl -MT -EHsc -J -O2 -W4 -WX -DUPX_VERSION_GITREV="""%GITREV%""" %DEFS% -DUCL_NO_ASM -I%s%\lzma-sdk -Ic:\projects\deps\ucl-1.03\include -Ic:\projects\deps\zlib-1.2.8 -Feupx.exe %s%\*.cpp %BDIR%\ucl-1.03\ucl.lib %BDIR%\zlib-1.2.8\zlib.lib
test_script: test_script:
- set UPX=--no-color --no-progress - set UPX=--no-color --no-progress
@@ -100,6 +105,7 @@ test_script:
# now run the UPX testsuite using bash # now run the UPX testsuite using bash
- cd c:\projects\upx - cd c:\projects\upx
- bash ./.github/travis_testsuite_1.sh - bash ./.github/travis_testsuite_1.sh
- bash ./.github/travis_deploy.sh # info: it seems that ssh is not properly installed/started on the 2019 worker image
- if NOT "%VS_VERSION%"=="2019" ( bash ./.github/travis_deploy.sh )
# vim:set ts=2 sw=2 et: # vim:set ts=2 sw=2 et:
-31
View File
@@ -1,31 +0,0 @@
# Support for Circle CI -- https://circleci.com/gh/upx/upx
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
machine:
environment:
TRAVIS_OS_NAME: linux
CROSS:
C: gcc-4.8-m64
B: release
T:
X:
checkout:
post:
- git submodule update --init --recursive
dependencies:
pre:
- mkdir -p ../deps
- cd ../deps && wget -q -O - https://github.com/upx/upx/releases/download/v3.00/ucl-1.03.tar.xz | tar -xJ
- cd ../deps && wget -q -O - https://github.com/upx/upx/releases/download/v3.00/zlib-1.2.8.tar.xz | tar -xJ
- cd ../deps && git clone https://github.com/upx/upx-testsuite
override:
- mkdir -p ../build/travis
- bash ./.github/travis_build.sh
test:
override:
- bash ./.github/travis_testsuite_1.sh
# vim:set ts=2 sw=2 et:
+3 -1
View File
@@ -1,7 +1,9 @@
# #
# see http://editorconfig.org/ # see https://editorconfig.org/
# #
root = true
[*] [*]
charset = utf-8 charset = utf-8
end_of_line = lf end_of_line = lf
+4 -2
View File
@@ -27,5 +27,7 @@ Just read it and fill in the details we're asking, it saves so much of our time.
## Please tell us details about your environment. ## Please tell us details about your environment.
<!--- Include as many relevant details about the environment you experienced the bug in --> <!--- Include as many relevant details about the environment you experienced the bug in -->
* UPX version used (`upx --version`): * UPX version used (`upx --version`):
* Operating System and version: * Host Operating System and version:
* CPU architecture: * Host CPU architecture:
* Target Operating System and version:
* Target CPU architecture:
+33 -2
View File
@@ -39,10 +39,37 @@ set -x
# #
if [[ $BM_X =~ (^|\+)rebuild-stubs($|\+) ]]; then if [[ $BM_X =~ (^|\+)rebuild-stubs($|\+) ]]; then
if [[ -f "$HOME/local/bin/bin-upx/upx-stubtools-check-version" ]]; then
bin_upx=$(readlink -en -- "$HOME/local/bin/bin-upx")
elif [[ -f "$HOME/.local/bin/bin-upx/upx-stubtools-check-version" ]]; then
bin_upx=$(readlink -en -- "$HOME/.local/bin/bin-upx")
else
bin_upx=$(readlink -en -- "$upx_SRCDIR/../deps/bin-upx-20160918") bin_upx=$(readlink -en -- "$upx_SRCDIR/../deps/bin-upx-20160918")
fi
cd / && cd $upx_SRCDIR || exit 1 cd / && cd $upx_SRCDIR || exit 1
extra_subdirs=()
extra_subdirs+=( src/stub/src/arch/amd64 )
extra_subdirs+=( src/stub/src/arch/arm/v4a )
extra_subdirs+=( src/stub/src/arch/arm/v4t )
extra_subdirs+=( src/stub/src/arch/arm64/v8 )
extra_subdirs+=( src/stub/src/arch/i386 )
extra_subdirs+=( src/stub/src/arch/m68k/m68000 )
extra_subdirs+=( src/stub/src/arch/m68k/m68020 )
extra_subdirs+=( src/stub/src/arch/mips/r3000 )
extra_subdirs+=( src/stub/src/arch/powerpc/32 )
extra_subdirs+=( src/stub/src/arch/powerpc/64 )
extra_subdirs+=( src/stub/src/arch/powerpc/64le )
make -C src/stub maintainer-clean make -C src/stub maintainer-clean
for d in ${extra_subdirs[@]}; do
make -C $d -f Makefile.extra maintainer-clean
git status $d || true
done
git status src/stub/src || true
git status || true
failed=0 failed=0
for d in ${extra_subdirs[@]}; do
PATH="$bin_upx:$PATH" make -C $d -f Makefile.extra || failed=1
done
PATH="$bin_upx:$PATH" make -C src/stub all || failed=1 PATH="$bin_upx:$PATH" make -C src/stub all || failed=1
if [[ $failed != 0 ]]; then if [[ $failed != 0 ]]; then
echo "UPX-ERROR: FATAL: rebuild-stubs failed" echo "UPX-ERROR: FATAL: rebuild-stubs failed"
@@ -54,11 +81,12 @@ if [[ $BM_X =~ (^|\+)rebuild-stubs($|\+) ]]; then
echo "UPX-ERROR: FATAL: rebuild-stubs git status mismatch. See log file." echo "UPX-ERROR: FATAL: rebuild-stubs git status mismatch. See log file."
exit 1 exit 1
fi fi
git status
if [[ $BM_X == rebuild-stubs ]]; then if [[ $BM_X == rebuild-stubs ]]; then
echo "X=rebuild-stubs done. Exiting." echo "X=rebuild-stubs done. Exiting."
exit 0 exit 0
fi fi
unset bin_upx failed unset bin_upx extra_subdirs d failed
fi fi
# #
@@ -66,7 +94,10 @@ fi
# #
cd / && cd $ucl_BUILDDIR || exit 1 cd / && cd $ucl_BUILDDIR || exit 1
if [[ -n $BM_CROSS || $TRAVIS_OS_NAME == windows ]]; then # patch UCL
sed 's/^#elif (ACC_ARCH_AMD64 || ACC_ARCH_IA64)$/& \&\& !defined(__ILP32__)/' $ucl_SRCDIR/acc/acc_chk.ch > a.tmp
if cmp -s a.tmp $ucl_SRCDIR/acc/acc_chk.ch; then rm a.tmp; else mv a.tmp $ucl_SRCDIR/acc/acc_chk.ch; fi
if [[ $BUILD_LOCAL_UCL == 1 ]]; then
# ucl-1.03/configure is too old - build manually # ucl-1.03/configure is too old - build manually
rm -f ./*.o libucl.a rm -f ./*.o libucl.a
$CC -O2 -I$ucl_SRCDIR/include -I$ucl_SRCDIR -c $ucl_SRCDIR/src/*.c $CC -O2 -I$ucl_SRCDIR/include -I$ucl_SRCDIR -c $ucl_SRCDIR/src/*.c
+42 -11
View File
@@ -15,7 +15,7 @@ source "$argv0dir/travis_init.sh" || exit 1
set -x # debug set -x # debug
if [[ $BM_X == rebuild-stubs ]]; then exit 0; fi if [[ $BM_X == rebuild-stubs ]]; then exit 0; fi
# save space # save space and do not deploy debug builds
if [[ $BM_B =~ (^|\+)coverage($|\+) ]]; then exit 0; fi if [[ $BM_B =~ (^|\+)coverage($|\+) ]]; then exit 0; fi
if [[ $BM_B =~ (^|\+)debug($|\+) ]]; then exit 0; fi if [[ $BM_B =~ (^|\+)debug($|\+) ]]; then exit 0; fi
if [[ $BM_B =~ (^|\+)sanitize($|\+) ]]; then exit 0; fi if [[ $BM_B =~ (^|\+)sanitize($|\+) ]]; then exit 0; fi
@@ -35,9 +35,11 @@ else
branch=$TRAVIS_BRANCH branch=$TRAVIS_BRANCH
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then exit 0; fi if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then exit 0; fi
fi fi
subdir=${subdir%%:*}; subdir=${subdir%%/*}; subdir=${subdir%%-*} subdir=${subdir%%:*}; subdir=${subdir%%/*}; subdir=${subdir%%--*}
case $branch in case $branch in
appveyor*) ;;
devel*) ;; devel*) ;;
gitlab*) ;;
master*) ;; master*) ;;
travis*) ;; travis*) ;;
*) exit 0;; *) exit 0;;
@@ -46,7 +48,13 @@ esac
# get $rev, $branch and $git_user # get $rev, $branch and $git_user
cd / && cd $upx_SRCDIR || exit 1 cd / && cd $upx_SRCDIR || exit 1
rev=$(git rev-parse --verify HEAD) rev=$(git rev-parse --verify HEAD)
timestamp=$(git log -n1 --format='%at' HEAD) if [[ "$branch" == gitlab* ]]; then
if git fetch -v origin devel; then
git branch -a -v
rev=$(git merge-base origin/devel $rev || echo $rev)
fi
fi
timestamp=$(git log -n1 --format='%at' $rev)
date=$(TZ=UTC0 date -d "@$timestamp" '+%Y%m%d-%H%M%S') date=$(TZ=UTC0 date -d "@$timestamp" '+%Y%m%d-%H%M%S')
#branch="$branch-$date-${rev:0:6}" #branch="$branch-$date-${rev:0:6}"
# make the branch name a little bit shorter so that it looks nice on GitHub # make the branch name a little bit shorter so that it looks nice on GitHub
@@ -92,9 +100,24 @@ else
[[ $cpu == amd64 ]] && os=win64 [[ $cpu == amd64 ]] && os=win64
fi fi
d=$cpu-$os d=$cpu-$os
unset cpu os
fi fi
d=$d-$BM_C-$BM_B d=$d-$BM_C-$BM_B
# remove redundant -m32/-m64/-x86/-x64 from directory name
if [[ $d =~ ^((i386-darwin|i386-linux|i386-win32).*)(-m32|-x86)(-.+)?$ ]]; then
d="${BASH_REMATCH[1]}${BASH_REMATCH[4]}"
fi
if [[ $d =~ ^((amd64-darwin|amd64-linux|amd64-win64).*)(-m64|-x64)(-.+)?$ ]]; then
d="${BASH_REMATCH[1]}${BASH_REMATCH[4]}"
fi
if [[ -n $subdir ]]; then
print_header "DEPLOY $subdir/$d"
else
print_header "DEPLOY $d"
fi
mkdir $d || exit 1 mkdir $d || exit 1
for exeext in .exe .out; do for exeext in .exe .out; do
f=$upx_BUILDDIR/upx$exeext f=$upx_BUILDDIR/upx$exeext
@@ -102,6 +125,7 @@ for exeext in .exe .out; do
cp -p -i $f $d/upx-git-${rev:0:12}$exeext cp -p -i $f $d/upx-git-${rev:0:12}$exeext
sha256sum -b $d/upx-git-${rev:0:12}$exeext sha256sum -b $d/upx-git-${rev:0:12}$exeext
fi fi
unset f
done done
# /*********************************************************************** # /***********************************************************************
@@ -109,7 +133,7 @@ done
# ************************************************************************/ # ************************************************************************/
new_branch=0 new_branch=0
if ! git clone -b $branch --single-branch https://github.com/upx/upx-automatic-builds.git; then if ! git clone -b "$branch" --single-branch https://github.com/upx/upx-automatic-builds.git; then
git clone -b master --single-branch https://github.com/upx/upx-automatic-builds.git git clone -b master --single-branch https://github.com/upx/upx-automatic-builds.git
new_branch=1 new_branch=1
fi fi
@@ -118,9 +142,10 @@ chmod 700 .git
git config user.name "$git_user" git config user.name "$git_user"
git config user.email "none@none" git config user.email "none@none"
if [[ $new_branch == 1 ]]; then if [[ $new_branch == 1 ]]; then
git checkout --orphan $branch git checkout --orphan "$branch"
git reset --hard git reset --hard || true
fi fi
git ls-files -v
if [[ -n $subdir ]]; then if [[ -n $subdir ]]; then
[[ -d $subdir ]] || mkdir $subdir [[ -d $subdir ]] || mkdir $subdir
@@ -139,11 +164,12 @@ fi
now=$(date '+%s') now=$(date '+%s')
##date=$(TZ=UTC0 date -d "@$now" '+%Y-%m-%d %H:%M:%S') ##date=$(TZ=UTC0 date -d "@$now" '+%Y-%m-%d %H:%M:%S')
git commit --date="$now" -m "Automatic build $d" git commit --date="$now" -m "Automatic build $d"
git ls-files git ls-files -v
#git log --pretty=fuller #git log --pretty=fuller
umask 077 umask 077
[[ -d ~/.ssh ]] || mkdir ~/.ssh [[ -d ~/.ssh ]] || mkdir ~/.ssh
fix_home_ssh_perms
repo=$(git config remote.origin.url) repo=$(git config remote.origin.url)
ssh_repo=${repo/https:\/\/github.com\//git@github.com:} ssh_repo=${repo/https:\/\/github.com\//git@github.com:}
eval $(ssh-agent -s) eval $(ssh-agent -s)
@@ -152,7 +178,9 @@ openssl aes-256-cbc -d -a -K "$UPX_AUTOMATIC_BUILDS_SSL_KEY" -iv "$UPX_AUTOMATIC
set -x set -x
chmod 600 .git/deploy.key chmod 600 .git/deploy.key
ssh-add .git/deploy.key ssh-add .git/deploy.key
fix_home_ssh_perms
ssh-keyscan -H github.com >> ~/.ssh/known_hosts ssh-keyscan -H github.com >> ~/.ssh/known_hosts
fix_home_ssh_perms
let i=0 || true let i=0 || true
while true; do while true; do
@@ -161,12 +189,15 @@ while true; do
exit 1 exit 1
fi fi
if [[ $new_branch == 1 ]]; then if [[ $new_branch == 1 ]]; then
if git push -u $ssh_repo $branch; then break; fi if git push -u $ssh_repo "$branch"; then break; fi
else else
if git push $ssh_repo $branch; then break; fi if git push $ssh_repo "$branch"; then break; fi
fi fi
git fetch -v origin $branch git branch -a -v
git rebase origin/$branch git fetch -v origin "$branch"
git branch -a -v
git rebase FETCH_HEAD
git branch -a -v
sleep $((RANDOM % 5 + 1)) sleep $((RANDOM % 5 + 1))
let i+=1 let i+=1
done done
+32 -4
View File
@@ -25,6 +25,9 @@ declare +x UPX_AUTOMATIC_BUILDS_SSL_KEY UPX_AUTOMATIC_BUILDS_SSL_IV
# compatibility wrappers # compatibility wrappers
if [[ $TRAVIS_OS_NAME == osx ]]; then if [[ $TRAVIS_OS_NAME == osx ]]; then
# use GNU coreutils ("brew install coreutils") # use GNU coreutils ("brew install coreutils")
chmod() {
gchmod "$@"
}
date() { date() {
gdate "$@" gdate "$@"
} }
@@ -49,6 +52,7 @@ if [[ -z $CC_OVERRIDE ]]; then
CC=false CXX=false SCAN_BUILD=false CC=false CXX=false SCAN_BUILD=false
AR=ar SIZE=size AR=ar SIZE=size
if [[ -n $APPVEYOR_JOB_ID ]]; then if [[ -n $APPVEYOR_JOB_ID ]]; then
BUILD_LOCAL_UCL=1
BUILD_LOCAL_ZLIB=1 BUILD_LOCAL_ZLIB=1
if [[ $BM_C =~ (^|\-)(clang|gcc)($|\-) ]]; then if [[ $BM_C =~ (^|\-)(clang|gcc)($|\-) ]]; then
export upx_EXTRA_LDFLAGS="-static-libgcc -static-libstdc++" export upx_EXTRA_LDFLAGS="-static-libgcc -static-libstdc++"
@@ -65,6 +69,7 @@ if [[ -n $APPVEYOR_JOB_ID ]]; then
esac esac
fi # APPVEYOR_JOB_ID fi # APPVEYOR_JOB_ID
if [[ -n $BM_CROSS ]]; then if [[ -n $BM_CROSS ]]; then
BUILD_LOCAL_UCL=1
BUILD_LOCAL_ZLIB=1 BUILD_LOCAL_ZLIB=1
if [[ $BM_C =~ (^|\-)(clang|gcc)($|\-) ]]; then if [[ $BM_C =~ (^|\-)(clang|gcc)($|\-) ]]; then
export upx_EXTRA_LDFLAGS="-static-libgcc -static-libstdc++" export upx_EXTRA_LDFLAGS="-static-libgcc -static-libstdc++"
@@ -129,18 +134,27 @@ if [[ -n $BM_CROSS ]]; then
fi # BM_CROSS fi # BM_CROSS
if [[ "$CC" == "false" ]]; then # generic if [[ "$CC" == "false" ]]; then # generic
if [[ -z $BM_CROSS ]]; then if [[ -z $BM_CROSS ]]; then
if [[ $TRAVIS_OS_NAME == osx ]]; then
case $BM_C in case $BM_C in
clang | clang-m?? | clang-3.4-m?? | clang-[678][0-9][0-9]-m??) clang | clang-m?? | clang-[6789][0-9][0-9]-m?? | clang-1[0-1][0-9][0-9]-m??)
CC="clang"; CXX="clang++" ;; # standard system compiler CC="clang"; CXX="clang++" ;; # standard system compiler
clang-[3].[0-9]-m??) esac
else
case $BM_C in
clang | clang-m?? | clang-3.4-m??)
CC="clang"; CXX="clang++" ;; # standard system compiler
clang-[3456].[0-9]-m??)
v=${BM_C:6:3}; CC="clang-$v"; CXX="clang++-$v"; SCAN_BUILD="scan-build-$v" ;; v=${BM_C:6:3}; CC="clang-$v"; CXX="clang++-$v"; SCAN_BUILD="scan-build-$v" ;;
clang-[789]-m??)
v=${BM_C:6:1}; CC="clang-$v"; CXX="clang++-$v"; SCAN_BUILD="scan-build-$v" ;;
gcc | gcc-m?? | gcc-mx32) gcc | gcc-m?? | gcc-mx32)
CC="gcc"; CXX="g++" ;; # standard system compiler CC="gcc"; CXX="g++" ;; # standard system compiler
gcc-[34].[0-9]-m?? | gcc-[34].[0-9]-mx32) gcc-[34].[0-9]-m?? | gcc-[34].[0-9]-mx32)
v=${BM_C:4:3}; CC="gcc-$v"; CXX="g++-$v" ;; v=${BM_C:4:3}; CC="gcc-$v"; CXX="g++-$v" ;;
gcc-[56]-m?? | gcc-[56]-mx32) gcc-[56789]-m?? | gcc-[56789]-mx32)
v=${BM_C:4:1}; CC="gcc-$v"; CXX="g++-$v" ;; v=${BM_C:4:1}; CC="gcc-$v"; CXX="g++-$v" ;;
esac esac
fi
fi fi
fi # generic fi # generic
case $BM_C in case $BM_C in
@@ -148,7 +162,7 @@ case $BM_C in
clang*-m64) CC="$CC -m64"; CXX="$CXX -m64" ;; clang*-m64) CC="$CC -m64"; CXX="$CXX -m64" ;;
gcc*-m32) CC="$CC -m32"; CXX="$CXX -m32" ;; gcc*-m32) CC="$CC -m32"; CXX="$CXX -m32" ;;
gcc*-m64) CC="$CC -m64"; CXX="$CXX -m64" ;; gcc*-m64) CC="$CC -m64"; CXX="$CXX -m64" ;;
gcc*-mx32) CC="$CC -mx32"; CXX="$CXX -mx32" ;; gcc*-mx32) CC="$CC -mx32"; CXX="$CXX -mx32"; BUILD_LOCAL_UCL=1; BUILD_LOCAL_ZLIB=1 ;;
esac esac
if [[ $BM_C =~ (^|\-)(clang|gcc)($|\-) ]]; then if [[ $BM_C =~ (^|\-)(clang|gcc)($|\-) ]]; then
CC="$CC -std=gnu89" CC="$CC -std=gnu89"
@@ -212,6 +226,11 @@ done
make_absolute lcov_OUTPUTDIR make_absolute lcov_OUTPUTDIR
unset var_prefix var_suffix unset var_prefix var_suffix
print_header() {
local x="==========="; x="$x$x$x$x$x$x$x"
echo -e "\n${x}\n${1}\n${x}\n"
}
print_settings() { print_settings() {
local v var_prefix var_suffix local v var_prefix var_suffix
# Build Matrix # Build Matrix
@@ -237,4 +256,13 @@ print_settings() {
##env | LC_ALL=C sort ##env | LC_ALL=C sort
} }
fix_home_ssh_perms() {
if [[ -d ~/.ssh ]]; then
if [[ -x /usr/sbin/restorecon ]]; then
/usr/sbin/restorecon -v -R ~/.ssh || true
fi
chmod -c -R go-rwx ~/.ssh || true
fi
}
true true
@@ -0,0 +1,210 @@
########## begin .sha256sums.recreate
expected_sha256sums__t010_decompressed="\
24158f78c34c4ef94bb7773a6dda7231d289be76c2f5f60e8b9ddb3f800c100e *amd64-linux.elf/upx-3.91
24808d572483f4cd713d66894b3da406755038737007a78b076528e6407e3132 *amd64-linux.elf/upx-3.95
c5007328ffcec842bb808329470afd71c9f7bf6416f5f5c978be1f942fe72618 *amd64-win64.pe/upx-3.95.exe
f7279729eb975e4238f8b8ee56fefa41ccbeb35ef0ffe4c34f8047baab78fff5 *arm-linux.elf/upx-3.95
28d7ca8f0dfca8159e637eaf2057230b6e6719e07751aca1d19a45b5efed817c *arm-wince.pe/upx-3.91.exe
ce81113f8a4ff1cd806811cb80ab8bea5c9c6fbced47451c7f07e50700f9817b *arm64-linux.elf/upx-3.95
b1c1c38d50007616aaf8e942839648c80a6111023e0b411e5fa7a06c543aeb4a *armeb-linux.elf/upx-3.91
84b90eb0d617571fe4885639925b35ca6a61060cb2616bb5bf729b4d701653e4 *armeb-linux.elf/upx-3.95
bcac77a287289301a45fde9a75e4e6c9ad7f8d57856bae6eafaae12ae4445a34 *i386-dos32.djgpp2.coff/upx-3.91.exe
7d331e508449497f64cd47abdd3f00f70307f508ad3fd692d333feb97beccead *i386-dos32.djgpp2.coff/upx-3.95.exe
730a513b72a094697f827e4ac1a4f8ef58a614fc7a7ad448fa58d60cd89af7ed *i386-linux.elf/upx-3.91
a1f3e5ffa7b2cfebe1e475ac1f4c7683b1b8b4e292aa0d04386cc0314dd162c9 *i386-linux.elf/upx-3.95
0dbc3c267ca8cd35ee3ea138b59c8b1ae35872c918be6d17df1a892b75710f9b *i386-win32.pe/upx-3.91.exe
e0dfcb440bb43d53cf68f0178429a5136f8f7f13544499ad17699a98a6f8ffc0 *i386-win32.pe/upx-3.95.exe
8e5333ea040f5594d3e67d5b09e005d52b3a52ef55099a7c11d7e39ead38e66d *m68k-atari.tos/upx-3.91.ttp
8902f38ec3d95d8e077e3ab5fdbb5bad408859913a35deb87041f4f053cd6605 *mips-linux.elf/upx-3.95
c3f44b4d00a87384c03a6f9e7aec809c1addfe3e271244d38a474f296603088c *mipsel-linux.elf/upx-3.91
dd1496bc4e9c32a5d5dd47e3eaabf7b134ca001d48807eebfd3d5e28c8a2ab58 *mipsel-linux.elf/upx-3.95
b8c35fa2956da17ca505956e9f5017bb5f3a746322647e24ccb8ff28059cafa4 *powerpc-linux.elf/upx-3.91
2bc00a51daa0bada19a8fa1bd2c227a8596844fa1b0aa3611087f195072700e2 *powerpc-linux.elf/upx-3.95
a0950546dc17fca9437219431d8ddb0249ce5b08e899e0c799a87ac982adee70 *powerpc64le-linux.elf/upx-3.95
"
expected_sha256sums__t020_canonicalized="\
24158f78c34c4ef94bb7773a6dda7231d289be76c2f5f60e8b9ddb3f800c100e *amd64-linux.elf/upx-3.91
24808d572483f4cd713d66894b3da406755038737007a78b076528e6407e3132 *amd64-linux.elf/upx-3.95
c5007328ffcec842bb808329470afd71c9f7bf6416f5f5c978be1f942fe72618 *amd64-win64.pe/upx-3.95.exe
f7279729eb975e4238f8b8ee56fefa41ccbeb35ef0ffe4c34f8047baab78fff5 *arm-linux.elf/upx-3.95
28d7ca8f0dfca8159e637eaf2057230b6e6719e07751aca1d19a45b5efed817c *arm-wince.pe/upx-3.91.exe
ce81113f8a4ff1cd806811cb80ab8bea5c9c6fbced47451c7f07e50700f9817b *arm64-linux.elf/upx-3.95
b1c1c38d50007616aaf8e942839648c80a6111023e0b411e5fa7a06c543aeb4a *armeb-linux.elf/upx-3.91
84b90eb0d617571fe4885639925b35ca6a61060cb2616bb5bf729b4d701653e4 *armeb-linux.elf/upx-3.95
bcac77a287289301a45fde9a75e4e6c9ad7f8d57856bae6eafaae12ae4445a34 *i386-dos32.djgpp2.coff/upx-3.91.exe
7d331e508449497f64cd47abdd3f00f70307f508ad3fd692d333feb97beccead *i386-dos32.djgpp2.coff/upx-3.95.exe
730a513b72a094697f827e4ac1a4f8ef58a614fc7a7ad448fa58d60cd89af7ed *i386-linux.elf/upx-3.91
a1f3e5ffa7b2cfebe1e475ac1f4c7683b1b8b4e292aa0d04386cc0314dd162c9 *i386-linux.elf/upx-3.95
0dbc3c267ca8cd35ee3ea138b59c8b1ae35872c918be6d17df1a892b75710f9b *i386-win32.pe/upx-3.91.exe
e0dfcb440bb43d53cf68f0178429a5136f8f7f13544499ad17699a98a6f8ffc0 *i386-win32.pe/upx-3.95.exe
8e5333ea040f5594d3e67d5b09e005d52b3a52ef55099a7c11d7e39ead38e66d *m68k-atari.tos/upx-3.91.ttp
8902f38ec3d95d8e077e3ab5fdbb5bad408859913a35deb87041f4f053cd6605 *mips-linux.elf/upx-3.95
c3f44b4d00a87384c03a6f9e7aec809c1addfe3e271244d38a474f296603088c *mipsel-linux.elf/upx-3.91
dd1496bc4e9c32a5d5dd47e3eaabf7b134ca001d48807eebfd3d5e28c8a2ab58 *mipsel-linux.elf/upx-3.95
b8c35fa2956da17ca505956e9f5017bb5f3a746322647e24ccb8ff28059cafa4 *powerpc-linux.elf/upx-3.91
2bc00a51daa0bada19a8fa1bd2c227a8596844fa1b0aa3611087f195072700e2 *powerpc-linux.elf/upx-3.95
a0950546dc17fca9437219431d8ddb0249ce5b08e899e0c799a87ac982adee70 *powerpc64le-linux.elf/upx-3.95
"
expected_sha256sums__t110_compress_ucl_nrv2b_3_no_filter="\
82a3c42af2aae745b6b233fb4c0d3b60c3a2b224ada7af4b81d062d913503bac *amd64-linux.elf/upx-3.91
8959e46212b736476f517f911b7740038da882b30788efebf71d0108a01cecf8 *amd64-linux.elf/upx-3.95
099a690a01bb8e08bb88a09919241c499aae1fa282f3fa49588f1240b1fdd3e8 *amd64-win64.pe/upx-3.95.exe
39f86a05b5a7065e13e028638d324d9ddbf72fc537f0a62ad4637364722249f2 *arm-linux.elf/upx-3.95
a6d50d99a37ed7d52ea6b53be1d2ce57550139276d450be0ccfc0c61eac99498 *arm-wince.pe/upx-3.91.exe
7cfb366a6ed04c6a2706a7cc28411c6f190dfde56403fc52eb1677130dd4307f *arm64-linux.elf/upx-3.95
9532ef921b3bfb02deaeb59cb33aaa499132af689fa1df51499790f26e99a790 *armeb-linux.elf/upx-3.91
b076ac9531bee0fbcf44824c2baf83284e747bb381325076c0a1466b9002581c *armeb-linux.elf/upx-3.95
5c365ab8f4c5811a55cceab8d6bfa59ee56c89a966d423e1f734cd27745e7191 *i386-dos32.djgpp2.coff/upx-3.91.exe
70c13950a28362bf4d5f49b496f683e2ed2d28875891cff283e11f2916163956 *i386-dos32.djgpp2.coff/upx-3.95.exe
32649cd041f5bee83d02b065c486ac8f26dd29d28a05c36503d42edd62ce7767 *i386-linux.elf/upx-3.91
f8dc23edc677f99075746f5f722ceb1642a82e3f38e5041fa1bf232016bdfc6e *i386-linux.elf/upx-3.95
1ab486ab59e331a811b7b16880b0673443a378442d875067377d4427075e124c *i386-win32.pe/upx-3.91.exe
f0416ec4793a0eed79858feaec6e5f9e04e8cdd7f7fe8bdef9c25fffbef6d358 *i386-win32.pe/upx-3.95.exe
2139848afeae725b6d7d95786a7ac5f07bf7116a76dfee169f99b3444cfca277 *m68k-atari.tos/upx-3.91.ttp
45c6f581807c0382462911899d30957d10ff58e6f2c4fde15d2187a0affa7785 *mips-linux.elf/upx-3.95
bc1ab2df1985aec60f78b1ee7adf52c6bc30d207dc4aca5f7f3b2cc187cc98ed *mipsel-linux.elf/upx-3.91
29d67983278a5149d122eb98b2f73f8abb648bc88cfcaae7ad468d69d5dbe3c4 *mipsel-linux.elf/upx-3.95
0a652f004aac31d2baa4610561ecd8210841f366b2f210953212a9e0750c301f *powerpc-linux.elf/upx-3.91
2bfc2e143736f378904f0f1322aaaf4086877fb37fd783ab4d0789825d59e6d5 *powerpc-linux.elf/upx-3.95
2c8657627f2247963d0187d6e5cf02fbe3bd84f2475908c234ecc1ae081b9ba7 *powerpc64le-linux.elf/upx-3.95
"
expected_sha256sums__t120_compress_ucl_nrv2d_3_no_filter="\
fcbe8cf92e76268950bd09e1285ce4cd9756d5505784e1e495a54623a88de8c5 *amd64-linux.elf/upx-3.91
272dbd7aa6eba2202008b9d5853fe8e24e894e7df66bf988690d96f428aeb93d *amd64-linux.elf/upx-3.95
7b7bd8e5c0d4e29ef9f3b97eb76dfe0afbe711172e25ee9c3079d656c5d036dd *amd64-win64.pe/upx-3.95.exe
21af84a819e789fad98534cb973c4ad3806cf7676caf546c9e4ace33d559e7e0 *arm-linux.elf/upx-3.95
74060375496ef1450252c9b30547ef3235b79e2b57666500dd44c61fedc0539e *arm-wince.pe/upx-3.91.exe
efb6240ce6a2be00906a4a3ba7652160e5aee43ed968961c1bc55ea370f6cd93 *arm64-linux.elf/upx-3.95
dc24337091e85595bf9ce259a702c52e9cc10e31d759df8f1ad26e65c148ed04 *armeb-linux.elf/upx-3.91
cde5cc6967cbee06c260a25eef3d7cdaf430bf8a63db5a6dfc8a9079ec895c52 *armeb-linux.elf/upx-3.95
217f050aecd01f04ef9eba37fed518c4380f170d3cdb483ae019312fad827490 *i386-dos32.djgpp2.coff/upx-3.91.exe
5a909066dd5aac865e36a26f7d002a8ddf6ae57e93a1dc1f6582b922388e9489 *i386-dos32.djgpp2.coff/upx-3.95.exe
909650339b3a93360b622a4ab2c9a2e489206ddbd4af2556101ff68a1082cf0f *i386-linux.elf/upx-3.91
d778256d361ab72ea9629a45a8c8ea501007978f64df6a003024f7a07efaf8e4 *i386-linux.elf/upx-3.95
8217b20bac36090189a7415196e96df93e0110f5d716d15ed84d0c1ac4b001e5 *i386-win32.pe/upx-3.91.exe
eb6a8c4e3652c75f4b054cc36933a4c9853ca23e4f2790ad6505368dc1ba82b7 *i386-win32.pe/upx-3.95.exe
29bf5c38da5cf33aecf6c48c55acdb0d73a3878790786f48815cbd8ad1819037 *m68k-atari.tos/upx-3.91.ttp
5163bf81989cf96127e833eacafa605248b3139ade256512122a8d56a00d8475 *mips-linux.elf/upx-3.95
6da6103fb68113c930f59455a504a5fbb1b982971d488f6cb34e6e19154eb812 *mipsel-linux.elf/upx-3.91
98c5ea01aeabb9d3d54b47dbce13b5884e3ff2b856598d191fe50eb026da48b4 *mipsel-linux.elf/upx-3.95
35458012d9e90013c6ff6442b9a5b2a5dc90ea1451c7653b0d144ea8be9b8fd5 *powerpc-linux.elf/upx-3.91
a61669951a13a530fa06d9e0286c4c9ff18e47be836ccdde4c24acc5d0e7dda0 *powerpc-linux.elf/upx-3.95
852844b06078a5c820936e31cd52f4edc44b42ee9aa0edca9a21ee41b4442af5 *powerpc64le-linux.elf/upx-3.95
"
expected_sha256sums__t130_compress_ucl_nrv2e_3_no_filter="\
24d0578ee2a83d40de7740c7141c1b102961c505a04155ca3b66c73c493eee64 *amd64-linux.elf/upx-3.91
4253f580fa8bb00db0a093c3826350f759f096098fcb43195eb71f4213479d85 *amd64-linux.elf/upx-3.95
626ac9e02a60c25ab26bfd96120ef728abd3c7ed56b23b81cf22f439a8673e5f *amd64-win64.pe/upx-3.95.exe
40d1f54eb707b51223a36e939caabd7a4df81c87edd12f36c40f525bcf59f919 *arm-linux.elf/upx-3.95
8f29c06b3eb3770eae267e6adad6bbaf3c03e12a1649e085d044d7ea03638d3b *arm-wince.pe/upx-3.91.exe
bebb9c6327d88eb92bad9b1182d4f8f732caaed4e6aff169057ad108016a6f72 *arm64-linux.elf/upx-3.95
94010dc973ce886131b6ecd9775e0a3e9ed421503bfc74954f31a154e4a60d39 *armeb-linux.elf/upx-3.91
49b3c157b56c2cf2b206447b981d7e74561fde02569ccb73814a187163a1e05a *armeb-linux.elf/upx-3.95
12fd7e4e4e5c4067880e7e3db0526601f67d1456e7fa2c77e46beb3c10234bb1 *i386-dos32.djgpp2.coff/upx-3.91.exe
3771f947c9ce27221c3c647aa6814cc990734cd4f5ec8b4a1e4fb890e8352130 *i386-dos32.djgpp2.coff/upx-3.95.exe
27141ee7a92c81461233e0f7ef2dd22bf9d086c6b006af9a7a63906ea998a8b3 *i386-linux.elf/upx-3.91
bdeda6183b13f14b389829be4c23e8aeb202ff16b9b5f6644ec98ef448529780 *i386-linux.elf/upx-3.95
37871a1a85954ced4211b3930d4f27acd51f77e999ea8801c01667f221ccde4a *i386-win32.pe/upx-3.91.exe
27a77ed9d8243e1f1ccf2051f80977c8727790823dcdfd33d788b97ee32482eb *i386-win32.pe/upx-3.95.exe
bd45c11476def67a48cd8c8b79fde0bcc10da4a4811fd1cd87acb4b8cb317f7c *m68k-atari.tos/upx-3.91.ttp
b2d63e1a494f9ad8296f7c5b90c22d67c4e554c6bd2d0a9685c8d45bf2b4cba4 *mips-linux.elf/upx-3.95
48772c5cc502e503978da73d6f72eea2cafa55c06726c3b61f8b80e17f523b18 *mipsel-linux.elf/upx-3.91
e7499fb50da2a7000e5ccb9d8b0d022c71ec449c81e2edf27e48e413f0258c1e *mipsel-linux.elf/upx-3.95
fdf8a7484ca0771d11509183639610fa0dcdb36d195013a8f4f754094545a259 *powerpc-linux.elf/upx-3.91
839de35bcc7e7beb185055c60ad8728731a0456c7a32bb69e30faee5646dfdbc *powerpc-linux.elf/upx-3.95
dccd1b5296c1a70533332e9eec2788f74abcebf223fb6e44642148bdcc63b195 *powerpc64le-linux.elf/upx-3.95
"
expected_sha256sums__t140_compress_lzma_2_no_filter="\
8bdcd33cb7073de57e3b72fcdfd52693d80e063c8f18c146fcbcb93feaa57438 *amd64-linux.elf/upx-3.91
c0cc9f01d4c74c003df410070f19181275650c96d6267b5af6d2029f72ecc2d5 *amd64-linux.elf/upx-3.95
32df633b40027b08da5a0cb4845294c971c2e133ee2506684979a3532c5fc685 *amd64-win64.pe/upx-3.95.exe
91474e9a68d5225916b2582ffbcae23d2644ece6f823686b1692edba0d909066 *arm-linux.elf/upx-3.95
19455d55f642e610df5f9071d59cde24d5db013ae8215a9946b3a995c6cb123a *arm-wince.pe/upx-3.91.exe
abd540824d65696fbb0aa45e1935f286435fc9c53049ac66d916cf53c39278b5 *arm64-linux.elf/upx-3.95
832db37f9c05d6e80e44d26974bc8368dcc02eadeeb37f4f79513855dc5e8ffb *armeb-linux.elf/upx-3.91
339086e40ae660fec688995a1fdb3b89487859891521a8dd03b44aaba9372331 *armeb-linux.elf/upx-3.95
3b4466fb3defcff86d7679b7c35929f959eba2e8d64f08099e3fbc5e7fd5aab9 *i386-dos32.djgpp2.coff/upx-3.91.exe
6a722037156b5b75e6622f4ac8187d163a73f7e090c0b6374d0c745f84ba197c *i386-dos32.djgpp2.coff/upx-3.95.exe
b67cc7eaee651c5ee41b02ae1894c3740274a1dd258e734c7933c48edf81ed06 *i386-linux.elf/upx-3.91
68eb9861137a5d0c05367f671343556f145d40aac49c6f7455d081b263d3e1ff *i386-linux.elf/upx-3.95
906fbf9f6c1e3483f6e9f003c602f20c584b013cf89c51cd17c8095c514a1d1d *i386-win32.pe/upx-3.91.exe
ca1e4f751677eab4e24d73d04e69c4c7f645798fa6bb416468bddde9c5dda61c *i386-win32.pe/upx-3.95.exe
11fbc05a27d6e2468baa64efc58bf23693e90d3a374b267d4a72a866af56e284 *m68k-atari.tos/upx-3.91.ttp
a81d82d7606f1735889dbfa1a5de1c6d35209c31e6e56c48cc40c9470d07da54 *mips-linux.elf/upx-3.95
3ce5b8a9b36a71c33a644a8cd4fc9e5cb1009f5133d1df181c18c175b94143e4 *mipsel-linux.elf/upx-3.91
f2e03dad0165c3adb683c3bd8f26117dca53a577c8603441abeda911af07204f *mipsel-linux.elf/upx-3.95
174eb63cf809b0a105fccfa5318a754da6685610c3ffa3d81ba41ced4a040984 *powerpc-linux.elf/upx-3.91
01d6aa378efda299ade377d1bcd04611a467cb903efb82545205ed439c566c26 *powerpc-linux.elf/upx-3.95
e9b32f705ea249cfafcd3e6181f7632f38b304dcba0ab39690e8a5ffbcc2504f *powerpc64le-linux.elf/upx-3.95
"
expected_sha256sums__t150_compress_ucl_2_all_filters="\
9d2d9449ff3cd62389337d76d419306b18be18c48dc23c89b9048ab13856999d *amd64-linux.elf/upx-3.91
f221da0c79fa1a59de5becf341126b1a41f19c9860ce66676e927b0546956d16 *amd64-linux.elf/upx-3.95
a0c35f620eb4f5c49cc7c0ae591c9bc1ff39fe3b5a084a7038c37ac4242172be *amd64-win64.pe/upx-3.95.exe
a09b27147773e2288dc0a7075097bd76d86d0fdd6fb9d0726c4b928bc8b74b1b *arm-linux.elf/upx-3.95
ff5abf994119a68584d752f5d3ab120ec9f28b2a719efede55e6c71cb4d82b57 *arm-wince.pe/upx-3.91.exe
6801a06892b7d1a3534410bfb4a03aed6195dbc5012801a987f0a635f6b3af7a *arm64-linux.elf/upx-3.95
69587df298a09ccf3a1c147cec28942fb0419478163f75f61cf7b72538abeefe *armeb-linux.elf/upx-3.91
985f238569e6aa2c3973a281bfcfd13cfc9e638c10ebb5a3ff07c4051c97c488 *armeb-linux.elf/upx-3.95
fe14d316c0dc98bc49e6c0f5888a83b1fa8e58caea6d211301726fee0cdd020e *i386-dos32.djgpp2.coff/upx-3.91.exe
e4dd0a9565f7a501520997a48227d027e37fa3becf3b84e839c5f96aa169e601 *i386-dos32.djgpp2.coff/upx-3.95.exe
301a0b90694809ad0be9d354a7a9d6baa3fa9b4ccd62264166c95d86142df164 *i386-linux.elf/upx-3.91
3a6c56ba29940b4ac3b42d23cdfd21d0331036b082e50f4d2d87e1508567591f *i386-linux.elf/upx-3.95
91d816d5ecee3ffa48bc624283a600758776790fe928c2dc1846a72cd4d9d14d *i386-win32.pe/upx-3.91.exe
1930f3a09c0ec1a12056be6469f12d048a572bcdd7a62dc2c006a1c46f09fcf6 *i386-win32.pe/upx-3.95.exe
9024f8d52cf40726f27c0782fe63eb15b6aa33789c97a343fb80b901df8a7468 *m68k-atari.tos/upx-3.91.ttp
4dbfb026a0e10ffb43b8053c1f32b20c1632f8963c93a3170230c0a7dbc3e805 *mips-linux.elf/upx-3.95
aaca5c6fdadb4f735b1f5ff99e1394ba711db28b1e22f1df9119ee2693c419b3 *mipsel-linux.elf/upx-3.91
9edd1d514102ed0955f9a333b1de41ca3550ec34d075dbd69dc09a7f6325b68e *mipsel-linux.elf/upx-3.95
1ffcbc5041300c223ef03dbbed131560f942033d3df55b317099d1a8ad2ced69 *powerpc-linux.elf/upx-3.91
9884be7a7d0a459e8d90ecdb663d2dfb166199e3ae614ef2478aa8d7dab215ef *powerpc-linux.elf/upx-3.95
7847d39cc94308d7509b1515eef2daee0fcca48678ec2540570a05d6d461e76c *powerpc64le-linux.elf/upx-3.95
"
expected_sha256sums__t160_compress_all_methods_1_no_filter="\
5f9e96872c68df382efb48502d5d81b8afe3240d4eba9f81643863b0c4db4c56 *amd64-linux.elf/upx-3.91
e9eeb7710b3e2d54c7cbabf7cb4de2c40c30efdf1dccbe5324bb58cfd665fbc8 *amd64-linux.elf/upx-3.95
46043947b045c1e7bb5a1e29b369a61609c5a7e7b5c89e029d3606e38703da4f *amd64-win64.pe/upx-3.95.exe
2b801d5b4f61ed2c90fd54648b1aad3f346f7539f4f8047c6d6585eafa443800 *arm-linux.elf/upx-3.95
6b5f6961874812665512518792cb5a21a7c013e5fb6e2da30e72591625983a13 *arm-wince.pe/upx-3.91.exe
444850947143d981137eb825225c2a09e9a67da186812d0c0b25304b9cefcca5 *arm64-linux.elf/upx-3.95
950e6cbae17f14cb53da024d814790aa006c019060cbc0a11a277eb5e0722cbb *armeb-linux.elf/upx-3.91
2a0e7f240ee8cabfa026a58aae0e9763eb4d21bb0ce59c538cb4a8bd0734c422 *armeb-linux.elf/upx-3.95
3094ac645a70cd5316e777208eb2af00116cab03b0924fed9f6f2f4d1335d975 *i386-dos32.djgpp2.coff/upx-3.91.exe
97e1f9535799fb58b7814d20fc18ce78fabef669b7467da4ec0da952dc003597 *i386-dos32.djgpp2.coff/upx-3.95.exe
6614ffb7d8f742a9407a99515608399e370732bcdf041b13280de5ecb83d6e35 *i386-linux.elf/upx-3.91
323c3943a677fe84d526da7707d865e57d28d9e24b5d7055e71bf3e9ffc924a8 *i386-linux.elf/upx-3.95
7a2deccab37f364e650df63ed3719433b38ee53193e29e7737bc352998a27281 *i386-win32.pe/upx-3.91.exe
0accf03fe46774a170710f5477f6e7095ba9ace0850bb3a1c697c1b1ec570be3 *i386-win32.pe/upx-3.95.exe
efb22c80605d58fb96a302c58fcc5c1bdf143f90a6874004fae6549df2a224c8 *m68k-atari.tos/upx-3.91.ttp
754295165a9c08364e9754322868c6f4df7c2772746d844a04fda3287907f362 *mips-linux.elf/upx-3.95
bf63ab0df4b2d45f3f156ebf9fd7e60e6cb175f688f68bd14b5e699e6b95872b *mipsel-linux.elf/upx-3.91
4a2894fb946d684d370f7d252abc43afcff0a339ef2aeaeaa23767ff3e6b15fd *mipsel-linux.elf/upx-3.95
fcb40e252de5e3a7f495d338ad6bf6dc73aee7d10513e06b07a270161fe449d8 *powerpc-linux.elf/upx-3.91
e282ca41f508ae63defc249aa2e4318540362ae8b3c40f31bf46946a6a1bf5f6 *powerpc-linux.elf/upx-3.95
8b67e3e700f6d5afb99bc561e5d2e5850b2eea4b5a854cab0c84766e6df2a4a6 *powerpc64le-linux.elf/upx-3.95
"
expected_sha256sums__t170_compress_all_methods_no_lzma_5_no_filter="\
42c2358cc7a6a1252c1fb8bb29562e3047d839a506720ef0dff098cbd6cd08c3 *amd64-linux.elf/upx-3.91
e11f33fa80dda7e2b547cc375c1802f5f075a80f12033c123c97b2d572ad8757 *amd64-linux.elf/upx-3.95
77230816a4ebc51a430e8304ea331399491c548d182aa001b8d653e2d7b6ea9a *amd64-win64.pe/upx-3.95.exe
54cb369bf7b8e1e55380a2a97bd7e644cb0da79982d1678eea7a668362d93610 *arm-linux.elf/upx-3.95
7818cd3cbc877d3781ae1ce0abbaf4a19186af55cb675229f406943d552694dd *arm-wince.pe/upx-3.91.exe
3186b21f336cae305bbcadcddc5691969752b4a97094f27344361d49037a9b48 *arm64-linux.elf/upx-3.95
1ff49ccf438feefb7a8c9467c6fa3d6ad218cf9abdf12870522a1b24fd26f0c6 *armeb-linux.elf/upx-3.91
b43bb20b5e372dd877015e0fffd18e908ed3d53ffa057624ab4242f07515e11a *armeb-linux.elf/upx-3.95
ce60084e86b17798e34e59c21b6cea28702d850f786f9e35e41a2bc873178f53 *i386-dos32.djgpp2.coff/upx-3.91.exe
aa3f9f5742e5f7aa87a7578d92b54425da6eb4b173200408f3e30384c4089370 *i386-dos32.djgpp2.coff/upx-3.95.exe
d63d34bffb7864f1af6c76edb85820b01f3ccb053528b075b81b1425feabe797 *i386-linux.elf/upx-3.91
e42f1febc0ca7f54adf7b2fd721aac2f9e72680e0e010ed2368f669f8d341071 *i386-linux.elf/upx-3.95
21d932deff36167a2f030773e8f68f952fc4fb67bf1864c515f3930f572fb624 *i386-win32.pe/upx-3.91.exe
7665c75c47fc3b7913e0849187070e8ddf73f584f1e2495f51d3ebb32cf0ad21 *i386-win32.pe/upx-3.95.exe
17420ed467a4f326c79c13d0b89b6d3a4dd6a2d3b96f199d7e9dd31528439f2f *m68k-atari.tos/upx-3.91.ttp
d93f08394e03b17044be5f22ff496913aeaf0a6927d2b926452aadc32af2a479 *mips-linux.elf/upx-3.95
b0d689013481cc7f668a2559a7d696356ab7adafe68ae49f9e7e68ced1d6a8ff *mipsel-linux.elf/upx-3.91
2593ca7f7609a44ae87c22a2d72e0470737253967eb82f9a8ceda9496b195503 *mipsel-linux.elf/upx-3.95
236f784979481ed09b875fb7302bb31beb151140752ea62ef9ad4aa0ec073a4f *powerpc-linux.elf/upx-3.91
70d0da07e4ac2e249864644fdf29935352452416f70b7362d0e62ab87ec05653 *powerpc-linux.elf/upx-3.95
f98e35412b9fda2aaa58c6f84b843b3d9493781b6510ac4ec0af9ccb9327a141 *powerpc64le-linux.elf/upx-3.95
"
########## end .sha256sums.recreate
+5 -105
View File
@@ -36,8 +36,7 @@ if [[ ! -d $upx_testsuite_SRCDIR/files/packed ]]; then exit 1; fi
# ************************************************************************/ # ************************************************************************/
testsuite_header() { testsuite_header() {
local x="==========="; x="$x$x$x$x$x$x$x" print_header "$1"
echo -e "\n${x}\n${1}\n${x}\n"
} }
testsuite_split_f() { testsuite_split_f() {
@@ -45,7 +44,7 @@ testsuite_split_f() {
fb=$(basename "$1") fb=$(basename "$1")
fsubdir=$(basename "$fd") fsubdir=$(basename "$fd")
# sanity checks # sanity checks
if [[ ! -f $f || -z $fsubdir || -z $fb ]]; then if [[ ! -f "$1" || -z "$fsubdir" || -z "$fb" ]]; then
fd= fb= fsubdir= fd= fb= fsubdir=
fi fi
} }
@@ -126,107 +125,7 @@ recreate_expected_sha256sums() {
echo "########## end .sha256sums.recreate" >> "$o" echo "########## end .sha256sums.recreate" >> "$o"
} }
########## begin .sha256sums.recreate source "$argv0dir/travis_testsuite_1-expected_sha256sums.sh" || exit 1
expected_sha256sums__t010_decompressed="\
24158f78c34c4ef94bb7773a6dda7231d289be76c2f5f60e8b9ddb3f800c100e *amd64-linux.elf/upx-3.91
28d7ca8f0dfca8159e637eaf2057230b6e6719e07751aca1d19a45b5efed817c *arm-wince.pe/upx-3.91.exe
b1c1c38d50007616aaf8e942839648c80a6111023e0b411e5fa7a06c543aeb4a *armeb-linux.elf/upx-3.91
bcac77a287289301a45fde9a75e4e6c9ad7f8d57856bae6eafaae12ae4445a34 *i386-dos32.djgpp2.coff/upx-3.91.exe
730a513b72a094697f827e4ac1a4f8ef58a614fc7a7ad448fa58d60cd89af7ed *i386-linux.elf/upx-3.91
0dbc3c267ca8cd35ee3ea138b59c8b1ae35872c918be6d17df1a892b75710f9b *i386-win32.pe/upx-3.91.exe
8e5333ea040f5594d3e67d5b09e005d52b3a52ef55099a7c11d7e39ead38e66d *m68k-atari.tos/upx-3.91.ttp
c3f44b4d00a87384c03a6f9e7aec809c1addfe3e271244d38a474f296603088c *mipsel-linux.elf/upx-3.91
b8c35fa2956da17ca505956e9f5017bb5f3a746322647e24ccb8ff28059cafa4 *powerpc-linux.elf/upx-3.91
"
expected_sha256sums__t020_canonicalized="\
24158f78c34c4ef94bb7773a6dda7231d289be76c2f5f60e8b9ddb3f800c100e *amd64-linux.elf/upx-3.91
28d7ca8f0dfca8159e637eaf2057230b6e6719e07751aca1d19a45b5efed817c *arm-wince.pe/upx-3.91.exe
b1c1c38d50007616aaf8e942839648c80a6111023e0b411e5fa7a06c543aeb4a *armeb-linux.elf/upx-3.91
bcac77a287289301a45fde9a75e4e6c9ad7f8d57856bae6eafaae12ae4445a34 *i386-dos32.djgpp2.coff/upx-3.91.exe
730a513b72a094697f827e4ac1a4f8ef58a614fc7a7ad448fa58d60cd89af7ed *i386-linux.elf/upx-3.91
0dbc3c267ca8cd35ee3ea138b59c8b1ae35872c918be6d17df1a892b75710f9b *i386-win32.pe/upx-3.91.exe
8e5333ea040f5594d3e67d5b09e005d52b3a52ef55099a7c11d7e39ead38e66d *m68k-atari.tos/upx-3.91.ttp
c3f44b4d00a87384c03a6f9e7aec809c1addfe3e271244d38a474f296603088c *mipsel-linux.elf/upx-3.91
b8c35fa2956da17ca505956e9f5017bb5f3a746322647e24ccb8ff28059cafa4 *powerpc-linux.elf/upx-3.91
"
expected_sha256sums__t110_compress_ucl_nrv2b_3_no_filter="\
52d0189f9ed16162332fbe359d723753ca1b7d7374a249d6b16144e363073384 *amd64-linux.elf/upx-3.91
0af0b3df9ca5b34ebc8ed06b3bf46807e585032961f053abfeefcb60bd63907e *arm-wince.pe/upx-3.91.exe
851ea686cc1d6ef7c63978829f0bfe40c761d00e9f07c3d4f9ce59201da4409c *armeb-linux.elf/upx-3.91
3345fda466927211ed3291ea1255fa09937fcfad974ffb1120deeefe6f655a9e *i386-dos32.djgpp2.coff/upx-3.91.exe
8631629945812b6766da0187390b4d26e830f39a79d80aacda196e678a4be10c *i386-linux.elf/upx-3.91
06794bdb9a8085ca5ef577648bf39402868a507f2a0bd02285c807929499aba4 *i386-win32.pe/upx-3.91.exe
6c9e164baa12c45ca8d55788b34e8fabdddb52374200444d42ff48c1d84103eb *m68k-atari.tos/upx-3.91.ttp
1f3ae2bde7c72e60d3c12fccf572c5aa5dbee566d1d28029e62a8b921c6d77bd *mipsel-linux.elf/upx-3.91
181345ff1dd1c35944ec79d1197ee223913617cdd148a576cd3b9b776b8e86c2 *powerpc-linux.elf/upx-3.91
"
expected_sha256sums__t120_compress_ucl_nrv2d_3_no_filter="\
d90f1e94fb8a1d5c123e1c13b30db148870c36ff6f00fc5677bd9f05bae1fc02 *amd64-linux.elf/upx-3.91
e09a089e642f33502a35ab9a416142d3db4dbb67930366054e25c390678c3f7c *arm-wince.pe/upx-3.91.exe
b794cc520ab507887324fe04e1c36e1ed0b63ecdb29241213a3a3cf980e16cc2 *armeb-linux.elf/upx-3.91
ea5df377a14457fc4a4791e67859f77f8fe8b94ed81fd13666618fc690d70987 *i386-dos32.djgpp2.coff/upx-3.91.exe
5f0876049576446707270baa651eaa724891cccbee268e18450812d5be5e9990 *i386-linux.elf/upx-3.91
4a65a19b430d50b9f15786342e3de86feb3627af07743b50a9ebfedb10c59a08 *i386-win32.pe/upx-3.91.exe
d7514121a811a36112cb2f3e42c3284e03a7807e972778229c62c075656d796f *m68k-atari.tos/upx-3.91.ttp
0effcd336be6dcb092e37bafc9611c99c1d19c1c53a8ca6a26834d9f5f9eb56c *mipsel-linux.elf/upx-3.91
dfe218814633aa9ed47477bf021ac0bae0b491ebf9d4ff44194f3d7195e5a200 *powerpc-linux.elf/upx-3.91
"
expected_sha256sums__t130_compress_ucl_nrv2e_3_no_filter="\
00b67a1cc766b13a6167e0f672cf46b62f0879b6318ed9f548f670b011b3f185 *amd64-linux.elf/upx-3.91
a377c263a3d981af1ec278a418fcdd09298d76cece0e7c7c9af63f20ccba769d *arm-wince.pe/upx-3.91.exe
dbf2fa9b4fa5319c52b25d34aa6f57577b2a63e7241b6d4600915de0f3400190 *armeb-linux.elf/upx-3.91
4d925cff00b8959324c0838284f4619831b8080136cef05131906149fdec5bbc *i386-dos32.djgpp2.coff/upx-3.91.exe
b114b257ff5de11b75eb4489d2cb2bd3be6cf9cf141e36f02b0ab781d0f9a3ff *i386-linux.elf/upx-3.91
ce874eafe18c0f09928992a3aa1f5fe9f0be9d89b87b39ecbcf1c460e4b8e0f7 *i386-win32.pe/upx-3.91.exe
c60b3faccc59ff37c2e1e3c908d4fe01a2532e7ac1abd4c4ec4ecee974a0e8bd *m68k-atari.tos/upx-3.91.ttp
2b74a6a831c7f9f4df22c65f8a5748a2b6cf6fd68232b0d250737938de27efc6 *mipsel-linux.elf/upx-3.91
47ddad5acc39e21d66e471c8af8d9b52e8dd8d7ad89631f771c2ea4d218f441e *powerpc-linux.elf/upx-3.91
"
expected_sha256sums__t140_compress_lzma_2_no_filter="\
f67ce2b6d4d36367a249faeb802df51dbc56019754c0f4606b5a6f97b72a54d1 *amd64-linux.elf/upx-3.91
57be6aa4f1e5ee6ef6f5eb8694b22eb07c3ea5cc9b9ebfde75db4c9a04a71a5a *arm-wince.pe/upx-3.91.exe
ef18c1ae56a037d15f0494f4b835c1336a43745edba87c783f62745488008783 *armeb-linux.elf/upx-3.91
54a6158bc6bd8cc28d3abc53cc5cf9b63c3c63ae884e96fb6d6ea974c7426206 *i386-dos32.djgpp2.coff/upx-3.91.exe
801d1761289f94d7f51effb88e100832d14ae96398844084b9d10852886c4731 *i386-linux.elf/upx-3.91
f828953a66d7b3394dd2514b5972680a0cc651bd198b7607f6d3f6f6cc390a0e *i386-win32.pe/upx-3.91.exe
587b5f1f529da60f5820b8f811743aaad59e3fa9407930de1ab433863f7262a4 *m68k-atari.tos/upx-3.91.ttp
84c811f5d27bac393610bfad4180258494c43d691c13eb57394ab95d4736e621 *mipsel-linux.elf/upx-3.91
ed83830ab5e1753a742cf4981401fd8d5bdaabcfdeb385a2e8087aeb46f93512 *powerpc-linux.elf/upx-3.91
"
expected_sha256sums__t150_compress_ucl_2_all_filters="\
2849771c8799d7a446b54ad9914d679e315a9f0d9440f9728c6d5ab6541ed494 *amd64-linux.elf/upx-3.91
7ccbe7d7822cd9fed9b3c902c2bcb80f85df4f5bbb4e9e850257435ffa375a38 *arm-wince.pe/upx-3.91.exe
c6849deffc7bb1976c18a4815bca0b8fd0b6d19e4136965108daa6382efae2d5 *armeb-linux.elf/upx-3.91
c04818c54d68c99f345ee7995634dffbe7f1c2f2db8f2b510bba461d9125f5a9 *i386-dos32.djgpp2.coff/upx-3.91.exe
a3758350a0454fb78060b6d6e48d8f000e17a628b6041e8c82e3990e0b3aabe9 *i386-linux.elf/upx-3.91
b4f27ba234a5c9b4f68e2067602a180c02f95fb044830f54a45267fe1c50bb83 *i386-win32.pe/upx-3.91.exe
dd9fb59d57a7157af1a44559f6ebd8a293b0988c66b4d0951c949f88f814bf8f *m68k-atari.tos/upx-3.91.ttp
c0bc81487114b9d158ffe1dbd4081b9e3636695c63f11b3e204033b56fc69706 *mipsel-linux.elf/upx-3.91
0a700713f0c7ff19a534963f5ab95a63d2f185f82d0c42ce8c1a485aba4c1147 *powerpc-linux.elf/upx-3.91
"
expected_sha256sums__t160_compress_all_methods_1_no_filter="\
831b0dd82d2c8fb058e8300bda5dd51657a709e76c45e0c372d9cf83c2e06f31 *amd64-linux.elf/upx-3.91
057b08389af5a31a0bf4baf03d09eb07f4698f8ddec615ae35795cec62132966 *arm-wince.pe/upx-3.91.exe
49b6b8d4f04d9078686372a315e7768fc882ad66bebb67225fa0b2255b5dd1c9 *armeb-linux.elf/upx-3.91
aef085cb86ef29d7aa380a3daea403f53659af1615ceeaa76e609dc793f50cfd *i386-dos32.djgpp2.coff/upx-3.91.exe
52087d4a2c17445b0e8d5238ec3abd2ca5cd909513cff76bf42232f33d93903f *i386-linux.elf/upx-3.91
e669d7c4fec901130dd387dc8f95e3b3f5e739d6ef0bfac10080dbd257084ae6 *i386-win32.pe/upx-3.91.exe
40cd5a94039a1703986a68dd404290aa7c27fd8c184fa4c651467b8c2d621a5d *m68k-atari.tos/upx-3.91.ttp
b1db1d04e350972aa06216ec43d12a451abf5c928c885b0c442f9436c804e84e *mipsel-linux.elf/upx-3.91
65602c3e1e3e152d44d9f803281d4021bfd91aab825b72d8901faf4d7d9b593e *powerpc-linux.elf/upx-3.91
"
expected_sha256sums__t170_compress_all_methods_no_lzma_5_no_filter="\
bce397f12372437802d887d203bb2f8e4755dbe1a0e3c6bb9fa9cccd3306eef7 *amd64-linux.elf/upx-3.91
84b1fe14dbff7d4e2f1bcfee9b6e3c73f68eb5b95b37cbf2c655340bd959bfa3 *arm-wince.pe/upx-3.91.exe
1b6ac9c0893b3093d47e403a14a5d346ae3a0f135ecdbe3bb04fc0542abd469b *armeb-linux.elf/upx-3.91
d27237cd4b55c80d2b6c7da8d70ffc4f390290fcc550eec06c795e92d934b72a *i386-dos32.djgpp2.coff/upx-3.91.exe
2032623990d22b2cf8df5f2c0b581de5fd53869869b65818ea023a6857c4eff0 *i386-linux.elf/upx-3.91
51e91ff8226517ad8cd06d240e2c6c2f3d3e4033af1e593a5b294356d1bb5d33 *i386-win32.pe/upx-3.91.exe
b371684bbb2693797dd1164159de3bff9618bf6b99536542f57da07093dbb649 *m68k-atari.tos/upx-3.91.ttp
7c1fa54b86f3e5f3410216aa627bd32680d7bd8210776a14762566cb2ea37d52 *mipsel-linux.elf/upx-3.91
5c60d0817feeb4dde55be90e552ccddc81591fbaecb899c3a21afc91c0ceb3b9 *powerpc-linux.elf/upx-3.91
"
########## end .sha256sums.recreate
# /*********************************************************************** # /***********************************************************************
# // init # // init
@@ -269,6 +168,7 @@ if [[ $BM_B =~ (^|\+)coverage($|\+) ]]; then
fi fi
export UPX="--prefer-ucl --no-color --no-progress" export UPX="--prefer-ucl --no-color --no-progress"
export UPX_DISABLE_GITREV_WARNING=1
# let's go # let's go
if ! $upx_run --version; then echo "UPX-ERROR: FATAL: upx --version FAILED"; exit 1; fi if ! $upx_run --version; then echo "UPX-ERROR: FATAL: upx --version FAILED"; exit 1; fi
@@ -286,7 +186,7 @@ testdir=t010_decompressed
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
testsuite_header $testdir testsuite_header $testdir
for f in $upx_testsuite_SRCDIR/files/packed/*/upx-3.91*; do for f in $upx_testsuite_SRCDIR/files/packed/*/upx-3.9[15]*; do
testsuite_split_f $f testsuite_split_f $f
[[ -z $fb ]] && continue [[ -z $fb ]] && continue
echo "# $f" echo "# $f"
+1 -1
View File
@@ -1,5 +1,6 @@
/.bzr* /.bzr*
/.hg* /.hg*
/.vscode*
/Makevars.global* /Makevars.global*
/build* /build*
/maint* /maint*
@@ -43,7 +44,6 @@ src/stub/tmp*/*.bin
src/stub/tmp*/*.bin.bindump src/stub/tmp*/*.bin.bindump
src/stub/tmp*/*.bin.disasm src/stub/tmp*/*.bin.disasm
src/stub/tmp*/*.d src/stub/tmp*/*.d
src/stub/tmp*/*.map
src/stub/tmp*/*.o src/stub/tmp*/*.o
src/stub/tmp*/*.o.disasm src/stub/tmp*/*.o.disasm
src/stub/tmp*/mips.r3000-*.[is] src/stub/tmp*/mips.r3000-*.[is]
-295
View File
@@ -1,295 +0,0 @@
# Support for GibLab CI -- https://gitlab.com/
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
before_script:
- export TRAVIS_OS_NAME=linux
- unset CROSS C B T X
- uname -a; pwd; id; umask
- cat /etc/os-release || true
- |
if [[ $CI_BUILD_NAME =~ ^(CentOS|Fedora|OpenSUSE) ]]; then
time rpm -qa | LC_ALL=C sort
fi
- |
if [[ $CI_BUILD_NAME =~ ^(Debian|Ubuntu) ]]; then
export DEBIAN_FRONTEND=noninteractive
time dpkg -l
if [[ $CI_BUILD_NAME =~ ^Ubuntu1604- ]]; then
dpkg --add-architecture i386
fi;
time apt-get -yq update
fi
-
if [[ $CI_BUILD_NAME =~ ^CentOS5- ]]; then
time rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm;
time yum install -y
coreutils curl diffutils grep gzip sed
bzip2 file findutils git openssh-clients openssl perl tar wget which xz
gcc gcc-c++ make valgrind
glibc-devel libstdc++-devel zlib-devel
glibc-devel.i386 libstdc++-devel.i386 zlib-devel.i386;
fi
-
if [[ $CI_BUILD_NAME =~ ^CentOS6- ]]; then
time yum install -y
coreutils curl diffutils grep gzip sed
bzip2 file findutils git openssh-clients openssl perl tar wget which xz
gcc gcc-c++ make valgrind
glibc-devel libstdc++-devel zlib-devel
glibc-devel.i686 libstdc++-devel.i686 zlib-devel.i686;
fi
-
if [[ $CI_BUILD_NAME =~ ^CentOS7- ]]; then
time yum install -y
coreutils curl diffutils grep gzip sed
bzip2 file findutils git openssh-clients openssl perl tar wget which xz
clang gcc gcc-c++ make valgrind
glibc-devel libasan libstdc++-devel zlib-devel
glibc-devel.i686 libasan.i686 libstdc++-devel.i686 zlib-devel.i686;
fi
-
if [[ $CI_BUILD_NAME =~ ^Fedora ]]; then
time dnf install -y --best --allowerasing
coreutils curl diffutils grep gzip sed
bzip2 file findutils git openssh-clients openssl perl tar wget which xz
clang gcc gcc-c++ lcov make valgrind
glibc-devel libasan libstdc++-devel libubsan zlib-devel
glibc-devel.i686 libasan.i686 libstdc++-devel.i686 libubsan.i686 zlib-devel.i686;
fi
-
if [[ $CI_BUILD_NAME =~ ^OpenSUSE42.2- ]]; then
time zypper update -y;
time zypper install -y
coreutils curl diffutils grep gzip sed
bzip2 file findutils git openssh openssl perl tar wget which xz
llvm-clang gcc gcc-32bit gcc-c++ gcc-c++-32bit lcov make valgrind
glibc-devel libstdc++-devel libz1 zlib-devel
glibc-devel-32bit libstdc++-devel-32bit libz1-32bit zlib-devel-32bit;
fi
-
if [[ $CI_BUILD_NAME =~ ^(Debian|Ubuntu) ]]; then
time apt-get -yq --no-install-suggests --no-install-recommends --force-yes upgrade;
time apt-get -yq --no-install-suggests --no-install-recommends --force-yes install
build-essential ca-certificates curl file git openssh-client openssl wget xz-utils zlib1g-dev;
fi
-
if [[ $CI_BUILD_NAME =~ ^Ubuntu1604- ]]; then
time apt-get -yq --no-install-suggests --no-install-recommends --force-yes install
g++-multilib
libstdc++-5-dev:i386 zlib1g-dev:i386
libx32stdc++-5-dev libx32z1-dev;
fi
-
if [[ $CI_BUILD_NAME =~ ^Ubuntu1604-cross ]]; then
time apt-get -yq --no-install-suggests --no-install-recommends --force-yes install
crossbuild-essential-arm64 crossbuild-essential-armel crossbuild-essential-armhf
crossbuild-essential-powerpc crossbuild-essential-ppc64el crossbuild-essential-s390x
binutils-mingw-w64-i686 g++-mingw-w64-i686
binutils-mingw-w64-x86-64 g++-mingw-w64-x86-64
binutils-mips-linux-gnu g++-mips-linux-gnu
binutils-mipsel-linux-gnu g++-mipsel-linux-gnu
binutils-powerpc-linux-gnu g++-powerpc-linux-gnu
binutils-powerpc64-linux-gnu g++-powerpc64-linux-gnu
qemu-user qemu-utils wine;
fi
- git --version && bash --version
- umask 022; mkdir -p ../deps ../build/gitlab
- time git submodule update --init --recursive
- cd ../deps && time wget -q -O - https://github.com/upx/upx/releases/download/v3.00/ucl-1.03.tar.xz | tar -x --use-compress-program=xz
- cd ../deps && time wget -q -O - https://github.com/upx/upx/releases/download/v3.00/zlib-1.2.8.tar.xz | tar -x --use-compress-program=xz
- cd ../deps && time git clone https://github.com/upx/upx-testsuite
- |
if [[ $CI_BUILD_NAME =~ ^Fedora ]]; then
time dnf install -y --best --allowerasing python
cd ../deps && time wget -q -O - https://github.com/upx/upx-stubtools/releases/download/v20160918/bin-upx-20160918.tar.xz | tar -x --use-compress-program=xz
fi
- cd $CI_PROJECT_DIR; pwd
CentOS5-gcc-m32+m64: # gcc-4.1
image: centos:5
script:
# patch src/Makefile for gcc-4.1
- perl -i -p -e 's/ -Wmissing-declarations / /; s/ -Wvla / /;' src/Makefile
- time C=gcc-m32 bash ./.github/travis_build.sh
- time C=gcc-m64 bash ./.github/travis_build.sh
- time C=gcc-m32 bash ./.github/travis_testsuite_1.sh
- time C=gcc-m64 bash ./.github/travis_testsuite_1.sh
tags: [ shared ]
except: [ tags ]
CentOS6-gcc-m32+m64: # gcc-4.4
image: centos:6
script:
- time C=gcc-m32 bash ./.github/travis_build.sh
- time C=gcc-m64 bash ./.github/travis_build.sh
- time C=gcc-m32 bash ./.github/travis_testsuite_1.sh
- time C=gcc-m64 bash ./.github/travis_testsuite_1.sh
tags: [ shared ]
except: [ tags ]
CentOS7-clang+gcc-m32+m64: # clang-3.4, gcc-4.8
image: centos:7
script:
- time C=clang-m32 bash ./.github/travis_build.sh
- time C=gcc-m32 bash ./.github/travis_build.sh
- time C=clang-m64 bash ./.github/travis_build.sh
- time C=gcc-m64 bash ./.github/travis_build.sh
- time C=clang-m32 bash ./.github/travis_testsuite_1.sh
- time C=gcc-m32 bash ./.github/travis_testsuite_1.sh
- time C=clang-m64 bash ./.github/travis_testsuite_1.sh
- time C=gcc-m64 bash ./.github/travis_testsuite_1.sh
tags: [ shared ]
except: [ tags ]
Debian7-gcc-m64: # gcc-4.7
image: debian:7
script:
- time C=gcc-4.7-m64 bash ./.github/travis_build.sh
- time C=gcc-4.7-m64 bash ./.github/travis_testsuite_1.sh
tags: [ shared ]
except: [ tags ]
Debian8-gcc-m64: # gcc-4.9
image: debian:8
script:
- time C=gcc-4.9-m64 bash ./.github/travis_build.sh
- time C=gcc-4.9-m64 bash ./.github/travis_testsuite_1.sh
- time C=gcc-4.9-m64 bash ./.github/travis_deploy.sh
tags: [ shared ]
except: [ tags ]
Fedora23-clang+gcc-m32+m64: # clang-3.7, gcc-5
image: fedora:23
script:
- time X=rebuild-stubs bash ./.github/travis_build.sh
- time C=clang-m32 bash ./.github/travis_build.sh
- time C=gcc-m32 bash ./.github/travis_build.sh
- time C=clang-m64 bash ./.github/travis_build.sh
- time C=gcc-m64 bash ./.github/travis_build.sh
- time C=gcc-m64 B=sanitize bash ./.github/travis_build.sh
- time C=clang-m32 bash ./.github/travis_testsuite_1.sh
- time C=gcc-m32 bash ./.github/travis_testsuite_1.sh
- time C=clang-m64 bash ./.github/travis_testsuite_1.sh
- time C=gcc-m64 bash ./.github/travis_testsuite_1.sh
- time C=gcc-m64 B=sanitize bash ./.github/travis_testsuite_1.sh
- time C=gcc-m64 T=valgrind bash ./.github/travis_testsuite_1.sh
tags: [ shared ]
except: [ tags ]
Fedora24-clang+gcc-m32+m64: # clang-3.8, gcc-6
image: fedora:24
script:
- time X=rebuild-stubs bash ./.github/travis_build.sh
- time C=clang-m32 bash ./.github/travis_build.sh
- time C=gcc-m32 bash ./.github/travis_build.sh
- time C=clang-m64 bash ./.github/travis_build.sh
- time C=gcc-m64 bash ./.github/travis_build.sh
- time C=gcc-m64 B=sanitize bash ./.github/travis_build.sh
- time C=clang-m32 bash ./.github/travis_testsuite_1.sh
- time C=gcc-m32 bash ./.github/travis_testsuite_1.sh
- time C=clang-m64 bash ./.github/travis_testsuite_1.sh
- time C=gcc-m64 bash ./.github/travis_testsuite_1.sh
- time C=gcc-m64 B=sanitize bash ./.github/travis_testsuite_1.sh
- time C=gcc-m64 T=valgrind bash ./.github/travis_testsuite_1.sh
tags: [ shared ]
except: [ tags ]
Fedora25-clang+gcc-m32+m64: # clang-3.8, gcc-6
image: fedora:25
script:
- time X=rebuild-stubs bash ./.github/travis_build.sh
- time C=clang-m32 bash ./.github/travis_build.sh
- time C=gcc-m32 bash ./.github/travis_build.sh
- time C=clang-m64 bash ./.github/travis_build.sh
- time C=gcc-m64 bash ./.github/travis_build.sh
- time C=gcc-m64 B=sanitize bash ./.github/travis_build.sh
- time C=clang-m32 bash ./.github/travis_testsuite_1.sh
- time C=gcc-m32 bash ./.github/travis_testsuite_1.sh
- time C=clang-m64 bash ./.github/travis_testsuite_1.sh
- time C=gcc-m64 bash ./.github/travis_testsuite_1.sh
- time C=gcc-m64 B=sanitize bash ./.github/travis_testsuite_1.sh
- time C=gcc-m64 T=valgrind bash ./.github/travis_testsuite_1.sh
tags: [ shared ]
except: [ tags ]
OpenSUSE42.2-clang+gcc-m32+m64: # clang-3.8, gcc-4.8
image: opensuse:42.2
script:
- time C=clang-m64 bash ./.github/travis_build.sh
- time C=gcc-4.8-m32 bash ./.github/travis_build.sh
- time C=gcc-4.8-m64 bash ./.github/travis_build.sh
- time C=clang-m64 bash ./.github/travis_testsuite_1.sh
- time C=gcc-4.8-m32 bash ./.github/travis_testsuite_1.sh
- time C=gcc-4.8-m64 bash ./.github/travis_testsuite_1.sh
tags: [ shared ]
except: [ tags ]
Ubuntu1204-gcc-m64: # gcc-4.6
image: ubuntu:12.04
script:
- time C=gcc-4.6-m64 bash ./.github/travis_build.sh
- time C=gcc-4.6-m64 bash ./.github/travis_testsuite_1.sh
tags: [ shared ]
except: [ tags ]
Ubuntu1404-gcc-m64: # gcc-4.8
image: ubuntu:14.04
script:
- time C=gcc-4.8-m64 bash ./.github/travis_build.sh
- time C=gcc-4.8-m64 bash ./.github/travis_testsuite_1.sh
- time C=gcc-4.8-m64 bash ./.github/travis_deploy.sh
tags: [ shared ]
except: [ tags ]
Ubuntu1604-gcc-m32+m64: # gcc-5
image: ubuntu:16.04
script:
- time C=gcc-5-m32 bash ./.github/travis_build.sh
- time C=gcc-5-m64 bash ./.github/travis_build.sh
- time C=gcc-5-m32 bash ./.github/travis_testsuite_1.sh
- time C=gcc-5-m64 bash ./.github/travis_testsuite_1.sh
- time C=gcc-5-m32 bash ./.github/travis_deploy.sh
- time C=gcc-5-m64 bash ./.github/travis_deploy.sh
tags: [ shared ]
except: [ tags ]
Ubuntu1604-cross: # gcc-5
image: ubuntu:16.04
script:
- time CROSS=aarch64-linux-gnu C=gcc-5 T=qemu bash ./.github/travis_build.sh
- time CROSS=arm-linux-gnueabi C=gcc-5 T=qemu bash ./.github/travis_build.sh
- time CROSS=arm-linux-gnueabihf C=gcc-5 T=qemu bash ./.github/travis_build.sh
- time CROSS=i686-w64-mingw32 C=gcc-5 T=wine bash ./.github/travis_build.sh
- time CROSS=mips-linux-gnu C=gcc-5 T=qemu bash ./.github/travis_build.sh
- time CROSS=mipsel-linux-gnu C=gcc-5 T=qemu bash ./.github/travis_build.sh
- time CROSS=powerpc-linux-gnu C=gcc-5 T=qemu bash ./.github/travis_build.sh
- time CROSS=powerpc64-linux-gnu C=gcc-5 T=qemu bash ./.github/travis_build.sh
- time CROSS=powerpc64le-linux-gnu C=gcc-5 T=qemu bash ./.github/travis_build.sh
- time CROSS=s390x-linux-gnu C=gcc-5 T=qemu bash ./.github/travis_build.sh
- time CROSS=x86_64-w64-mingw32 C=gcc-5 T=wine bash ./.github/travis_build.sh
- time CROSS=aarch64-linux-gnu C=gcc-5 T=qemu bash ./.github/travis_testsuite_1.sh
- time CROSS=arm-linux-gnueabi C=gcc-5 T=qemu bash ./.github/travis_testsuite_1.sh
- time CROSS=arm-linux-gnueabihf C=gcc-5 T=qemu bash ./.github/travis_testsuite_1.sh
# - time CROSS=i686-w64-mingw32 C=gcc-5 T=wine bash ./.github/travis_testsuite_1.sh
# - time CROSS=mips-linux-gnu C=gcc-5 T=qemu bash ./.github/travis_testsuite_1.sh
- time CROSS=mipsel-linux-gnu C=gcc-5 T=qemu bash ./.github/travis_testsuite_1.sh
# - time CROSS=powerpc-linux-gnu C=gcc-5 T=qemu bash ./.github/travis_testsuite_1.sh
# - time CROSS=powerpc64-linux-gnu C=gcc-5 T=qemu bash ./.github/travis_testsuite_1.sh
# - time CROSS=powerpc64le-linux-gnu C=gcc-5 T=qemu bash ./.github/travis_testsuite_1.sh
# - time CROSS=s390x-linux-gnu C=gcc-5 T=qemu bash ./.github/travis_testsuite_1.sh
# - time CROSS=x86_64-w64-mingw32 C=gcc-5 T=wine bash ./.github/travis_testsuite_1.sh
- time CROSS=aarch64-linux-gnu C=gcc-5 T=qemu bash ./.github/travis_deploy.sh
- time CROSS=arm-linux-gnueabi C=gcc-5 T=qemu bash ./.github/travis_deploy.sh
- time CROSS=arm-linux-gnueabihf C=gcc-5 T=qemu bash ./.github/travis_deploy.sh
- time CROSS=i686-w64-mingw32 C=gcc-5 T=wine bash ./.github/travis_deploy.sh
- time CROSS=mips-linux-gnu C=gcc-5 T=qemu bash ./.github/travis_deploy.sh
- time CROSS=mipsel-linux-gnu C=gcc-5 T=qemu bash ./.github/travis_deploy.sh
- time CROSS=powerpc-linux-gnu C=gcc-5 T=qemu bash ./.github/travis_deploy.sh
- time CROSS=powerpc64-linux-gnu C=gcc-5 T=qemu bash ./.github/travis_deploy.sh
- time CROSS=powerpc64le-linux-gnu C=gcc-5 T=qemu bash ./.github/travis_deploy.sh
- time CROSS=s390x-linux-gnu C=gcc-5 T=qemu bash ./.github/travis_deploy.sh
- time CROSS=x86_64-w64-mingw32 C=gcc-5 T=wine bash ./.github/travis_deploy.sh
tags: [ shared ]
except: [ tags ]
# vim:set ts=2 sw=2 et:
+414 -113
View File
@@ -2,225 +2,524 @@
# Copyright (C) Markus Franz Xaver Johannes Oberhumer # Copyright (C) Markus Franz Xaver Johannes Oberhumer
sudo: false sudo: false
os: linux
dist: xenial
language: cpp language: cpp
notifications: notifications: { email: { on_success: never, on_failure: change } }
email:
on_success: never
on_failure: change
.ubuntu_toolchain_sources: &S branches:
except:
- /^appveyor.*/
- /^gitlab.*/
# Ubuntu 12.04 LTS "Precise"
# also see TB_OS_linux_precise_llvm below
.ubuntu_precise_toolchain_sources: &PS
- ubuntu-toolchain-r-test - ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.5 - llvm-toolchain-precise-3.5
- llvm-toolchain-precise-3.6 - llvm-toolchain-precise-3.6
- llvm-toolchain-precise-3.7 - llvm-toolchain-precise-3.7
- llvm-toolchain-precise-3.8 - llvm-toolchain-precise-3.8
- llvm-toolchain-precise-3.9
# Ubuntu 14.04 LTS "Trusty"
.ubuntu_trusty_toolchain_sources: &TS
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-3.9
- llvm-toolchain-trusty-4.0
- llvm-toolchain-trusty-5.0
- llvm-toolchain-trusty-6.0
- llvm-toolchain-trusty-7
- llvm-toolchain-trusty-8
# Ubuntu 16.04 LTS "Xenial"
.ubuntu_xenial_toolchain_sources: &XS
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-6.0
- llvm-toolchain-xenial-7
- llvm-toolchain-xenial-8
env: env:
global: global:
# TB_LEVEL >= 1: gcc-7, gcc-8, gcc-9, clang-8, xcode11
# TB_LEVEL >= 2: gcc-4.4, gcc-4.8, gcc-6, clang-3.4, clang-7
# TB_LEVEL >= 3: gcc-4.6, gcc-5, clang-3.9, clang-6, xcode9, xcode10
# TB_LEVEL >= 4: include sanitize/scan-build/valgrind builds
# TB_LEVEL >= 5: cross-compilers running testsuite under qemu/wine
# TB_LEVEL >= 6: all other compilers & builds
- TB_LEVEL=5
- TB_OS_linux=1 TB_OS_osx=1
- TB_OS_linux_precise_llvm=1
- CROSS= C= B= T= X= - CROSS= C= B= T= X=
- secure: "YXHLXK+CM5d8yELIUSSs+P0/CoefClO7/AUX1oBj5W75g+YzR5uS2doVsB8UH8S8/GdNxk4P9Jgn4EiEVnjfGgn2eAD9MVpDPIxyJs5vI+5G77asq3QNdSl6QFv3O9I/6yBoVCewgPFPqsMd7Yvs/Ea3LcQkqalVhrC8ybYtmfs6VL2w33gn2J3b3TCn/s21L0ijklM0xvP1GNMDtuUpTSish5wvGOHE/91rwtdUDbJR8u31QY7fTASDiNnL/7ihgEIZ5XxpDYXviX1GC+nemhX1fWpmVmuT8m30Ruodi0yJVGASw9i2SaKv/VX/fJ/w2vlCfspL5LMZKkVLlfpIo3mQGqmMHFxv7mNy+hRu50ptoWNSkWArcqifwveh2liHUpl4jTvWaVll5Tw5VUGJhAUdzCTnqLIbWFnKIgCedL3iRFi4+EbyWNxel8lFESMOTDZFfJG5yEiDJbgbLsUaT2GmrsOphwAG7zDcZzvYTdjg/lF4Wh0MUnQJ+0MhDpii8Ahjp49lAPdw8uRQyyY7d7ksYKXVIkbgl6dRCC5vZSPucJiFjq2BClqIoEmzZPvHveDbovzFkNhJX9tFLrHLcXbPPcegww1FGoQ3wBM6JwJ+TvSD6N4OdCmou05aDuuQeznHi3GxOScjGwxdMIU28fdJDCTDg2rOihm22kHVajo=" - secure: "YXHLXK+CM5d8yELIUSSs+P0/CoefClO7/AUX1oBj5W75g+YzR5uS2doVsB8UH8S8/GdNxk4P9Jgn4EiEVnjfGgn2eAD9MVpDPIxyJs5vI+5G77asq3QNdSl6QFv3O9I/6yBoVCewgPFPqsMd7Yvs/Ea3LcQkqalVhrC8ybYtmfs6VL2w33gn2J3b3TCn/s21L0ijklM0xvP1GNMDtuUpTSish5wvGOHE/91rwtdUDbJR8u31QY7fTASDiNnL/7ihgEIZ5XxpDYXviX1GC+nemhX1fWpmVmuT8m30Ruodi0yJVGASw9i2SaKv/VX/fJ/w2vlCfspL5LMZKkVLlfpIo3mQGqmMHFxv7mNy+hRu50ptoWNSkWArcqifwveh2liHUpl4jTvWaVll5Tw5VUGJhAUdzCTnqLIbWFnKIgCedL3iRFi4+EbyWNxel8lFESMOTDZFfJG5yEiDJbgbLsUaT2GmrsOphwAG7zDcZzvYTdjg/lF4Wh0MUnQJ+0MhDpii8Ahjp49lAPdw8uRQyyY7d7ksYKXVIkbgl6dRCC5vZSPucJiFjq2BClqIoEmzZPvHveDbovzFkNhJX9tFLrHLcXbPPcegww1FGoQ3wBM6JwJ+TvSD6N4OdCmou05aDuuQeznHi3GxOScjGwxdMIU28fdJDCTDg2rOihm22kHVajo="
- secure: "JpSv3+QRmHcfN/bmT3mVkqET44NCPhM/qpcUssCVXnd2GW0qWURoyPHzVMn/gbeAkUjR6djtN3OzJ+M181QmlmTmE26pZC9Q6r1buNDWdkIH1FcpMCa67BBAjmq+yDwulDtvCMv0lbz60v57lzHBOLczF3yMxBVTjXxt1RsrzDLHzzVaDR5lEe+sQUNeRL7Vaq8crimPNTr4ZhMe59eweTO/3AWovuSPf250k1flfv7I8audZgrVZdbVKvj5C3Sziy1AGXcu8mDfET9/Ya2XBCQHWODjiKlnhSxqthhP3gQuacaLjpS2FjvQlamd+I9x6BBoLSeNbiXD9vgCydDUKvmUrU+zQs64U1hHk9WZWVC19kG7lTtTdanGDIUlIUtFZgqE4AQpJaIUWkUmHGyHi61JMvduzX21eL5c5j9DoJteX42FPb1n3xK/JSnUkLMpbFdQuy5inhzefhDfeNzaYxt8nPwHnJqrF73SW4PLDKeRyzvg/P+zqcou8nXrHfA1z9/FlnYzf7Qc9meai9Q/JARX3Q1ZKu5uyG+RuBLe2POq0192w6pflTr1ZlLJsKNSc1147PviKfmpla1lg3/6uVzMp5tgwbve/hx9SDXiRueGttKw/ymsY662+8G24NRKo4fxNklWFHaB4owM84edDzXDckPXbPgue8/HQT8BFio=" - secure: "JpSv3+QRmHcfN/bmT3mVkqET44NCPhM/qpcUssCVXnd2GW0qWURoyPHzVMn/gbeAkUjR6djtN3OzJ+M181QmlmTmE26pZC9Q6r1buNDWdkIH1FcpMCa67BBAjmq+yDwulDtvCMv0lbz60v57lzHBOLczF3yMxBVTjXxt1RsrzDLHzzVaDR5lEe+sQUNeRL7Vaq8crimPNTr4ZhMe59eweTO/3AWovuSPf250k1flfv7I8audZgrVZdbVKvj5C3Sziy1AGXcu8mDfET9/Ya2XBCQHWODjiKlnhSxqthhP3gQuacaLjpS2FjvQlamd+I9x6BBoLSeNbiXD9vgCydDUKvmUrU+zQs64U1hHk9WZWVC19kG7lTtTdanGDIUlIUtFZgqE4AQpJaIUWkUmHGyHi61JMvduzX21eL5c5j9DoJteX42FPb1n3xK/JSnUkLMpbFdQuy5inhzefhDfeNzaYxt8nPwHnJqrF73SW4PLDKeRyzvg/P+zqcou8nXrHfA1z9/FlnYzf7Qc9meai9Q/JARX3Q1ZKu5uyG+RuBLe2POq0192w6pflTr1ZlLJsKNSc1147PviKfmpla1lg3/6uVzMp5tgwbve/hx9SDXiRueGttKw/ymsY662+8G24NRKo4fxNklWFHaB4owM84edDzXDckPXbPgue8/HQT8BFio="
matrix:
- TRAVIS_EMPTY_JOB_WORKAROUND=true
matrix: matrix:
fast_finish: true fast_finish: true
exclude:
- env: TRAVIS_EMPTY_JOB_WORKAROUND=true
include: include:
- os: linux - if: 1 = 1
sudo: required os: linux
dist: trusty dist: xenial
compiler: gcc compiler: gcc
env: X=rebuild-stubs env: X=rebuild-stubs
addons: { apt: { packages: [ "g++-multilib", "lib32z1" ] } } addons: { apt: { packages: [ "g++-multilib", "lib32z1" ] } }
- os: linux
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[2-9]$/
os: linux
dist: precise
compiler: gcc compiler: gcc
env: C=gcc-4.4-m32 env: C=gcc-4.4-m32
addons: { apt: { sources: *S, packages: [ "g++-4.4-multilib", "zlib1g-dev:i386" ] } } addons: { apt: { sources: *PS, packages: [ "g++-4.4-multilib", "zlib1g-dev:i386" ] } }
- os: linux - if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[2-9]$/
os: linux
dist: precise
compiler: gcc compiler: gcc
env: C=gcc-4.4-m64 env: C=gcc-4.4-m64
addons: { apt: { sources: *S, packages: [ "g++-4.4" ] } } addons: { apt: { sources: *PS, packages: [ "g++-4.4" ] } }
- os: linux
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[6-9]$/
os: linux
dist: precise
compiler: gcc compiler: gcc
env: C=gcc-4.5-m32 env: C=gcc-4.5-m32
addons: { apt: { sources: *S, packages: [ "g++-4.5-multilib", "zlib1g-dev:i386" ] } } addons: { apt: { sources: *PS, packages: [ "g++-4.5-multilib", "zlib1g-dev:i386" ] } }
- os: linux - if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[6-9]$/
os: linux
dist: precise
compiler: gcc compiler: gcc
env: C=gcc-4.5-m64 env: C=gcc-4.5-m64
addons: { apt: { sources: *S, packages: [ "g++-4.5" ] } } addons: { apt: { sources: *PS, packages: [ "g++-4.5" ] } }
- os: linux
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[3-9]$/
os: linux
dist: precise
compiler: gcc compiler: gcc
env: C=gcc-4.6-m32 env: C=gcc-4.6-m32
addons: { apt: { packages: [ "g++-multilib", "zlib1g-dev:i386" ] } } addons: { apt: { packages: [ "g++-multilib", "zlib1g-dev:i386" ] } }
- os: linux - if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[3-9]$/
os: linux
dist: precise
compiler: gcc compiler: gcc
env: C=gcc-4.6-m64 env: C=gcc-4.6-m64
- os: linux
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[6-9]$/
os: linux
dist: precise
compiler: gcc compiler: gcc
env: C=gcc-4.7-m32 env: C=gcc-4.7-m32
addons: { apt: { sources: *S, packages: [ "g++-4.7-multilib", "zlib1g-dev:i386" ] } } addons: { apt: { sources: *PS, packages: [ "g++-4.7-multilib", "zlib1g-dev:i386" ] } }
- os: linux - if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[6-9]$/
os: linux
dist: precise
compiler: gcc compiler: gcc
env: C=gcc-4.7-m64 env: C=gcc-4.7-m64
addons: { apt: { sources: *S, packages: [ "g++-4.7" ] } } addons: { apt: { sources: *PS, packages: [ "g++-4.7" ] } }
- os: linux
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[2-9]$/
os: linux
dist: trusty
compiler: gcc compiler: gcc
env: C=gcc-4.8-m32 env: C=gcc-4.8-m32
addons: { apt: { sources: *S, packages: [ "g++-4.8-multilib", "zlib1g-dev:i386" ] } } addons: { apt: { packages: [ "g++-multilib", "zlib1g-dev:i386" ] } }
- os: linux - if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[2-9]$/
os: linux
dist: trusty
compiler: gcc compiler: gcc
env: C=gcc-4.8-m64 env: C=gcc-4.8-m64
addons: { apt: { sources: *S, packages: [ "g++-4.8" ] } } - if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[2-9]$/
# - os: linux os: linux
# sudo: required dist: trusty
# dist: trusty compiler: gcc
# compiler: gcc env: C=gcc-4.8-mx32
# env: C=gcc-4.8-mx32 addons: { apt: { packages: [ "g++-multilib", "libx32stdc++-4.8-dev" ] } }
# addons: { apt: { packages: [ "g++-multilib", "libx32stdc++-4.8-dev", "libx32z1-dev" ] } }
- os: linux - if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[6-9]$/
os: linux
dist: trusty
compiler: gcc compiler: gcc
env: C=gcc-4.9-m32 env: C=gcc-4.9-m32
addons: { apt: { sources: *S, packages: [ "g++-4.9-multilib", "zlib1g-dev:i386" ] } } addons: { apt: { sources: *TS, packages: [ "g++-4.9-multilib", "zlib1g-dev:i386" ] } }
- os: linux - if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[6-9]$/
os: linux
dist: trusty
compiler: gcc compiler: gcc
env: C=gcc-4.9-m64 env: C=gcc-4.9-m64
addons: { apt: { sources: *S, packages: [ "g++-4.9" ] } } addons: { apt: { sources: *TS, packages: [ "g++-4.9" ] } }
- os: linux
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[3-9]$/
os: linux
dist: trusty
compiler: gcc compiler: gcc
env: C=gcc-5-m32 env: C=gcc-5-m32
addons: { apt: { sources: *S, packages: [ "g++-5-multilib", "zlib1g-dev:i386" ] } } addons: { apt: { sources: *TS, packages: [ "g++-5-multilib", "zlib1g-dev:i386" ] } }
- os: linux - if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[3-9]$/
os: linux
dist: trusty
compiler: gcc compiler: gcc
env: C=gcc-5-m64 env: C=gcc-5-m64
addons: { apt: { sources: *S, packages: [ "g++-5" ] } } addons: { apt: { sources: *TS, packages: [ "g++-5" ] } }
- os: linux
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[2-9]$/
os: linux
dist: trusty
compiler: gcc compiler: gcc
env: C=gcc-6-m32 env: C=gcc-6-m32
addons: { apt: { sources: *S, packages: [ "g++-6-multilib", "zlib1g-dev:i386" ] } } addons: { apt: { sources: *TS, packages: [ "g++-6-multilib", "zlib1g-dev:i386" ] } }
- os: linux - if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[2-9]$/
os: linux
dist: trusty
compiler: gcc compiler: gcc
env: C=gcc-6-m64 env: C=gcc-6-m64
addons: { apt: { sources: *S, packages: [ "g++-6" ] } } addons: { apt: { sources: *TS, packages: [ "g++-6" ] } }
- os: linux
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[1-9]$/
os: linux
dist: trusty
compiler: gcc compiler: gcc
env: C=gcc-6-m32 B=debug env: C=gcc-7-m32
addons: { apt: { sources: *S, packages: [ "g++-6-multilib", "zlib1g-dev:i386" ] } } addons: { apt: { sources: *TS, packages: [ "g++-7-multilib", "zlib1g-dev:i386" ] } }
- os: linux - if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[1-9]$/
os: linux
dist: trusty
compiler: gcc compiler: gcc
env: C=gcc-6-m64 B=debug env: C=gcc-7-m64
addons: { apt: { sources: *S, packages: [ "g++-6" ] } } addons: { apt: { sources: *TS, packages: [ "g++-7" ] } }
- os: linux
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[1-9]$/
os: linux
dist: trusty
compiler: gcc compiler: gcc
env: C=gcc-6-m64 B=debug+sanitize env: C=gcc-8-m32
addons: { apt: { sources: *S, packages: [ "g++-6" ] } } addons: { apt: { sources: *TS, packages: [ "g++-8-multilib", "zlib1g-dev:i386" ] } }
- os: linux - if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[1-9]$/
os: linux
dist: trusty
compiler: gcc compiler: gcc
env: C=gcc-6-m64 B=sanitize env: C=gcc-8-m64
addons: { apt: { sources: *S, packages: [ "g++-6" ] } } addons: { apt: { sources: *TS, packages: [ "g++-8" ] } }
- os: linux - if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[6-9]$/
os: linux
dist: trusty
compiler: gcc compiler: gcc
env: C=gcc-6-m64 B=valgrind T=valgrind env: C=gcc-8-m32 B=debug
addons: { apt: { sources: *S, packages: [ "g++-6", valgrind ] } } addons: { apt: { sources: *TS, packages: [ "g++-8-multilib", "zlib1g-dev:i386" ] } }
- os: linux - if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[6-9]$/
os: linux
dist: trusty
compiler: gcc
env: C=gcc-8-m64 B=debug
addons: { apt: { sources: *TS, packages: [ "g++-8" ] } }
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[4-9]$/
# must use sudo CAP_SYS_PTRACE for sanitize - see https://github.com/travis-ci/travis-ci/issues/9033
sudo: true
os: linux
dist: trusty
compiler: gcc
env: C=gcc-8-m64 B=debug+sanitize
addons: { apt: { sources: *TS, packages: [ "g++-8" ] } }
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[4-9]$/
# must use sudo CAP_SYS_PTRACE for sanitize - see https://github.com/travis-ci/travis-ci/issues/9033
sudo: true
os: linux
dist: trusty
compiler: gcc
env: C=gcc-8-m64 B=sanitize
addons: { apt: { sources: *TS, packages: [ "g++-8" ] } }
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[4-9]$/
os: linux
dist: trusty
compiler: gcc
env: C=gcc-8-m64 B=valgrind T=valgrind
addons: { apt: { sources: *TS, packages: [ "g++-8", valgrind ] } }
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[1-9]$/
os: linux
dist: xenial
compiler: gcc
env: C=gcc-9-m32
addons: { apt: { sources: *XS, packages: [ "g++-9-multilib", "zlib1g-dev:i386" ] } }
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[1-9]$/
os: linux
dist: xenial
compiler: gcc
env: C=gcc-9-m64
addons: { apt: { sources: *XS, packages: [ "g++-9" ] } }
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[2-9]$/
os: linux
dist: precise
compiler: clang compiler: clang
env: C=clang-3.4-m32 env: C=clang-3.4-m32
addons: { apt: { packages: [ "g++-multilib", "zlib1g-dev:i386" ] } } addons: { apt: { packages: [ "g++-multilib", "zlib1g-dev:i386" ] } }
- os: linux - if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[2-9]$/
os: linux
dist: precise
compiler: clang compiler: clang
env: C=clang-3.4-m64 env: C=clang-3.4-m64
- os: linux
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[6-9]$/ AND env(TB_OS_linux_precise_llvm) = 1
os: linux
dist: precise
compiler: clang compiler: clang
env: C=clang-3.5-m32 env: C=clang-3.5-m32
addons: { apt: { sources: *S, packages: [ "clang-3.5", "g++-6-multilib", "zlib1g-dev:i386" ] } } addons: { apt: { sources: *PS, packages: [ "clang-3.5", "g++-6-multilib", "zlib1g-dev:i386" ] } }
- os: linux - if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[6-9]$/ AND env(TB_OS_linux_precise_llvm) = 1
os: linux
dist: precise
compiler: clang compiler: clang
env: C=clang-3.5-m64 env: C=clang-3.5-m64
addons: { apt: { sources: *S, packages: [ "clang-3.5" ] } } addons: { apt: { sources: *PS, packages: [ "clang-3.5" ] } }
- os: linux
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[6-9]$/ AND env(TB_OS_linux_precise_llvm) = 1
os: linux
dist: precise
compiler: clang compiler: clang
env: C=clang-3.6-m32 env: C=clang-3.6-m32
addons: { apt: { sources: *S, packages: [ "clang-3.6", "g++-6-multilib", "zlib1g-dev:i386" ] } } addons: { apt: { sources: *PS, packages: [ "clang-3.6", "g++-6-multilib", "zlib1g-dev:i386" ] } }
- os: linux - if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[6-9]$/ AND env(TB_OS_linux_precise_llvm) = 1
os: linux
dist: precise
compiler: clang compiler: clang
env: C=clang-3.6-m64 env: C=clang-3.6-m64
addons: { apt: { sources: *S, packages: [ "clang-3.6" ] } } addons: { apt: { sources: *PS, packages: [ "clang-3.6" ] } }
- os: linux
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[6-9]$/ AND env(TB_OS_linux_precise_llvm) = 1
os: linux
dist: precise
compiler: clang compiler: clang
env: C=clang-3.7-m32 env: C=clang-3.7-m32
addons: { apt: { sources: *S, packages: [ "clang-3.7", "g++-6-multilib", "zlib1g-dev:i386" ] } } addons: { apt: { sources: *PS, packages: [ "clang-3.7", "g++-6-multilib", "zlib1g-dev:i386" ] } }
- os: linux - if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[6-9]$/ AND env(TB_OS_linux_precise_llvm) = 1
os: linux
dist: precise
compiler: clang compiler: clang
env: C=clang-3.7-m64 env: C=clang-3.7-m64
addons: { apt: { sources: *S, packages: [ "clang-3.7" ] } } addons: { apt: { sources: *PS, packages: [ "clang-3.7" ] } }
- os: linux
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[6-9]$/ AND env(TB_OS_linux_precise_llvm) = 1
os: linux
dist: precise
compiler: clang compiler: clang
env: C=clang-3.8-m32 env: C=clang-3.8-m32
addons: { apt: { sources: *S, packages: [ "clang-3.8", "g++-6-multilib", "zlib1g-dev:i386" ] } } addons: { apt: { sources: *PS, packages: [ "clang-3.8", "g++-6-multilib", "zlib1g-dev:i386" ] } }
- os: linux - if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[6-9]$/ AND env(TB_OS_linux_precise_llvm) = 1
os: linux
dist: precise
compiler: clang compiler: clang
env: C=clang-3.8-m64 env: C=clang-3.8-m64
addons: { apt: { sources: *S, packages: [ "clang-3.8" ] } } addons: { apt: { sources: *PS, packages: [ "clang-3.8" ] } }
- os: linux
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[3-9]$/
os: linux
dist: trusty
compiler: clang compiler: clang
env: C=clang-3.8-m64 B=debug+sanitize env: C=clang-3.9-m32
addons: { apt: { sources: *S, packages: [ "clang-3.8" ] } } addons: { apt: { sources: *TS, packages: [ "clang-3.9", "g++-7-multilib", "zlib1g-dev:i386" ] } }
- os: linux - if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[3-9]$/
os: linux
dist: trusty
compiler: clang compiler: clang
env: C=clang-3.8-m64 B=sanitize env: C=clang-3.9-m64
addons: { apt: { sources: *S, packages: [ "clang-3.8" ] } } addons: { apt: { sources: *TS, packages: [ "clang-3.9" ] } }
- os: linux
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[6-9]$/
os: linux
dist: trusty
compiler: clang compiler: clang
env: C=clang-3.8-m64 B=debug+scan-build env: C=clang-4.0-m32
addons: { apt: { sources: *S, packages: [ "clang-3.8" ] } } addons: { apt: { sources: *TS, packages: [ "clang-4.0", "g++-7-multilib", "zlib1g-dev:i386" ] } }
- os: linux - if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[6-9]$/
os: linux
dist: trusty
compiler: clang compiler: clang
env: C=clang-3.8-m64 B=scan-build env: C=clang-4.0-m64
addons: { apt: { sources: *S, packages: [ "clang-3.8" ] } } addons: { apt: { sources: *TS, packages: [ "clang-4.0" ] } }
- os: linux
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[6-9]$/
os: linux
dist: trusty
compiler: clang
env: C=clang-5.0-m32
addons: { apt: { sources: *TS, packages: [ "clang-5.0", "g++-7-multilib", "zlib1g-dev:i386" ] } }
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[6-9]$/
os: linux
dist: trusty
compiler: clang
env: C=clang-5.0-m64
addons: { apt: { sources: *TS, packages: [ "clang-5.0" ] } }
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[3-9]$/
os: linux
dist: trusty
compiler: clang
env: C=clang-6.0-m32
addons: { apt: { sources: *TS, packages: [ "clang-6.0", "g++-7-multilib", "zlib1g-dev:i386" ] } }
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[3-9]$/
os: linux
dist: trusty
compiler: clang
env: C=clang-6.0-m64
addons: { apt: { sources: *TS, packages: [ "clang-6.0" ] } }
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[4-9]$/
# must use sudo CAP_SYS_PTRACE for sanitize - see https://github.com/travis-ci/travis-ci/issues/9033
sudo: true
os: linux
dist: trusty
compiler: clang
env: C=clang-6.0-m64 B=debug+sanitize
addons: { apt: { sources: *TS, packages: [ "clang-6.0" ] } }
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[4-9]$/
# must use sudo CAP_SYS_PTRACE for sanitize - see https://github.com/travis-ci/travis-ci/issues/9033
sudo: true
os: linux
dist: trusty
compiler: clang
env: C=clang-6.0-m64 B=sanitize
addons: { apt: { sources: *TS, packages: [ "clang-6.0" ] } }
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[4-9]$/
os: linux
dist: trusty
compiler: clang
env: C=clang-6.0-m64 B=debug+scan-build
addons: { apt: { sources: *TS, packages: [ "clang-6.0", "clang-tools-6.0" ] } }
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[4-9]$/
os: linux
dist: trusty
compiler: clang
env: C=clang-6.0-m64 B=scan-build
addons: { apt: { sources: *TS, packages: [ "clang-6.0", "clang-tools-6.0" ] } }
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[2-9]$/
os: linux
dist: xenial
compiler: clang
env: C=clang-7-m32
addons: { apt: { sources: *XS, packages: [ "clang-7", "g++-9-multilib", "zlib1g-dev:i386" ] } }
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[2-9]$/
os: linux
dist: xenial
compiler: clang
env: C=clang-7-m64
addons: { apt: { sources: *XS, packages: [ "clang-7" ] } }
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[1-9]$/
os: linux
dist: xenial
compiler: clang
env: C=clang-8-m32
addons: { apt: { sources: *XS, packages: [ "clang-8", "g++-9-multilib", "zlib1g-dev:i386" ] } }
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[1-9]$/
os: linux
dist: xenial
compiler: clang
env: C=clang-8-m64
addons: { apt: { sources: *XS, packages: [ "clang-8" ] } }
# Ubuntu 12.04 cross compilers
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[5-9]$/
os: linux
dist: precise
compiler: gcc compiler: gcc
env: CROSS=arm-linux-gnueabi C=gcc-4.6 T=SKIP env: CROSS=arm-linux-gnueabi C=gcc-4.6 T=qemu
addons: { apt: { packages: [ "g++-arm-linux-gnueabi", "qemu-user" ] } } addons: { apt: { packages: [ "g++-arm-linux-gnueabi", "qemu-user" ] } }
- os: linux - if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[5-9]$/
os: linux
dist: precise
compiler: gcc compiler: gcc
env: CROSS=arm-linux-gnueabihf C=gcc-4.6 T=SKIP env: CROSS=arm-linux-gnueabihf C=gcc-4.6 T=qemu
addons: { apt: { packages: [ "g++-arm-linux-gnueabihf", "qemu-user" ] } } addons: { apt: { packages: [ "g++-arm-linux-gnueabihf", "qemu-user" ] } }
- os: linux - if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[5-9]$/
os: linux
dist: precise
compiler: gcc compiler: gcc
env: CROSS=i386-w64-mingw32 C=gcc-4.6 T=wine env: CROSS=i386-w64-mingw32 C=gcc-4.6 T=wine
addons: { apt: { packages: [ "binutils-mingw-w64-i686", "g++-mingw-w64-i686", "wine" ] } } addons: { apt: { packages: [ "binutils-mingw-w64-i686", "g++-mingw-w64-i686", "wine" ] } }
- os: linux - if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[5-9]$/
os: linux
dist: precise
compiler: gcc compiler: gcc
env: CROSS=x86_64-w64-mingw32 C=gcc-4.6 T=wine env: CROSS=x86_64-w64-mingw32 C=gcc-4.6 T=wine
addons: { apt: { packages: [ "binutils-mingw-w64-x86-64", "g++-mingw-w64-x86-64", "wine" ] } } addons: { apt: { packages: [ "binutils-mingw-w64-x86-64", "g++-mingw-w64-x86-64", "wine" ] } }
- os: osx
# Ubuntu 16.04 cross compilers
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[5-90]$/
os: linux
dist: xenial
compiler: gcc
env: CROSS=mips-linux-gnu C=gcc-5 T=qemu
addons: { apt: { packages: [ "g++-5-mips-linux-gnu", "qemu-user" ] } }
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[5-90]$/
os: linux
dist: xenial
compiler: gcc
env: CROSS=mipsel-linux-gnu C=gcc-5 T=qemu
addons: { apt: { packages: [ "g++-5-mipsel-linux-gnu", "qemu-user" ] } }
- if: env(TB_OS_linux) = 1 AND env(TB_LEVEL) =~ /^[5-90]$/
os: linux
dist: xenial
compiler: gcc
env: CROSS=powerpc-linux-gnu C=gcc-5 T=qemu
addons: { apt: { packages: [ "g++-5-powerpc-linux-gnu", "qemu-user" ] } }
- if: env(TB_OS_osx) = 1 AND env(TB_LEVEL) =~ /^[6-9]$/
os: osx
osx_image: xcode6.4 osx_image: xcode6.4
compiler: clang compiler: clang
# must use debug build or else we get "ld: internal error: atom not found" when linking # must use debug build or else we get "ld: internal error: atom not found" when linking
env: C=clang-602-m32 B=debug env: C=clang-602-m32 B=debug
- os: osx - if: env(TB_OS_osx) = 1 AND env(TB_LEVEL) =~ /^[6-9]$/
os: osx
osx_image: xcode6.4 osx_image: xcode6.4
compiler: clang compiler: clang
# must use debug build or else we get "ld: internal error: atom not found" when linking # must use debug build or else we get "ld: internal error: atom not found" when linking
env: C=clang-602-m64 B=debug env: C=clang-602-m64 B=debug
- os: osx
- if: env(TB_OS_osx) = 1 AND env(TB_LEVEL) =~ /^[6-9]$/
os: osx
osx_image: xcode7.3 osx_image: xcode7.3
compiler: clang compiler: clang
env: C=clang-703-m32 env: C=clang-703-m32
- os: osx - if: env(TB_OS_osx) = 1 AND env(TB_LEVEL) =~ /^[6-9]$/
os: osx
osx_image: xcode7.3 osx_image: xcode7.3
compiler: clang compiler: clang
env: C=clang-703-m64 env: C=clang-703-m64
- os: osx
osx_image: xcode8.2 - if: env(TB_OS_osx) = 1 AND env(TB_LEVEL) =~ /^[6-9]$/
os: osx
osx_image: xcode8.3
compiler: clang compiler: clang
env: C=clang-800-m32 env: C=clang-802-m32
- os: osx - if: env(TB_OS_osx) = 1 AND env(TB_LEVEL) =~ /^[6-9]$/
osx_image: xcode8.2 os: osx
osx_image: xcode8.3
compiler: clang compiler: clang
env: C=clang-800-m64 env: C=clang-802-m64
- if: env(TB_OS_osx) = 1 AND env(TB_LEVEL) =~ /^[3-9]$/
os: osx
osx_image: xcode9.4
compiler: clang
env: C=clang-902-m32
- if: env(TB_OS_osx) = 1 AND env(TB_LEVEL) =~ /^[3-9]$/
os: osx
osx_image: xcode9.4
compiler: clang
env: C=clang-902-m64
- if: env(TB_OS_osx) = 1 AND env(TB_LEVEL) =~ /^[3-9]$/
os: osx
osx_image: xcode10.3
compiler: clang
env: C=clang-1001-m64
- if: env(TB_OS_osx) = 1 AND env(TB_LEVEL) =~ /^[1-9]$/
os: osx
osx_image: xcode11.3
compiler: clang
env: C=clang-1100-m64
addons: { homebrew: { packages: [ "coreutils" ] } }
install: install:
- uname -a; pwd; id; umask - uname -a; pwd; id; umask
@@ -250,9 +549,11 @@ install:
fi fi
script: script:
- cd $TRAVIS_BUILD_DIR && bash ./.github/travis_build.sh - success=1
- cd $TRAVIS_BUILD_DIR && bash ./.github/travis_testsuite_1.sh - cd $TRAVIS_BUILD_DIR || success=0
after_success: - test $success = 0 || bash ./.github/travis_build.sh || success=0
- cd $TRAVIS_BUILD_DIR && bash ./.github/travis_deploy.sh - test $success = 0 || bash ./.github/travis_testsuite_1.sh || success=0
- test $success = 0 || bash ./.github/travis_deploy.sh || success=0
- test $success = 1
# vim:set ts=2 sw=2 et: # vim:set ts=2 sw=2 et:
+1 -1
View File
@@ -8,7 +8,7 @@
The Ultimate Packer for eXecutables The Ultimate Packer for eXecutables
Copyright (c) 1996-2017 Markus Oberhumer, Laszlo Molnar & John Reiser Copyright (c) 1996-2020 Markus Oberhumer, Laszlo Molnar & John Reiser
https://upx.github.io https://upx.github.io
+1 -1
View File
@@ -1,7 +1,7 @@
# #
# UPX toplevel Makefile - needs GNU make 3.81 or better # UPX toplevel Makefile - needs GNU make 3.81 or better
# #
# Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer # Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
# #
MAKEFLAGS += -rR MAKEFLAGS += -rR
+23 -5
View File
@@ -2,12 +2,30 @@
User visible changes for UPX User visible changes for UPX
================================================================== ==================================================================
Changes in 3.96 (23 Jan 2020):
* bug fixes - see https://github.com/upx/upx/milestone/5
Changes in 3.95 (26 Aug 2018):
* Flag --android-shlib to work around bad design in Android
* Flag --force-pie when ET_DYN main program is not marked as DF_1_PIE
* Better compatibility with varying layout of address space on Linux
* Support for 4 PT_LOAD layout in ELF generated by binutils-2.31
* bug fixes, particularly better diagnosis of malformed input
* bug fixes - see https://github.com/upx/upx/milestone/4
Changes in 3.94 (12 May 2017):
* Add support for arm64-linux (aka "aarch64").
* Add support for --lzma compression on 64-bit PowerPC (Thierry Fauck).
* For Mach, "upx -d" will unpack a prefix of the file (and warn).
* Various improvements to the ELF formats.
* bug fixes - see https://github.com/upx/upx/milestone/3
Changes in 3.93 (29 Jan 2017): Changes in 3.93 (29 Jan 2017):
* UPX has moved to GitHub - the new home page is https://upx.github.io * Fixed some win32/pe and win64/pe regressions introduced in 3.92
* fixed some win32/pe and win64/pe regressions introduced in 3.92 * bug fixes - see https://github.com/upx/upx/milestone/2
Changes in 3.92 (11 Dec 2016): Changes in 3.92 (11 Dec 2016):
* UPX has moved to GitHub - the new home page is https://upx.github.io * INFO: UPX has moved to GitHub - the new home page is https://upx.github.io
* IMPORTANT: all PE formats: internal changes: reunited the diverged source * IMPORTANT: all PE formats: internal changes: reunited the diverged source
files - please report all regressions into the bug tracker and try UPX 3.91 files - please report all regressions into the bug tracker and try UPX 3.91
in case of problems. in case of problems.
@@ -19,7 +37,7 @@ Changes in 3.92 (11 Dec 2016):
by Codenomicon to NCSC-FI on 2015-01-08. by Codenomicon to NCSC-FI on 2015-01-08.
The vulnerabilities were discovered by Joonas Kuorilehto and The vulnerabilities were discovered by Joonas Kuorilehto and
Antti Häyrynen from Codenomicon. Antti Häyrynen from Codenomicon.
* bug fixes * bug fixes - see https://github.com/upx/upx/milestone/1
Changes in 3.91 (30 Sep 2013): Changes in 3.91 (30 Sep 2013):
* Added experimental support for Windows 64-bit PE files, based on * Added experimental support for Windows 64-bit PE files, based on
@@ -103,7 +121,7 @@ Changes in 2.93 beta (08 Mar 2007):
you have to explicitly use '--lzma' even for '--ultra-brute' here you have to explicitly use '--lzma' even for '--ultra-brute' here
because runtime decompression is about 30 times slower than NRV - because runtime decompression is about 30 times slower than NRV -
which is really noticeable on old machines. which is really noticeable on old machines.
* dos/exe: fixed a rarely occuring bug in relocation handling * dos/exe: fixed a rarely occurring bug in relocation handling
* win32/pe & arm/pe: better icon compression handling * win32/pe & arm/pe: better icon compression handling
Changes in 2.92 beta (23 Jan 2007): Changes in 2.92 beta (23 Jan 2007):
+1 -1
View File
@@ -8,7 +8,7 @@
The Ultimate Packer for eXecutables The Ultimate Packer for eXecutables
Copyright (c) 1996-2017 Markus Oberhumer, Laszlo Molnar & John Reiser Copyright (c) 1996-2020 Markus Oberhumer, Laszlo Molnar & John Reiser
https://upx.github.io https://upx.github.io
+4 -4
View File
@@ -8,7 +8,7 @@
The Ultimate Packer for eXecutables The Ultimate Packer for eXecutables
Copyright (c) 1996-2017 Markus Oberhumer, Laszlo Molnar & John Reiser Copyright (c) 1996-2020 Markus Oberhumer, Laszlo Molnar & John Reiser
https://upx.github.io https://upx.github.io
@@ -103,9 +103,9 @@ THE FUTURE
COPYRIGHT COPYRIGHT
========= =========
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
Copyright (C) 2000-2017 John F. Reiser Copyright (C) 2000-2020 John F. Reiser
This program may be used freely, and you are welcome to This program may be used freely, and you are welcome to
redistribute it under certain conditions. redistribute it under certain conditions.
+1 -1
View File
@@ -8,7 +8,7 @@
The Ultimate Packer for eXecutables The Ultimate Packer for eXecutables
Copyright (c) 1996-2017 Markus Oberhumer, Laszlo Molnar & John Reiser Copyright (c) 1996-2020 Markus Oberhumer, Laszlo Molnar & John Reiser
https://upx.github.io https://upx.github.io
+4
View File
@@ -61,6 +61,10 @@ Prerequisites
- first of all you need to build the UCL compression library - first of all you need to build the UCL compression library
http://www.oberhumer.com/opensource/ucl/ http://www.oberhumer.com/opensource/ucl/
Use "CC=gcc -std=gnu89" especially with gcc-6.3 and gcc-7.1.
To build for native aarch64 (64-bit ARM) the files config.guess
and config.sub must be updated according to the recipe at
https://www.gnu.org/software/gettext/manual/html_node/config_002eguess.html
Tools needed to build/modify the UPX sources Tools needed to build/modify the UPX sources
+1 -1
View File
@@ -8,7 +8,7 @@
The Ultimate Packer for eXecutables The Ultimate Packer for eXecutables
Copyright (c) 1996-2017 Markus Oberhumer, Laszlo Molnar & John Reiser Copyright (c) 1996-2020 Markus Oberhumer, Laszlo Molnar & John Reiser
https://upx.github.io https://upx.github.io
+6
View File
@@ -50,22 +50,28 @@ mostlyclean clean distclean maintainer-clean:
%.1 : %.pod %.1 : %.pod
pod2man --center=" " --release="$(PACKAGE) $(VERSION)" --date="$(VERSION_DATE)" $< | $(RTRIM) > $@ pod2man --center=" " --release="$(PACKAGE) $(VERSION)" --date="$(VERSION_DATE)" $< | $(RTRIM) > $@
test -s $@
%.doc : %.pod %.doc : %.pod
pod2text < $< | $(RTRIM) > $@ pod2text < $< | $(RTRIM) > $@
test -s $@
%.html : %.pod %.html : %.pod
pod2html --noindex $< | $(RTRIM) | $(DETAB2) > $@ pod2html --noindex $< | $(RTRIM) | $(DETAB2) > $@
@rm -f pod2htm* @rm -f pod2htm*
test -s $@
%.man : %.1 %.man : %.1
nroff -man $< | $(RTRIM) > $@ nroff -man $< | $(RTRIM) > $@
test -s $@
%.ps : %.1 %.ps : %.1
groff -man $< | $(RTRIM) > $@ groff -man $< | $(RTRIM) > $@
test -s $@
%.tex : %.pod %.tex : %.pod
pod2latex $< pod2latex $<
test -s $@
### ###
+1 -1
View File
@@ -1,5 +1,5 @@
Decompressing ELF Directly to Memory on Linux/x86 Decompressing ELF Directly to Memory on Linux/x86
Copyright (C) 2000-2017 John F. Reiser jreiser@BitWagon.com Copyright (C) 2000-2020 John F. Reiser jreiser@BitWagon.com
References: References:
<elf.h> definitions for the ELF file format <elf.h> definitions for the ELF file format
+6 -6
View File
@@ -13,8 +13,8 @@ B<upx> S<[ I<command> ]> S<[ I<options> ]> I<filename>...
=head1 ABSTRACT =head1 ABSTRACT
The Ultimate Packer for eXecutables The Ultimate Packer for eXecutables
Copyright (c) 1996-2017 Markus Oberhumer, Laszlo Molnar & John Reiser Copyright (c) 1996-2020 Markus Oberhumer, Laszlo Molnar & John Reiser
http://upx.sourceforge.net https://upx.github.io
B<UPX> is a portable, extendable, high-performance executable packer for B<UPX> is a portable, extendable, high-performance executable packer for
@@ -934,13 +934,13 @@ Please report all bugs immediately to the authors.
=head1 COPYRIGHT =head1 COPYRIGHT
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
Copyright (C) 2000-2017 John F. Reiser Copyright (C) 2000-2020 John F. Reiser
Copyright (C) 2002-2017 Jens Medoch Copyright (C) 2002-2020 Jens Medoch
This program may be used freely, and you are welcome to This program may be used freely, and you are welcome to
redistribute it under certain conditions. redistribute it under certain conditions.
+5 -3
View File
@@ -1,7 +1,7 @@
# #
# UPX Makefile - needs GNU make 3.81 or better # UPX Makefile - needs GNU make 3.81 or better
# #
# Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer # Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
# #
# build configuration options for this Makefile # build configuration options for this Makefile
@@ -148,6 +148,8 @@ upx_testsuite_SRCDIR := $(top_srcdir)/../upx-testsuite
endif endif
endif endif
# run the UPX testsuite # run the UPX testsuite
# The expected (old) checksums are in $(top_srcdir)/.github/travis_testsuite_1-expected_sha256sums.sh
# The actual (new) checksums are in tmp-testsuite/testsuite_1/.sha256sums.recreate
ifneq ($(wildcard $(upx_testsuite_SRCDIR)/files/packed/.),) ifneq ($(wildcard $(upx_testsuite_SRCDIR)/files/packed/.),)
ifneq ($(wildcard $(top_srcdir)/.github/travis_testsuite_1.sh),) ifneq ($(wildcard $(top_srcdir)/.github/travis_testsuite_1.sh),)
run-testsuite: export upx_exe := ./upx$(exeext) run-testsuite: export upx_exe := ./upx$(exeext)
@@ -161,11 +163,11 @@ endif
# automatically format some C++ source code files # automatically format some C++ source code files
ifeq ($(shell uname),Linux) ifeq ($(shell uname),Linux)
CLANG_FORMAT_FILES += linker.cpp linker.h packhead.cpp CLANG_FORMAT_FILES += linker.cpp linker.h packhead.cpp packmast.cpp packmast.h
CLANG_FORMAT_FILES += s_djgpp2.cpp s_object.cpp s_vcsa.cpp s_win32.cpp screen.h CLANG_FORMAT_FILES += s_djgpp2.cpp s_object.cpp s_vcsa.cpp s_win32.cpp screen.h
CLANG_FORMAT_FILES += snprintf.cpp CLANG_FORMAT_FILES += snprintf.cpp
CLANG_FORMAT_FILES += stdcxx.cpp stdcxx.h CLANG_FORMAT_FILES += stdcxx.cpp stdcxx.h
CLANG_FORMAT_FILES += ui.cpp ui.h util.h CLANG_FORMAT_FILES += ui.cpp ui.h util.cpp util.h work.cpp
clang-format: clang-format:
$(top_srcdir)/src/stub/scripts/upx-clang-format -i $(addprefix $(top_srcdir)/src/,$(CLANG_FORMAT_FILES)) $(top_srcdir)/src/stub/scripts/upx-clang-format -i $(addprefix $(top_srcdir)/src/,$(CLANG_FORMAT_FILES))
.PHONY: clang-format .PHONY: clang-format
+18 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -142,6 +142,22 @@ inline void set_le24(void *p, unsigned v)
#endif #endif
} }
inline unsigned get_le26(const void *p)
{
const acc_hbyte_p b = ACC_CCAST(const acc_hbyte_p, p);
return ACC_ICONV(acc_uint32l_t, b[0] ) | ( ACC_ICONV(acc_uint32l_t, b[1]) << 8) |
(ACC_ICONV(acc_uint32l_t, b[2]) << 16) | (((ACC_ICONV(acc_uint32l_t, b[3]) & 3)<< 24));
}
inline void set_le26(void *p, unsigned v)
{
acc_hbyte_p b = ACC_PCAST(acc_hbyte_p, p);
b[0] = ACC_ICONV(unsigned char, (v >> 0) & 0xff);
b[1] = ACC_ICONV(unsigned char, (v >> 8) & 0xff);
b[2] = ACC_ICONV(unsigned char, (v >> 16) & 0xff);
b[3] = ACC_ICONV(unsigned char, (v >> 24) & 0x03) | (0xFC & b[3]);
}
inline unsigned get_le32(const void *p) inline unsigned get_le32(const void *p)
{ {
#if defined(ACC_UA_GET_LE32) #if defined(ACC_UA_GET_LE32)
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+3 -3
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -126,7 +126,7 @@ static int init(FILE *f, int o, int now)
else else
return CON_INIT; return CON_INIT;
#if defined(__DJGPP__) #if (ACC_OS_DOS32) && defined(__DJGPP__)
if (!screen) if (!screen)
screen = do_construct(screen_djgpp2_construct(),fd); screen = do_construct(screen_djgpp2_construct(),fd);
#endif #endif
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+19 -9
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -30,6 +30,12 @@
#include "compress.h" #include "compress.h"
#include "mem.h" #include "mem.h"
#if (ACC_CC_CLANG)
# pragma clang diagnostic ignored "-Wshadow"
#endif
#if (ACC_CC_GNUC >= 0x040200)
# pragma GCC diagnostic ignored "-Wshadow"
#endif
#if (ACC_CC_MSC) #if (ACC_CC_MSC)
# pragma warning(disable: 4456) // -Wno-shadow # pragma warning(disable: 4456) // -Wno-shadow
#endif #endif
@@ -43,8 +49,6 @@
void lzma_compress_config_t::reset() void lzma_compress_config_t::reset()
{ {
memset(this, 0, sizeof(*this));
pos_bits.reset(); pos_bits.reset();
lit_pos_bits.reset(); lit_pos_bits.reset();
lit_context_bits.reset(); lit_context_bits.reset();
@@ -111,11 +115,11 @@ static int prepare(lzma_compress_result_t *res,
res->num_fast_bytes = 64; // 5 .. 273 res->num_fast_bytes = 64; // 5 .. 273
res->match_finder_cycles = 0; res->match_finder_cycles = 0;
// UPX overrides // UPX overrides
res->pos_bits = lzma_compress_config_t::pos_bits_t::default_value_c; res->pos_bits = lzma_compress_config_t::pos_bits_t::default_value;
res->lit_pos_bits = lzma_compress_config_t::lit_pos_bits_t::default_value_c; res->lit_pos_bits = lzma_compress_config_t::lit_pos_bits_t::default_value;
res->lit_context_bits = lzma_compress_config_t::lit_context_bits_t::default_value_c; res->lit_context_bits = lzma_compress_config_t::lit_context_bits_t::default_value;
res->dict_size = lzma_compress_config_t::dict_size_t::default_value_c; res->dict_size = lzma_compress_config_t::dict_size_t::default_value;
res->num_fast_bytes = lzma_compress_config_t::num_fast_bytes_t::default_value_c; res->num_fast_bytes = lzma_compress_config_t::num_fast_bytes_t::default_value;
// method overrides // method overrides
if (method >= 0x100) { if (method >= 0x100) {
res->pos_bits = (method >> 16) & 15; res->pos_bits = (method >> 16) & 15;
@@ -201,6 +205,12 @@ static int prepare(lzma_compress_result_t *res,
} }
} }
lzma_compress_config_t::pos_bits_t::assertValue(res->pos_bits);
lzma_compress_config_t::lit_pos_bits_t::assertValue(res->lit_pos_bits);
lzma_compress_config_t::lit_context_bits_t::assertValue(res->lit_context_bits);
lzma_compress_config_t::dict_size_t::assertValue(res->dict_size);
lzma_compress_config_t::num_fast_bytes_t::assertValue(res->num_fast_bytes);
res->num_probs = 1846 + (768 << (res->lit_context_bits + res->lit_pos_bits)); res->num_probs = 1846 + (768 << (res->lit_context_bits + res->lit_pos_bits));
//printf("\nlzma_compress config: %u %u %u %u %u\n", res->pos_bits, res->lit_pos_bits, res->lit_context_bits, res->dict_size, res->num_probs); //printf("\nlzma_compress config: %u %u %u %u %u\n", res->pos_bits, res->lit_pos_bits, res->lit_context_bits, res->dict_size, res->num_probs);
return 0; return 0;
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+3 -3
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -33,7 +33,7 @@
void zlib_compress_config_t::reset() void zlib_compress_config_t::reset()
{ {
memset(this, 0, sizeof(*this)); mem_clear(this, sizeof(*this));
mem_level.reset(); mem_level.reset();
window_bits.reset(); window_bits.reset();
+26 -15
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -123,7 +123,7 @@ typedef unsigned char upx_byte;
#undef small #undef small
#undef tos #undef tos
#undef unix #undef unix
#if defined(__DJGPP__) #if (ACC_OS_DOS32) && defined(__DJGPP__)
# undef sopen # undef sopen
# undef __unix__ # undef __unix__
# undef __unix # undef __unix
@@ -230,7 +230,9 @@ typedef size_t upx_rsize_t;
#endif #endif
// avoid warnings about shadowing global functions // avoid warnings about shadowing global functions
#undef basename
#undef index #undef index
#undef outp
#define basename upx_basename #define basename upx_basename
#define index upx_index #define index upx_index
#define outp upx_outp #define outp upx_outp
@@ -403,6 +405,8 @@ private:
#define UPX_F_VMLINUX_PPC64LE 40 #define UPX_F_VMLINUX_PPC64LE 40
#define UPX_F_DYLIB_PPC64LE 41 #define UPX_F_DYLIB_PPC64LE 41
#define UPX_F_LINUX_ELF64_ARM 42
#define UPX_F_ATARI_TOS 129 #define UPX_F_ATARI_TOS 129
#define UPX_F_SOLARIS_SPARC 130 // NOT IMPLEMENTED #define UPX_F_SOLARIS_SPARC 130 // NOT IMPLEMENTED
#define UPX_F_MACH_PPC32 131 #define UPX_F_MACH_PPC32 131
@@ -414,6 +418,10 @@ private:
#define UPX_F_LINUX_ELF32_MIPSEB 137 #define UPX_F_LINUX_ELF32_MIPSEB 137
#define UPX_F_DYLIB_PPC32 138 #define UPX_F_DYLIB_PPC32 138
#define UPX_F_MACH_PPC64 139
#define UPX_F_LINUX_ELFPPC64 140
#define UPX_F_VMLINUX_PPC64 141
#define UPX_F_DYLIB_PPC64 142
// compression methods // compression methods
#define M_ALL (-1) #define M_ALL (-1)
@@ -474,24 +482,27 @@ struct upx_callback_t
// compression - config_t // compression - config_t
**************************************************************************/ **************************************************************************/
template <class T, T default_value, T min_value, T max_value> template <class T, T default_value_, T min_value_, T max_value_>
struct OptVar struct OptVar
{ {
typedef T value_type; typedef T value_type;
static const T default_value_c = default_value; static const T default_value = default_value_;
static const T min_value_c = min_value; static const T min_value = min_value_;
static const T max_value_c = max_value; static const T max_value = max_value_;
void assertValue() const { static void assertValue(const T &v) {
// info: this generates annoying warnings "unsigned >= 0 is always true" // info: this generates annoying warnings "unsigned >= 0 is always true"
//assert(v >= min_value_c); //assert(v >= min_value);
assert(v == min_value_c || v >= min_value_c + 1); assert(v == min_value || v >= min_value + 1);
assert(v <= max_value_c); assert(v <= max_value);
}
void assertValue() const {
assertValue(v);
} }
OptVar() : v(default_value), is_set(0) { } OptVar() : v(default_value), is_set(0) { }
OptVar& operator= (const T other) { OptVar& operator= (const T &other) {
v = other; is_set += 1; v = other; is_set = 1;
assertValue(); assertValue();
return *this; return *this;
} }
@@ -507,10 +518,10 @@ struct OptVar
// optional assignments // optional assignments
template <class T, T a, T b, T c> template <class T, T a, T b, T c>
inline void oassign(OptVar<T,a,b,c> &self, const OptVar<T,a,b,c> &other) { inline void oassign(OptVar<T,a,b,c> &self, const OptVar<T,a,b,c> &other) {
if (other.is_set) { self.v = other.v; self.is_set += 1; } if (other.is_set) { self.v = other.v; self.is_set = 1; }
} }
template <class T, T a, T b, T c> template <class T, T a, T b, T c>
inline void oassign(unsigned &v, const OptVar<T,a,b,c> &other) { inline void oassign(T &v, const OptVar<T,a,b,c> &other) {
if (other.is_set) { v = other.v; } if (other.is_set) { v = other.v; }
} }
+3 -3
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -56,7 +56,7 @@
# endif # endif
#endif #endif
#if 1 && defined(__DJGPP__) #if 1 && (ACC_OS_DOS32) && defined(__DJGPP__)
# define USE_SCREEN 1 # define USE_SCREEN 1
#elif 1 && (ACC_OS_CYGWIN || ACC_OS_WIN32 || ACC_OS_WIN64) #elif 1 && (ACC_OS_CYGWIN || ACC_OS_WIN32 || ACC_OS_WIN64)
# define USE_SCREEN 1 # define USE_SCREEN 1
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+3 -3
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -129,7 +129,7 @@ public:
/************************************************************************* /*************************************************************************
// application execptions // application exceptions
**************************************************************************/ **************************************************************************/
class OverlayException : public Exception class OverlayException : public Exception
+6 -4
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -48,7 +48,7 @@ void File::chmod(const char *name, int mode)
void File::rename(const char *old_, const char *new_) void File::rename(const char *old_, const char *new_)
{ {
#if defined(__DJGPP__) #if (ACC_OS_DOS32) && defined(__DJGPP__)
if (::_rename(old_,new_) != 0) if (::_rename(old_,new_) != 0)
#else #else
if (::rename(old_,new_) != 0) if (::rename(old_,new_) != 0)
@@ -94,7 +94,7 @@ bool FileBase::do_sopen()
_fd = ::open(_name, _flags, _mode); _fd = ::open(_name, _flags, _mode);
else else
{ {
#if defined(__DJGPP__) #if (ACC_OS_DOS32) && defined(__DJGPP__)
_fd = ::open(_name,_flags | _shflags, _mode); _fd = ::open(_name,_flags | _shflags, _mode);
#elif defined(__MINT__) #elif defined(__MINT__)
_fd = ::open(_name,_flags | (_shflags & O_SHMODE), _mode); _fd = ::open(_name,_flags | (_shflags & O_SHMODE), _mode);
@@ -140,6 +140,7 @@ int FileBase::read(void *buf, int len)
{ {
if (!isOpen() || len < 0) if (!isOpen() || len < 0)
throwIOException("bad read"); throwIOException("bad read");
mem_size_assert(1, len); // sanity check
errno = 0; errno = 0;
long l = acc_safe_hread(_fd, buf, len); long l = acc_safe_hread(_fd, buf, len);
if (errno) if (errno)
@@ -161,6 +162,7 @@ void FileBase::write(const void *buf, int len)
{ {
if (!isOpen() || len < 0) if (!isOpen() || len < 0)
throwIOException("bad write"); throwIOException("bad write");
mem_size_assert(1, len); // sanity check
errno = 0; errno = 0;
long l = acc_safe_hwrite(_fd, buf, len); long l = acc_safe_hwrite(_fd, buf, len);
if (l != len) if (l != len)
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+43 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -459,4 +459,45 @@ static int s_ct24arm_be(Filter *f)
#undef CT24ARM_BE #undef CT24ARM_BE
#undef ARMCT_COND #undef ARMCT_COND
/*************************************************************************
// 26-bit ARM calltrick ("naive")
**************************************************************************/
#define CT26ARM_LE(f, cond, addvalue, get, set) \
upx_byte *b = f->buf; \
upx_byte *b_end = b + f->buf_len - 4; \
do { \
if (cond) \
{ \
unsigned a = (unsigned) (b - f->buf); \
f->lastcall = a; \
set(b, get(b) + (addvalue)); \
f->calls++; \
} \
b += 4; \
} while (b < b_end); \
if (f->lastcall) f->lastcall += 4; \
return 0;
#define ARMCT_COND (((b[3] & 0x7C) == 0x14))
static int f_ct26arm_le(Filter *f)
{
CT26ARM_LE(f, ARMCT_COND, a / 4 + f->addvalue, get_le26, set_le26)
}
static int u_ct26arm_le(Filter *f)
{
CT26ARM_LE(f, ARMCT_COND, 0 - a / 4 - f->addvalue, get_le26, set_le26)
}
static int s_ct26arm_le(Filter *f)
{
CT26ARM_LE(f, ARMCT_COND, a + f->addvalue, get_le26, set_dummy)
}
#undef CT26ARM_LE
#undef ARMCT_COND
/* vim:set ts=4 sw=4 et: */ /* vim:set ts=4 sw=4 et: */
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+3 -3
View File
@@ -2,9 +2,9 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
Copyright (C) 2000-2017 John F. Reiser Copyright (C) 2000-2020 John F. Reiser
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+3 -3
View File
@@ -2,9 +2,9 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
Copyright (C) 2000-2017 John F. Reiser Copyright (C) 2000-2020 John F. Reiser
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+3 -3
View File
@@ -2,9 +2,9 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
Copyright (C) 2000-2017 John F. Reiser Copyright (C) 2000-2020 John F. Reiser
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+3 -3
View File
@@ -2,9 +2,9 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
Copyright (C) 2004-2017 John F. Reiser Copyright (C) 2004-2020 John F. Reiser
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+5 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -228,6 +228,9 @@ const FilterImp::FilterEntry FilterImp::filters[] = {
{ 0x50, 8, 0x01ffffff, f_ct24arm_le, u_ct24arm_le, s_ct24arm_le }, { 0x50, 8, 0x01ffffff, f_ct24arm_le, u_ct24arm_le, s_ct24arm_le },
{ 0x51, 8, 0x01ffffff, f_ct24arm_be, u_ct24arm_be, s_ct24arm_be }, { 0x51, 8, 0x01ffffff, f_ct24arm_be, u_ct24arm_be, s_ct24arm_be },
// 26-bit calltrick for arm64
{ 0x52, 8, 0x03ffffff, f_ct26arm_le, u_ct26arm_le, s_ct26arm_le },
// 32-bit cto calltrick with jmp and jcc(swap 0x0f/0x8Y) and relative renumbering // 32-bit cto calltrick with jmp and jcc(swap 0x0f/0x8Y) and relative renumbering
{ 0x80, 8, 0x00ffffff, f_ctojr32_e8e9_bswap_le, u_ctojr32_e8e9_bswap_le, s_ctojr32_e8e9_bswap_le }, { 0x80, 8, 0x00ffffff, f_ctojr32_e8e9_bswap_le, u_ctojr32_e8e9_bswap_le, s_ctojr32_e8e9_bswap_le },
{ 0x81, 8, 0x00ffffff, f_ctojr32_e8e9_bswap_le, u_ctojr32_e8e9_bswap_le, s_ctojr32_e8e9_bswap_le }, { 0x81, 8, 0x00ffffff, f_ctojr32_e8e9_bswap_le, u_ctojr32_e8e9_bswap_le, s_ctojr32_e8e9_bswap_le },
+8 -17
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -91,7 +91,7 @@ void show_usage(void)
FILE *f = con_term; FILE *f = con_term;
con_fprintf(f,"Usage: %s [-123456789dlthVL] [-qvfk] [-o file] %sfile..\n", progname, con_fprintf(f,"Usage: %s [-123456789dlthVL] [-qvfk] [-o file] %sfile..\n", progname,
#if defined(__DJGPP__) || defined(__EMX__) #if (ACC_OS_DOS32) && defined(__DJGPP__)
"[@]"); "[@]");
#else #else
""); "");
@@ -262,15 +262,6 @@ void show_help(int verbose)
con_fprintf(f, con_fprintf(f,
" --8086 make compressed sys work on any 8086\n" " --8086 make compressed sys work on any 8086\n"
"\n"); "\n");
#if 0
fg = con_fg(f,FG_YELLOW);
con_fprintf(f,"Options for linux/386\n");
fg = con_fg(f,fg);
con_fprintf(f,
" --script use /usr/local/lib/upx/upx[bd] as decompressor\n"
" --script=/path/upxX use path/upxX as decompressor\n"
"\n");
#endif
fg = con_fg(f,FG_YELLOW); fg = con_fg(f,FG_YELLOW);
con_fprintf(f,"Options for ps1/exe:\n"); con_fprintf(f,"Options for ps1/exe:\n");
fg = con_fg(f,fg); fg = con_fg(f,fg);
@@ -370,7 +361,7 @@ void show_license(void)
); );
int fg = con_fg(f,FG_CYAN); int fg = con_fg(f,FG_CYAN);
con_fprintf(f, con_fprintf(f,
" http://upx.sourceforge.net\n" " https://upx.github.io\n"
" http://www.oberhumer.com/opensource/upx/\n" " http://www.oberhumer.com/opensource/upx/\n"
); );
(void)con_fg(f,FG_ORANGE); (void)con_fg(f,FG_ORANGE);
@@ -421,10 +412,10 @@ void show_version(int x)
if (v != NULL && v[0]) if (v != NULL && v[0])
fprintf(fp, "LZMA SDK version %s\n", v); fprintf(fp, "LZMA SDK version %s\n", v);
#endif #endif
fprintf(fp, "Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer\n"); fprintf(fp, "Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer\n");
fprintf(fp, "Copyright (C) 1996-2017 Laszlo Molnar\n"); fprintf(fp, "Copyright (C) 1996-2020 Laszlo Molnar\n");
fprintf(fp, "Copyright (C) 2000-2017 John F. Reiser\n"); fprintf(fp, "Copyright (C) 2000-2020 John F. Reiser\n");
fprintf(fp, "Copyright (C) 2002-2017 Jens Medoch\n"); fprintf(fp, "Copyright (C) 2002-2020 Jens Medoch\n");
#if (WITH_ZLIB) #if (WITH_ZLIB)
fprintf(fp, "Copyright (C) 1995" "-2005 Jean-loup Gailly and Mark Adler\n"); fprintf(fp, "Copyright (C) 1995" "-2005 Jean-loup Gailly and Mark Adler\n");
#endif #endif
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+3 -3
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -112,7 +112,7 @@ protected:
LE32 extra_heap_alloc; LE32 extra_heap_alloc;
char reserved[12]; char reserved[12];
LE32 versioninfo; LE32 versioninfo;
LE32 unkown; LE32 unknown;
// 0xC0 // 0xC0
LE16 device_id; LE16 device_id;
LE16 ddk_version; LE16 ddk_version;
+82 -12
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -472,9 +472,10 @@ void ElfLinker::relocate() {
value = rel->value->section->offset + rel->value->offset + rel->add; value = rel->value->section->offset + rel->value->offset + rel->add;
} }
upx_byte *location = rel->section->output + rel->offset; upx_byte *location = rel->section->output + rel->offset;
// printf("%-28s %-28s %-10s 0x%16llx 0x%16llx\n", rel->section->name, rel->value->name, // printf("%-28s %-28s %-10s %#16llx %#16llx\n", rel->section->name, rel->value->name,
// rel->type, (long long) value, (long long) value - rel->section->offset - rel->offset); // rel->type, (long long) value, (long long) value - rel->section->offset - rel->offset);
// printf(" %llx %d %llx %d %llx : %d\n", (long long) value, rel->value->section->offset, // printf(" %llx %d %llx %d %llx : %d\n", (long long) value,
// (int)rel->value->section->offset,
// rel->value->offset, rel->offset, (long long) rel->add, *location); // rel->value->offset, rel->offset, (long long) rel->add, *location);
relocate1(rel, location, value, rel->type); relocate1(rel, location, value, rel->type);
} }
@@ -541,7 +542,7 @@ void ElfLinker::alignWithByte(unsigned len, unsigned char b) {
} }
void ElfLinker::relocate1(const Relocation *rel, upx_byte *, upx_uint64_t, const char *) { void ElfLinker::relocate1(const Relocation *rel, upx_byte *, upx_uint64_t, const char *) {
internal_error("unknown relocation type '%s\n", rel->type); internal_error("unknown relocation type '%s\n'", rel->type);
} }
/************************************************************************* /*************************************************************************
@@ -593,7 +594,8 @@ void ElfLinkerAMD64::relocate1(const Relocation *rel, upx_byte *location, upx_ui
void ElfLinkerArmBE::relocate1(const Relocation *rel, upx_byte *location, upx_uint64_t value, void ElfLinkerArmBE::relocate1(const Relocation *rel, upx_byte *location, upx_uint64_t value,
const char *type) { const char *type) {
if (strcmp(type, "R_ARM_PC24") == 0) { if (!strcmp(type, "R_ARM_PC24") || !strcmp(type, "R_ARM_CALL") ||
!strcmp(type, "R_ARM_JUMP24")) {
value -= rel->section->offset + rel->offset; value -= rel->section->offset + rel->offset;
set_be24(1 + location, get_be24(1 + location) + value / 4); set_be24(1 + location, get_be24(1 + location) + value / 4);
} else if (strcmp(type, "R_ARM_ABS32") == 0) { } else if (strcmp(type, "R_ARM_ABS32") == 0) {
@@ -617,7 +619,8 @@ void ElfLinkerArmBE::relocate1(const Relocation *rel, upx_byte *location, upx_ui
void ElfLinkerArmLE::relocate1(const Relocation *rel, upx_byte *location, upx_uint64_t value, void ElfLinkerArmLE::relocate1(const Relocation *rel, upx_byte *location, upx_uint64_t value,
const char *type) { const char *type) {
if (strcmp(type, "R_ARM_PC24") == 0) { if (!strcmp(type, "R_ARM_PC24") || !strcmp(type, "R_ARM_CALL") ||
!strcmp(type, "R_ARM_JUMP24")) {
value -= rel->section->offset + rel->offset; value -= rel->section->offset + rel->offset;
set_le24(location, get_le24(location) + value / 4); set_le24(location, get_le24(location) + value / 4);
} else if (strcmp(type, "R_ARM_ABS32") == 0) { } else if (strcmp(type, "R_ARM_ABS32") == 0) {
@@ -641,11 +644,40 @@ void ElfLinkerArmLE::relocate1(const Relocation *rel, upx_byte *location, upx_ui
void ElfLinkerArm64LE::relocate1(const Relocation *rel, upx_byte *location, upx_uint64_t value, void ElfLinkerArm64LE::relocate1(const Relocation *rel, upx_byte *location, upx_uint64_t value,
const char *type) { const char *type) {
if (strcmp(type, "R_AARCH64_CALL26") == 0) { if (strncmp(type, "R_AARCH64_", 10))
return super::relocate1(rel, location, value, type);
type += 10;
if (!strncmp(type, "PREL", 4)) {
value -= rel->section->offset + rel->offset; value -= rel->section->offset + rel->offset;
set_le24(location, get_le24(location) + value / 4); // FIXME set_le26 type += 4;
} else if (strcmp(type, "R_AARCH64_ABS32") == 0) {
if (!strcmp(type, "16"))
set_le16(location, get_le16(location) + value);
else if (!strncmp(type, "32", 2)) // for "32" and "32S"
set_le32(location, get_le32(location) + value); set_le32(location, get_le32(location) + value);
else if (!strcmp(type, "64"))
set_le64(location, get_le64(location) + value);
} else if (!strcmp(type, "ADR_PREL_LO21")) {
value -= rel->section->offset + rel->offset;
upx_uint32_t const m19 = ~(~0u << 19);
upx_uint32_t w = get_le32(location);
set_le32(location, (w & ~((3u << 29) | (m19 << 5))) | ((3u & value) << 29) |
((m19 & (value >> 2)) << 5));
} else if (!strcmp(type, "ABS32")) {
set_le32(location, get_le32(location) + value);
} else if (!strcmp(type, "ABS64")) {
set_le64(location, get_le64(location) + value);
} else if (!strcmp(type, "CONDBR19")) {
value -= rel->section->offset + rel->offset;
upx_uint32_t const m19 = ~(~0u << 19);
upx_uint32_t w = get_le32(location);
set_le32(location, (w & ~(m19 << 5)) | ((((w >> 5) + (value >> 2)) & m19) << 5));
} else if (!strcmp(type, "CALL26")) {
value -= rel->section->offset + rel->offset;
upx_uint32_t const m26 = ~(~0u << 26);
upx_uint32_t w = get_le32(location);
set_le32(location, (w & ~m26) | (m26 & (value >> 2)));
} else } else
super::relocate1(rel, location, value, type); super::relocate1(rel, location, value, type);
} }
@@ -767,6 +799,14 @@ void ElfLinkerPpc32::relocate1(const Relocation *rel, upx_byte *location, upx_ui
void ElfLinkerPpc64le::relocate1(const Relocation *rel, upx_byte *location, upx_uint64_t value, void ElfLinkerPpc64le::relocate1(const Relocation *rel, upx_byte *location, upx_uint64_t value,
const char *type) { const char *type) {
if (!strcmp(type, "R_PPC64_ADDR64")) {
set_le64(location, get_le64(location) + value);
return;
}
if (!strcmp(type, "R_PPC64_ADDR32")) {
set_le32(location, get_le32(location) + value);
return;
}
if (strncmp(type, "R_PPC64_REL", 11)) if (strncmp(type, "R_PPC64_REL", 11))
return super::relocate1(rel, location, value, type); return super::relocate1(rel, location, value, type);
type += 11; type += 11;
@@ -786,11 +826,11 @@ void ElfLinkerPpc64le::relocate1(const Relocation *rel, upx_byte *location, upx_
internal_error("target out of range (%d) in reloc %s:%x\n", displ, rel->section->name, internal_error("target out of range (%d) in reloc %s:%x\n", displ, rel->section->name,
rel->offset); rel->offset);
*location += value; *location += value;
} else if (strncmp(type, "14", 2) == 0) // for "32" and "32S" } else if (strncmp(type, "14", 2) == 0) // for "14" and "14S"
set_le16(location, get_le16(location) + value); set_le16(location, get_le16(location) + value);
else if (strcmp(type, "16") == 0) else if (strcmp(type, "16") == 0)
set_le16(location, get_le16(location) + value); set_le16(location, get_le16(location) + value);
else if (strncmp(type, "24", 2) == 0) // for "32" and "32S" else if (strncmp(type, "24", 2) == 0) // for "24" and "24S"
set_le24(location, get_le24(location) + value); set_le24(location, get_le24(location) + value);
else if (strncmp(type, "32", 2) == 0) // for "32" and "32S" else if (strncmp(type, "32", 2) == 0) // for "32" and "32S"
set_le32(location, get_le32(location) + value); set_le32(location, get_le32(location) + value);
@@ -800,6 +840,36 @@ void ElfLinkerPpc64le::relocate1(const Relocation *rel, upx_byte *location, upx_
super::relocate1(rel, location, value, type); super::relocate1(rel, location, value, type);
} }
void ElfLinkerPpc64::relocate1(const Relocation *rel, upx_byte *location, upx_uint64_t value,
const char *type) {
if (!strcmp(type, "R_PPC64_ADDR32")) {
set_be32(location, get_be32(location) + value);
return;
}
if (!strcmp(type, "R_PPC64_ADDR64")) {
set_be64(location, get_be64(location) + value);
return;
}
if (strncmp(type, "R_PPC64_REL", 11))
return super::relocate1(rel, location, value, type);
type += 11;
if (strncmp(type, "PC", 2) == 0) {
type += 2;
}
// We have "R_PPC64_REL" or "R_PPC64_RELPC" as a prefix.
/* value will hold relative displacement */
value -= rel->section->offset + rel->offset;
if (strncmp(type, "14", 2) == 0) // for "14" and "14S"
set_be16(2 + location, get_be16(2 + location) + value);
else if (strncmp(type, "24", 2) == 0) // for "24" and "24S"
set_be24(1 + location, get_be24(1 + location) + value);
else
super::relocate1(rel, location, value, type);
}
void ElfLinkerX86::relocate1(const Relocation *rel, upx_byte *location, upx_uint64_t value, void ElfLinkerX86::relocate1(const Relocation *rel, upx_byte *location, upx_uint64_t value,
const char *type) { const char *type) {
if (strncmp(type, "R_386_", 6)) if (strncmp(type, "R_386_", 6))
+22 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -160,6 +160,15 @@ protected:
const char *type); const char *type);
}; };
class ElfLinkerARM64 : public ElfLinker {
typedef ElfLinker super;
protected:
virtual void alignCode(unsigned len) { alignWithByte(len, 0x90); }
virtual void relocate1(const Relocation *, upx_byte *location, upx_uint64_t value,
const char *type);
};
class ElfLinkerArmBE : public ElfLinker { class ElfLinkerArmBE : public ElfLinker {
typedef ElfLinker super; typedef ElfLinker super;
@@ -237,6 +246,17 @@ protected:
const char *type); const char *type);
}; };
class ElfLinkerPpc64 : public ElfLinker {
typedef ElfLinker super;
public:
ElfLinkerPpc64() { bele = &N_BELE_RTP::be_policy; }
protected:
virtual void relocate1(const Relocation *, upx_byte *location, upx_uint64_t value,
const char *type);
};
class ElfLinkerX86 : public ElfLinker { class ElfLinkerX86 : public ElfLinker {
typedef ElfLinker super; typedef ElfLinker super;
+24 -9
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -33,7 +33,7 @@
#include "p_elf.h" #include "p_elf.h"
#if 1 && defined(__DJGPP__) #if 1 && (ACC_OS_DOS32) && defined(__DJGPP__)
#include <crt0.h> #include <crt0.h>
int _crt0_startup_flags = _CRT0_FLAG_UNIX_SBRK; int _crt0_startup_flags = _CRT0_FLAG_UNIX_SBRK;
#endif #endif
@@ -46,7 +46,7 @@ int _crt0_startup_flags = _CRT0_FLAG_UNIX_SBRK;
void options_t::reset() void options_t::reset()
{ {
options_t *o = this; options_t *o = this;
memset(o, 0, sizeof(*o)); mem_clear(o, sizeof(*o));
o->crp.reset(); o->crp.reset();
o->cmd = CMD_NONE; o->cmd = CMD_NONE;
@@ -61,7 +61,7 @@ void options_t::reset()
o->preserve_timestamp = true; o->preserve_timestamp = true;
o->console = CON_FILE; o->console = CON_FILE;
#if defined(__DJGPP__) #if (ACC_OS_DOS32) && defined(__DJGPP__)
o->console = CON_INIT; o->console = CON_INIT;
#elif (USE_SCREEN_WIN32) #elif (USE_SCREEN_WIN32)
o->console = CON_INIT; o->console = CON_INIT;
@@ -866,6 +866,12 @@ static int do_option(int optc, const char *arg)
case 675: case 675:
opt->o_unix.preserve_build_id = true; opt->o_unix.preserve_build_id = true;
break; break;
case 676:
opt->o_unix.android_shlib = true;
break;
case 677:
opt->o_unix.force_pie = true;
break;
case '\0': case '\0':
return -1; return -1;
@@ -1016,6 +1022,8 @@ static const struct mfx_option longopts[] =
{"openbsd", 0x10, 0, 669}, {"openbsd", 0x10, 0, 669},
{"unmap-all-pages", 0x10, 0, 674}, // linux /proc/self/exe vanishes {"unmap-all-pages", 0x10, 0, 674}, // linux /proc/self/exe vanishes
{"preserve-build-id", 0, 0, 675}, {"preserve-build-id", 0, 0, 675},
{"android-shlib", 0, 0, 676},
{"force-pie", 0, 0, 677},
// watcom/le // watcom/le
{"le", 0x10, 0, 620}, // produce LE output {"le", 0x10, 0, 620}, // produce LE output
// win32/pe // win32/pe
@@ -1409,7 +1417,7 @@ int __acc_cdecl_main main(int argc, char *argv[])
static char default_argv0[] = "upx"; static char default_argv0[] = "upx";
// int cmdline_cmd = CMD_NONE; // int cmdline_cmd = CMD_NONE;
#if 0 && defined(__DJGPP__) #if 0 && (ACC_OS_DOS32) && defined(__DJGPP__)
// LFN=n may cause problems with 2.03's _rename and mkdir under WinME // LFN=n may cause problems with 2.03's _rename and mkdir under WinME
putenv("LFN=y"); putenv("LFN=y");
#endif #endif
@@ -1531,13 +1539,20 @@ int __acc_cdecl_main main(int argc, char *argv[])
do_files(i,argc,argv); do_files(i,argc,argv);
if (gitrev[0]) if (gitrev[0])
{
bool warn = true;
const char *ee = getenv("UPX_DISABLE_GITREV_WARNING");
if (ee && ee[0] && strcmp(ee, "1") == 0)
warn = false;
if (warn)
{ {
FILE *f = stdout; FILE *f = stdout;
int fg = con_fg(f,FG_RED); int fg = con_fg(f, FG_RED);
con_fprintf(f,"\nWARNING: this is an unstable beta version - use for testing only! Really.\n"); con_fprintf(f, "\nWARNING: this is an unstable beta version - use for testing only! Really.\n");
fg = con_fg(f,fg); fg = con_fg(f, fg);
UNUSED(fg); UNUSED(fg);
} }
}
#if 0 && defined(__GLIBC__) #if 0 && defined(__GLIBC__)
//malloc_stats(); //malloc_stats();
+14 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -73,6 +73,18 @@ MemBuffer::~MemBuffer()
this->dealloc(); this->dealloc();
} }
// similar to BoundedPtr, except checks only at creation
unsigned char *MemBuffer::subref(char const *errfmt, unsigned skip, unsigned take)
{
if ((take + skip) < take // wrap-around
|| (take + skip) > b_size // overrun
) {
char buf[100]; snprintf(buf, sizeof(buf), errfmt, skip, take);
throwCantPack(buf);
}
return &b[skip];
}
void MemBuffer::dealloc() void MemBuffer::dealloc()
{ {
if (b != NULL) if (b != NULL)
+7 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -64,6 +64,11 @@ public:
void clear(unsigned off, unsigned len) { fill(off, len, 0); } void clear(unsigned off, unsigned len) { fill(off, len, 0); }
void clear() { fill(0, b_size, 0); } void clear() { fill(0, b_size, 0); }
// If the entire range [skip, take+skip) is inside the buffer,
// then return &b[skip]; else throwCantPack(sprintf(errfmt, skip, take)).
// This is similar to BoundedPtr, except only checks once.
unsigned char *subref(char const *errfmt, unsigned skip, unsigned take);
private: private:
unsigned char *b; unsigned char *b;
unsigned b_size; unsigned b_size;
+134 -66
View File
@@ -2,7 +2,7 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -27,7 +27,7 @@
#ifndef __ACC_H_INCLUDED #ifndef __ACC_H_INCLUDED
#define __ACC_H_INCLUDED 1 #define __ACC_H_INCLUDED 1
#define ACC_VERSION 20170125L #define ACC_VERSION 20200116L
#if defined(__CYGWIN32__) && !defined(__CYGWIN__) #if defined(__CYGWIN32__) && !defined(__CYGWIN__)
# define __CYGWIN__ __CYGWIN32__ # define __CYGWIN__ __CYGWIN32__
#endif #endif
@@ -52,6 +52,8 @@
# error "__cplusplus" # error "__cplusplus"
# elif (__cplusplus < 199711L) # elif (__cplusplus < 199711L)
# define ACC_LANG_CXX 1 # define ACC_LANG_CXX 1
# elif (__cplusplus >= 201402L)
# define ACC_LANG_CXX __cplusplus
# elif defined(_MSC_VER) && defined(_MSVC_LANG) && (_MSVC_LANG+0 >= 201402L) && 1 # elif defined(_MSC_VER) && defined(_MSVC_LANG) && (_MSVC_LANG+0 >= 201402L) && 1
# define ACC_LANG_CXX _MSVC_LANG # define ACC_LANG_CXX _MSVC_LANG
# else # else
@@ -66,6 +68,33 @@
# endif # endif
#endif #endif
#endif #endif
#if defined(ACC_CFG_ASSERT_LANG_ASSEMBLER) && (ACC_CFG_ASSERT_LANG_ASSEMBLER+0)
# if !(ACC_LANG_ASSEMBLER)
# error "ACC_CFG_ASSERT_LANG_ASSEMBLER"
# endif
# if (ACC_CFG_ASSERT_LANG_ASSEMBLER > 1) && (ACC_CFG_ASSERT_LANG_ASSEMBLER < ACC_LANG_ASSEMBLER)
# error "ACC_CFG_ASSERT_LANG_ASSEMBLER standard min version"
# endif
#endif
#if defined(ACC_CFG_ASSERT_LANG_C) && (ACC_CFG_ASSERT_LANG_C+0)
# if !(ACC_LANG_C)
# error "ACC_CFG_ASSERT_LANG_C"
# endif
# if (ACC_CFG_ASSERT_LANG_C > 1) && (ACC_CFG_ASSERT_LANG_C < ACC_LANG_C)
# error "ACC_CFG_ASSERT_LANG_C standard min version"
# endif
#endif
#if defined(ACC_CFG_ASSERT_LANG_CXX) && (ACC_CFG_ASSERT_LANG_CXX+0)
# if !(ACC_LANG_CXX)
# error "ACC_CFG_ASSERT_LANG_CXX"
# endif
# if !defined(__cplusplus)
# error "ACC_CFG_ASSERT_LANG_CXX __cplusplus"
# endif
# if (ACC_CFG_ASSERT_LANG_CXX > 1) && (ACC_CFG_ASSERT_LANG_CXX < ACC_LANG_CXX)
# error "ACC_CFG_ASSERT_LANG_CXX standard min version"
# endif
#endif
#if !defined(ACC_CFG_NO_DISABLE_WUNDEF) #if !defined(ACC_CFG_NO_DISABLE_WUNDEF)
#if defined(__ARMCC_VERSION) #if defined(__ARMCC_VERSION)
# pragma diag_suppress 193 # pragma diag_suppress 193
@@ -523,6 +552,9 @@
# if defined(_AIX) || defined(__AIX__) || defined(__aix__) # if defined(_AIX) || defined(__AIX__) || defined(__aix__)
# define ACC_OS_POSIX_AIX 1 # define ACC_OS_POSIX_AIX 1
# define ACC_INFO_OS_POSIX "aix" # define ACC_INFO_OS_POSIX "aix"
# elif defined(__DragonFly__)
# define ACC_OS_POSIX_DRAGONFLY 1
# define ACC_INFO_OS_POSIX "dragonfly"
# elif defined(__FreeBSD__) # elif defined(__FreeBSD__)
# define ACC_OS_POSIX_FREEBSD 1 # define ACC_OS_POSIX_FREEBSD 1
# define ACC_INFO_OS_POSIX "freebsd" # define ACC_INFO_OS_POSIX "freebsd"
@@ -639,6 +671,12 @@
# define ACC_CC_ARMCC __ARMCC_VERSION # define ACC_CC_ARMCC __ARMCC_VERSION
# define ACC_INFO_CC "ARM C Compiler" # define ACC_INFO_CC "ARM C Compiler"
# define ACC_INFO_CCVER __VERSION__ # define ACC_INFO_CCVER __VERSION__
#elif defined(__clang__) && defined(__c2__) && defined(__c2_version__) && defined(_MSC_VER)
# define ACC_CC_CLANG (__clang_major__ * 0x10000L + (__clang_minor__-0) * 0x100 + (__clang_patchlevel__-0))
# define ACC_CC_CLANG_C2 _MSC_VER
# define ACC_CC_CLANG_VENDOR_MICROSOFT 1
# define ACC_INFO_CC "clang/c2"
# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__c2_version__)
#elif defined(__clang__) && defined(__llvm__) && defined(__VERSION__) #elif defined(__clang__) && defined(__llvm__) && defined(__VERSION__)
# if defined(__clang_major__) && defined(__clang_minor__) && defined(__clang_patchlevel__) # if defined(__clang_major__) && defined(__clang_minor__) && defined(__clang_patchlevel__)
# define ACC_CC_CLANG (__clang_major__ * 0x10000L + (__clang_minor__-0) * 0x100 + (__clang_patchlevel__-0)) # define ACC_CC_CLANG (__clang_major__ * 0x10000L + (__clang_minor__-0) * 0x100 + (__clang_patchlevel__-0))
@@ -650,7 +688,13 @@
# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) # elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
# define ACC_CC_CLANG_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) # define ACC_CC_CLANG_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
# endif # endif
# if defined(__APPLE_CC__)
# define ACC_CC_CLANG_VENDOR_APPLE 1
# define ACC_INFO_CC "clang/apple"
# else
# define ACC_CC_CLANG_VENDOR_LLVM 1
# define ACC_INFO_CC "clang" # define ACC_INFO_CC "clang"
# endif
# if defined(__clang_version__) # if defined(__clang_version__)
# define ACC_INFO_CCVER __clang_version__ # define ACC_INFO_CCVER __clang_version__
# else # else
@@ -953,6 +997,9 @@
#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC8051__) #elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC8051__)
# define ACC_ARCH_MCS51 1 # define ACC_ARCH_MCS51 1
# define ACC_INFO_ARCH "mcs51" # define ACC_INFO_ARCH "mcs51"
#elif defined(__microblaze__) || defined(__MICROBLAZE__)
# define ACC_ARCH_MICROBLAZE 1
# define ACC_INFO_ARCH "microblaze"
#elif defined(__mips__) || defined(__mips) || defined(_MIPS_ARCH) || defined(_M_MRX000) #elif defined(__mips__) || defined(__mips) || defined(_MIPS_ARCH) || defined(_M_MRX000)
# define ACC_ARCH_MIPS 1 # define ACC_ARCH_MIPS 1
# define ACC_INFO_ARCH "mips" # define ACC_INFO_ARCH "mips"
@@ -971,6 +1018,9 @@
#elif defined(__powerpc64le__) || defined(__powerpc64le) || defined(__ppc64le__) || defined(__PPC64LE__) #elif defined(__powerpc64le__) || defined(__powerpc64le) || defined(__ppc64le__) || defined(__PPC64LE__)
# define ACC_ARCH_POWERPC 1 # define ACC_ARCH_POWERPC 1
# define ACC_INFO_ARCH "powerpc" # define ACC_INFO_ARCH "powerpc"
#elif defined(__riscv)
# define ACC_ARCH_RISCV 1
# define ACC_INFO_ARCH "riscv"
#elif defined(__s390__) || defined(__s390) || defined(__s390x__) || defined(__s390x) #elif defined(__s390__) || defined(__s390) || defined(__s390x__) || defined(__s390x)
# define ACC_ARCH_S390 1 # define ACC_ARCH_S390 1
# define ACC_INFO_ARCH "s390" # define ACC_INFO_ARCH "s390"
@@ -1012,6 +1062,8 @@
# define ACC_ARCH_ARM_THUMB2 1 # define ACC_ARCH_ARM_THUMB2 1
# elif 1 && defined(__TARGET_ARCH_THUMB) && ((__TARGET_ARCH_THUMB)+0 >= 4) # elif 1 && defined(__TARGET_ARCH_THUMB) && ((__TARGET_ARCH_THUMB)+0 >= 4)
# define ACC_ARCH_ARM_THUMB2 1 # define ACC_ARCH_ARM_THUMB2 1
# elif 1 && defined(_MSC_VER) && defined(_M_THUMB) && ((_M_THUMB)+0 >= 7)
# define ACC_ARCH_ARM_THUMB2 1
# endif # endif
# endif # endif
#endif #endif
@@ -1223,7 +1275,7 @@
# error "unexpected configuration - check your compiler defines" # error "unexpected configuration - check your compiler defines"
# endif # endif
#endif #endif
#ifdef __cplusplus #if defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
#if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0200)) #if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0200))
@@ -1246,7 +1298,7 @@ extern "C" {
#else #else
# error "FIXME - implement ACC_MM_AHSHIFT" # error "FIXME - implement ACC_MM_AHSHIFT"
#endif #endif
#ifdef __cplusplus #if defined(__cplusplus)
} }
#endif #endif
#endif #endif
@@ -1546,7 +1598,7 @@ extern "C" {
#endif #endif
#if !defined(ACC_UNUSED_LABEL) #if !defined(ACC_UNUSED_LABEL)
# if (ACC_CC_CLANG >= 0x020800ul) # if (ACC_CC_CLANG >= 0x020800ul)
# define ACC_UNUSED_LABEL(l) (__acc_gnuc_extension__ ((void) ((const void *) &&l))) # define ACC_UNUSED_LABEL(l) (__acc_gnuc_extension__ ((void) ACC_STATIC_CAST(const void *, &&l)))
# elif (ACC_CC_ARMCC || ACC_CC_CLANG || ACC_CC_INTELC || ACC_CC_WATCOMC) # elif (ACC_CC_ARMCC || ACC_CC_CLANG || ACC_CC_INTELC || ACC_CC_WATCOMC)
# define ACC_UNUSED_LABEL(l) if __acc_cte(0) goto l # define ACC_UNUSED_LABEL(l) if __acc_cte(0) goto l
# else # else
@@ -1945,6 +1997,7 @@ extern "C" {
#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 800)) #elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 800))
# define __acc_likely(e) (__builtin_expect(!!(e),1)) # define __acc_likely(e) (__builtin_expect(!!(e),1))
# define __acc_unlikely(e) (__builtin_expect(!!(e),0)) # define __acc_unlikely(e) (__builtin_expect(!!(e),0))
#elif (ACC_CC_CLANG && ACC_CC_CLANG_C2)
#elif (ACC_CC_ARMCC_GNUC || ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE) #elif (ACC_CC_ARMCC_GNUC || ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define __acc_likely(e) (__builtin_expect(!!(e),1)) # define __acc_likely(e) (__builtin_expect(!!(e),1))
# define __acc_unlikely(e) (__builtin_expect(!!(e),0)) # define __acc_unlikely(e) (__builtin_expect(!!(e),0))
@@ -2022,7 +2075,11 @@ extern "C" {
#endif #endif
#endif #endif
#if !defined(ACC_COMPILE_TIME_ASSERT_HEADER) #if !defined(ACC_COMPILE_TIME_ASSERT_HEADER)
# if (ACC_CC_AZTECC || ACC_CC_ZORTECHC) # if (ACC_LANG_CXX >= 201103L)
# define ACC_COMPILE_TIME_ASSERT_HEADER(e) static_assert(e, #e);
# elif (ACC_LANG_C >= 201112L)
# define ACC_COMPILE_TIME_ASSERT_HEADER(e) _Static_assert(e, #e);
# elif (ACC_CC_AZTECC || ACC_CC_ZORTECHC)
# define ACC_COMPILE_TIME_ASSERT_HEADER(e) ACC_EXTERN_C_BEGIN extern int __ACC_CTA_NAME(acc_cta__)[1-!(e)]; ACC_EXTERN_C_END # define ACC_COMPILE_TIME_ASSERT_HEADER(e) ACC_EXTERN_C_BEGIN extern int __ACC_CTA_NAME(acc_cta__)[1-!(e)]; ACC_EXTERN_C_END
# elif (ACC_CC_DMC || ACC_CC_SYMANTECC) # elif (ACC_CC_DMC || ACC_CC_SYMANTECC)
# define ACC_COMPILE_TIME_ASSERT_HEADER(e) ACC_EXTERN_C_BEGIN extern int __ACC_CTA_NAME(acc_cta__)[1u-2*!(e)]; ACC_EXTERN_C_END # define ACC_COMPILE_TIME_ASSERT_HEADER(e) ACC_EXTERN_C_BEGIN extern int __ACC_CTA_NAME(acc_cta__)[1u-2*!(e)]; ACC_EXTERN_C_END
@@ -2037,7 +2094,11 @@ extern "C" {
# endif # endif
#endif #endif
#if !defined(ACC_COMPILE_TIME_ASSERT) #if !defined(ACC_COMPILE_TIME_ASSERT)
# if (ACC_CC_AZTECC) # if (ACC_LANG_CXX >= 201103L)
# define ACC_COMPILE_TIME_ASSERT(e) {static_assert(e, #e);}
# elif (ACC_LANG_C >= 201112L)
# define ACC_COMPILE_TIME_ASSERT(e) {_Static_assert(e, #e);}
# elif (ACC_CC_AZTECC)
# define ACC_COMPILE_TIME_ASSERT(e) {typedef int __ACC_CTA_NAME(acc_cta_t__)[1-!(e)];} # define ACC_COMPILE_TIME_ASSERT(e) {typedef int __ACC_CTA_NAME(acc_cta_t__)[1-!(e)];}
# elif (ACC_CC_CLANG && (ACC_CC_CLANG >= 0x030000ul)) # elif (ACC_CC_CLANG && (ACC_CC_CLANG >= 0x030000ul))
# define ACC_COMPILE_TIME_ASSERT(e) {typedef int __ACC_CTA_NAME(acc_cta_t__)[1-2*!(e)] __attribute__((__unused__));} # define ACC_COMPILE_TIME_ASSERT(e) {typedef int __ACC_CTA_NAME(acc_cta_t__)[1-2*!(e)] __attribute__((__unused__));}
@@ -2360,7 +2421,9 @@ ACC_COMPILE_TIME_ASSERT_HEADER(ACC_SIZEOF_LONG == sizeof(long))
# define ACC_WORDSIZE 4 # define ACC_WORDSIZE 4
#elif (ACC_ARCH_Z80) #elif (ACC_ARCH_Z80)
# define ACC_WORDSIZE 1 # define ACC_WORDSIZE 1
#elif (ACC_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) #elif (ACC_ARCH_MIPS) && (ACC_SIZEOF_LONG == 8) && (defined(__R5900) || defined(__MIPS_PSX2__))
# define ACC_WORDSIZE 8
#elif (ACC_ARCH_MIPS) && (ACC_SIZEOF_LONG == 4) && defined(__mips64) && defined(_MIPS_SIM) && defined(_ABIN32) && (_MIPS_SIM+0 == _ABIN32+0)
# define ACC_WORDSIZE 8 # define ACC_WORDSIZE 8
#elif (ACC_OS_OS400 || defined(__OS400__)) #elif (ACC_OS_OS400 || defined(__OS400__))
# define ACC_WORDSIZE 8 # define ACC_WORDSIZE 8
@@ -2486,7 +2549,7 @@ ACC_COMPILE_TIME_ASSERT_HEADER(ACC_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t))
# define ACC_ABI_BIG_ENDIAN 1 # define ACC_ABI_BIG_ENDIAN 1
#elif (ACC_ARCH_IA64) && (ACC_OS_POSIX_LINUX || ACC_OS_WIN64) #elif (ACC_ARCH_IA64) && (ACC_OS_POSIX_LINUX || ACC_OS_WIN64)
# define ACC_ABI_LITTLE_ENDIAN 1 # define ACC_ABI_LITTLE_ENDIAN 1
#elif (ACC_ARCH_ALPHA || ACC_ARCH_AMD64 || ACC_ARCH_BLACKFIN || ACC_ARCH_CRIS || ACC_ARCH_I086 || ACC_ARCH_I386 || ACC_ARCH_MSP430) #elif (ACC_ARCH_ALPHA || ACC_ARCH_AMD64 || ACC_ARCH_BLACKFIN || ACC_ARCH_CRIS || ACC_ARCH_I086 || ACC_ARCH_I386 || ACC_ARCH_MSP430 || ACC_ARCH_RISCV)
# define ACC_ABI_LITTLE_ENDIAN 1 # define ACC_ABI_LITTLE_ENDIAN 1
#elif (ACC_ARCH_AVR32 || ACC_ARCH_M68K || ACC_ARCH_S390 || ACC_ARCH_SPU) #elif (ACC_ARCH_AVR32 || ACC_ARCH_M68K || ACC_ARCH_S390 || ACC_ARCH_SPU)
# define ACC_ABI_BIG_ENDIAN 1 # define ACC_ABI_BIG_ENDIAN 1
@@ -2506,6 +2569,8 @@ ACC_COMPILE_TIME_ASSERT_HEADER(ACC_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t))
# define ACC_ABI_BIG_ENDIAN 1 # define ACC_ABI_BIG_ENDIAN 1
#elif 1 && (ACC_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__) #elif 1 && (ACC_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__)
# define ACC_ABI_LITTLE_ENDIAN 1 # define ACC_ABI_LITTLE_ENDIAN 1
#elif 1 && (ACC_ARCH_ARM) && defined(_MSC_VER) && defined(_WIN32)
# define ACC_ABI_LITTLE_ENDIAN 1
#elif 1 && (ACC_ARCH_ARM && ACC_CC_ARMCC_ARMCC) #elif 1 && (ACC_ARCH_ARM && ACC_CC_ARMCC_ARMCC)
# if defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN) # if defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN)
# error "unexpected configuration - check your compiler defines" # error "unexpected configuration - check your compiler defines"
@@ -2521,6 +2586,8 @@ ACC_COMPILE_TIME_ASSERT_HEADER(ACC_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t))
# define ACC_ABI_BIG_ENDIAN 1 # define ACC_ABI_BIG_ENDIAN 1
#elif 1 && (ACC_ARCH_ARM64) && defined(__AARCH64EL__) && !defined(__AARCH64EB__) #elif 1 && (ACC_ARCH_ARM64) && defined(__AARCH64EL__) && !defined(__AARCH64EB__)
# define ACC_ABI_LITTLE_ENDIAN 1 # define ACC_ABI_LITTLE_ENDIAN 1
#elif 1 && (ACC_ARCH_ARM64) && defined(_MSC_VER) && defined(_WIN32)
# define ACC_ABI_LITTLE_ENDIAN 1
#elif 1 && (ACC_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__) #elif 1 && (ACC_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__)
# define ACC_ABI_BIG_ENDIAN 1 # define ACC_ABI_BIG_ENDIAN 1
#elif 1 && (ACC_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__) #elif 1 && (ACC_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__)
@@ -2691,6 +2758,13 @@ ACC_COMPILE_TIME_ASSERT_HEADER(ACC_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t))
# ifndef ACC_OPT_UNALIGNED32 # ifndef ACC_OPT_UNALIGNED32
# define ACC_OPT_UNALIGNED32 1 # define ACC_OPT_UNALIGNED32 1
# endif # endif
# elif 1 && defined(_MSC_VER) && defined(_M_ARM) && ((_M_ARM)+0 >= 7)
# ifndef ACC_OPT_UNALIGNED16
# define ACC_OPT_UNALIGNED16 1
# endif
# ifndef ACC_OPT_UNALIGNED32
# define ACC_OPT_UNALIGNED32 1
# endif
# endif # endif
#elif (ACC_ARCH_ARM64) #elif (ACC_ARCH_ARM64)
# ifndef ACC_OPT_UNALIGNED16 # ifndef ACC_OPT_UNALIGNED16
@@ -2749,6 +2823,21 @@ ACC_COMPILE_TIME_ASSERT_HEADER(ACC_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t))
# endif # endif
# endif # endif
# endif # endif
#elif (ACC_ARCH_RISCV)
# define ACC_OPT_AVOID_UINT_INDEX 1
# if 0
# ifndef ACC_OPT_UNALIGNED16
# define ACC_OPT_UNALIGNED16 1
# endif
# ifndef ACC_OPT_UNALIGNED32
# define ACC_OPT_UNALIGNED32 1
# endif
# if (ACC_WORDSIZE == 8)
# ifndef ACC_OPT_UNALIGNED64
# define ACC_OPT_UNALIGNED64 1
# endif
# endif
# endif
#elif (ACC_ARCH_S390) #elif (ACC_ARCH_S390)
# ifndef ACC_OPT_UNALIGNED16 # ifndef ACC_OPT_UNALIGNED16
# define ACC_OPT_UNALIGNED16 1 # define ACC_OPT_UNALIGNED16 1
@@ -3335,7 +3424,7 @@ ACC_COMPILE_TIME_ASSERT_HEADER(sizeof(acc_int_fast64_t) == sizeof(acc_uint_fast6
#if (ACC_OS_POSIX) #if (ACC_OS_POSIX)
# if (ACC_OS_POSIX_AIX) # if (ACC_OS_POSIX_AIX)
# define HAVE_SYS_RESOURCE_H 1 # define HAVE_SYS_RESOURCE_H 1
# elif (ACC_OS_POSIX_DARWIN || ACC_OS_POSIX_FREEBSD || ACC_OS_POSIX_NETBSD || ACC_OS_POSIX_OPENBSD) # elif (ACC_OS_POSIX_DARWIN || ACC_OS_POSIX_DRAGONFLY || ACC_OS_POSIX_FREEBSD || ACC_OS_POSIX_NETBSD || ACC_OS_POSIX_OPENBSD)
# define HAVE_STRINGS_H 1 # define HAVE_STRINGS_H 1
# undef HAVE_MALLOC_H # undef HAVE_MALLOC_H
# elif (ACC_OS_POSIX_HPUX || ACC_OS_POSIX_INTERIX) # elif (ACC_OS_POSIX_HPUX || ACC_OS_POSIX_INTERIX)
@@ -3418,7 +3507,7 @@ ACC_COMPILE_TIME_ASSERT_HEADER(sizeof(acc_int_fast64_t) == sizeof(acc_uint_fast6
# undef HAVE_UTIME_H # undef HAVE_UTIME_H
# undef HAVE_SYS_TIME_H # undef HAVE_SYS_TIME_H
# define HAVE_SYS_UTIME_H 1 # define HAVE_SYS_UTIME_H 1
#elif (ACC_CC_CLANG_MSC || ACC_CC_GHS || ACC_CC_INTELC_MSC || ACC_CC_MSC) #elif (ACC_CC_CLANG_C2 || ACC_CC_CLANG_MSC || ACC_CC_GHS || ACC_CC_INTELC_MSC || ACC_CC_MSC)
# undef HAVE_DIRENT_H # undef HAVE_DIRENT_H
# undef HAVE_UNISTD_H # undef HAVE_UNISTD_H
# undef HAVE_UTIME_H # undef HAVE_UTIME_H
@@ -3721,7 +3810,7 @@ ACC_COMPILE_TIME_ASSERT_HEADER(sizeof(acc_int_fast64_t) == sizeof(acc_uint_fast6
# endif # endif
#elif (ACC_CC_LCCWIN32) #elif (ACC_CC_LCCWIN32)
# define utime _utime # define utime _utime
#elif (ACC_CC_MSC) #elif (ACC_CC_CLANG_C2 || ACC_CC_MSC)
# if (_MSC_VER < 600) # if (_MSC_VER < 600)
# undef HAVE_STRFTIME # undef HAVE_STRFTIME
# endif # endif
@@ -3921,8 +4010,6 @@ extern "C" {
#endif #endif
#if (ACC_BROKEN_CDECL_ALT_SYNTAX) #if (ACC_BROKEN_CDECL_ALT_SYNTAX)
typedef void __acc_cdecl_sighandler (*acc_sighandler_t)(acc_signo_t); typedef void __acc_cdecl_sighandler (*acc_sighandler_t)(acc_signo_t);
#elif defined(RETSIGTYPE)
typedef RETSIGTYPE (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t);
#else #else
typedef void (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t); typedef void (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t);
#endif #endif
@@ -4542,8 +4629,6 @@ extern "C" {
#endif #endif
#if (ACC_BROKEN_CDECL_ALT_SYNTAX) #if (ACC_BROKEN_CDECL_ALT_SYNTAX)
typedef void __acc_cdecl_sighandler (*acc_sighandler_t)(acc_signo_t); typedef void __acc_cdecl_sighandler (*acc_sighandler_t)(acc_signo_t);
#elif defined(RETSIGTYPE)
typedef RETSIGTYPE (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t);
#else #else
typedef void (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t); typedef void (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t);
#endif #endif
@@ -4834,7 +4919,7 @@ typedef unsigned short wchar_t;
#if (HAVE_SIGNAL_H) #if (HAVE_SIGNAL_H)
# include <signal.h> # include <signal.h>
#endif #endif
#if (TIME_WITH_SYS_TIME) #if (HAVE_SYS_TIME_H && HAVE_TIME_H)
# include <sys/time.h> # include <sys/time.h>
# include <time.h> # include <time.h>
#elif (HAVE_TIME_H) #elif (HAVE_TIME_H)
@@ -6641,35 +6726,31 @@ ACCLIB_PUBLIC(int, acc_dos_free) (void __far* p)
# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f) # define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
#endif #endif
ACCLIB_PUBLIC(void, acc_getopt_init) (acc_getopt_p g, ACCLIB_PUBLIC(void, acc_getopt_init) (acc_getopt_p g,
int start_argc, int argc, char** argv) int start_argc, int argc, char **argv)
{ {
memset(g, 0, sizeof(*g)); memset(g, 0, sizeof(*g));
g->optind = start_argc; g->optind = start_argc;
g->argc = argc; g->argv = argv; g->argc = argc; g->argv = argv;
g->optopt = -1; g->optopt = -1;
} }
static int __ACCLIB_FUNCNAME(acc_getopt_rotate) (char** p, int first, int middle, int last) static int __ACCLIB_FUNCNAME(acc_getopt_rotate) (char **p, int first, int middle, int last)
{ {
int i = middle, n = middle - first; int i = middle, n = middle - first;
if (first >= middle || middle >= last) return 0; if (first >= middle || middle >= last) return 0;
for (;;) for (;;) {
{ char *t = p[first]; p[first++] = p[i]; p[i++] = t;
char* t = p[first]; p[first] = p[i]; p[i] = t; if (first == middle) {
if (++first == middle) if (i == last) break;
{
if (++i == last) break;
middle = i; middle = i;
} } else if (i == last)
else if (++i == last)
i = middle; i = middle;
} }
return n; return n;
} }
static int __ACCLIB_FUNCNAME(acc_getopt_perror) (acc_getopt_p g, int ret, const char* f, ...) static int __ACCLIB_FUNCNAME(acc_getopt_perror) (acc_getopt_p g, int ret, const char *f, ...)
{ {
if (g->opterr) if (g->opterr) {
{ #if defined(HAVE_STDARG_H) && (HAVE_STDARG_H)
#if (HAVE_STDARG_H)
struct { va_list ap; } s; struct { va_list ap; } s;
va_start(s.ap, f); va_start(s.ap, f);
g->opterr(g, f, &s); g->opterr(g, f, &s);
@@ -6682,16 +6763,15 @@ static int __ACCLIB_FUNCNAME(acc_getopt_perror) (acc_getopt_p g, int ret, const
return ret; return ret;
} }
ACCLIB_PUBLIC(int, acc_getopt) (acc_getopt_p g, ACCLIB_PUBLIC(int, acc_getopt) (acc_getopt_p g,
const char* shortopts, const char *shortopts,
const acc_getopt_longopt_p longopts, const acc_getopt_longopt_p longopts,
int* longind) int *longind)
{ {
#define pe __ACCLIB_FUNCNAME(acc_getopt_perror) #define pe __ACCLIB_FUNCNAME(acc_getopt_perror)
int ordering = ACC_GETOPT_PERMUTE; int ordering = ACC_GETOPT_PERMUTE;
int missing_arg_ret = g->bad_option; int missing_arg_ret = g->bad_option;
char* a; char *a;
if (shortopts) if (shortopts) {
{
if (*shortopts == '-' || *shortopts == '+') if (*shortopts == '-' || *shortopts == '+')
ordering = *shortopts++ == '-' ? ACC_GETOPT_RETURN_IN_ORDER : ACC_GETOPT_REQUIRE_ORDER; ordering = *shortopts++ == '-' ? ACC_GETOPT_RETURN_IN_ORDER : ACC_GETOPT_REQUIRE_ORDER;
if (*shortopts == ':') if (*shortopts == ':')
@@ -6708,20 +6788,17 @@ ACCLIB_PUBLIC(int, acc_getopt) (acc_getopt_p g,
goto acc_label_next_shortopt; goto acc_label_next_shortopt;
g->optind -= __ACCLIB_FUNCNAME(acc_getopt_rotate)(g->argv, g->pending_rotate_first, g->pending_rotate_middle, g->optind); g->optind -= __ACCLIB_FUNCNAME(acc_getopt_rotate)(g->argv, g->pending_rotate_first, g->pending_rotate_middle, g->optind);
g->pending_rotate_first = g->pending_rotate_middle = g->optind; g->pending_rotate_first = g->pending_rotate_middle = g->optind;
if (ordering == ACC_GETOPT_PERMUTE) if (ordering == ACC_GETOPT_PERMUTE) {
{
while (g->optind < g->argc && !(g->argv[g->optind][0] == '-' && g->argv[g->optind][1])) while (g->optind < g->argc && !(g->argv[g->optind][0] == '-' && g->argv[g->optind][1]))
++g->optind; ++g->optind;
g->pending_rotate_middle = g->optind; g->pending_rotate_middle = g->optind;
} }
if (g->optind >= g->argc) if (g->optind >= g->argc) {
{
g->optind = g->pending_rotate_first; g->optind = g->pending_rotate_first;
goto acc_label_eof; goto acc_label_eof;
} }
a = g->argv[g->optind]; a = g->argv[g->optind];
if (a[0] == '-' && a[1] == '-') if (a[0] == '-' && a[1] == '-') {
{
size_t l = 0; size_t l = 0;
const acc_getopt_longopt_p o; const acc_getopt_longopt_p o;
const acc_getopt_longopt_p o1 = NULL; const acc_getopt_longopt_p o1 = NULL;
@@ -6732,12 +6809,13 @@ ACCLIB_PUBLIC(int, acc_getopt) (acc_getopt_p g,
goto acc_label_eof; goto acc_label_eof;
for (a += 2; a[l] && a[l] != '=' && a[l] != '#'; ) for (a += 2; a[l] && a[l] != '=' && a[l] != '#'; )
++l; ++l;
for (o = longopts; l && o && o->name; ++o) for (o = longopts; l && o && o->name; ++o) {
{
if (strncmp(a, o->name, l) != 0) if (strncmp(a, o->name, l) != 0)
continue; continue;
if (!o->name[l]) if (!o->name[l])
goto acc_label_found_o; goto acc_label_found_o;
if ((o->has_arg & (ACC_GETOPT_EXACT_ARG | 0x80)) == (ACC_GETOPT_EXACT_ARG | 0x80))
continue;
need_exact |= o->has_arg & ACC_GETOPT_EXACT_ARG; need_exact |= o->has_arg & ACC_GETOPT_EXACT_ARG;
if (o1) o2 = o; if (o1) o2 = o;
else o1 = o; else o1 = o;
@@ -6749,8 +6827,7 @@ ACCLIB_PUBLIC(int, acc_getopt) (acc_getopt_p g,
o = o1; o = o1;
acc_label_found_o: acc_label_found_o:
a += l; a += l;
switch (o->has_arg & 0x2f) switch (o->has_arg & 0x2f) {
{
case ACC_GETOPT_OPTIONAL_ARG: case ACC_GETOPT_OPTIONAL_ARG:
if (a[0]) if (a[0])
g->optarg = a + 1; g->optarg = a + 1;
@@ -6760,7 +6837,7 @@ ACCLIB_PUBLIC(int, acc_getopt) (acc_getopt_p g,
g->optarg = a + 1; g->optarg = a + 1;
else if (g->optind < g->argc) else if (g->optind < g->argc)
g->optarg = g->argv[g->optind++]; g->optarg = g->argv[g->optind++];
if (!g->optarg) if (!g->optarg || (!g->optarg[0] && (o->has_arg & 0x40)))
return pe(g, missing_arg_ret, "option '--%s' requires an argument", o->name); return pe(g, missing_arg_ret, "option '--%s' requires an argument", o->name);
break; break;
case ACC_GETOPT_REQUIRED_ARG | 0x20: case ACC_GETOPT_REQUIRED_ARG | 0x20:
@@ -6776,43 +6853,35 @@ ACCLIB_PUBLIC(int, acc_getopt) (acc_getopt_p g,
} }
if (longind) if (longind)
*longind = (int) (o - longopts); *longind = (int) (o - longopts);
if (o->flag) if (o->flag) {
{
*o->flag = o->val; *o->flag = o->val;
return 0; return 0;
} }
return o->val; return o->val;
} }
if (a[0] == '-' && a[1]) if (a[0] == '-' && a[1]) {
{
unsigned char c; unsigned char c;
const char* s; const char *s;
acc_label_next_shortopt: acc_label_next_shortopt:
a = g->argv[g->optind] + ++g->shortpos; a = g->argv[g->optind] + ++g->shortpos;
c = (unsigned char) *a++; s = NULL; c = (unsigned char) *a++; s = NULL;
if (c != ':' && shortopts) if (c != ':' && shortopts)
s = strchr(shortopts, c); s = strchr(shortopts, c);
if (!s || s[1] != ':') if (!s || s[1] != ':') {
{
if (!a[0]) if (!a[0])
{ ++g->optind; g->shortpos = 0; } { ++g->optind; g->shortpos = 0; }
if (!s) if (!s) {
{
g->optopt = c; g->optopt = c;
return pe(g, g->bad_option, "invalid option '-%c'", c); return pe(g, g->bad_option, "invalid option '-%c'", c);
} }
} } else {
else
{
++g->optind; g->shortpos = 0; ++g->optind; g->shortpos = 0;
if (a[0]) if (a[0])
g->optarg = a; g->optarg = a;
else if (s[2] != ':') else if (s[2] != ':') {
{
if (g->optind < g->argc) if (g->optind < g->argc)
g->optarg = g->argv[g->optind++]; g->optarg = g->argv[g->optind++];
else else {
{
g->optopt = c; g->optopt = c;
return pe(g, missing_arg_ret, "option '-%c' requires an argument", c); return pe(g, missing_arg_ret, "option '-%c' requires an argument", c);
} }
@@ -6820,8 +6889,7 @@ ACCLIB_PUBLIC(int, acc_getopt) (acc_getopt_p g,
} }
return c; return c;
} }
if (ordering == ACC_GETOPT_RETURN_IN_ORDER) if (ordering == ACC_GETOPT_RETURN_IN_ORDER) {
{
++g->optind; ++g->optind;
g->optarg = a; g->optarg = a;
return 1; return 1;
@@ -7314,7 +7382,7 @@ static int acc_pclock_read_clock_gettime_t_libc(acc_pclock_handle_p h, acc_pcloc
if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts) != 0) if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts) != 0)
return -1; return -1;
c->tv_sec = ts.tv_sec; c->tv_sec = ts.tv_sec;
c->tv_nsec = (acc_uint32l_t) ts.tv_nsec; c->tv_nsec = ACC_STATIC_CAST(acc_uint32l_t, ts.tv_nsec);
ACC_UNUSED(h); return 0; ACC_UNUSED(h); return 0;
} }
#endif #endif
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+4 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -146,6 +146,8 @@ struct options_t {
bool unmap_all_pages; // thus /proc/self/exe vanishes bool unmap_all_pages; // thus /proc/self/exe vanishes
unsigned char osabi0; // replacement if 0==.e_ident[EI_OSABI] unsigned char osabi0; // replacement if 0==.e_ident[EI_OSABI]
bool preserve_build_id; // copy the build-id to the compressed binary bool preserve_build_id; // copy the build-id to the compressed binary
bool android_shlib; // keep some ElfXX_Shdr for dlopen()
bool force_pie; // choose DF_1_PIE instead of is_shlib
} o_unix; } o_unix;
struct { struct {
bool le; bool le;
+2 -11
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -92,15 +92,6 @@ void PackArmPe::processImports2(unsigned myimport, unsigned iat_off) // pass 2
{ {
PeFile::processImports2(myimport, iat_off); PeFile::processImports2(myimport, iat_off);
__packed_struct(import_desc)
LE32 oft; // orig first thunk
char _[8];
LE32 dllname;
LE32 iat; // import address table
__packed_struct_end()
COMPILE_TIME_ASSERT(sizeof(import_desc) == 20);
// adjust import data // adjust import data
for (import_desc *im = (import_desc*) oimpdlls; im->dllname; im++) for (import_desc *im = (import_desc*) oimpdlls; im->dllname; im++)
{ {
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+59 -4
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -73,7 +73,8 @@
EM_PPC = 20, EM_PPC = 20,
EM_PPC64 = 21, EM_PPC64 = 21,
EM_ARM = 40, EM_ARM = 40,
EM_X86_64 = 62 EM_X86_64 = 62,
EM_AARCH64 = 183
}; };
enum { // e_version enum { // e_version
@@ -90,6 +91,7 @@
PT_INTERP = 3, /* Name of program interpreter */ PT_INTERP = 3, /* Name of program interpreter */
PT_NOTE = 4, /* Auxiliary information (esp. OpenBSD) */ PT_NOTE = 4, /* Auxiliary information (esp. OpenBSD) */
PT_PHDR = 6 /* Entry for header table itself */ PT_PHDR = 6 /* Entry for header table itself */
, PT_GNU_STACK = 0x6474e551 /* Indicates stack executability */
}; };
enum { // p_flags enum { // p_flags
@@ -122,6 +124,10 @@
SHT_GROUP = 17, /* Section group */ SHT_GROUP = 17, /* Section group */
SHT_SYMTAB_SHNDX = 18, /* Extended section indeces */ SHT_SYMTAB_SHNDX = 18, /* Extended section indeces */
SHT_GNU_LIBLIST = 0x6ffffff7 /* Prelink library list */ SHT_GNU_LIBLIST = 0x6ffffff7 /* Prelink library list */
, SHT_LOOS = 0x60000000 /* LOcal OS; SHT_ANDROID_REL{,A} is +1, +2 */
, SHT_LOPROC = 0x70000000/* Start of processor-specific */
, SHT_ARM_ATTRIBUTES = (SHT_LOPROC + 3) /* ARM attributes section. */
}; };
enum { // sh_flags enum { // sh_flags
@@ -142,25 +148,41 @@
DT_NULL = 0, /* End flag */ DT_NULL = 0, /* End flag */
DT_NEEDED = 1, /* Name of needed library */ DT_NEEDED = 1, /* Name of needed library */
DT_PLTRELSZ = 2, /* Size in bytes of PLT relocs */ DT_PLTRELSZ = 2, /* Size in bytes of PLT relocs */
DT_PLTGOT = 3, /* Processor defined value */
DT_HASH = 4, /* Hash table of symbol names */ DT_HASH = 4, /* Hash table of symbol names */
DT_STRTAB = 5, /* String table */ DT_STRTAB = 5, /* String table */
DT_SYMTAB = 6, /* Symbol table */ DT_SYMTAB = 6, /* Symbol table */
DT_RELA = 7, /* Relocations which do contain an addend */ DT_RELA = 7, /* Relocations which do contain an addend */
DT_RELASZ = 8, /* Total size of Rela relocs */ DT_RELASZ = 8, /* Total size of Rela relocs */
DT_RELAENT = 9, /* Size of one RELA relocation */ DT_RELAENT = 9, /* Size of one RELA relocation */
DT_STRSZ = 10, /* Size of string table */
DT_SYMENT = 11, /* Size of one symbol table entry */
DT_INIT = 12, /* Address of init function */ DT_INIT = 12, /* Address of init function */
DT_FINI = 13, /* Address of termination function */
DT_REL = 17, /* Relocations which contain no addend */ DT_REL = 17, /* Relocations which contain no addend */
DT_RELSZ = 18, /* Total size of Rel relocs */
DT_RELENT = 19, /* Size of one Rel relocation */ DT_RELENT = 19, /* Size of one Rel relocation */
DT_STRSZ = 10, /* Sizeof string table */
DT_PLTREL = 20, /* Type of reloc in PLT */ DT_PLTREL = 20, /* Type of reloc in PLT */
DT_TEXTREL = 22, /* Reloc might modify .text */ DT_TEXTREL = 22, /* Reloc might modify .text */
DT_JMPREL = 23, /* Address of PLT relocs */ DT_JMPREL = 23, /* Address of PLT relocs */
DT_INIT_ARRAY = 25, /* Array with addresses of init fct */
DT_FINI_ARRAY = 26, /* Array with addresses of fini fct */
DT_INIT_ARRAYSZ= 27, /* size in bytes */
DT_FINI_ARRAYSZ= 28, /* size in bytes */
DT_PREINIT_ARRAY = 32, /* Array with addresses of preinit fct*/
DT_PREINIT_ARRAYSZ= 33, /* size in bytes */
DT_CHECKSUM = 0x6ffffdf8, /* Only for prelink? */ DT_CHECKSUM = 0x6ffffdf8, /* Only for prelink? */
DT_GNU_HASH = 0x6ffffef5, /* GNU-style hash table */ DT_GNU_HASH = 0x6ffffef5, /* GNU-style hash table */
DT_VERSYM = 0x6ffffff0, /* version[] for each symbol */ DT_VERSYM = 0x6ffffff0, /* version[] for each symbol */
DT_FLAGS_1 = 0x6ffffffb, /* DF_1_* */
DT_VERDEF = 0x6ffffffc, /* version definitions[] */ DT_VERDEF = 0x6ffffffc, /* version definitions[] */
DT_VERNEEDED= 0x6ffffffe /* version[] needed */ DT_VERNEEDED= 0x6ffffffe /* version[] needed */
}; };
enum { // DT_FLAGS_1
DF_1_NOW = 0x00000001, /* Set RTLD_NOW for this object. */
DF_1_PIE = 0x08000000 // Position-Independent Executable (main program)
};
#endif #endif
@@ -197,6 +219,39 @@
#endif #endif
#ifdef WANT_REL_ENUM //{
#undef WANT_REL_ENUM
static inline unsigned ELF32_R_TYPE(unsigned x) { return 0xff & x; }
static inline unsigned ELF64_R_TYPE(upx_uint64_t x) { return 0xffffffff & (unsigned)x; }
# undef R_PPC_RELATIVE
# undef R_PPC64_RELATIVE
# undef R_PPC_JMP_SLOT
# undef R_PPC64_JMP_SLOT
enum { // relocation types
R_386_RELATIVE = 8,
R_AARCH64_RELATIVE = 1027,
R_ARM_RELATIVE = 23,
R_PPC_RELATIVE = 22,
R_PPC64_RELATIVE = R_PPC_RELATIVE,
R_X86_64_RELATIVE = 8,
R_386_JMP_SLOT = 7,
R_AARCH64_JUMP_SLOT = 1026,
R_ARM_JUMP_SLOT = 22,
R_PPC_JMP_SLOT = 21,
R_PPC64_JMP_SLOT = R_PPC_JMP_SLOT,
R_X86_64_JUMP_SLOT = 7
, R_ARM_ABS32 = 2
, R_ARM_GLOB_DAT = 21
, R_AARCH64_ABS64 = 257
, R_AARCH64_GLOB_DAT = 1025
};
#endif //}
#ifdef WANT_NHDR_ENUM #ifdef WANT_NHDR_ENUM
#undef WANT_NHDR_ENUM #undef WANT_NHDR_ENUM
enum { // ELF PT_NOTE types enum { // ELF PT_NOTE types
+7 -3
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -281,9 +281,13 @@ int PackExe::readFileHeader()
if (ih.ident != 'M' + 'Z'*256 && ih.ident != 'Z' + 'M'*256) if (ih.ident != 'M' + 'Z'*256 && ih.ident != 'Z' + 'M'*256)
return 0; return 0;
ih_exesize = ih.m512 + ih.p512*512 - (ih.m512 ? 512 : 0); ih_exesize = ih.m512 + ih.p512*512 - (ih.m512 ? 512 : 0);
if (!ih_exesize) {
ih_exesize = file_size;
}
ih_imagesize = ih_exesize - ih.headsize16*16; ih_imagesize = ih_exesize - ih.headsize16*16;
ih_overlay = file_size - ih_exesize; ih_overlay = file_size - ih_exesize;
if (ih.m512+ih.p512*512u < sizeof (ih)) if (file_size < (int)sizeof(ih)
|| ((ih.m512 | ih.p512) && ih.m512+ih.p512*512u < sizeof (ih)))
throwCantPack("illegal exe header"); throwCantPack("illegal exe header");
if (file_size < (off_t)ih_exesize || ih_imagesize <= 0 || ih_imagesize > ih_exesize) if (file_size < (off_t)ih_exesize || ih_imagesize <= 0 || ih_imagesize > ih_exesize)
throwCantPack("exe header corrupted"); throwCantPack("exe header corrupted");
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+2641 -995
View File
File diff suppressed because it is too large Load Diff
+106 -16
View File
@@ -2,9 +2,9 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
Copyright (C) 2000-2017 John F. Reiser Copyright (C) 2000-2020 John F. Reiser
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -33,7 +33,6 @@
#ifndef __UPX_P_LX_ELF_H //{ #ifndef __UPX_P_LX_ELF_H //{
#define __UPX_P_LX_ELF_H 1 #define __UPX_P_LX_ELF_H 1
class PackLinuxElf : public PackUnix class PackLinuxElf : public PackUnix
{ {
typedef PackUnix super; typedef PackUnix super;
@@ -51,7 +50,7 @@ protected:
virtual void pack1(OutputFile *, Filter &) = 0; // generate executable header virtual void pack1(OutputFile *, Filter &) = 0; // generate executable header
virtual int pack2(OutputFile *, Filter &) = 0; // append compressed data virtual int pack2(OutputFile *, Filter &) = 0; // append compressed data
virtual void pack3(OutputFile *, Filter &) = 0; // append loader virtual off_t pack3(OutputFile *, Filter &) = 0; // append loader
//virtual void pack4(OutputFile *, Filter &) = 0; // append pack header //virtual void pack4(OutputFile *, Filter &) = 0; // append pack header
virtual void generateElfHdr( virtual void generateElfHdr(
@@ -63,12 +62,12 @@ protected:
virtual void addStubEntrySections(Filter const *); virtual void addStubEntrySections(Filter const *);
virtual void unpack(OutputFile *fo); virtual void unpack(OutputFile *fo);
//virtual void const *elf_find_dynamic(unsigned) const = 0;
virtual upx_uint64_t elf_unsigned_dynamic(unsigned) const = 0; virtual upx_uint64_t elf_unsigned_dynamic(unsigned) const = 0;
static unsigned elf_hash(char const *) /*const*/; static unsigned elf_hash(char const *) /*const*/;
static unsigned gnu_hash(char const *) /*const*/; static unsigned gnu_hash(char const *) /*const*/;
protected: protected:
static unsigned int const asl_delta = (1u<<12); // --android-shlib extra page
unsigned e_type; unsigned e_type;
unsigned e_phnum; /* Program header table entry count */ unsigned e_phnum; /* Program header table entry count */
unsigned e_shnum; unsigned e_shnum;
@@ -81,18 +80,24 @@ protected:
unsigned sz_pack2a; // after pack2() of all PT_LOAD unsigned sz_pack2a; // after pack2() of all PT_LOAD
unsigned lg2_page; // log2(PAGE_SIZE) unsigned lg2_page; // log2(PAGE_SIZE)
unsigned page_size; // 1u<<lg2_page unsigned page_size; // 1u<<lg2_page
bool is_big; // stub style: must use area above the brk bool is_pie; // is Position-Independent-Executable (ET_DYN main program)
unsigned xct_off; // shared library: file offset of SHT_EXECINSTR unsigned xct_off; // shared library: file offset of SHT_EXECINSTR
unsigned hatch_off; // file offset of escape hatch unsigned hatch_off; // file offset of escape hatch
unsigned o_binfo; // offset to first b_info
upx_uint64_t load_va; // PT_LOAD[0].p_vaddr upx_uint64_t load_va; // PT_LOAD[0].p_vaddr
upx_uint64_t xct_va; // minimum SHT_EXECINSTR virtual address upx_uint64_t xct_va; // minimum SHT_EXECINSTR virtual address
upx_uint64_t jni_onload_va; // runtime &JNI_OnLoad upx_uint64_t jni_onload_va; // runtime &JNI_OnLoad
upx_uint64_t user_init_va;
unsigned user_init_off; // within file_image
upx_uint16_t e_machine; upx_uint16_t e_machine;
unsigned char ei_class; unsigned char ei_class;
unsigned char ei_data; unsigned char ei_data;
unsigned char ei_osabi; unsigned char ei_osabi;
char const *osabi_note; char const *osabi_note;
unsigned upx_dt_init; // DT_INIT, DT_PREINIT_ARRAY, DT_INIT_ARRAY
static unsigned const DT_NUM = 34; // elf.h
unsigned dt_table[DT_NUM]; // 1+ index in PT_DYNAMIC
unsigned char const *buildid_data; unsigned char const *buildid_data;
int o_elf_shnum; // num output Shdrs int o_elf_shnum; // num output Shdrs
@@ -118,15 +123,18 @@ protected:
virtual void pack1(OutputFile *, Filter &); // generate executable header virtual void pack1(OutputFile *, Filter &); // generate executable header
virtual int pack2(OutputFile *, Filter &); // append compressed data virtual int pack2(OutputFile *, Filter &); // append compressed data
virtual void pack3(OutputFile *, Filter &); // append loader virtual off_t pack3(OutputFile *, Filter &); // append loader
virtual void pack4(OutputFile *, Filter &); // append pack header virtual void pack4(OutputFile *, Filter &); // append pack header
virtual void unpack(OutputFile *fo); virtual void unpack(OutputFile *fo);
virtual void unRel32(unsigned dt_rel, Elf32_Rel *rel0, unsigned relsz,
MemBuffer &membuf, unsigned const load_off, OutputFile *fo);
virtual void generateElfHdr( virtual void generateElfHdr(
OutputFile *, OutputFile *,
void const *proto, void const *proto,
unsigned const brka unsigned const brka
); );
virtual void defineSymbols(Filter const *);
virtual void buildLinuxLoader( virtual void buildLinuxLoader(
upx_byte const *const proto, // assembly-only sections upx_byte const *const proto, // assembly-only sections
unsigned const szproto, unsigned const szproto,
@@ -140,23 +148,37 @@ protected:
virtual unsigned find_LOAD_gap(Elf32_Phdr const *const phdri, unsigned const k, virtual unsigned find_LOAD_gap(Elf32_Phdr const *const phdri, unsigned const k,
unsigned const e_phnum); unsigned const e_phnum);
virtual off_t getbase(const Elf32_Phdr *phdr, int e_phnum) const; virtual off_t getbase(const Elf32_Phdr *phdr, int e_phnum) const;
bool calls_crt1(Elf32_Rel const *rel, int sz);
virtual Elf32_Sym const *elf_lookup(char const *) const; virtual Elf32_Sym const *elf_lookup(char const *) const;
virtual unsigned elf_get_offset_from_address(unsigned) const; virtual unsigned elf_get_offset_from_address(unsigned) const;
Elf32_Phdr const *elf_find_ptype(unsigned type, Elf32_Phdr const *phdr0, unsigned phnum);
Elf32_Shdr const *elf_find_section_name(char const *) const; Elf32_Shdr const *elf_find_section_name(char const *) const;
Elf32_Shdr const *elf_find_section_type(unsigned) const; Elf32_Shdr const *elf_find_section_type(unsigned) const;
unsigned check_pt_load(Elf32_Phdr const *);
unsigned check_pt_dynamic(Elf32_Phdr const *);
void invert_pt_dynamic(Elf32_Dyn const *);
void const *elf_find_dynamic(unsigned) const; void const *elf_find_dynamic(unsigned) const;
Elf32_Dyn const *elf_has_dynamic(unsigned) const; Elf32_Dyn const *elf_has_dynamic(unsigned) const;
virtual upx_uint64_t elf_unsigned_dynamic(unsigned) const; virtual upx_uint64_t elf_unsigned_dynamic(unsigned) const;
virtual int adjABS(Elf32_Sym *sym, unsigned delta);
char const *get_str_name(unsigned st_name, unsigned symnum) const;
char const *get_dynsym_name(unsigned symnum, unsigned relnum) const;
protected: protected:
Elf32_Ehdr ehdri; // from input file Elf32_Ehdr ehdri; // from input file
MemBuffer lowmem; // especially for shlib
Elf32_Phdr *phdri; // for input file Elf32_Phdr *phdri; // for input file
Elf32_Shdr *shdri; // from input file
Elf32_Phdr const *gnu_stack; // propagate NX
unsigned e_phoff; unsigned e_phoff;
unsigned e_shoff; unsigned e_shoff;
unsigned sz_dynseg; // PT_DYNAMIC.p_memsz
unsigned so_slide;
unsigned char *note_body; // concatenated contents of PT_NOTEs, if any unsigned char *note_body; // concatenated contents of PT_NOTEs, if any
unsigned note_size; // total size of PT_NOTEs unsigned note_size; // total size of PT_NOTEs
Elf32_Shdr const *shdri; // from input file unsigned n_jmp_slot;
unsigned plt_off;
unsigned page_mask; // AND clears the offset-within-page unsigned page_mask; // AND clears the offset-within-page
Elf32_Dyn const *dynseg; // from PT_DYNAMIC Elf32_Dyn const *dynseg; // from PT_DYNAMIC
@@ -166,9 +188,11 @@ protected:
Elf32_Sym const *jni_onload_sym; Elf32_Sym const *jni_onload_sym;
char const *shstrtab; // via Elf32_Shdr char const *shstrtab; // via Elf32_Shdr
Elf32_Shdr const *sec_strndx; Elf32_Shdr *sec_strndx;
Elf32_Shdr const *sec_dynsym; Elf32_Shdr const *sec_dynsym;
Elf32_Shdr const *sec_dynstr; Elf32_Shdr const *sec_dynstr;
unsigned symnum_end;
unsigned strtab_end;
__packed_struct(cprElfHdr1) __packed_struct(cprElfHdr1)
Elf32_Ehdr ehdr; Elf32_Ehdr ehdr;
@@ -233,18 +257,23 @@ public:
protected: protected:
virtual void PackLinuxElf64help1(InputFile *f); virtual void PackLinuxElf64help1(InputFile *f);
virtual int checkEhdr(Elf64_Ehdr const *ehdr) const; virtual int checkEhdr(Elf64_Ehdr const *ehdr) const;
virtual bool canPack();
virtual void pack1(OutputFile *, Filter &); // generate executable header virtual void pack1(OutputFile *, Filter &); // generate executable header
virtual int pack2(OutputFile *, Filter &); // append compressed data virtual int pack2(OutputFile *, Filter &); // append compressed data
virtual void pack3(OutputFile *, Filter &); // append loader virtual off_t pack3(OutputFile *, Filter &); // append loader
virtual void pack4(OutputFile *, Filter &); // append pack header virtual void pack4(OutputFile *, Filter &); // append pack header
virtual void unpack(OutputFile *fo); virtual void unpack(OutputFile *fo);
virtual void unRela64(upx_uint64_t dt_rela, Elf64_Rela *rela0, unsigned relasz,
MemBuffer &membuf, upx_uint64_t const load_off, upx_uint64_t const old_dtinit,
OutputFile *fo);
virtual void generateElfHdr( virtual void generateElfHdr(
OutputFile *, OutputFile *,
void const *proto, void const *proto,
unsigned const brka unsigned const brka
); );
virtual void defineSymbols(Filter const *);
virtual void buildLinuxLoader( virtual void buildLinuxLoader(
upx_byte const *const proto, // assembly-only sections upx_byte const *const proto, // assembly-only sections
unsigned const szproto, unsigned const szproto,
@@ -257,23 +286,37 @@ protected:
virtual void updateLoader(OutputFile *fo); virtual void updateLoader(OutputFile *fo);
virtual unsigned find_LOAD_gap(Elf64_Phdr const *const phdri, unsigned const k, virtual unsigned find_LOAD_gap(Elf64_Phdr const *const phdri, unsigned const k,
unsigned const e_phnum); unsigned const e_phnum);
bool calls_crt1(Elf64_Rela const *rela, int sz);
virtual Elf64_Sym const *elf_lookup(char const *) const; virtual Elf64_Sym const *elf_lookup(char const *) const;
virtual upx_uint64_t elf_get_offset_from_address(upx_uint64_t) const; virtual upx_uint64_t elf_get_offset_from_address(upx_uint64_t) const;
Elf64_Phdr const *elf_find_ptype(unsigned type, Elf64_Phdr const *phdr0, unsigned phnum);
Elf64_Shdr const *elf_find_section_name(char const *) const; Elf64_Shdr const *elf_find_section_name(char const *) const;
Elf64_Shdr const *elf_find_section_type(unsigned) const; Elf64_Shdr const *elf_find_section_type(unsigned) const;
upx_uint64_t check_pt_load(Elf64_Phdr const *);
upx_uint64_t check_pt_dynamic(Elf64_Phdr const *);
void invert_pt_dynamic(Elf64_Dyn const *);
void const *elf_find_dynamic(unsigned) const; void const *elf_find_dynamic(unsigned) const;
Elf64_Dyn const *elf_has_dynamic(unsigned) const; Elf64_Dyn const *elf_has_dynamic(unsigned) const;
virtual upx_uint64_t elf_unsigned_dynamic(unsigned) const; virtual upx_uint64_t elf_unsigned_dynamic(unsigned) const;
virtual int adjABS(Elf64_Sym *sym, unsigned delta);
char const *get_str_name(unsigned st_name, unsigned symnum) const;
char const *get_dynsym_name(unsigned symnum, unsigned relnum) const;
protected: protected:
Elf64_Ehdr ehdri; // from input file Elf64_Ehdr ehdri; // from input file
MemBuffer lowmem; // especially for shlib
Elf64_Phdr *phdri; // for input file Elf64_Phdr *phdri; // for input file
Elf64_Shdr *shdri; // from input file
Elf64_Phdr const *gnu_stack; // propagate NX
upx_uint64_t e_phoff; upx_uint64_t e_phoff;
upx_uint64_t e_shoff; upx_uint64_t e_shoff;
upx_uint64_t sz_dynseg; // PT_DYNAMIC.p_memsz
upx_uint64_t so_slide;
unsigned char *note_body; // concatenated contents of PT_NOTEs, if any unsigned char *note_body; // concatenated contents of PT_NOTEs, if any
unsigned note_size; // total size of PT_NOTEs unsigned note_size; // total size of PT_NOTEs
Elf64_Shdr const *shdri; // from input file unsigned n_jmp_slot;
upx_uint64_t plt_off;
upx_uint64_t page_mask; // AND clears the offset-within-page upx_uint64_t page_mask; // AND clears the offset-within-page
Elf64_Dyn const *dynseg; // from PT_DYNAMIC Elf64_Dyn const *dynseg; // from PT_DYNAMIC
@@ -283,9 +326,11 @@ protected:
Elf64_Sym const *jni_onload_sym; Elf64_Sym const *jni_onload_sym;
char const *shstrtab; // via Elf64_Shdr char const *shstrtab; // via Elf64_Shdr
Elf64_Shdr const *sec_strndx; Elf64_Shdr *sec_strndx;
Elf64_Shdr const *sec_dynsym; Elf64_Shdr const *sec_dynsym;
Elf64_Shdr const *sec_dynstr; Elf64_Shdr const *sec_dynstr;
unsigned symnum_end;
unsigned strtab_end;
__packed_struct(cprElfHdr1) __packed_struct(cprElfHdr1)
Elf64_Ehdr ehdr; Elf64_Ehdr ehdr;
@@ -363,6 +408,18 @@ protected:
} }
}; };
class PackLinuxElf64Be : public PackLinuxElf64
{
typedef PackLinuxElf64 super;
protected:
PackLinuxElf64Be(InputFile *f) : super(f) {
lg2_page=16;
page_size=1u<<lg2_page;
bele = &N_BELE_RTP::be_policy;
PackLinuxElf64help1(f);
}
};
/************************************************************************* /*************************************************************************
// linux/elf64amd // linux/elf64amd
@@ -378,10 +435,25 @@ public:
virtual const char *getName() const { return "linux/amd64"; } virtual const char *getName() const { return "linux/amd64"; }
virtual const char *getFullName(const options_t *) const { return "amd64-linux.elf"; } virtual const char *getFullName(const options_t *) const { return "amd64-linux.elf"; }
virtual const int *getFilters() const; virtual const int *getFilters() const;
virtual bool canPack();
protected: protected:
virtual void pack1(OutputFile *, Filter &); // generate executable header virtual void pack1(OutputFile *, Filter &); // generate executable header
//virtual void pack3(OutputFile *, Filter &); // append loader virtual void buildLoader(const Filter *);
virtual Linker* newLinker() const;
virtual void defineSymbols(Filter const *);
};
class PackLinuxElf64arm : public PackLinuxElf64Le
{
typedef PackLinuxElf64Le super;
public:
PackLinuxElf64arm(InputFile *f);
virtual ~PackLinuxElf64arm();
virtual int getFormat() const { return UPX_F_LINUX_ELF64_ARM; }
virtual const char *getName() const { return "linux/arm64"; }
virtual const char *getFullName(const options_t *) const { return "arm64-linux.elf"; }
virtual const int *getFilters() const;
protected:
virtual void pack1(OutputFile *, Filter &); // generate executable header
virtual void buildLoader(const Filter *); virtual void buildLoader(const Filter *);
virtual Linker* newLinker() const; virtual Linker* newLinker() const;
virtual void defineSymbols(Filter const *); virtual void defineSymbols(Filter const *);
@@ -425,7 +497,25 @@ public:
protected: protected:
unsigned lg2_page; // log2(PAGE_SIZE) unsigned lg2_page; // log2(PAGE_SIZE)
unsigned page_size; // 1u<<lg2_page unsigned page_size; // 1u<<lg2_page
virtual bool canPack(); virtual void pack1(OutputFile *, Filter &); // generate executable header
virtual void buildLoader(const Filter *);
virtual Linker* newLinker() const;
};
class PackLinuxElf64ppc : public PackLinuxElf64Be
{
typedef PackLinuxElf64Be super;
public:
PackLinuxElf64ppc(InputFile *f);
virtual ~PackLinuxElf64ppc();
virtual int getFormat() const { return UPX_F_LINUX_ELFPPC64; }
virtual const char *getName() const { return "linux/ppc64"; }
virtual const char *getFullName(const options_t *) const { return "powerpc64-linux.elf"; }
virtual const int *getFilters() const;
protected:
unsigned lg2_page; // log2(PAGE_SIZE)
unsigned page_size; // 1u<<lg2_page
virtual void pack1(OutputFile *, Filter &); // generate executable header virtual void pack1(OutputFile *, Filter &); // generate executable header
virtual void buildLoader(const Filter *); virtual void buildLoader(const Filter *);
virtual Linker* newLinker() const; virtual Linker* newLinker() const;
+3 -3
View File
@@ -2,9 +2,9 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
Copyright (C) 2001-2017 John F. Reiser Copyright (C) 2001-2020 John F. Reiser
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+6 -5
View File
@@ -2,9 +2,9 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
Copyright (C) 2000-2017 John F. Reiser Copyright (C) 2000-2020 John F. Reiser
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -82,7 +82,7 @@ void PackLinuxElf32x86interp::pack1(OutputFile *fo, Filter &)
assert(ehdri.e_phoff == sizeof(Elf32_Ehdr)); // checked by canPack() assert(ehdri.e_phoff == sizeof(Elf32_Ehdr)); // checked by canPack()
sz_phdrs = ehdri.e_phnum * ehdri.e_phentsize; sz_phdrs = ehdri.e_phnum * ehdri.e_phentsize;
phdri = new Elf32_Phdr[(unsigned)ehdri.e_phnum]; phdri = New(Elf32_Phdr, ehdri.e_phnum);
fi->seek(ehdri.e_phoff, SEEK_SET); fi->seek(ehdri.e_phoff, SEEK_SET);
fi->readx(phdri, sz_phdrs); fi->readx(phdri, sz_phdrs);
@@ -135,7 +135,7 @@ int PackLinuxElf32x86interp::pack2(OutputFile *fo, Filter &ft)
#undef PAGE_MASK #undef PAGE_MASK
#define PAGE_MASK (~0u<<12) #define PAGE_MASK (~0u<<12)
void PackLinuxElf32x86interp::pack3(OutputFile *fo, Filter &/*ft*/) off_t PackLinuxElf32x86interp::pack3(OutputFile *fo, Filter &/*ft*/)
{ {
unsigned base = getbase(phdri, ehdri.e_phnum); unsigned base = getbase(phdri, ehdri.e_phnum);
unsigned sz = PAGE_MASK & (~PAGE_MASK + elfout.phdr[0].p_filesz); unsigned sz = PAGE_MASK & (~PAGE_MASK + elfout.phdr[0].p_filesz);
@@ -191,6 +191,7 @@ void PackLinuxElf32x86interp::pack3(OutputFile *fo, Filter &/*ft*/)
else { else {
updateLoader(fo); updateLoader(fo);
} }
return fo->getBytesWritten();
} }
+4 -4
View File
@@ -2,9 +2,9 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
Copyright (C) 2000-2017 John F. Reiser Copyright (C) 2000-2020 John F. Reiser
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -55,7 +55,7 @@ public:
protected: protected:
virtual void pack1(OutputFile *, Filter &); // generate executable header virtual void pack1(OutputFile *, Filter &); // generate executable header
virtual int pack2(OutputFile *, Filter &); // append compressed data virtual int pack2(OutputFile *, Filter &); // append compressed data
virtual void pack3(OutputFile *, Filter &); // build loader virtual off_t pack3(OutputFile *, Filter &); // build loader
}; };
+5 -6
View File
@@ -2,9 +2,9 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
Copyright (C) 2000-2017 John F. Reiser Copyright (C) 2000-2020 John F. Reiser
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -161,11 +161,10 @@ PackLinuxI386sh::pack1(OutputFile *fo, Filter &)
generateElfHdr(fo, stub_i386_linux_elf_shell_fold, 0x08048000); generateElfHdr(fo, stub_i386_linux_elf_shell_fold, 0x08048000);
} }
void off_t
PackLinuxI386sh::pack3(OutputFile *fo, Filter &ft) PackLinuxI386sh::pack3(OutputFile *fo, Filter &ft)
{ {
super::pack3(fo,ft); return elfout.phdr[0].p_filesz = super::pack3(fo,ft);
elfout.phdr[0].p_filesz = fo->getBytesWritten();
} }
/* vim:set ts=4 sw=4 et: */ /* vim:set ts=4 sw=4 et: */
+4 -4
View File
@@ -2,9 +2,9 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
Copyright (C) 2000-2017 John F. Reiser Copyright (C) 2000-2020 John F. Reiser
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -52,7 +52,7 @@ public:
virtual void buildLoader(const Filter *); virtual void buildLoader(const Filter *);
virtual void pack1(OutputFile *fo, Filter &ft); virtual void pack1(OutputFile *fo, Filter &ft);
virtual void pack3(OutputFile *fo, Filter &ft); virtual off_t pack3(OutputFile *fo, Filter &ft);
virtual bool canPack(); virtual bool canPack();
// virtual void unpack(OutputFile *fo) { super::unpack(fo); } // virtual void unpack(OutputFile *fo) { super::unpack(fo); }
+562 -485
View File
File diff suppressed because it is too large Load Diff
+17 -49
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -29,6 +29,7 @@
#ifndef __UPX_P_MACHO_H #ifndef __UPX_P_MACHO_H
#define __UPX_P_MACHO_H 1 #define __UPX_P_MACHO_H 1
#include "conf.h"
__packed_struct(Mach_fat_header) __packed_struct(Mach_fat_header)
BE32 magic; BE32 magic;
@@ -287,7 +288,9 @@ template <class TMachITypes>
__packed_struct(Mach_linkedit_data_command) __packed_struct(Mach_linkedit_data_command)
typedef typename TMachITypes::Word Word; typedef typename TMachITypes::Word Word;
Word cmd; Word cmd; // LC_CODE_SIGNATURE, LC_SEGMENT_SPLIT_INFO,
// LC_FUNCTION_STARTS, LC_DATA_IN_CODE,
// LC_DYLIB_CODE_SIGN_DRS, LC_LINKER_OPTIMIZATION_HINT
Word cmdsize; Word cmdsize;
Word dataoff; // file offset of data in __LINKEDIT segment Word dataoff; // file offset of data in __LINKEDIT segment
Word datasize; // file size of data in __LINKEDIT segment Word datasize; // file size of data in __LINKEDIT segment
@@ -333,6 +336,7 @@ __packed_struct(Mach_source_version_command)
Word cmd; // LC_SOURCE_VERSION Word cmd; // LC_SOURCE_VERSION
Word cmdsize; // 16 Word cmdsize; // 16
Word version; Word version;
Word __pad; // to 0 mod 8
__packed_struct_end() __packed_struct_end()
template <class TMachITypes> template <class TMachITypes>
@@ -391,26 +395,6 @@ __packed_struct(Mach_load_dylib_command)
Mach_dylib<TMachITypes> dylib; Mach_dylib<TMachITypes> dylib;
__packed_struct_end() __packed_struct_end()
template <class TMachITypes>
__packed_struct(Mach_function_starts_command)
typedef typename TMachITypes::Word Word;
Word cmd;
Word cmdsize;
Word dataoff;
Word datasize;
__packed_struct_end()
template <class TMachITypes>
__packed_struct(Mach_data_in_code_command)
typedef typename TMachITypes::Word Word;
Word cmd;
Word cmdsize;
Word dataoff;
Word datasize;
__packed_struct_end()
} // namespace N_Mach } // namespace N_Mach
namespace N_Mach32 { namespace N_Mach32 {
@@ -558,8 +542,6 @@ struct MachClass_32
typedef N_Mach::Mach_twolevel_hints_command<MachITypes> Mach_twolevel_hints_command; typedef N_Mach::Mach_twolevel_hints_command<MachITypes> Mach_twolevel_hints_command;
typedef N_Mach::Mach_linkedit_data_command<MachITypes> Mach_linkedit_data_command; typedef N_Mach::Mach_linkedit_data_command<MachITypes> Mach_linkedit_data_command;
typedef N_Mach::Mach_uuid_command<MachITypes> Mach_uuid_command; typedef N_Mach::Mach_uuid_command<MachITypes> Mach_uuid_command;
typedef N_Mach::Mach_data_in_code_command<MachITypes> Mach_data_in_code_command;
typedef N_Mach::Mach_function_starts_command<MachITypes> Mach_function_starts_command;
typedef N_Mach::Mach_load_dylib_command<MachITypes> Mach_load_dylib_command; typedef N_Mach::Mach_load_dylib_command<MachITypes> Mach_load_dylib_command;
typedef N_Mach::Mach_dylib<MachITypes> Mach_dylib; typedef N_Mach::Mach_dylib<MachITypes> Mach_dylib;
typedef N_Mach::Mach_load_dylinker_command<MachITypes> Mach_load_dylinker_command; typedef N_Mach::Mach_load_dylinker_command<MachITypes> Mach_load_dylinker_command;
@@ -602,8 +584,6 @@ struct MachClass_64
typedef N_Mach::Mach_twolevel_hints_command<MachITypes> Mach_twolevel_hints_command; typedef N_Mach::Mach_twolevel_hints_command<MachITypes> Mach_twolevel_hints_command;
typedef N_Mach::Mach_linkedit_data_command<MachITypes> Mach_linkedit_data_command; typedef N_Mach::Mach_linkedit_data_command<MachITypes> Mach_linkedit_data_command;
typedef N_Mach::Mach_uuid_command<MachITypes> Mach_uuid_command; typedef N_Mach::Mach_uuid_command<MachITypes> Mach_uuid_command;
typedef N_Mach::Mach_data_in_code_command<MachITypes> Mach_data_in_code_command;
typedef N_Mach::Mach_function_starts_command<MachITypes> Mach_function_starts_command;
typedef N_Mach::Mach_load_dylib_command<MachITypes> Mach_load_dylib_command; typedef N_Mach::Mach_load_dylib_command<MachITypes> Mach_load_dylib_command;
typedef N_Mach::Mach_dylib<MachITypes> Mach_dylib; typedef N_Mach::Mach_dylib<MachITypes> Mach_dylib;
typedef N_Mach::Mach_load_dylinker_command<MachITypes> Mach_load_dylinker_command; typedef N_Mach::Mach_load_dylinker_command<MachITypes> Mach_load_dylinker_command;
@@ -642,8 +622,6 @@ typedef MachClass_Host32::Mach_twolevel_hints_command Mach32_twolevel_hints_comm
typedef MachClass_Host32::Mach_linkedit_data_command Mach32_linkedit_data_command; typedef MachClass_Host32::Mach_linkedit_data_command Mach32_linkedit_data_command;
typedef MachClass_Host32::Mach_uuid_command Mach32_uuid_command; typedef MachClass_Host32::Mach_uuid_command Mach32_uuid_command;
typedef MachClass_Host32::Mach_main_command Mach32_main_command; typedef MachClass_Host32::Mach_main_command Mach32_main_command;
typedef MachClass_Host32::Mach_data_in_code_command Mach32_data_in_code_command;
typedef MachClass_Host32::Mach_function_starts_command Mach32_function_starts_command;
typedef MachClass_Host32::Mach_load_dylib_command Mach32_load_dylib_command; typedef MachClass_Host32::Mach_load_dylib_command Mach32_load_dylib_command;
typedef MachClass_Host32::Mach_dylib Mach32_dylib; typedef MachClass_Host32::Mach_dylib Mach32_dylib;
typedef MachClass_Host32::Mach_load_dylinker_command Mach32_load_dylinker_command; typedef MachClass_Host32::Mach_load_dylinker_command Mach32_load_dylinker_command;
@@ -661,8 +639,6 @@ typedef MachClass_Host64::Mach_twolevel_hints_command Mach64_twolevel_hints_comm
typedef MachClass_Host64::Mach_linkedit_data_command Mach64_linkedit_data_command; typedef MachClass_Host64::Mach_linkedit_data_command Mach64_linkedit_data_command;
typedef MachClass_Host64::Mach_uuid_command Mach64_uuid_command; typedef MachClass_Host64::Mach_uuid_command Mach64_uuid_command;
typedef MachClass_Host64::Mach_main_command Mach64_main_command; typedef MachClass_Host64::Mach_main_command Mach64_main_command;
typedef MachClass_Host64::Mach_data_in_code_command Mach64_data_in_code_command;
typedef MachClass_Host64::Mach_function_starts_command Mach64_function_starts_command;
typedef MachClass_Host64::Mach_load_dylib_command Mach64_load_dylib_command; typedef MachClass_Host64::Mach_load_dylib_command Mach64_load_dylib_command;
typedef MachClass_Host64::Mach_dylib Mach64_dylib; typedef MachClass_Host64::Mach_dylib Mach64_dylib;
typedef MachClass_Host64::Mach_load_dylinker_command Mach64_load_dylinker_command; typedef MachClass_Host64::Mach_load_dylinker_command Mach64_load_dylinker_command;
@@ -680,8 +656,6 @@ typedef MachClass_BE32::Mach_twolevel_hints_command MachBE32_twolevel_hints_co
typedef MachClass_BE32::Mach_linkedit_data_command MachBE32_linkedit_data_command; typedef MachClass_BE32::Mach_linkedit_data_command MachBE32_linkedit_data_command;
typedef MachClass_BE32::Mach_uuid_command MachBE32_uuid_command; typedef MachClass_BE32::Mach_uuid_command MachBE32_uuid_command;
typedef MachClass_BE32::Mach_main_command MachBE32_main_command; typedef MachClass_BE32::Mach_main_command MachBE32_main_command;
typedef MachClass_BE32::Mach_data_in_code_command MachBE32_data_in_code_command;
typedef MachClass_BE32::Mach_function_starts_command MachBE32_function_starts_command;
typedef MachClass_BE32::Mach_load_dylib_command MachBE32_load_dylib_command; typedef MachClass_BE32::Mach_load_dylib_command MachBE32_load_dylib_command;
typedef MachClass_BE32::Mach_dylib MachBE32_dylib; typedef MachClass_BE32::Mach_dylib MachBE32_dylib;
typedef MachClass_BE32::Mach_load_dylinker_command MachBE32_load_dylinker_command; typedef MachClass_BE32::Mach_load_dylinker_command MachBE32_load_dylinker_command;
@@ -699,8 +673,6 @@ typedef MachClass_BE64::Mach_twolevel_hints_command MachBE64_twolevel_hints_co
typedef MachClass_BE64::Mach_linkedit_data_command MachBE64_linkedit_data_command; typedef MachClass_BE64::Mach_linkedit_data_command MachBE64_linkedit_data_command;
typedef MachClass_BE64::Mach_uuid_command MachBE64_uuid_command; typedef MachClass_BE64::Mach_uuid_command MachBE64_uuid_command;
typedef MachClass_BE64::Mach_main_command MachBE64_main_command; typedef MachClass_BE64::Mach_main_command MachBE64_main_command;
typedef MachClass_BE64::Mach_data_in_code_command MachBE64_data_in_code_command;
typedef MachClass_BE64::Mach_function_starts_command MachBE64_function_starts_command;
typedef MachClass_BE64::Mach_load_dylib_command MachBE64_load_dylib_command; typedef MachClass_BE64::Mach_load_dylib_command MachBE64_load_dylib_command;
typedef MachClass_BE64::Mach_dylib MachBE64_dylib; typedef MachClass_BE64::Mach_dylib MachBE64_dylib;
typedef MachClass_BE64::Mach_load_dylinker_command MachBE64_load_dylinker_command; typedef MachClass_BE64::Mach_load_dylinker_command MachBE64_load_dylinker_command;
@@ -718,8 +690,6 @@ typedef MachClass_LE32::Mach_twolevel_hints_command MachLE32_twolevel_hints_co
typedef MachClass_LE32::Mach_linkedit_data_command MachLE32_linkedit_data_command; typedef MachClass_LE32::Mach_linkedit_data_command MachLE32_linkedit_data_command;
typedef MachClass_LE32::Mach_uuid_command MachLE32_uuid_command; typedef MachClass_LE32::Mach_uuid_command MachLE32_uuid_command;
typedef MachClass_LE32::Mach_main_command MachLE32_main_command; typedef MachClass_LE32::Mach_main_command MachLE32_main_command;
typedef MachClass_LE32::Mach_data_in_code_command MachLE32_data_in_code_command;
typedef MachClass_LE32::Mach_function_starts_command MachLE32_function_starts_command;
typedef MachClass_LE32::Mach_load_dylib_command MachLE32_load_dylib_command; typedef MachClass_LE32::Mach_load_dylib_command MachLE32_load_dylib_command;
typedef MachClass_LE32::Mach_dylib MachLE32_dylib; typedef MachClass_LE32::Mach_dylib MachLE32_dylib;
typedef MachClass_LE32::Mach_load_dylinker_command MachLE32_load_dylinker_command; typedef MachClass_LE32::Mach_load_dylinker_command MachLE32_load_dylinker_command;
@@ -737,8 +707,6 @@ typedef MachClass_LE64::Mach_twolevel_hints_command MachLE64_twolevel_hints_co
typedef MachClass_LE64::Mach_linkedit_data_command MachLE64_linkedit_data_command; typedef MachClass_LE64::Mach_linkedit_data_command MachLE64_linkedit_data_command;
typedef MachClass_LE64::Mach_uuid_command MachLE64_uuid_command; typedef MachClass_LE64::Mach_uuid_command MachLE64_uuid_command;
typedef MachClass_LE64::Mach_main_command MachLE64_main_command; typedef MachClass_LE64::Mach_main_command MachLE64_main_command;
typedef MachClass_LE64::Mach_data_in_code_command MachLE64_data_in_code_command;
typedef MachClass_LE64::Mach_function_starts_command MachLE64_function_starts_command;
typedef MachClass_LE64::Mach_load_dylib_command MachLE64_load_dylib_command; typedef MachClass_LE64::Mach_load_dylib_command MachLE64_load_dylib_command;
typedef MachClass_LE64::Mach_dylib MachLE64_dylib; typedef MachClass_LE64::Mach_dylib MachLE64_dylib;
typedef MachClass_LE64::Mach_load_dylinker_command MachLE64_load_dylinker_command; typedef MachClass_LE64::Mach_load_dylinker_command MachLE64_load_dylinker_command;
@@ -781,8 +749,6 @@ protected:
typedef typename MachClass::Mach_linkedit_data_command Mach_linkedit_data_command; typedef typename MachClass::Mach_linkedit_data_command Mach_linkedit_data_command;
typedef typename MachClass::Mach_uuid_command Mach_uuid_command; typedef typename MachClass::Mach_uuid_command Mach_uuid_command;
typedef typename MachClass::Mach_main_command Mach_main_command; typedef typename MachClass::Mach_main_command Mach_main_command;
typedef typename MachClass::Mach_data_in_code_command Mach_data_in_code_command;
typedef typename MachClass::Mach_function_starts_command Mach_function_starts_command;
typedef typename MachClass::Mach_load_dylib_command Mach_load_dylib_command; typedef typename MachClass::Mach_load_dylib_command Mach_load_dylib_command;
typedef typename MachClass::Mach_dylib Mach_dylib; typedef typename MachClass::Mach_dylib Mach_dylib;
typedef typename MachClass::Mach_load_dylinker_command Mach_load_dylinker_command; typedef typename MachClass::Mach_load_dylinker_command Mach_load_dylinker_command;
@@ -800,7 +766,7 @@ public:
// called by the generic pack() // called by the generic pack()
virtual void pack1(OutputFile *, Filter &); // generate executable header virtual void pack1(OutputFile *, Filter &); // generate executable header
virtual int pack2(OutputFile *, Filter &); // append compressed data virtual int pack2(OutputFile *, Filter &); // append compressed data
virtual void pack3(OutputFile *, Filter &) /*= 0*/; // append loader virtual off_t pack3(OutputFile *, Filter &) /*= 0*/; // append loader
virtual void pack4(OutputFile *, Filter &) /*= 0*/; // append PackHeader virtual void pack4(OutputFile *, Filter &) /*= 0*/; // append PackHeader
virtual void pack4dylib(OutputFile *, Filter &, Addr init_address); virtual void pack4dylib(OutputFile *, Filter &, Addr init_address);
@@ -814,6 +780,7 @@ public:
virtual bool canPack(); virtual bool canPack();
virtual int canUnpack(); virtual int canUnpack();
virtual upx_uint64_t get_mod_init_func(Mach_segment_command const *segptr);
virtual unsigned find_SEGMENT_gap(unsigned const k, unsigned pos_eof); virtual unsigned find_SEGMENT_gap(unsigned const k, unsigned pos_eof);
protected: protected:
@@ -853,8 +820,10 @@ protected:
upx_byte const *stub_main; upx_byte const *stub_main;
Mach_segment_command *rawmseg; // as input, with sections Mach_segment_command *rawmseg; // as input, with sections
Mach_segment_command *msegcmd; // LC_SEGMENT first, without sections Mach_segment_command *msegcmd; // LC_SEGMENT first, without sections
unsigned o_routines_cmd; // file offset to LC_ROUINTES unsigned o__mod_init_func; // file offset to __DATA.__mod_init_func Mach_section_command
upx_uint64_t prev_init_address; upx_uint64_t prev_mod_init_func;
upx_uint64_t pagezero_vmsize;
upx_uint64_t vma_max; // max over (.vmsize + .vmaddr)
Mach_header mhdri; Mach_header mhdri;
Mach_header mhdro; Mach_header mhdro;
@@ -1022,7 +991,7 @@ public:
virtual const char *getName() const { return "dylib/ppc32"; } virtual const char *getName() const { return "dylib/ppc32"; }
virtual const char *getFullName(const options_t *) const { return "powerpc-darwin.dylib"; } virtual const char *getFullName(const options_t *) const { return "powerpc-darwin.dylib"; }
protected: protected:
virtual void pack3(OutputFile *, Filter &); // append loader virtual off_t pack3(OutputFile *, Filter &); // append loader
virtual void pack4(OutputFile *, Filter &); // append PackHeader virtual void pack4(OutputFile *, Filter &); // append PackHeader
}; };
@@ -1037,7 +1006,7 @@ public:
virtual const char *getName() const { return "dylib/ppc64le"; } virtual const char *getName() const { return "dylib/ppc64le"; }
virtual const char *getFullName(const options_t *) const { return "powerpc64le-darwin.dylib"; } virtual const char *getFullName(const options_t *) const { return "powerpc64le-darwin.dylib"; }
protected: protected:
virtual void pack3(OutputFile *, Filter &); // append loader virtual off_t pack3(OutputFile *, Filter &); // append loader
virtual void pack4(OutputFile *, Filter &); // append PackHeader virtual void pack4(OutputFile *, Filter &); // append PackHeader
}; };
@@ -1104,7 +1073,7 @@ public:
virtual const char *getName() const { return "dylib/i386"; } virtual const char *getName() const { return "dylib/i386"; }
virtual const char *getFullName(const options_t *) const { return "i386-darwin.dylib"; } virtual const char *getFullName(const options_t *) const { return "i386-darwin.dylib"; }
protected: protected:
virtual void pack3(OutputFile *, Filter &); // append loader virtual off_t pack3(OutputFile *, Filter &); // append loader
virtual void pack4(OutputFile *, Filter &); // append PackHeader virtual void pack4(OutputFile *, Filter &); // append PackHeader
}; };
@@ -1172,7 +1141,7 @@ public:
virtual const char *getName() const { return "dylib/amd64"; } virtual const char *getName() const { return "dylib/amd64"; }
virtual const char *getFullName(const options_t *) const { return "amd64-darwin.dylib"; } virtual const char *getFullName(const options_t *) const { return "amd64-darwin.dylib"; }
protected: protected:
virtual void pack3(OutputFile *, Filter &); // append loader virtual off_t pack3(OutputFile *, Filter &); // append loader
virtual void pack4(OutputFile *, Filter &); // append PackHeader virtual void pack4(OutputFile *, Filter &); // append PackHeader
}; };
@@ -1240,7 +1209,6 @@ public:
virtual const char *getName() const { return "macho/arm64"; } virtual const char *getName() const { return "macho/arm64"; }
virtual const char *getFullName(const options_t *) const { return "arm64-darwin.macho"; } virtual const char *getFullName(const options_t *) const { return "arm64-darwin.macho"; }
protected: protected:
virtual const int *getCompressionMethods(int method, int level) const;
virtual const int *getFilters() const; virtual const int *getFilters() const;
virtual void pack1_setup_threado(OutputFile *const fo); virtual void pack1_setup_threado(OutputFile *const fo);
+15 -4
View File
@@ -2,7 +2,7 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 2007-2017 John F. Reiser Copyright (C) 2007-2020 John F. Reiser
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -45,7 +45,8 @@
enum { // cputype enum { // cputype
CPU_TYPE_I386 = 7, CPU_TYPE_I386 = 7,
CPU_TYPE_X86_64 = 0x01000007, CPU_TYPE_X86_64 = 0x01000007,
CPU_TYPE_ARM = 12, CPU_TYPE_ARM = 0x0000000c,
CPU_TYPE_ARM64 = 0x0100000c,
CPU_TYPE_POWERPC = 0x00000012, CPU_TYPE_POWERPC = 0x00000012,
CPU_TYPE_POWERPC64 = 0x01000012, CPU_TYPE_POWERPC64 = 0x01000012,
CPU_TYPE_POWERPC64LE = 0x01000021 CPU_TYPE_POWERPC64LE = 0x01000021
@@ -57,7 +58,9 @@
}; };
enum { // filetype enum { // filetype
MH_EXECUTE = 2, MH_EXECUTE = 2,
MH_DYLIB = 6, MH_PRELOAD = 5, /* preloaded executable */
MH_DYLIB = 6, /* dynamically bound shared library */
MH_DYLINKER= 7, /* /usr/bin/dyld */
MH_BUNDLE = 8 /* dynamically bound bundle file */ MH_BUNDLE = 8 /* dynamically bound bundle file */
}; };
enum { // flags enum { // flags
@@ -83,23 +86,31 @@
LC_LOAD_DYLINKER = 0xe, LC_LOAD_DYLINKER = 0xe,
LC_ROUTINES = 0x11, LC_ROUTINES = 0x11,
LC_TWOLEVEL_HINTS= 0x16, LC_TWOLEVEL_HINTS= 0x16,
LC_LOAD_WEAK_DYLIB= (0x18 | LC_REQ_DYLD),
LC_SEGMENT_64 = 0x19, LC_SEGMENT_64 = 0x19,
LC_ROUTINES_64 = 0x1a, LC_ROUTINES_64 = 0x1a,
LC_UUID = 0x1b, LC_UUID = 0x1b,
LC_RPATH = 0x1c, LC_RPATH = 0x1c,
LC_CODE_SIGNATURE = 0x1d, LC_CODE_SIGNATURE = 0x1d,
LC_SEGMENT_SPLIT_INFO = 0x1e, LC_SEGMENT_SPLIT_INFO = 0x1e,
LC_REEXPORT_DYLIB = 0x1f, LC_REEXPORT_DYLIB = (0x1f | LC_REQ_DYLD),
LC_LAZY_LOAD_DYLIB= 0x20, LC_LAZY_LOAD_DYLIB= 0x20,
LC_ENCRYPTION_INFO= 0x21, LC_ENCRYPTION_INFO= 0x21,
LC_DYLD_INFO = 0x22, // compressed dyld information (10.6.x) LC_DYLD_INFO = 0x22, // compressed dyld information (10.6.x)
LC_DYLD_INFO_ONLY = (0x22|LC_REQ_DYLD), LC_DYLD_INFO_ONLY = (0x22|LC_REQ_DYLD),
LC_VERSION_MIN_MACOSX= 0x24, LC_VERSION_MIN_MACOSX= 0x24,
LC_VERSION_MIN_IPHONEOS= 0x25,
LC_FUNCTION_STARTS= 0x26, LC_FUNCTION_STARTS= 0x26,
LC_DYLD_ENVIRONMENT= 0x27, // string as environment variable
LC_MAIN = (0x28|LC_REQ_DYLD), LC_MAIN = (0x28|LC_REQ_DYLD),
LC_DATA_IN_CODE = 0x29, LC_DATA_IN_CODE = 0x29,
LC_SOURCE_VERSION = 0x2a, LC_SOURCE_VERSION = 0x2a,
LC_DYLIB_CODE_SIGN_DRS= 0x2B,
LC_ENCRYPTION_INFO_64= 0x2C,
LC_VERSION_MIN_TVOS= 0x2F,
LC_VERSION_MIN_WATCHOS= 0x30,
}; };
enum { // maxprot enum { // maxprot
VM_PROT_READ = 1, VM_PROT_READ = 1,
VM_PROT_WRITE = 2, VM_PROT_WRITE = 2,
+6 -6
View File
@@ -2,9 +2,9 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
Copyright (C) 2002-2017 Jens Medoch Copyright (C) 2002-2020 Jens Medoch
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -160,7 +160,7 @@ void PackPs1::putBkupHeader(const unsigned char *src, unsigned char *dst, unsign
if (src && dst) if (src && dst)
{ {
unsigned char *cpr_bh = new unsigned char[sz_cbh]; unsigned char *cpr_bh = New(unsigned char, sz_cbh);
memset(cpr_bh, 0, sizeof(bh)); memset(cpr_bh, 0, sizeof(bh));
ps1_exe_chb_t * p = (ps1_exe_chb_t * )cpr_bh; ps1_exe_chb_t * p = (ps1_exe_chb_t * )cpr_bh;
@@ -189,7 +189,7 @@ bool PackPs1::getBkupHeader(unsigned char *p, unsigned char *dst)
if (src && (src->id == '1' && src->len < SZ_IH_BKUP) && dst) if (src && (src->id == '1' && src->len < SZ_IH_BKUP) && dst)
{ {
unsigned char *unc_bh = new unsigned char[MemBuffer::getSizeForUncompression(SZ_IH_BKUP)]; unsigned char *unc_bh = New(unsigned char, MemBuffer::getSizeForUncompression(SZ_IH_BKUP));
unsigned sz_bh = SZ_IH_BKUP; unsigned sz_bh = SZ_IH_BKUP;
int r = upx_decompress((const unsigned char *)&src->ih_bkup, src->len, int r = upx_decompress((const unsigned char *)&src->ih_bkup, src->len,
@@ -338,7 +338,7 @@ void PackPs1::buildLoader(const Filter *)
if (M_IS_LZMA(ph.method) && buildPart2) if (M_IS_LZMA(ph.method) && buildPart2)
{ {
sz_lcpr = MemBuffer::getSizeForCompression(sz_lunc); sz_lcpr = MemBuffer::getSizeForCompression(sz_lunc);
unsigned char *cprLoader = new unsigned char[sz_lcpr]; unsigned char *cprLoader = New(unsigned char, sz_lcpr);
int r = upx_compress(getLoader(), sz_lunc, cprLoader, &sz_lcpr, int r = upx_compress(getLoader(), sz_lunc, cprLoader, &sz_lcpr,
NULL, M_NRV2B_8, 10, NULL, NULL ); NULL, M_NRV2B_8, 10, NULL, NULL );
if (r != UPX_E_OK || sz_lcpr >= sz_lunc) if (r != UPX_E_OK || sz_lcpr >= sz_lunc)
+3 -3
View File
@@ -2,9 +2,9 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
Copyright (C) 2002-2017 Jens Medoch Copyright (C) 2002-2020 Jens Medoch
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
+28 -8
View File
@@ -2,8 +2,9 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
Copyright (C) 2000-2020 John F. Reiser
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -23,6 +24,9 @@
Markus F.X.J. Oberhumer Laszlo Molnar Markus F.X.J. Oberhumer Laszlo Molnar
<markus@oberhumer.com> <ezerotven+github@gmail.com> <markus@oberhumer.com> <ezerotven+github@gmail.com>
John F. Reiser
<jreiser@users.sourceforge.net>
*/ */
@@ -59,7 +63,7 @@ bool PackUnix::canPack()
if (exetype == 0) if (exetype == 0)
return false; return false;
#if defined(__unix__) #if defined(__unix__) && !defined(__MSYS2__)
// must be executable by owner // must be executable by owner
if ((fi->st.st_mode & S_IXUSR) == 0) if ((fi->st.st_mode & S_IXUSR) == 0)
throwCantPack("file not executable; try 'chmod +x'"); throwCantPack("file not executable; try 'chmod +x'");
@@ -242,13 +246,20 @@ PackUnix::patchLoaderChecksum()
set_te32(&lp->l_checksum, upx_adler32(ptr, lsize)); set_te32(&lp->l_checksum, upx_adler32(ptr, lsize));
} }
void PackUnix::pack3(OutputFile *fo, Filter &/*ft*/) off_t PackUnix::pack3(OutputFile *fo, Filter &ft)
{ {
if (0==linker) {
// If no filter, then linker is not constructed by side effect
// of packExtent calling compressWithFilters.
// This is typical after "/usr/bin/patchelf --set-rpath".
buildLoader(&ft);
}
upx_byte *p = getLoader(); upx_byte *p = getLoader();
lsize = getLoaderSize(); lsize = getLoaderSize();
updateLoader(fo); updateLoader(fo);
patchLoaderChecksum(); patchLoaderChecksum();
fo->write(p, lsize); fo->write(p, lsize);
return fo->getBytesWritten();
} }
void PackUnix::pack4(OutputFile *fo, Filter &) void PackUnix::pack4(OutputFile *fo, Filter &)
@@ -438,7 +449,7 @@ void PackUnix::packExtent(
void PackUnix::unpackExtent(unsigned wanted, OutputFile *fo, void PackUnix::unpackExtent(unsigned wanted, OutputFile *fo,
unsigned &total_in, unsigned &total_out, unsigned &total_in, unsigned &total_out,
unsigned &c_adler, unsigned &u_adler, unsigned &c_adler, unsigned &u_adler,
bool first_PF_X, unsigned szb_info bool first_PF_X, unsigned szb_info, bool is_rewrite
) )
{ {
b_info hdr; memset(&hdr, 0, sizeof(hdr)); b_info hdr; memset(&hdr, 0, sizeof(hdr));
@@ -491,8 +502,14 @@ void PackUnix::unpackExtent(unsigned wanted, OutputFile *fo,
total_in += sz_cpr; total_in += sz_cpr;
total_out += sz_unc; total_out += sz_unc;
// write block // write block
if (fo) if (fo) {
if (is_rewrite) {
fo->rewrite(ibuf + j, sz_unc);
}
else {
fo->write(ibuf + j, sz_unc); fo->write(ibuf + j, sz_unc);
}
}
if (wanted < (unsigned)sz_unc) if (wanted < (unsigned)sz_unc)
throwCantUnpack("corrupt b_info"); throwCantUnpack("corrupt b_info");
wanted -= sz_unc; wanted -= sz_unc;
@@ -541,7 +558,10 @@ int PackUnix::canUnpack()
void PackUnix::unpack(OutputFile *fo) void PackUnix::unpack(OutputFile *fo)
{ {
unsigned const szb_info = sizeof(b_info); b_info bhdr;
unsigned const szb_info = (ph.version <= 11)
? sizeof(bhdr.sz_unc) + sizeof(bhdr.sz_cpr) // old style
: sizeof(bhdr);
unsigned c_adler = upx_adler32(NULL, 0); unsigned c_adler = upx_adler32(NULL, 0);
unsigned u_adler = upx_adler32(NULL, 0); unsigned u_adler = upx_adler32(NULL, 0);
@@ -574,7 +594,7 @@ void PackUnix::unpack(OutputFile *fo)
// decompress blocks // decompress blocks
unsigned total_in = 0; unsigned total_in = 0;
unsigned total_out = 0; unsigned total_out = 0;
b_info bhdr; memset(&bhdr, 0, sizeof(bhdr)); memset(&bhdr, 0, sizeof(bhdr));
for (;;) for (;;)
{ {
#define buf ibuf #define buf ibuf
+4 -4
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2020 Laszlo Molnar
All Rights Reserved. All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them UPX and the UCL library are free software; you can redistribute them
@@ -55,7 +55,7 @@ protected:
// called by the generic pack() // called by the generic pack()
virtual void pack1(OutputFile *, Filter &); // generate executable header virtual void pack1(OutputFile *, Filter &); // generate executable header
virtual int pack2(OutputFile *, Filter &); // append compressed data virtual int pack2(OutputFile *, Filter &); // append compressed data
virtual void pack3(OutputFile *, Filter &); // append loader virtual off_t pack3(OutputFile *, Filter &); // append loader
virtual void pack4(OutputFile *, Filter &); // append PackHeader virtual void pack4(OutputFile *, Filter &); // append PackHeader
virtual void patchLoader() = 0; virtual void patchLoader() = 0;
@@ -77,7 +77,7 @@ protected:
virtual void unpackExtent(unsigned wanted, OutputFile *fo, virtual void unpackExtent(unsigned wanted, OutputFile *fo,
unsigned &total_in, unsigned &total_out, unsigned &total_in, unsigned &total_out,
unsigned &c_adler, unsigned &u_adler, unsigned &c_adler, unsigned &u_adler,
bool first_PF_X, unsigned szb_info ); bool first_PF_X, unsigned szb_info, bool is_rewrite = false);
int exetype; int exetype;
unsigned blocksize; unsigned blocksize;

Some files were not shown because too many files have changed in this diff Show More