John Reiser
813e7b05e4
fix .ui_total_passes when shlib
2009-10-16 10:56:15 -07:00
John Reiser
ab8b486b4a
Fix -Wshadow complaints.
2009-10-16 10:01:29 -07:00
John Reiser
856ecb84a0
Compress shared library for i386-linux. DT_INIT must exist. Everything
...
needed by ld-linux for runtime relocation must be at the beginning of the
first PT_LOAD, etc.
2009-10-15 20:35:07 -07:00
John Reiser
0a485eafcb
Better detection of Position Independent main Executables (gcc -pie -FPIC).
2009-10-10 14:50:30 -07:00
Markus F.X.J. Oberhumer
57a64de023
Small conf.h update.
2009-01-01 13:40:52 +01:00
Markus F.X.J. Oberhumer
5ed689ceb0
Enter 2009.
2008-12-31 17:07:18 +01:00
Markus F.X.J. Oberhumer
25f1765f36
Support building with OpenWatcom 1.8. Silence some compiler warnings.
2008-12-31 16:56:38 +01:00
Markus F.X.J. Oberhumer
063bd58802
Silence gcc's -Wstrict-aliasing=1 warnings.
2008-12-29 23:15:56 +01:00
John Reiser
0b31fbf827
armel-eabi sets Elf32_Ehdr::EI_ABIVERSION = 4
2008-08-04 17:29:59 -07:00
John Reiser
e6ba71390d
armel-eabi choose proper decompressor
2008-07-20 15:35:19 -07:00
John Reiser
f0c8dbe0ec
armel-eabi-linux.elf (Debian) new protocol for system calls
2008-07-20 05:41:51 -07:00
John Reiser
74ebb7c722
more get_te32(&...) needed for endian neutrality
2008-07-16 13:49:28 -07:00
Markus F.X.J. Oberhumer
d54f947c98
Add Packer::hasLoaderSection() to handle missing CFLUSH sections.
2008-04-07 18:44:00 +02:00
John Reiser
703d498772
Implement cache flush for PowerPC.
2008-02-26 12:15:09 -08:00
Markus F.X.J. Oberhumer
7f9c47176a
Introduce target endianness accessors get_teXX() and set_teXX() in packer.h to
...
replace all [gs]et_nativeXX() member functions.
2008-01-09 13:57:47 +01:00
Markus F.X.J. Oberhumer
6ff1bd5917
Update my email address.
2008-01-02 10:12:42 +01:00
Markus F.X.J. Oberhumer
fa49dbe2cb
Enter 2008.
2008-01-02 09:42:31 +01:00
John Reiser
d9d0dc5201
get_native(&Elf32_Phdr.p_align)
2007-12-15 10:07:09 -08:00
Markus F.X.J. Oberhumer
e9e5507483
stub: rename "mipseb" to "mips".
2007-11-14 04:54:33 +01:00
John Reiser
1a035e2866
PackLinuxElf32::canPack must use explicit get_native32
2007-11-13 11:11:31 -08:00
John Reiser
95075aa28e
MIPSEB implementation [still broken because no big-endian tools]
2007-11-12 09:23:45 -08:00
John Reiser
27a77a15ed
prepare to deal with DT_GNU_HASH instead of DT_HASH
2007-11-12 09:05:36 -08:00
John Reiser
e66823d017
mipsel.r3000-linux: flush cache for NRV, fix stub copying when big
2007-06-09 17:13:50 -07:00
John Reiser
81928d4ab1
mipsel stub escape hatch for munmap
2007-05-10 13:13:11 -07:00
John Reiser
8f15777427
merge
2007-05-08 10:43:50 -07:00
John Reiser
748c4bf780
mipsel stub system calls
2007-05-08 10:41:13 -07:00
Markus F.X.J. Oberhumer
40e19293f9
Added throwOutOfMemoryException().
2007-05-08 15:28:35 +02:00
John Reiser
573009eeb6
new format UPX_F_LINUX_ELF32_MIPSEL [work in progress]
2007-05-06 06:17:49 -07:00
Markus F.X.J. Oberhumer
5e83596a1b
Enter 2007.
2007-01-14 13:08:58 +01:00
Markus F.X.J. Oberhumer
0b988176fa
Portability fixes.
2007-01-10 17:16:59 +01:00
John Reiser
961031efc1
make_st_info()
2006-12-19 16:12:15 -08:00
Markus F.X.J. Oberhumer
f8ebbf8b08
Rework p_elf.h.
2006-12-19 14:24:35 +01:00
Markus F.X.J. Oberhumer
f2b9dff596
More work so that watom/le now uses compressWithFilters().
2006-12-06 11:08:32 +01:00
Markus F.X.J. Oberhumer
ae945ed315
Clean up help and avoid using backticks as quoting chars.
2006-12-06 08:11:55 +01:00
Markus F.X.J. Oberhumer
1d0d538d0c
Added new option '--ultra-brute'.
2006-12-01 02:47:46 +01:00
Markus F.X.J. Oberhumer
2ced230965
Updated packers to use new stub names.
2006-11-21 03:40:11 +01:00
Markus F.X.J. Oberhumer
a6cb6f57d3
Introduce Packer::relocateLoader(). This is the first step of finally getting
...
rid of all Packer::patchXXX() methods.
2006-11-20 18:10:23 +01:00
John Reiser
796d58867b
use separate stub/armeb-linux.elf-entry and fold
2006-11-20 08:02:28 -08:00
John Reiser
0687c9a57a
PackLinuxElf32::ARM_buildLoader endianness bugs
2006-11-19 14:28:15 -08:00
John Reiser
5ec16153f7
PackLinuxElf64amd::defineSymbols forgot a get_native64()
2006-11-18 19:52:55 -08:00
Markus F.X.J. Oberhumer
d822b4a62a
Store shentsize in target byte-order.
2006-11-18 18:25:11 +01:00
Markus F.X.J. Oberhumer
be235ddc38
Removed unused Packer::freezeLoader(). Changed return type of
...
buildLoader() from "int" to "void".
2006-11-12 20:57:08 +01:00
John Reiser
829e2d6c5d
set e_shentsize to work around bug in binutils [mostly cosmetic]
2006-10-24 09:43:50 -07:00
Markus F.X.J. Oberhumer
c2e5e45c84
Fix UINT64_MAX.
2006-10-06 08:42:12 +02:00
John Reiser
014236c861
amd64 stub: fix length of move for non-small programs
2006-10-04 08:38:06 -07:00
Markus F.X.J. Oberhumer
d6f4480a4f
Removed debugging leftover.
2006-10-04 09:17:59 +02:00
Markus F.X.J. Oberhumer
28a6ac09ad
Initialize a field in constructor.
2006-10-04 09:14:13 +02:00
John Reiser
86e4d24476
avoid circularity of sz_pack2 in PackLinuxElf64amd::defineSymbols()
2006-10-03 20:21:36 -07:00
John Reiser
913a697ab2
Remove dead code and uses of sz_pack2 from PackLinuxElf32::ARM_defineSymbols()
2006-10-03 19:28:08 -07:00
Markus F.X.J. Oberhumer
a61457b422
Added some debugging support via Linker::dumpSymbols().
2006-10-03 23:48:19 +02:00
John Reiser
6c59b73ae5
PackLinuxElf64::generateElfHdr() .p_flags are only 32 bits
2006-09-06 10:36:50 -07:00
John Reiser
4ffde4db98
8-byte align LZMA_DEC20
2006-08-27 10:03:12 -07:00
Markus F.X.J. Oberhumer
0c61ca1a6b
Renamed addLinkerSymbols() to defineSymbols().
2006-08-23 11:20:06 +02:00
John Reiser
1846fa1f54
PackLinuxElf start loader at 0 mod 8
2006-08-22 21:22:49 -07:00
John Reiser
579ce20cad
remove patchFilter32()
2006-08-22 20:49:28 -07:00
John Reiser
12e4bcba5d
Elf64 sets .p_flags for 0-length .bss
2006-08-22 11:23:55 -07:00
Markus F.X.J. Oberhumer
601cd95277
Removed Packer::getIdentstr().
2006-08-21 19:57:43 +02:00
John Reiser
c19ffafd8d
i386-linux.elf decompress does not need cto8
2006-08-20 11:19:37 -07:00
Markus F.X.J. Oberhumer
aab984618d
Fix newLinker() for mach/ppc32.
2006-08-19 14:29:40 +02:00
John Reiser
6a7066ac2f
Avoid linker->setLoaderAlignOffset().
2006-08-14 19:21:15 -07:00
Markus F.X.J. Oberhumer
3ad5cb8a23
Merge.
2006-08-14 08:44:58 +02:00
John Reiser
0d1f12e31a
Use better name osabi_note.
2006-08-13 20:14:14 -07:00
John Reiser
a8ddf8f66d
Detect PT_NOTE for NetBSD, OpenBSD.
2006-08-13 20:00:44 -07:00
Markus F.X.J. Oberhumer
c15b8d71bc
Removed trailing whitespace.
2006-08-13 14:47:24 +02:00
John Reiser
5f622efb77
nrv2e PackLinuxElf32armLe works
2006-07-21 19:10:48 -07:00
John Reiser
52e8326d54
work on PackLinuxElf32arm; add nrv2b_d8.S
2006-07-21 13:11:02 -07:00
John Reiser
98942f5528
work on PackLinuxElf32arm, including nrv2d and lzma
2006-07-19 17:29:17 -07:00
John Reiser
b8b983dded
nrv2d decompressor for PackLinuxElf64amd
2006-07-17 15:02:37 -07:00
John Reiser
d6a6673971
nrv2d decompressor for PackLinuxElf32ppc
2006-07-17 13:23:49 -07:00
John Reiser
efdee11d5a
lzma PackLinuxElf32ppc works!
2006-07-17 08:05:31 -07:00
John Reiser
49f277192c
hacking lzma PackLinuxElf32ppc
2006-07-16 22:32:55 -07:00
John Reiser
b34e204676
PackLinuxElf32ppc conversion; alignment in *::Section
2006-07-16 15:04:16 -07:00
John Reiser
755d990dfd
unify buildLinuxLoader using addStubEntrySections and addLinkerSymbols
2006-07-16 09:48:22 -07:00
John Reiser
3843ec1e02
lzma for PackLinuxElf64amd
2006-07-15 16:01:53 -07:00
John Reiser
cfc5631d5d
PackLinuxElf64amd works (except for lzma)
2006-07-15 13:46:37 -07:00
John Reiser
e64555aca0
hacking PackLinuxElf64amd
2006-07-14 19:43:38 -07:00
John Reiser
44f20782fd
cleanup after merge; AMD64 ElfLinker
2006-07-12 11:42:03 -07:00
John Reiser
0b8825fecb
i386 conversion stub conversion; nrv2b_d32_2.ash etc.
2006-07-12 11:15:14 -07:00
John Reiser
b76118802a
ElfLinkerPpc32
2006-07-09 19:52:23 -07:00
John Reiser
ab0c349261
workaround ElfLinker not handling addSection(,,) from dynamic block
2006-07-09 17:29:22 -07:00
John Reiser
d5e0e66426
PackLinuxElf32x86::newLinker()
2006-07-09 16:59:41 -07:00
John Reiser
1a0a64e4de
::addStubEntrySections() with default ELFMAINX
2006-07-09 08:48:06 -07:00
John Reiser
6bd9805bcc
start converting PackLinuxElf64amd to ElfLinker
2006-07-09 08:14:04 -07:00
John Reiser
0a10334f1b
more *BSD, especially do_xmap() for OpenBSD
2006-07-04 08:59:00 -07:00
John Reiser
0d7255158a
OpenBSD "pro-active security" causes headaches
2006-07-03 16:35:21 -07:00
John Reiser
18fe124696
::generateElfHdr() sets .e_ident[Elf32_Ehdr::EI_OSABI]
2006-07-03 05:51:45 -07:00
John Reiser
ea3a3b6e1c
Elf32_Ehdr::ELFOSABI_LINUX
2006-07-03 05:47:01 -07:00
John Reiser
32ce83475d
more *BSD arrangements
2006-07-02 21:54:44 -07:00
John Reiser
75294b9146
FreeBSD, NetBSD, OpenBSD on equal footing
2006-07-02 19:27:08 -07:00
John Reiser
68dadabc29
BSD/elf386
2006-07-02 16:25:31 -07:00
Markus F.X.J. Oberhumer
7b77491c06
Refactoring: move fields ui_pass and ui_total_passes from class
...
Packer into class UiPacker.
2006-06-29 14:37:01 +02:00
John Reiser
89e25657d8
fix cross-platform endian trouble with ELF headers
2006-06-27 13:07:31 -07:00
John Reiser
4eb505755e
lzma for ELF
2006-06-24 14:00:41 -07:00
John Reiser
1a51451ec2
ELF stub uses getSizeForCompression()
2006-06-23 19:32:29 -07:00
John Reiser
28d56bab04
Merge
2006-06-22 21:30:59 -07:00
John Reiser
2500eff90d
more LZMA debugging for Linux i386 ELF
2006-06-22 21:25:18 -07:00
Markus F.X.J. Oberhumer
153446b3a1
Fixed debugging code.
2006-06-23 05:40:35 +02:00
John Reiser
03910d67c3
M_LZMA bug tracking: decompress fails but says OK
2006-06-22 17:18:17 -07:00
John Reiser
b13f7366cf
freezeLoader() sooner in PackLinuxElf32x86::buildLinuxLoader()
2006-06-21 17:08:58 -07:00
Markus F.X.J. Oberhumer
bf5cbfffc2
Start major refactoring.
2006-06-19 19:20:50 +02:00
John Reiser
fd2b9a6e21
filter 0x51 (ARM call trick, big-endian at compress time)
2006-06-16 06:49:37 -07:00
John Reiser
fa702b48e3
unify PackLinuxElf32arm...::pack1()
2006-06-15 15:41:00 -07:00
John Reiser
299dcf6686
Merge
2006-06-15 12:21:01 -07:00
Markus F.X.J. Oberhumer
d3323d6550
Major refactoring of src/stub directory.
2006-06-15 08:17:50 +02:00
John Reiser
ebed0b9f20
allow brev() in-place
2006-06-14 20:21:39 -07:00
John Reiser
f654a453dc
ARM_pack3() unifies big/little endian and HostPolicy
2006-06-14 16:06:50 -07:00
John Reiser
10decf94cc
fix delete[] file_image
2006-06-14 11:41:49 -07:00
John Reiser
96dd4817f1
unify PackLinuxElf32...::canPack(); also ARM buildLinuxLoader()
2006-06-14 11:33:16 -07:00
Markus F.X.J. Oberhumer
7daf63fd3f
Merge.
2006-06-14 11:48:44 +02:00
John Reiser
4fc0a32572
Do not brev() strings in stub for PackLinuxEl32armBe.
2006-06-13 18:55:26 -07:00
John Reiser
dcc704a357
debug PackLinuxElf32armBe. Also unify subroutines.
2006-06-13 15:51:29 -07:00
John Reiser
bd8acbde97
PackLinuxElf32armBe (Linux ARM big-endian)
2006-06-13 11:48:54 -07:00
John Reiser
112b10c19d
avoid randomness for progid in Elf
2006-06-13 08:53:41 -07:00
John Reiser
d89e561a85
PackLinuxElf32armLe, PackLinuxElf32armBe
2006-06-13 08:51:02 -07:00
John Reiser
49c1da79c8
PackLinuxElf32arm ==> PackLinuxElf32armLe
2006-06-13 08:27:14 -07:00
Markus F.X.J. Oberhumer
d8748f4270
Introduced MemBuffer::getSizeForCompression().
2006-06-12 13:18:55 +02:00
Markus F.X.J. Oberhumer
c34daf1a35
Make code -Wshadow warning free.
2006-06-11 12:25:19 +02:00
Markus F.X.J. Oberhumer
d461b53235
Renamed variable clen to c_len and ulen to u_len.
2006-06-11 12:13:37 +02:00
Markus F.X.J. Oberhumer
f1ba0c0aa7
More lzma stuff.
2006-06-09 18:36:53 +02:00
Markus F.X.J. Oberhumer
34ae413607
Initial lzma support.
2006-06-07 04:42:15 +02:00
John Reiser
1f18050930
elf32arm escape hatch: avoid Elf32_Ehdr if possible
2006-06-02 08:51:02 -07:00
John Reiser
17ecfc9765
new class PackLinuxElf32arm : PackLinuxElf32Le;
...
Unify some functions in leaf classes by moving to parent class.
2006-06-01 06:37:44 -07:00
John Reiser
504deeff42
ET_DYN cannot be old format for decompression
2006-05-24 13:15:39 -07:00
John Reiser
51536a7acd
decompression PackLinuxElf32x86.ET_DYN
2006-05-23 17:42:35 -07:00
John Reiser
d2718e99a4
Change class PackLinuxI386elf : public PackLinuxI386
...
into class PackLinuxElf32x86 : public PackLinuxElf32Le : public PackLinuxElf32
which makes the code for compressing ELF (for direct-to-memory decompression)
cleaner because ELF has some of the class tree to itself.
This assumes PROT_EXEC|PROT_WRITE ought to work.
This is checked at runtime, and if it fails then
give a message on stderr and exit(127).
Modify --force-execve so that runtime avoids PROT_EXEC|PROT_WRITE.
Then executables compressed with --force-execve will run under
PaX, grSecurity, and strict SELinux.
2006-05-21 13:58:24 -07:00
László Molnár
0ca8ae17d4
updated my email address
2006-05-17 21:05:46 +02:00
John Reiser
b739bd3d79
Work better with SELinux. We still require allow_execmem.
...
p_lx_elf.cpp
stub/fold_elfppc32.h
stub/l_lx_elfppc32.h
stub/l_lx_elfppc32.S
stub/m_lx_elfppc32.c
committer: jreiser <jreiser> 1145666524 +0000
2006-04-22 00:42:04 +00:00
John Reiser
c264750924
Adapt better to SELinux. We still need allow_execmem.
...
p_lx_elf.cpp
stub/a_lx_elf64.c
stub/l_lx_elf64amd.h
stub/l_lx_elf64amd.lds
stub/l_lx_elf64amd.S
stub/fold_elf64amd.h
committer: jreiser <jreiser> 1145657332 +0000
2006-04-21 22:08:52 +00:00
John Reiser
fb1181ed26
Allow executables >=3MB on elf64amd; -r1.69 on 2005-11-12 forgot to remove check.
...
committer: jreiser <jreiser> 1145139994 +0000
2006-04-15 22:26:34 +00:00
Markus F.X.J. Oberhumer
90b1817e92
Undef PAGE_{MASK,SIZE} in conf.h.
...
committer: mfx <mfx> 1143454717 +0000
2006-03-27 10:18:37 +00:00
John Reiser
f95e171e11
Workaround linux-2.6.14 binfmt_elf.c: SIGKILL if (0==.p_memsz) on a page boundary.
...
p_lx_elf.cpp p_lx_exc.cpp
committer: jreiser <jreiser> 1143057770 +0000
2006-03-22 20:02:50 +00:00
Markus F.X.J. Oberhumer
1810440355
Added __attribute__((__sentinel__)) to Packer::addLoader(). This is
...
a new gcc-4.1 feature.
committer: mfx <mfx> 1142035833 +0000
2006-03-11 00:10:33 +00:00
John Reiser
366a708f3a
Generalize to more than 2 PT_LOAD using find_LOAD_gap; needed for linux/ElfAMD.
...
Also simplifies, and applies to both ::pack and ::unpack.
p_lx_elf.cpp p_lx_elf.h
committer: jreiser <jreiser> 1141348876 +0000
2006-03-03 01:21:16 +00:00
John Reiser
b389abd99f
PackLinuxElf64amd::getCompressionMethods allows both nrv2b and nrv2e
...
committer: jreiser <jreiser> 1141326792 +0000
2006-03-02 19:13:12 +00:00
John Reiser
268e322e1c
Extra parameter for compressWithFilters and packExtent,
...
to fix 2-pass problem with --brute on linux/elf386.
Only one decompression method is allowed, chosen by
smallest output for .text; but Elf headers come first.
packer.cpp packer.h p_unix.cpp p_unix.h p_lx_elf.cpp
committer: jreiser <jreiser> 1140241030 +0000
2006-02-18 05:37:10 +00:00
Markus F.X.J. Oberhumer
8b7ebcf040
Enter 2006.
...
committer: mfx <mfx> 1139778883 +0000
2006-02-12 21:14:43 +00:00
Markus F.X.J. Oberhumer
51ac5172f5
#undef PAGE_{MASK,SIZE} to fix build problems on some machines.
...
committer: mfx <mfx> 1139743226 +0000
2006-02-12 11:20:26 +00:00
John Reiser
ce33ffb62a
handle compressed executables larger than 3MB on Elf64amd
...
committer: jreiser <jreiser> 1131833508 +0000
2005-11-12 22:11:48 +00:00
John Reiser
75bba319de
tuning, and prepare for large executables (>3MB compressed)
...
p_lx_elf.cpp stub/a_lx_elf64.c stub/amd_d_nrv2e.S
stub/fold_elf64amd.S stub/l_lx_elf64amd.S
committer: jreiser <jreiser> 1131824655 +0000
2005-11-12 19:44:15 +00:00
John Reiser
f78e9261f3
Do initLoader() properly, instead of relying on the amount of stack space
...
that is in use when ::buildLinuxLoader is called.
committer: jreiser <jreiser> 1131597922 +0000
2005-11-10 04:45:22 +00:00
John Reiser
6737a3ae09
PackLinuxElf64amd
...
p_lx_elf.h p_lx_elf.cpp packmast.cpp
committer: jreiser <jreiser> 1131570778 +0000
2005-11-09 21:12:58 +00:00
John Reiser
0c328372b5
Allow __uClibc_main and __uClibc_start_main like __libc_start_main.
...
committer: jreiser <jreiser> 1127269046 +0000
2005-09-21 02:17:26 +00:00
John Reiser
3f7b642c7d
Linux i386 allow compression of position-independent main executables (gcc -pie).
...
p_elf.h p_lx_elf.cpp p_lx_elf.h p_lx_exc.cpp
stub/fold_elf86.asm stub/fold_elf86.h stub/l_lx_elf.c
stub/l_lx_elf86.asm stub/l_lx_elf86.h stub/l_lx_elf86.lds
stub/linux.hh
committer: jreiser <jreiser> 1126886896 +0000
2005-09-16 16:08:16 +00:00
Markus F.X.J. Oberhumer
6b7c7f755c
Avoid warnings about unused vars.
...
committer: mfx <mfx> 1119613814 +0000
2005-06-24 11:50:14 +00:00
John Reiser
d339ee3135
PackLinuxElf32::unpack forgot several get_native32()
...
committer: jreiser <jreiser> 1114229735 +0000
2005-04-23 04:15:35 +00:00
John Reiser
14b0527e79
fix compiler waring
...
committer: jreiser <jreiser> 1108941316 +0000
2005-02-20 23:15:16 +00:00
John Reiser
664a82e7c9
Start re-organizing the packing of Elf, by making Elf32 come first,
...
with Big endian and Little endian derived from it.
I386 still uses the old way, but PowerPC (both Linux and Darwin [Mac])
use the new way.
p_elf.h p_lx_elf.cpp p_lx_elf.h p_lx_exc.cpp p_lx_exc.h
p_unix.cpp p_unix.h p_vmlinx.cpp p_vmlinx.h p_vmlinz.cpp
committer: jreiser <jreiser> 1108940224 +0000
2005-02-20 22:57:04 +00:00
Markus F.X.J. Oberhumer
18ef55ac14
Final updates for upx-1.91.
...
committer: mfx <mfx> 1088566877 +0000
2004-06-30 03:41:17 +00:00
John Reiser
1555be40b7
fix alignment of loader after packing multiple blocks
...
p_lx_elf.h p_lx_elf.cpp
committer: jreiser <jreiser> 1080880623 +0000
2004-04-02 04:37:03 +00:00
Markus F.X.J. Oberhumer
5f87e9891b
Enter 2004.
...
committer: mfx <mfx> 1074623868 +0000
2004-01-20 18:37:48 +00:00