Commit Graph

555 Commits

Author SHA1 Message Date
Markus F.X.J. Oberhumer
d001a63bce Welcome 2022. 2022-09-04 04:24:39 +02:00
John Reiser
acad3c3000 DT_INIT_ARRAY noes not pertain to DT_* for symbol table info
https://github.com/upx/upx/issues/586
	modified:   p_lx_elf.cpp
2022-07-02 20:52:18 -07:00
John Reiser
c1311c78a3 Extra space to force "git commit" to force rebuild for tagging Issue
https://github.com/upx/upx/issues/577
	modified:   p_lx_elf.cpp
2022-05-30 15:19:18 -07:00
John Reiser
717150b7f3 Stupid MSVC: bad C4706: assignment within conditional expression
-    for (unsigned j=0; (k = dt_names[j]); ++j) {
+    for (unsigned j=0; ((k = dt_names[j]), k); ++j) {

The complaint was:
    p_lx_elf.cpp(5710) : warning C4706: assignment within conditional expression
which is INCORRECT, as shown in the change which is 100% equivalent.
The assignment occurs BEFORE the conditional expression.
	modified:   p_lx_elf.cpp
2022-05-30 15:09:34 -07:00
John Reiser
a68c62d938 More placate compilers
https://github.com/upx/upx/issues/577
	modified:   p_lx_elf.cpp
2022-05-30 15:02:53 -07:00
John Reiser
c11f8a569a Placate 'clang' -Wcast-align
https://github.com/upx/upx/issues/577
	modified:   p_lx_elf.cpp
2022-05-30 14:55:39 -07:00
John Reiser
03436d2415 Bug in handling DT_GNU_HASH table.
Fix includes a more-general and stronger heuristic to find the end of
GNU_HASH table when there is no ElfXX_Shdr for it.  64-bit only for now.
(This is needed to help prevent SIGSEGV when processing tampered .exe.)

https://github.com/upx/upx/issues/577
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2022-05-30 14:24:21 -07:00
John Reiser
78c555b4a6 Handle old-style compressed main programs when de-compressing
modified:   p_lx_elf.cpp
2022-03-22 19:20:09 -07:00
John Reiser
e7ca5c54ff Fix --brute for p_lx_elf.cpp, which compresses multiple pieces
Force all pieces to use the same de-compressor.
(Future: allow each PT_LOAD to choose its own.)
Has minor wobbles due to page alignment, and size of de-compressor.
64-bit only for now.
https://github.com/upx/upx/issues/570
https://github.com/upx/upx/issues/297
	modified:   p_lx_elf.cpp
	modified:   p_unix.cpp
	modified:   packer.cpp
	modified:   packer.h
2022-03-22 11:46:25 -07:00
John Reiser
663d6b466b WIP: clarify compressWithFilters; reduce size of obuf for PackLinuxElf64
modified:   p_lx_elf.cpp
	modified:   packer.cpp
	modified:   packer.h
2022-03-21 13:49:46 -07:00
John Reiser
34df0d6ef1 More empty HASH and/or GNU_HASH when Rust-musl
https://github.com/upx/upx/issues/568
	modified:   p_lx_elf.cpp
2022-03-12 14:21:51 -08:00
John Reiser
e5aeea9ed2 Check more carefully in invert_pt_dynamic()
https://github.com/upx/upx/issues/566
	modified:   p_lx_elf.cpp
2022-02-28 07:55:49 -08:00
John Reiser
5bcf9dd8af Do not complain for minimal DT_GNU_HASH as by Rust.
Also: .p_type is 32 bits only!

https://github.com/upx/upx/issues/525
	modified:   p_lx_elf.cpp
2021-12-25 12:39:31 -08:00
John Reiser
284adb203f Better checking of DT_HASH.nbuckets
https://github.com/upx/upx/issues/507
	modified:   p_lx_elf.cpp
2021-12-24 15:52:16 -08:00
John Reiser
adafa841f7 Some PT_LOAD must have (p_flags & PF_X)
https://github.com/upx/upx/issues/511
	modified:   p_lx_elf.cpp
2021-12-24 15:32:19 -08:00
John Reiser
fdc5d25d03 Require DT_STRSZ
https://github.com/upx/upx/issues/512
	modified:   p_lx_elf.cpp
2021-12-24 15:08:22 -08:00
John Reiser
bd441e83ae WIP: de-compression of old-style shlib
modified:   p_lx_elf.cpp
2021-09-06 08:43:20 -07:00
John Reiser
c9f6a3583c WIP 64-bit shlib
modified:   p_lx_elf.cpp
2021-08-07 06:45:01 -07:00
John Reiser
076aaf829a WIP: Elf64 shlib compress+decompress seems to work
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   p_unix.cpp
2021-07-05 13:47:19 -07:00
John Reiser
85f0c5a445 WIP: Elf64 shlib cleanup
modified:   file.cpp
	modified:   file.h
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2021-07-02 18:33:38 -07:00
John Reiser
d5263a56ce WIP: handling shared library
modified:   p_lx_elf.cpp
	modified:   p_unix.cpp
	modified:   p_unix.h
2021-05-22 16:03:53 -07:00
John Reiser
181c752488 WIP: un_shlib_1
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2021-05-08 11:14:31 -07:00
John Reiser
333a288248 shlib: Don't compress below xct_off (except Elf headers)
modified:   p_lx_elf.cpp
2021-04-11 15:16:34 -07:00
John Reiser
613df414ed Fix off-by-1 in invert_pt_dynamic; SHT_NOBITS occupies no space
modified:   p_lx_elf.cpp
2021-04-11 15:09:55 -07:00
John Reiser
be050693f2 PackLinuxElf::canUnpack must checkEhdr() for ELF input
https://github.com/upx/upx/issues/485
	modified:   p_lx_elf.cpp
2021-04-10 10:11:48 -07:00
John Reiser
78f48d65d5 Allow 0==nbucket for DT_HASH, DT_GNU_HASH
static linked 'Rust' program with no symbols
https://github.com/upx/upx/issues/476
2021-03-25 07:22:01 -07:00
John Reiser
b81ec224b7 Fix headway argument to invert_pt_dynamic()
https://github.com/upx/upx/issues/473
	modified:   p_lx_elf.cpp
2021-03-25 07:10:40 -07:00
John Reiser
4be6cfebcd get_te32() when checking DT_GNU_HASH chains (MIPS .so)
https://github.com/upx/upx/issues/473
        modified:   p_lx_elf.cpp
2021-03-23 18:21:45 -07:00
John Reiser
98973dd8b9 get_te32() when checking DT_HASH chains (MIPS .so)
https://github.com/upx/upx/issues/473
	modified:   p_lx_elf.cpp
2021-03-23 06:45:01 -07:00
John Reiser
1218b6ff2a Check more in invert_pt_dynamic
https://github.com/upx/upx/issues/471
	modified:   p_lx_elf.cpp
2021-03-16 18:46:11 -07:00
John Reiser
0a69e7803b Fix errors detected by "make run-testsuite".
total_out does not matter when option -t writes no output file.
Subtle error in generateElfHdr() [noted by address sanitizer].
New member function is_LOAD32() to avoid confusion with (1+ LO_PROC).
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2021-03-06 15:31:56 -08:00
John Reiser
0a1d24d1d9 Remove nit from PackLinuxElf64::generateElfHdr [address sanitizer]
modified:   p_lx_elf.cpp
2021-03-05 16:33:25 -08:00
John Reiser
35555bfb8a WIP: PackLinuxElf64::unpack working for shared libraries (non-Android)
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   p_unix.cpp
2021-03-05 16:20:36 -08:00
John Reiser
c9cb42df40 WIP: hacking un_shlib_1
modified:   p_lx_elf.cpp
2021-02-28 17:12:20 -08:00
John Reiser
2be03028f4 WIP: un_shlib_1
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2021-02-27 19:27:12 -08:00
John Reiser
182e0796df Split PackLinuxElf64::unpack for main program vs shared library
modified:   p_lx_elf.cpp
2021-02-22 16:15:03 -08:00
John Reiser
fb844a8ed1 total_in, total_out move to PackUnix
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   p_lx_interp.cpp
	modified:   p_mach.cpp
	modified:   p_unix.cpp
	modified:   p_unix.h
2021-02-22 16:13:40 -08:00
John Reiser
23f63e4196 WIP unpacking ELF shared library
modified:   Makefile
	modified:   lzma-sdk
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   p_mach.cpp
	modified:   p_unix.cpp
	modified:   p_unix.h
	modified:   packer.cpp
	modified:   packer.h
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/tmp/arm64-linux.elf-fold.map
2021-01-15 14:11:09 -08:00
Markus F.X.J. Oberhumer
9131d5216f Welcome 2021. 2021-01-01 20:39:22 +01:00
John Reiser
13bc031163 Check DT_REL/DT_RELA, DT_RELSZ/DT_RELASZ
https://github.com/upx/upx/issues/421
	modified:   p_lx_elf.cpp
2020-12-11 13:38:18 -08:00
Markus F.X.J. Oberhumer
f7e2266c3f Start using some C++ 14 features. 2020-12-08 05:40:17 +01:00
John Reiser
7841e15583 Prefer MemBuffer instead of New()+delete
https://github.com/upx/upx/issues/428
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2020-12-05 10:31:55 -08:00
Markus F.X.J. Oberhumer
94e72238f2 Fix some warnings. 2020-12-03 03:10:12 +01:00
John Reiser
e6ccef2cf1 MSVC strikes again
modified:   p_lx_elf.cpp
2020-09-05 19:19:11 -07:00
John Reiser
be61e9f584 Fix 64-bit ET_EXEC
https://github.com/upx/upx/issues/405
	modified:   p_lx_elf.cpp
	modified:   stub/src/amd64-linux.elf-main.c

	modified:   ../.github/travis_testsuite_1-expected_sha256sums.sh
	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/powerpc64-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/tmp/amd64-linux.elf-fold.map
	modified:   stub/tmp/arm64-linux.elf-fold.map
	modified:   stub/tmp/powerpc64-linux.elf-fold.map
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
2020-09-04 10:21:14 -07:00
John Reiser
c1a55b063e 0==e_shnum obviates testing of e_shoff
modified:   p_lx_elf.cpp
2020-07-26 20:00:05 -07:00
John Reiser
77c914bce5 Check de-compressed SHT_SYMTAB
https://github.com/upx/upx/issues/396
	modified:   p_lx_elf.cpp
2020-07-25 09:28:02 -07:00
John Reiser
cc60f03b2e Check Shdr more
https://github.com/upx/upx/issues/395
	modified:   p_lx_elf.cpp
2020-07-25 08:19:45 -07:00
John Reiser
cc9ccdbbd1 Check .sh_offset and .sh_size in SHT_DYNAMIC and SHT_STRNDX
https://github.com/upx/upx/issues/394
	modified:   p_lx_elf.cpp
2020-07-25 07:41:43 -07:00
John Reiser
9dfc8f573c Avoid 0==nbucket
https://github.com/upx/upx/issues/393
	modified:   p_lx_elf.cpp
2020-07-23 05:44:18 -07:00