Commit Graph

517 Commits

Author SHA1 Message Date
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
John Reiser
4e2fdb464a Defend against bad PT_DYNAMIC
https://github.com/upx/upx/issues/391
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2020-07-23 05:09:52 -07:00
John Reiser
73b854874e Defend against junk PT_DYNAMIC
https://github.com/upx/upx/issues/390
	modified:   p_lx_elf.cpp
2020-07-23 04:14:34 -07:00
John Reiser
0016512df1 Unpack: Phdrs must be within expansion of first compressed block
https://github.com/upx/upx/issues/388
	modified:   p_lx_elf.cpp
2020-07-22 19:34:27 -07:00
John Reiser
527139978a DT_HASH chains might be trimmed (64-bit, too)
https://github.com/upx/upx/issues/383
	modified:   p_lx_elf.cpp
2020-06-08 12:37:53 -07:00
John Reiser
47bc68fa6b DT_HASH chains might be trimmed
https://github.com/upx/upx/issues/383
	modified:   p_lx_elf.cpp
2020-06-07 19:35:49 -07:00
John Reiser
963392a5ae De-compress (upx -d) for ELF pageholes
modified:   p_lx_elf.cpp
2020-05-30 13:54:11 -07:00
John Reiser
a817ed0692 uintptr_t for MSVC
modified:   p_lx_elf.cpp
2020-05-23 11:02:46 -07:00
John Reiser
828a6cf07b invert_pt_dynamic() more checking
https://github.com/upx/upx/issues/378
https://github.com/upx/upx/issues/379
	modified:   p_lx_elf.cpp
2020-05-23 10:51:03 -07:00
John Reiser
962c35aa08 More checking of DT_GNU_HASH and DT_HASH tables
https://github.com/upx/upx/issues/381
	modified:   p_lx_elf.cpp
2020-05-23 10:04:38 -07:00
John Reiser
b327645e64 More checking of DT_GNU_HASH and DT_HASH tables
https://github.com/upx/upx/issues/380
	modified:   p_lx_elf.cpp
2020-05-23 09:41:41 -07:00
John Reiser
6272152dfe phdr[C_BASE].p_memsz for ET_EXEC
modified:   p_lx_elf.cpp
2020-05-25 14:11:46 -07:00
John Reiser
80c27e0822 arm.v4a works: ELF layout for page holes
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/arm.v4a-linux.elf-entry.h
	modified:   stub/arm.v4a-linux.elf-fold.h
	modified:   stub/arm.v5a-linux.elf-entry.h
	modified:   stub/arm.v5a-linux.elf-fold.h
	modified:   stub/armeb.v4a-linux.elf-entry.h
	modified:   stub/armeb.v4a-linux.elf-fold.h
	modified:   stub/i386-linux.elf-fold.h
	modified:   stub/mips.r3000-linux.elf-fold.h
	modified:   stub/mipsel.r3000-linux.elf-fold.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/tmp/arm.v4a-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm.v4a-linux.elf-fold.map
	modified:   stub/tmp/arm.v5a-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm.v5a-linux.elf-fold.map
	modified:   stub/tmp/armeb.v4a-linux.elf-entry.bin.dump
	modified:   stub/tmp/armeb.v4a-linux.elf-fold.map
	modified:   stub/tmp/i386-linux.elf-fold.map
	modified:   stub/tmp/mips.r3000-linux.elf-fold.map
	modified:   stub/tmp/mipsel.r3000-linux.elf-fold.map
	modified:   stub/tmp/powerpc-linux.elf-fold.map
2020-05-14 15:10:40 -07:00
John Reiser
926481dace ELF layout for page holes when runtime PAGE_SIZE < .p_align
amd64 works
	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
	modified:   Makefile
	modified:   stub/amd64-linux.elf-entry.h
	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/amd64-linux.shlib-init.h
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/powerpc64-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/src/amd64-linux.shlib-init.S
	modified:   stub/tmp/amd64-linux.elf-entry.bin.dump
	modified:   stub/tmp/amd64-linux.elf-fold.map
	modified:   stub/tmp/amd64-linux.shlib-init.bin.dump
	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-05-09 08:05:05 -07:00
John Reiser
a3b2cde58d max_bucket versus symbias
modified:   p_lx_elf.cpp
2020-04-17 17:09:47 -07:00
John Reiser
30f37d2cc6 DT_GNU_HASH check the buckets
https://github.com/upx/upx/issues/365
	modified:   p_lx_elf.cpp
2020-04-17 16:49:54 -07:00
John Reiser
c4d61dd9fe --preserve-build-id for ET_EXEC
https://github.com/upx/upx/issues/371
	modified:   p_lx_elf.cpp
2020-04-17 16:17:29 -07:00
John Reiser
210870f840 invert_pt_dynamic() DT_GNU_HASH trims hash array for Rust and Android
https://github.com/upx/upx/issues/369
	modified:   p_lx_elf.cpp
2020-04-15 17:29:03 -07:00
John Reiser
4cb4bd38eb check_pt_dynamic() checks PT_DYNAMIC.p_memsz
https://github.com/upx/upx/issues/368
	modified:   p_lx_elf.cpp
2020-04-15 14:24:05 -07:00
John Reiser
58c6d19f7c unpack() checks PT_DYNAMIC.p_filesz
https://github.com/upx/upx/issues/367
	modified:   p_lx_elf.cpp
2020-04-15 14:12:06 -07:00
John Reiser
c67a5d677c More bounds checking for DT_INIT (etc.) in shlib
https://github.com/upx/upx/issues/364
	modified:   p_lx_elf.cpp
2020-04-13 17:08:49 -07:00
John Reiser
740b4ff865 ELF shared lib: PT_DYNAMIC might be below xct_off, such as MIPS
https://github.com/upx/upx/issues/298
	modified:   p_lx_elf.cpp
2020-02-15 15:04:44 -08:00
John Reiser
342b1b7d6c EM_PPC64 forgot get_te16(&...) for ehdri.e_machine
So compression on big-endian host was not correct.
https://github.com/upx/upx/issues/334
	modified:   p_lx_elf.cpp
2020-01-19 18:48:50 -08:00
John Reiser
e2f60adc95 Detect 0==DT_SYMTAB in invert_pt_dynamic()
https://github.com/upx/upx/issues/333
	modified:   p_lx_elf.cpp
2020-01-14 18:45:52 -08:00
John Reiser
1bb93d4fce Detect bad e_shstrtab better.
https://github.com/upx/upx/issues/332
	modified:   p_lx_elf.cpp
2020-01-13 17:26:31 -08:00
John Reiser
eb90eab632 Detect bogus DT_SYMENT.
https://github.com/upx/upx/issues/331
	modified:   p_lx_elf.cpp
2020-01-13 17:10:02 -08:00
Markus F.X.J. Oberhumer
92f072cf70 Silence some compiler warnings. 2020-01-08 04:49:27 +01:00
Markus F.X.J. Oberhumer
d1174385ef Welcome 2020. 2020-01-08 04:13:28 +01:00
John Reiser
cb5f590e10 More hacking Android shlib.
https://github.com/upx/upx/issues/318
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
2019-12-12 20:23:33 -08:00
John Reiser
5ed9c66ed9 Hack Android shared libraries on arm64.
https://github.com/upx/upx/issues/318
	modified:   p_lx_elf.cpp
2019-12-12 17:05:50 -08:00
John Reiser
b8f52d14f4 user_init_va on AARCH64
https://github.com/upx/upx/issues/318  (work-in-progress)
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
2019-12-04 14:26:46 -08:00
John Reiser
5d295c24f0 DT_NEEDED can be duplicated
modified:   p_lx_elf.cpp
2019-11-26 19:33:27 -08:00
John Reiser
8be9da8280 Avoid bogus values in PT_DYNAMIC segment.
Detect duplicate DT_*.
Detect out-of-bounds hashtab and gashtab.
Detect missing DT_REL, DT_RELA.
Detect out-of-bounds d_val.
https://github.com/upx/upx/issues/317
	modified:   p_lx_elf.cpp
2019-11-23 20:06:14 -08:00
John Reiser
23570097cf MSVC barfs on {unsigned == long int) [because sizeof() is the same!]
https://github.com/upx/upx/issues/283
	modified:   p_lx_elf.cpp
2019-07-14 13:39:09 -07:00
John Reiser
593a69ce25 PT_LOAD[0] with ElfXX.Ehdr only
https://github.com/upx/upx/issues/283
	modified:   p_lx_elf.cpp
2019-07-14 13:08:56 -07:00
John Reiser
49766388bc Fix compression and de-compression of Android shared libraries
Handle relocation (and DT_INIT_ARRAY[0]==NULL) when !DT_INIT.
Warn about missing --android-shlib if (ET_DYN && !DF_1_PIE && Arm*).
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
https://github.com/upx/upx/issues/265
https://github.com/upx/upx/issues/262
https://github.com/upx/upx/issues/259
https://github.com/upx/upx/issues/243
https://github.com/upx/upx/issues/229
https://github.com/upx/upx/issues/220
2019-04-14 19:59:08 -07:00
John Reiser
f23267bddd Fix rotate+lop of PT_INTERP in shared library
Found while working on https://github.com/upx/upx/issues/262
but probably does not help that bug.
	modified:   p_lx_elf.cpp
2019-04-01 21:35:53 -07:00
John Reiser
d4e2d7e8a8 arm64 (aarch64) and PAGE_SIZE > 4KiB
Future: use prctl(PR_SET_MM, PR_SET_MM_START_BRK, addr)
https://github.com/upx/upx/issues/254
	modified:   p_lx_elf.cpp
	modified:   stub/src/amd64-linux.elf-main.c
2019-03-01 20:31:41 -08:00
Markus F.X.J. Oberhumer
3667fa4e44 Welcome 2019. 2019-02-15 11:04:09 +01:00