Compare commits

...

260 Commits

Author SHA1 Message Date
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
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 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 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
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 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 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
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 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 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
480 changed files with 37737 additions and 32768 deletions
+6 -14
View File
@@ -14,10 +14,8 @@ 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: msvc-15.0-x86, CL_VERSION: 19.10, VS_VERSION: 2017, APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 } - { C: msvc-14.1-x86, CL_VERSION: 19.12, VS_VERSION: 2017, APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 }
- { C: msvc-15.0-x64, CL_VERSION: 19.10, VS_VERSION: 2017, APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 } - { C: msvc-14.1-x64, CL_VERSION: 19.12, VS_VERSION: 2017, APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 }
# - { C: gcc-4.9-m32, T: SKIP }
# - { C: gcc-4.9-m64, T: SKIP }
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:
@@ -25,7 +23,7 @@ environment:
init: init:
- git config --global core.autocrlf input - git config --global core.autocrlf input
- 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 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"
@@ -58,17 +56,11 @@ 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-15.0-x86" ( call "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86 ) - 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-15.0-x64" ( call "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64 ) - if "%C%"=="msvc-14.1-x64" ( call "c:\Program Files (x86)\Microsoft Visual Studio\2017\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%
@@ -89,7 +81,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 -WX -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
+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
+1
View File
@@ -57,6 +57,7 @@ if [[ $BM_X =~ (^|\+)rebuild-stubs($|\+) ]]; then
extra_subdirs+=( src/stub/src/arch/m68k/m68020 ) extra_subdirs+=( src/stub/src/arch/m68k/m68020 )
extra_subdirs+=( src/stub/src/arch/mips/r3000 ) extra_subdirs+=( src/stub/src/arch/mips/r3000 )
extra_subdirs+=( src/stub/src/arch/powerpc/32 ) extra_subdirs+=( src/stub/src/arch/powerpc/32 )
extra_subdirs+=( src/stub/src/arch/powerpc/64 )
extra_subdirs+=( src/stub/src/arch/powerpc/64le ) 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 for d in ${extra_subdirs[@]}; do
+3 -1
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
@@ -99,6 +99,7 @@ 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
@@ -115,6 +116,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
# /*********************************************************************** # /***********************************************************************
+6 -3
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 "$@"
} }
@@ -132,15 +135,15 @@ fi # BM_CROSS
if [[ "$CC" == "false" ]]; then # generic if [[ "$CC" == "false" ]]; then # generic
if [[ -z $BM_CROSS ]]; then if [[ -z $BM_CROSS ]]; 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-3.4-m?? | clang-[6789][0-9][0-9]-m??)
CC="clang"; CXX="clang++" ;; # standard system compiler CC="clang"; CXX="clang++" ;; # standard system compiler
clang-[3].[0-9]-m??) clang-[345].[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" ;;
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-[567]-m?? | gcc-[567]-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
+63 -63
View File
@@ -149,81 +149,81 @@ c3f44b4d00a87384c03a6f9e7aec809c1addfe3e271244d38a474f296603088c *mipsel-linux.e
b8c35fa2956da17ca505956e9f5017bb5f3a746322647e24ccb8ff28059cafa4 *powerpc-linux.elf/upx-3.91 b8c35fa2956da17ca505956e9f5017bb5f3a746322647e24ccb8ff28059cafa4 *powerpc-linux.elf/upx-3.91
" "
expected_sha256sums__t110_compress_ucl_nrv2b_3_no_filter="\ expected_sha256sums__t110_compress_ucl_nrv2b_3_no_filter="\
c82d400d99a78f21b594ad9900208ee89b3df5b67723c06dbb374dc3f42ca934 *amd64-linux.elf/upx-3.91 7301bb93535f91bb789b44da75c2f365cc2d0fa99a4d597f49de8716d96dbcf6 *amd64-linux.elf/upx-3.91
5b9ec916beae0eadc665235158a9ae5bce1309823a344503268a88e32e77824a *arm-wince.pe/upx-3.91.exe 17a9aef8087ca2b3f5fc4e3a41d7c4d721bf3ad222030ac2068ed00eb85a9deb *arm-wince.pe/upx-3.91.exe
a099aedddbaa960247209e08ed922b43f4bbd6559ad646a6ff801384e2f661eb *armeb-linux.elf/upx-3.91 3ddbde0d00ff6ea9ce163d889e6f418146b35238d05005b98b76adb555bcf644 *armeb-linux.elf/upx-3.91
960dc15876221832510142816605b9ef568c0de3050ca0a79f3553643c5d5e0f *i386-dos32.djgpp2.coff/upx-3.91.exe f680566e3daae0526c5f6965c23219d7946c4d4117eeaa277bd9e68e907418c6 *i386-dos32.djgpp2.coff/upx-3.91.exe
43ec77282bbe73eb5d6f5471e9593127928bcfc2ebaedd93dd86969b12c9c61d *i386-linux.elf/upx-3.91 14394ce9806dc7a3622addfb625d1731e021600e0489dc7c8ea7f30c54d1fd37 *i386-linux.elf/upx-3.91
ca6925a15c1ab8931f0a8fe9ef87f5893403d6e46098f4cd1a5f6f6f0fbdeb44 *i386-win32.pe/upx-3.91.exe d3cfb5347758ee54e54cfc92ae502a3e19702cd4fec115d74f84f8a5ab7a9bc2 *i386-win32.pe/upx-3.91.exe
14ff2a4e215a25ed7442b004bca3d82094f7c01784fc4876eb50d365441f35c3 *m68k-atari.tos/upx-3.91.ttp d0e68eed8f001f3074351acbc7133bd41f67f8e3b7e5f82d5df1911481123378 *m68k-atari.tos/upx-3.91.ttp
4163afbb2475b669e131265c0f7ea179c35f19ccce66732feee08fe20c33775e *mipsel-linux.elf/upx-3.91 58db1b12b5462dbb05c08d7952cacd7c7090a6b3cbfbf9b431e6390f246cbb95 *mipsel-linux.elf/upx-3.91
00c9d16157a734e1b386e5fe01dbae76c7f8ab7d6035dfa6975d656b43ef4e67 *powerpc-linux.elf/upx-3.91 4fd2e2fc33563e95453f9b4a52c153f248937a548cbfe746bb0d71f19ae5ad03 *powerpc-linux.elf/upx-3.91
" "
expected_sha256sums__t120_compress_ucl_nrv2d_3_no_filter="\ expected_sha256sums__t120_compress_ucl_nrv2d_3_no_filter="\
27b530885ccb425cf14963feea677c4177cce5324821c277823b3262a7a6ced4 *amd64-linux.elf/upx-3.91 e537c1a28bea559cbe43cd23723443e2617316a40a6632927f6d94589f800efe *amd64-linux.elf/upx-3.91
22216286b1bf3066d9022b921f37beff6712b5f3fc8c092f2dc1477638d9f8cc *arm-wince.pe/upx-3.91.exe 33a13fa63379b9eae6878cd2bfb0b41963795a27bc5a026de0b50b4a43131b12 *arm-wince.pe/upx-3.91.exe
90e2960d01214b3e2f62f76effa2360fed655e72392acfa8096d1d9a729ade21 *armeb-linux.elf/upx-3.91 3c6f9ab67e21c72073f66c558765d8f07f192ba63d3ffb2ce40ebc9178ccd5ef *armeb-linux.elf/upx-3.91
b6e98d36bd916fa63ec799e47dd7cac3674154370a9680492d84f1853bf14c3e *i386-dos32.djgpp2.coff/upx-3.91.exe 28bc9ee28b73b11a32fb2e4d3ad99ff06d61cf5b9f104052db89f6f6f0557ca9 *i386-dos32.djgpp2.coff/upx-3.91.exe
483e4a7eba0b88302658fcaacb7ee1de32fb514dac5dccb010a55a5202918c0c *i386-linux.elf/upx-3.91 8201f15f7ef5e54cddb18474a5ed2d48e2fc7726d6014c457ad3cd82c01e1072 *i386-linux.elf/upx-3.91
d2692b3e4a278559456e299164714c4bb8ebbcf230ab12521619e2e94580597d *i386-win32.pe/upx-3.91.exe 5bebadb8455b052580b1f22a949c3eb5a441c8b6ba9c6b50506cb703fc3f65ce *i386-win32.pe/upx-3.91.exe
cd1ae0f2781787bf7c61f3600cc889313e6027615d78e562d624d717671e55c3 *m68k-atari.tos/upx-3.91.ttp e4d3a430f93b41a3aa67492e6c06d74a1fcd4e06b272de2c681252d91b7a953a *m68k-atari.tos/upx-3.91.ttp
26b30c10ba8980fa6fc564b79eb2931e07bb7b2f89f07a0656c28be71185a3ea *mipsel-linux.elf/upx-3.91 1bd8be4eb09dc39b4b0d447ef4eebac29c51d56380be79b46461962dea81b8fb *mipsel-linux.elf/upx-3.91
bbce9449d105e4ac7e9a04d56b286cbba3b34c1bf8ee928e9e97a4943ae3c5ac *powerpc-linux.elf/upx-3.91 c1928cd500450f1f09f2c0265980c329cd0e083095abb3a48f1999a7dd551309 *powerpc-linux.elf/upx-3.91
" "
expected_sha256sums__t130_compress_ucl_nrv2e_3_no_filter="\ expected_sha256sums__t130_compress_ucl_nrv2e_3_no_filter="\
81a528ed6f678bdbb1c18a9ee69b7d04169466e756a71baa98c7651ad1c40bec *amd64-linux.elf/upx-3.91 3fadda0299775195558de2ac25a673ab65467bd147ab8aaf57b7af1542f1d5de *amd64-linux.elf/upx-3.91
08c55815175ce0d34fca3b368336dd346a2354dbe4f046210c82f6961350a50f *arm-wince.pe/upx-3.91.exe 99f7d8d7faf57c78053158c6a6915dab8c5cfdcc73112cee9607bcec55837ae8 *arm-wince.pe/upx-3.91.exe
6dae3b18770e6af45e074b092c1f2f3632bef1996ce71af0f6e252caf34555a1 *armeb-linux.elf/upx-3.91 8f06e11a0c60fd83db607089b7ad985a48a26ee09bd533e55072f9fe2ba39f2f *armeb-linux.elf/upx-3.91
45f50d69e685f7ea752f76c05554d4c2ce023c0218465a4f8919138a76ae6c71 *i386-dos32.djgpp2.coff/upx-3.91.exe 542c368392f2d584145cc51d51b9dbc5dc61754597bb1cb7673821a2a4650816 *i386-dos32.djgpp2.coff/upx-3.91.exe
f1db16f6be23b0bd96226e7e57f8b41ddfb93ede5ca0750ae680bbd615523083 *i386-linux.elf/upx-3.91 edf61800e09e0ef963b27fded0e032839f4b0cb907a84e43d19ed31bd536440f *i386-linux.elf/upx-3.91
eb7c2f74979c11b35193a0a9d428596bda46420d9363666fe1b967f5cd1610c6 *i386-win32.pe/upx-3.91.exe ef5e25c79d356e9ed0736f34dc5ee7a8f4c66d0c330b8d16672fac7d829b5a7c *i386-win32.pe/upx-3.91.exe
cefb13395220fb2e931d0fb32e27663c4a27035f9e79131bbabc44fa54e6336e *m68k-atari.tos/upx-3.91.ttp 2c85e506d670aef707789e5d8a97901ddbb42f50a205a207f575f79b901c2cd7 *m68k-atari.tos/upx-3.91.ttp
602be188fca1dd63593a2ace68ea221d720fd2ddf9df85c1ab019feda69f1cad *mipsel-linux.elf/upx-3.91 93014cd6edd07fafcae133b449837f550f92eeab86ceebd8e7ed5337ab65bdc2 *mipsel-linux.elf/upx-3.91
2f299fdbc37bf6675559c5b1245aecf56de268bc074bd558bd7d9f84f7be5eae *powerpc-linux.elf/upx-3.91 761f0d45b61e020fd8931cd5192677d06b34fec64a534d99be9fe0346eb56d2b *powerpc-linux.elf/upx-3.91
" "
expected_sha256sums__t140_compress_lzma_2_no_filter="\ expected_sha256sums__t140_compress_lzma_2_no_filter="\
12d2ec20370655396711fc794db41745c21f51c998b766e6aa96283feb00eb48 *amd64-linux.elf/upx-3.91 4abe4fff006e53ee147573d74a0f7feba9ebc62b8233e19ac331c5350391bd66 *amd64-linux.elf/upx-3.91
9759deb5aa8fb004c4b23bbe174042e45869aedeea1a1dd1b729be0e736814da *arm-wince.pe/upx-3.91.exe df8ad2d951368ddfb64b8c405f4b4727a2cf5f1c823ecd6e1d298eb21cad0afc *arm-wince.pe/upx-3.91.exe
9b25bcc69fcdbdf4b4adc54e5c6508749c918179644ff9fa34b437bc7e42eca5 *armeb-linux.elf/upx-3.91 cd109f76ff00030f564a883da5a57784d9626e85c2c54e6de1f0f2cfda709325 *armeb-linux.elf/upx-3.91
a2a800d2ba5cfc1b6bb2b48c91adccb5d3c3b6c0b5c548affccac9244197a312 *i386-dos32.djgpp2.coff/upx-3.91.exe deeae51e0a4c25e6f5afd741361eea445c198fba247b583663b010778699419a *i386-dos32.djgpp2.coff/upx-3.91.exe
1865bc9b76579e33df4038f3d0abf848993b0c865b687f4b4bd482099416ef80 *i386-linux.elf/upx-3.91 591d02bbb604aab55ed653411ea5888d3e93c5e078f3fc79f73d54b12bc83b22 *i386-linux.elf/upx-3.91
80aba41aad8268085e853ec872f885981838a625c14095d21ba70cb7abe045a5 *i386-win32.pe/upx-3.91.exe 171bde9f27a5571b524e9d7cdba6cefa142bb8a0b114c4d5294944ee5781e0bb *i386-win32.pe/upx-3.91.exe
bbed61e42fa7b330b5cde66e4614329f41e21facff1f3667edc03495219c29f9 *m68k-atari.tos/upx-3.91.ttp 54ca62d5f15ce87708867f7b349584799779711bca015a3ebac69f5cf077b905 *m68k-atari.tos/upx-3.91.ttp
57b47244a3a0d01725cbdc9af8572cbe20e2d173857015ad4d32245b52577dc2 *mipsel-linux.elf/upx-3.91 bc9c9ce0ce7ce32e3f77fca39ffdd7809731e93f978fb201ea49b53a980c5d4e *mipsel-linux.elf/upx-3.91
6b02b01fa48910a104b523b265503131e4259ef83765464d002614e1a4eba38f *powerpc-linux.elf/upx-3.91 4357697b615fb40d041ad5a2217a4722aa9066d2100ba2c73212262f581f820f *powerpc-linux.elf/upx-3.91
" "
expected_sha256sums__t150_compress_ucl_2_all_filters="\ expected_sha256sums__t150_compress_ucl_2_all_filters="\
3e0df832830a4a0cca77da16868a2655f85b2b36f783123b6f067f5586460704 *amd64-linux.elf/upx-3.91 15dd4ad982953a1f7b7c74e7cb34e777fc7db11201280cd5af19ac547c8b9a0f *amd64-linux.elf/upx-3.91
c7b0f611e9941be58b700219e7a5d34cdbdbf972b6184b13dec5e98fe84de808 *arm-wince.pe/upx-3.91.exe a8cd8c9abb50ab45f30bd2f01bcb4d2e934806440ef206d7da44097aced7085b *arm-wince.pe/upx-3.91.exe
ef7c6febc18d5ecf7d846f38d75f398a92b5b21eb5d35b1eac4935d0e6de92ac *armeb-linux.elf/upx-3.91 c7af209eb44204a6e4ccbed18e1b3f6eaac5df01c1106426d375d1cd65cd01fd *armeb-linux.elf/upx-3.91
425c9128285f49b41f9b736f48794f5bebba6981250f669e5a342016b89f2170 *i386-dos32.djgpp2.coff/upx-3.91.exe ea265e1f78c23beb632187bfebcb4ae15ce688f10e87db69952ab54724666042 *i386-dos32.djgpp2.coff/upx-3.91.exe
d6cb6d50dfda98ff8efbab2d2c8751adfb67df58652313c630d45db1b89e921e *i386-linux.elf/upx-3.91 530a267e8fdae0f4b746df62d3f2d406c6bcb08a58058448b867e372dd4a6cc6 *i386-linux.elf/upx-3.91
5565f8196d971feec261dc663ca7ec329fd82b1b18ad49593b865edbaa15765d *i386-win32.pe/upx-3.91.exe 7c3d7398f63eb9e235992d2d8fd6de9e355f6f21621c45032a6ae6c9009067e6 *i386-win32.pe/upx-3.91.exe
78f24d77855034d467568f05c22cb5e3abd167c90a4d89f4e2059c3e6faa3e2b *m68k-atari.tos/upx-3.91.ttp bf11d38e3a2cd2c585fdb2173368287e3d82edd5727ea3508c21752b2e7c5a53 *m68k-atari.tos/upx-3.91.ttp
23d6856df8f31b9176e0f4709135ce81656ed94539bf909e873b787ce89821cd *mipsel-linux.elf/upx-3.91 271adf2c52ed777c00a17a19283478e226d76181b1dfb72d6c3aead3923fbad4 *mipsel-linux.elf/upx-3.91
8dbf63b21d3ced1cceec71e507d3086de2612b8ce8ba35ee2d75acd06435baf1 *powerpc-linux.elf/upx-3.91 a0152edb1476dc0f713bcd55a7462de200e92e7d057ff4a9af92c7af6abbc3bc *powerpc-linux.elf/upx-3.91
" "
expected_sha256sums__t160_compress_all_methods_1_no_filter="\ expected_sha256sums__t160_compress_all_methods_1_no_filter="\
27a248133cd386332daa14ec25367b4f1ff5595df213a2d72c341bbb7f264033 *amd64-linux.elf/upx-3.91 16d2a30dd00dfd38d3aba417a087a7341314fa8f5769f8c87565728f2f2bf06a *amd64-linux.elf/upx-3.91
6b2333719a4fe6c8d2067f682d57cf6fc5fd928bffad4e61aaffcc31287772a7 *arm-wince.pe/upx-3.91.exe 560335ec9f89f2cb8b2a2cff51b4d3dee215c68ecfc0a182fab4a838fafee166 *arm-wince.pe/upx-3.91.exe
d094f3a0e80e579aa6afeac239aacb3d8210580acdb095c9fc5511d77da7aeaa *armeb-linux.elf/upx-3.91 b3b0a0c277e947cfc19048e142e71c902cfe6d77931b2a1caeba63b9449aa8c7 *armeb-linux.elf/upx-3.91
d09af3652aa601650f9cd0f125d54e50dfe57b45b9871567140e62a04d032407 *i386-dos32.djgpp2.coff/upx-3.91.exe d5f89d57c0d74923e557410e1b5ec135e3853985965bfe9fd38283851896b4c9 *i386-dos32.djgpp2.coff/upx-3.91.exe
110bb3344a27b2677085e130956371df43ca6c231c01070480bb3a9e519fed30 *i386-linux.elf/upx-3.91 e6586de002ae8ccda77d9088e37412c1069626e807d81722c1cd810a8a7367e6 *i386-linux.elf/upx-3.91
c3c8b428f7e57a528db89f1365b4f3fda60f0dc03eadb30775ecdbadaa19f0aa *i386-win32.pe/upx-3.91.exe 4c73a38e81fe12f36dc37e514f8580c12bdf5d8cb92e9a07b7070db291a2f7eb *i386-win32.pe/upx-3.91.exe
53c77efbccf41072c4c206343ba3c838be04c47eab415d18c08f086d481612db *m68k-atari.tos/upx-3.91.ttp 53d9857238472bf4e2822134e8d63c11d6ed32f83615bb7491ba4441ff55c6c2 *m68k-atari.tos/upx-3.91.ttp
616cefa819c0e516c554faac20e6aaf9350a2aacf0041a2641d5809c0da220df *mipsel-linux.elf/upx-3.91 6b11b762f1dbf07e3135a2ccfbf558d44f4743e23e73ce7c143396b26ae49c4d *mipsel-linux.elf/upx-3.91
04ad8f4a60de80bbba7953489d3ef4b74b89a3961ae764acee00bd6df814ed9a *powerpc-linux.elf/upx-3.91 96bcf3f5f0f5168d5cdfc01dee5d35e77e0eb8401ae6623ab559254cc99ffbdc *powerpc-linux.elf/upx-3.91
" "
expected_sha256sums__t170_compress_all_methods_no_lzma_5_no_filter="\ expected_sha256sums__t170_compress_all_methods_no_lzma_5_no_filter="\
c8f0808d9cd81ece5f04c33388e6c5a056e2ceeb03308a1aa390ea6afc22d6ba *amd64-linux.elf/upx-3.91 3ded78e90066b688f820a35fe10270c2d3c00bc4c09d02f811b14a959003cd6b *amd64-linux.elf/upx-3.91
685b7e419b8b0fe3cabdf338a5cad17da55edc608c1bb91c13580b5988d38908 *arm-wince.pe/upx-3.91.exe 6f70c268d4686a50db2843efc58ef547048d8ed0d758bad0c95a50b3ce155a1f *arm-wince.pe/upx-3.91.exe
7344cf818e8a668c7364f47779742bf41b451ebb7db85abc917c463a5f9c9d9a *armeb-linux.elf/upx-3.91 20acc14939776fcd2e643cea83075d84a764fb12942ce52fa0e72dc313df026b *armeb-linux.elf/upx-3.91
fd0652470c19ebb4a2d1a49e02e71acf9fadab78e513bb4f75d1dc26a0caa7a3 *i386-dos32.djgpp2.coff/upx-3.91.exe 45ae9d42b5c6f1eec0ebc75e656c767efe796719b00922ba9e8095ffa5373450 *i386-dos32.djgpp2.coff/upx-3.91.exe
3b9dd7de613541f567b2573063399473deeaa015a1c3679fe0fb339d80724e0d *i386-linux.elf/upx-3.91 a6f13ec927d6a44fddd1af92190a530ff59282134080cd9881fef47b34e262f2 *i386-linux.elf/upx-3.91
5b334db8debd2d59470cad25c7b45e38f6195cdafe92dc8281e4edc9c51385ef *i386-win32.pe/upx-3.91.exe 14b192b5419ca0ec2b3f238dc6ed9c17596e82ff2674a299d4b0a76d118a73de *i386-win32.pe/upx-3.91.exe
db1c6a70d990cb9a8e02db9b28054267658ce371b8a50e909efdd04cd3670279 *m68k-atari.tos/upx-3.91.ttp 0c341752253e2c530f3dfefc1b4b3619f931f7e23f032a7feffeb192a6a3c373 *m68k-atari.tos/upx-3.91.ttp
19b801ace68ca0ff034dd557d3ef0a8340d8f17d7b97f120727f67ce098a7d7a *mipsel-linux.elf/upx-3.91 24887c6e98651b663cf04720bf7467501fa260a86ae8f83507669cce05d4b8bf *mipsel-linux.elf/upx-3.91
a0b3ba40848df9b3a8aac31bc20671992be179ec2d702337bd1addd15513c2e4 *powerpc-linux.elf/upx-3.91 22947eb320540740b012aa53e85b99b038d5c4bf0ebcd28ea76c1c4f9018878f *powerpc-linux.elf/upx-3.91
" "
########## end .sha256sums.recreate ########## end .sha256sums.recreate
+71 -38
View File
@@ -2,11 +2,13 @@
# Copyright (C) Markus Franz Xaver Johannes Oberhumer # Copyright (C) Markus Franz Xaver Johannes Oberhumer
sudo: false sudo: false
dist: precise
language: cpp language: cpp
notifications: { email: { on_success: never, on_failure: change } } notifications: { email: { on_success: never, on_failure: change } }
.ubuntu_toolchain_sources: &S # Ubuntu 12.04 LTS "Precise"
.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
@@ -14,6 +16,11 @@ notifications: { email: { on_success: never, on_failure: change } }
- llvm-toolchain-precise-3.8 - llvm-toolchain-precise-3.8
- llvm-toolchain-precise-3.9 - llvm-toolchain-precise-3.9
# Ubuntu 14.04 LTS "Trusty"
.ubuntu_trusty_toolchain_sources: &TS
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-5.0
env: env:
global: global:
- CROSS= C= B= T= X= - CROSS= C= B= T= X=
@@ -24,7 +31,6 @@ matrix:
fast_finish: true fast_finish: true
include: include:
- os: linux - os: linux
sudo: required
dist: trusty dist: trusty
compiler: gcc compiler: gcc
env: X=rebuild-stubs env: X=rebuild-stubs
@@ -32,19 +38,19 @@ matrix:
- os: linux - os: linux
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 - os: linux
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 - os: linux
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 - os: linux
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 - os: linux
compiler: gcc compiler: gcc
env: C=gcc-4.6-m32 env: C=gcc-4.6-m32
@@ -55,21 +61,20 @@ matrix:
- os: linux - os: linux
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 - os: linux
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 - os: linux
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: { sources: *PS, packages: [ "g++-4.8-multilib", "zlib1g-dev:i386" ] } }
- os: linux - os: linux
compiler: gcc compiler: gcc
env: C=gcc-4.8-m64 env: C=gcc-4.8-m64
addons: { apt: { sources: *S, packages: [ "g++-4.8" ] } } addons: { apt: { sources: *PS, packages: [ "g++-4.8" ] } }
- 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
@@ -77,47 +82,57 @@ matrix:
- os: linux - os: linux
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: *PS, packages: [ "g++-4.9-multilib", "zlib1g-dev:i386" ] } }
- os: linux - os: linux
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: *PS, packages: [ "g++-4.9" ] } }
- os: linux - os: linux
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: *PS, packages: [ "g++-5-multilib", "zlib1g-dev:i386" ] } }
- os: linux - os: linux
compiler: gcc compiler: gcc
env: C=gcc-5-m64 env: C=gcc-5-m64
addons: { apt: { sources: *S, packages: [ "g++-5" ] } } addons: { apt: { sources: *PS, packages: [ "g++-5" ] } }
- os: linux - os: linux
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: *PS, packages: [ "g++-6-multilib", "zlib1g-dev:i386" ] } }
- os: linux - os: linux
compiler: gcc compiler: gcc
env: C=gcc-6-m64 env: C=gcc-6-m64
addons: { apt: { sources: *S, packages: [ "g++-6" ] } } addons: { apt: { sources: *PS, packages: [ "g++-6" ] } }
- os: linux - os: linux
compiler: gcc compiler: gcc
env: C=gcc-6-m32 B=debug env: C=gcc-6-m32 B=debug
addons: { apt: { sources: *S, packages: [ "g++-6-multilib", "zlib1g-dev:i386" ] } } addons: { apt: { sources: *PS, packages: [ "g++-6-multilib", "zlib1g-dev:i386" ] } }
- os: linux - os: linux
compiler: gcc compiler: gcc
env: C=gcc-6-m64 B=debug env: C=gcc-6-m64 B=debug
addons: { apt: { sources: *S, packages: [ "g++-6" ] } } addons: { apt: { sources: *PS, packages: [ "g++-6" ] } }
- os: linux - os: linux
compiler: gcc compiler: gcc
env: C=gcc-6-m64 B=debug+sanitize env: C=gcc-6-m64 B=debug+sanitize
addons: { apt: { sources: *S, packages: [ "g++-6" ] } } addons: { apt: { sources: *PS, packages: [ "g++-6" ] } }
- os: linux - os: linux
compiler: gcc compiler: gcc
env: C=gcc-6-m64 B=sanitize env: C=gcc-6-m64 B=sanitize
addons: { apt: { sources: *S, packages: [ "g++-6" ] } } addons: { apt: { sources: *PS, packages: [ "g++-6" ] } }
- os: linux - os: linux
compiler: gcc compiler: gcc
env: C=gcc-6-m64 B=valgrind T=valgrind env: C=gcc-6-m64 B=valgrind T=valgrind
addons: { apt: { sources: *S, packages: [ "g++-6", valgrind ] } } addons: { apt: { sources: *PS, packages: [ "g++-6", valgrind ] } }
- os: linux
dist: trusty
compiler: gcc
env: C=gcc-7-m32
addons: { apt: { sources: *TS, packages: [ "g++-7-multilib", "zlib1g-dev:i386" ] } }
- os: linux
dist: trusty
compiler: gcc
env: C=gcc-7-m64
addons: { apt: { sources: *TS, packages: [ "g++-7" ] } }
- os: linux - os: linux
compiler: clang compiler: clang
env: C=clang-3.4-m32 env: C=clang-3.4-m32
@@ -128,66 +143,76 @@ matrix:
- os: linux - os: linux
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 - os: linux
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 - os: linux
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 - os: linux
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 - os: linux
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 - os: linux
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 - os: linux
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 - os: linux
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 - os: linux
compiler: clang compiler: clang
env: C=clang-3.9-m32 env: C=clang-3.9-m32
addons: { apt: { sources: *S, packages: [ "clang-3.9", "g++-6-multilib", "zlib1g-dev:i386" ] } } addons: { apt: { sources: *PS, packages: [ "clang-3.9", "g++-6-multilib", "zlib1g-dev:i386" ] } }
- os: linux - os: linux
compiler: clang compiler: clang
env: C=clang-3.9-m64 env: C=clang-3.9-m64
addons: { apt: { sources: *S, packages: [ "clang-3.9" ] } } addons: { apt: { sources: *PS, packages: [ "clang-3.9" ] } }
- os: linux - os: linux
compiler: clang compiler: clang
env: C=clang-3.9-m64 B=debug+sanitize env: C=clang-3.9-m64 B=debug+sanitize
addons: { apt: { sources: *S, packages: [ "clang-3.9" ] } } addons: { apt: { sources: *PS, packages: [ "clang-3.9" ] } }
- os: linux - os: linux
compiler: clang compiler: clang
env: C=clang-3.9-m64 B=sanitize env: C=clang-3.9-m64 B=sanitize
addons: { apt: { sources: *S, packages: [ "clang-3.9" ] } } addons: { apt: { sources: *PS, packages: [ "clang-3.9" ] } }
- os: linux - os: linux
compiler: clang compiler: clang
env: C=clang-3.9-m64 B=debug+scan-build env: C=clang-3.9-m64 B=debug+scan-build
addons: { apt: { sources: *S, packages: [ "clang-3.9" ] } } addons: { apt: { sources: *PS, packages: [ "clang-3.9" ] } }
- os: linux - os: linux
compiler: clang compiler: clang
env: C=clang-3.9-m64 B=scan-build env: C=clang-3.9-m64 B=scan-build
addons: { apt: { sources: *S, packages: [ "clang-3.9" ] } } addons: { apt: { sources: *PS, packages: [ "clang-3.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" ] } }
- os: linux
dist: trusty
compiler: clang
env: C=clang-5.0-m64
addons: { apt: { sources: *TS, packages: [ "clang-5.0" ] } }
- os: linux - os: linux
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 - os: linux
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 - os: linux
compiler: gcc compiler: gcc
@@ -223,6 +248,14 @@ matrix:
osx_image: xcode8.3 osx_image: xcode8.3
compiler: clang compiler: clang
env: C=clang-802-m64 env: C=clang-802-m64
- os: osx
osx_image: xcode9.2
compiler: clang
env: C=clang-900-m32
- os: osx
osx_image: xcode9.2
compiler: clang
env: C=clang-900-m64
install: install:
- uname -a; pwd; id; umask - uname -a; pwd; id; umask
+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-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
# #
MAKEFLAGS += -rR MAKEFLAGS += -rR
+11 -4
View File
@@ -2,6 +2,14 @@
User visible changes for UPX User visible changes for UPX
================================================================== ==================================================================
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): Changes in 3.94 (12 May 2017):
* Add support for arm64-linux (aka "aarch64"). * Add support for arm64-linux (aka "aarch64").
* Add support for --lzma compression on 64-bit PowerPC (Thierry Fauck). * Add support for --lzma compression on 64-bit PowerPC (Thierry Fauck).
@@ -10,12 +18,11 @@ Changes in 3.94 (12 May 2017):
* bug fixes - see https://github.com/upx/upx/milestone/3 * 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/1 * 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.
@@ -111,7 +118,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-2018 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-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 Laszlo Molnar
Copyright (C) 2000-2017 John F. Reiser Copyright (C) 2000-2018 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-2018 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-2018 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-2018 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-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 Laszlo Molnar
Copyright (C) 2000-2017 John F. Reiser Copyright (C) 2000-2018 John F. Reiser
Copyright (C) 2002-2017 Jens Medoch Copyright (C) 2002-2018 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.
+3 -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-2018 Markus Franz Xaver Johannes Oberhumer
# #
# build configuration options for this Makefile # build configuration options for this Makefile
@@ -163,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 packmast.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
+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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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
+13 -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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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,8 +43,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 +109,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 +199,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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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();
+21 -14
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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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
@@ -416,6 +416,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)
@@ -476,24 +480,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;
} }
@@ -509,10 +516,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; }
} }
+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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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
+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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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
@@ -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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 Laszlo Molnar
Copyright (C) 2000-2017 John F. Reiser Copyright (C) 2000-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 Laszlo Molnar
Copyright (C) 2000-2017 John F. Reiser Copyright (C) 2000-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 Laszlo Molnar
Copyright (C) 2000-2017 John F. Reiser Copyright (C) 2000-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 Laszlo Molnar
Copyright (C) 2004-2017 John F. Reiser Copyright (C) 2004-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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
+7 -16
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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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
@@ -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-2018 Markus Franz Xaver Johannes Oberhumer\n");
fprintf(fp, "Copyright (C) 1996-2017 Laszlo Molnar\n"); fprintf(fp, "Copyright (C) 1996-2018 Laszlo Molnar\n");
fprintf(fp, "Copyright (C) 2000-2017 John F. Reiser\n"); fprintf(fp, "Copyright (C) 2000-2018 John F. Reiser\n");
fprintf(fp, "Copyright (C) 2002-2017 Jens Medoch\n"); fprintf(fp, "Copyright (C) 2002-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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;
+78 -38
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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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
@@ -592,38 +592,10 @@ void ElfLinkerAMD64::relocate1(const Relocation *rel, upx_byte *location, upx_ui
super::relocate1(rel, location, value, type); super::relocate1(rel, location, value, type);
} }
void ElfLinkerARM64::relocate1(const Relocation *rel, upx_byte *location, upx_uint64_t value,
const char *type) {
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;
type += 4;
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);
else if (!strcmp(type, "64"))
set_le64(location, get_le64(location) + value);
} 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
super::relocate1(rel, location, value, type);
}
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) {
@@ -647,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) {
@@ -671,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);
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); 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);
} }
@@ -797,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;
@@ -816,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);
@@ -830,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))
+13 -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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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
@@ -246,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;
+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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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
@@ -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;
@@ -869,6 +869,9 @@ static int do_option(int optc, const char *arg)
case 676: case 676:
opt->o_unix.android_shlib = true; opt->o_unix.android_shlib = true;
break; break;
case 677:
opt->o_unix.force_pie = true;
break;
case '\0': case '\0':
return -1; return -1;
@@ -1020,6 +1023,7 @@ static const struct mfx_option longopts[] =
{"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}, {"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
+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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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;
+1 -1
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-2018 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
+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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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 -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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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
@@ -147,6 +147,7 @@ struct options_t {
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 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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
+44 -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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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,6 +126,8 @@
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_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
@@ -146,6 +148,7 @@
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 */
@@ -153,18 +156,31 @@
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_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_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
@@ -201,6 +217,32 @@
#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
};
#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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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
+1650 -1279
View File
File diff suppressed because it is too large Load Diff
+71 -17
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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 Laszlo Molnar
Copyright (C) 2000-2017 John F. Reiser Copyright (C) 2000-2018 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
@@ -51,7 +51,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(
@@ -68,6 +68,7 @@ protected:
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;
@@ -80,18 +81,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
@@ -117,15 +124,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,
@@ -139,26 +149,33 @@ 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_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_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;
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 const *shdri; // from input file Elf32_Shdr *shdri; // from input file
Elf32_Phdr const *gnu_stack; // propagate NX 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 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
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
@@ -168,7 +185,7 @@ 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;
@@ -235,18 +252,22 @@ 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, 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,
@@ -259,26 +280,33 @@ 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_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_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;
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 const *shdri; // from input file Elf64_Shdr *shdri; // from input file
Elf64_Phdr const *gnu_stack; // propagate NX 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;
unsigned so_slide; 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
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
@@ -288,7 +316,7 @@ 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;
@@ -368,6 +396,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
@@ -383,10 +423,8 @@ 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 void buildLoader(const Filter *);
virtual Linker* newLinker() const; virtual Linker* newLinker() const;
virtual void defineSymbols(Filter const *); virtual void defineSymbols(Filter const *);
@@ -402,10 +440,8 @@ public:
virtual const char *getName() const { return "linux/arm64"; } virtual const char *getName() const { return "linux/arm64"; }
virtual const char *getFullName(const options_t *) const { return "arm64-linux.elf"; } virtual const char *getFullName(const options_t *) const { return "arm64-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 void buildLoader(const Filter *);
virtual Linker* newLinker() const; virtual Linker* newLinker() const;
virtual void defineSymbols(Filter const *); virtual void defineSymbols(Filter const *);
@@ -449,7 +485,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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 Laszlo Molnar
Copyright (C) 2001-2017 John F. Reiser Copyright (C) 2001-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 Laszlo Molnar
Copyright (C) 2000-2017 John F. Reiser Copyright (C) 2000-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 Laszlo Molnar
Copyright (C) 2000-2017 John F. Reiser Copyright (C) 2000-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 Laszlo Molnar
Copyright (C) 2000-2017 John F. Reiser Copyright (C) 2000-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 Laszlo Molnar
Copyright (C) 2000-2017 John F. Reiser Copyright (C) 2000-2018 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); }
+411 -372
View File
File diff suppressed because it is too large Load Diff
+14 -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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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);
@@ -853,8 +819,8 @@ 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 pagezero_vmsize;
Mach_header mhdri; Mach_header mhdri;
@@ -1023,7 +989,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
}; };
@@ -1038,7 +1004,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
}; };
@@ -1105,7 +1071,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
}; };
@@ -1173,7 +1139,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
}; };
@@ -1241,7 +1207,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-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 Laszlo Molnar
Copyright (C) 2002-2017 Jens Medoch Copyright (C) 2002-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 Laszlo Molnar
Copyright (C) 2002-2017 Jens Medoch Copyright (C) 2002-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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
+10 -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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 Laszlo Molnar
Copyright (C) 2000-2017 John F. Reiser Copyright (C) 2000-2018 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
@@ -246,7 +246,7 @@ 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 (0==linker) {
// If no filter, then linker is not constructed by side effect // If no filter, then linker is not constructed by side effect
@@ -259,6 +259,7 @@ void PackUnix::pack3(OutputFile *fo, Filter &ft)
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 &)
@@ -557,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);
@@ -590,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
+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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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;
+5 -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) 2004-2017 John Reiser Copyright (C) 2004-2018 John Reiser
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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
@@ -111,7 +111,8 @@ typename T::Shdr const *PackVmlinuxBase<T>::getElfSections()
int j; int j;
for (p = shdri, j= ehdri.e_shnum; --j>=0; ++p) { for (p = shdri, j= ehdri.e_shnum; --j>=0; ++p) {
if (Shdr::SHT_STRTAB==p->sh_type if (Shdr::SHT_STRTAB==p->sh_type
&& (p->sh_size + p->sh_offset) <= (unsigned) file_size && (p->sh_size + p->sh_offset) <= (unsigned long)file_size
&& p->sh_name < p->sh_size
&& (10+ p->sh_name) <= p->sh_size // 1+ strlen(".shstrtab") && (10+ p->sh_name) <= p->sh_size // 1+ strlen(".shstrtab")
) { ) {
delete [] shstrtab; delete [] shstrtab;
+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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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-2018 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2017 Laszlo Molnar Copyright (C) 1996-2018 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

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