Compare commits

..

74 Commits

Author SHA1 Message Date
Markus F.X.J. Oberhumer fed3ed9f9a Prepare release. 2011-12-12 11:55:45 +01:00
Markus F.X.J. Oberhumer 260138ba11 Silence some compilation warnings. 2011-12-12 11:30:02 +01:00
John Reiser 67f7e0089c NEWS summary in preparation for release 2011-12-06 08:22:44 -08:00
John Reiser d4a22c7851 Sync stub for amd64-darwin.macho-entry. 2011-12-06 07:03:53 -08:00
John Reiser 06cf986490 overlap unfolded stub on Mach-O amd64 [SourceForge upx-Bugs-3447184] 2011-12-02 22:01:13 -08:00
John Reiser adf9aa04ce overlap unfolded stub on Mach-O i386 [SourceForge upx-Bugs-3447184] 2011-12-02 20:51:13 -08:00
John Reiser 69f66fbe52 rebuild using broader dependencies of previous commit 2011-11-23 13:25:25 -08:00
John Reiser d061005c89 propagate dependency on i386-linux.elf-main.c by hand 2011-11-23 13:23:11 -08:00
John Reiser f6ee8b9f04 MSVC++ disallows zero-length array in struct 2011-11-23 13:05:00 -08:00
John Reiser 31af22c2ff ARM_is_QNX looks for PT_INTERP containing "ldqnx" 2011-10-16 15:04:18 -07:00
John Reiser c421e3f243 ARM stub: fix editing mistake 2011-10-16 13:40:21 -07:00
John Reiser 6e92902407 ARM_is_QNX() heuristic 2011-10-16 13:11:03 -07:00
John Reiser 6256381dc3 mmap_privanon() in stub for arm,i386,mips eases QNX 2011-10-16 11:39:46 -07:00
John Reiser b247b051ea QNX on armel (experimental) 2011-10-15 19:49:37 -07:00
Markus F.X.J. Oberhumer afbd553622 Silence some compilation warnings. 2011-08-30 03:40:53 +02:00
John Reiser 36bc14e884 fix PackMachFat::unpack for test mode ("-t"): fo==NULL 2011-07-11 14:37:40 -07:00
John Reiser 9c5d0ff2ff PeFile::processRelocs() defends itself against corrupt PE header 2011-06-08 10:06:42 -07:00
John Reiser cfa6c8ddf6 Fix ::pack3 for shared library. 2011-06-06 20:00:43 -07:00
John Reiser 21924bf022 move stub escape hatch for shared library to end of .text [glibc-2.13.90] 2011-06-02 07:18:50 -07:00
John Reiser eea33f6019 Document copy ONLY for old_dtinit, .e_shoff in compressed shared library. 2011-05-31 11:01:40 -07:00
John Reiser 66d48ae808 MH_BUNDLE enum 2011-05-30 07:22:31 -07:00
John Reiser de9b9fd0b1 more messages in PackLinuxElf32::canPack 2011-05-30 07:21:51 -07:00
John Reiser ece7384be4 fpad4 from st_size(), not from getBytesWritten() 2011-05-28 12:18:27 -07:00
John Reiser 0c052e4506 amd64 output PT_LOAD[0] ends after loader 2011-05-20 10:29:04 -07:00
John Reiser 1996a0a3d6 32-bit shared libraries on i386 only (SourceForge bug 3286178) 2011-04-14 09:39:55 -07:00
László Molnár 679ad9b8c6 fixed computing of tls data end (sf.net bug 3256788) 2011-03-29 15:49:20 +02:00
John Reiser d4983731e7 More l_info.l_lszie and .l_checksum TargetEndian. 2011-03-28 11:11:05 -07:00
John Reiser 4fec3c8f34 Merge. 2011-03-28 10:45:47 -07:00
John Reiser 836fd2565f Place loader immediately after compressed PT_LOADs, in "middle" of file.
This moves compressed gaps and debuginfo out of compressed PT_LOADs,
and fixes a bug where large debuginfo would cause first mmap
at runtime to erase the loader (SourceForge bug 3239079).
2011-03-28 10:44:23 -07:00
John Reiser 54618064a1 l_info.l_lsize and .l_checksum are TargetEndian 2011-03-28 10:14:06 -07:00
John Reiser 519e3e01ae OutputFile implements read() and readx(); beware --stdout. 2011-03-28 10:12:36 -07:00
László Molnár aec8f81358 fixed a warning (sf.net bug 3241423) 2011-03-25 12:02:22 +01:00
John Reiser c1d6bf4366 avoid .so with DT_TEXTREL; SourceForge bug 3190915 2011-02-24 09:38:17 -08:00
Markus F.X.J. Oberhumer 9bf2b79d9e Enter 2011. 2011-01-03 08:49:23 +01:00
Markus F.X.J. Oberhumer 4d98408995 Remove trailing whitespace. 2010-12-29 15:46:55 +01:00
Markus F.X.J. Oberhumer 7b466388f9 Detabify. 2010-12-29 15:46:34 +01:00
Markus F.X.J. Oberhumer b926fb3c66 Fix __cdecl syntax error. 2010-12-24 10:38:30 +01:00
László Molnár 6c8d5c0d0e replaced abort() with internal_error() (sf.net bug 3101319) 2010-12-21 10:28:36 +01:00
László Molnár 5a1d234260 merge 2010-12-21 09:40:16 +01:00
John Reiser fd6d42c297 i386-linux.shlib-init needs empty LEXECDYN (sourceforge 3101319) 2010-12-20 10:20:10 -08:00
László Molnár 7310ad6e92 align TLS callbacks to 4 byte boundary 2010-12-20 14:57:24 +01:00
László Molnár 7e47b1348d fixed a typo 2010-12-20 10:51:29 +01:00
László Molnár 1e3555a6b7 added some input validity checks (for sf.net bug 3122661) 2010-12-20 00:35:57 +01:00
László Molnár 9a67ce5968 do not skip dlls with no imports from the preprocessed import data (sf.net bug 3125753) 2010-12-19 23:22:58 +01:00
Markus F.X.J. Oberhumer 279d7955f8 Keep entries sorted in Makefiles. 2010-12-03 01:04:16 +01:00
Markus F.X.J. Oberhumer db977c0bf5 Add a .dump file to repo. 2010-11-29 15:28:35 +01:00
Markus F.X.J. Oberhumer ba6bc59818 Update .hgignore. 2010-11-29 15:28:10 +01:00
John Reiser 6e8be0578c improve PIC_STRING 2010-11-18 08:23:08 -08:00
John Reiser 92f7d16b5e more flexible labels on trace output 2010-11-18 08:22:36 -08:00
John Reiser 40bb3c2f5e better PIC_STRING for __mips__ 2010-11-17 20:45:39 -08:00
John Reiser 56a6096221 better PIC_STRING for __mips__ 2010-11-17 20:42:01 -08:00
John Reiser ee37b42a91 DEBUG for MIPS i386-linux.elf-main.c 2010-11-17 20:21:41 -08:00
John Reiser 0806e61df4 move DEBUG_STRCON adjacent to uses 2010-11-17 15:17:03 -08:00
John Reiser 279ffeeefa unify DEBUG STR_* into i386-linux.elf-main.c from *.elf-fold.S 2010-11-17 14:32:24 -08:00
John Reiser 80c5ee2479 use up4() 2010-11-17 14:28:00 -08:00
John Reiser 16208544e5 ELFOSABI_NETBSD 2010-11-17 14:27:00 -08:00
John Reiser 6afeb24fdb use brand_netbsd 2010-11-17 12:49:29 -08:00
John Reiser e6357b81eb NetBSD version 5 requires PT_NOTE for PaX. Also adjust other *BSD and PT_NOTE.
[Tested OK on FreeBSD 8.1, NetBSD 5.1, OpenBSD 4.8.  Cleanup needed.]
2010-11-16 21:13:42 -08:00
John Reiser dfc2efe8a6 make_hatch_arm() needs sys_munmap; also fix ARM div10. 2010-11-15 11:51:46 -08:00
John Reiser f28b96f431 Stand-alone tracing for ARM stub; "#define DEBUG 1" then re-compile.
https://sourceforge.net/tracker/?func=detail&atid=102331&aid=3105926&group_id=2331
2010-11-13 21:30:34 -08:00
John Reiser a10293f8f7 ARM copy .e_flags from input to output to preserve soft_FP flag, etc. 2010-11-09 11:05:55 -08:00
John Reiser b1f02f91d7 NetBSD 5.0 wants PT_NOTE and branded executables 2010-11-09 10:47:53 -08:00
Markus F.X.J. Oberhumer e76fa45d86 Small upx_sanity_check() update. 2010-11-08 23:59:34 +01:00
Markus F.X.J. Oberhumer 06f43892a5 Set sane abort() default behaviour when using msvcrt. 2010-11-08 20:48:50 +01:00
Markus F.X.J. Oberhumer a094332b0d Silence some compilation warnings. 2010-10-23 11:40:41 +02:00
Markus F.X.J. Oberhumer 7b8779f534 Portability updates. 2010-10-20 01:46:38 +02:00
Markus F.X.J. Oberhumer 371bf20d19 New ACC version. 2010-10-17 10:10:23 +02:00
Markus F.X.J. Oberhumer 0f633ddd15 Bump version for next release. 2010-09-08 18:04:39 +02:00
Markus F.X.J. Oberhumer 7886ca7f5f Add tag for RELEASE_307. 2010-09-08 15:07:00 +00:00
Markus F.X.J. Oberhumer 9b4c11954d Prepare release. 2010-09-08 16:56:49 +02:00
László Molnár a1b724f30a NEWS updated 2010-09-08 16:02:04 +02:00
László Molnár 7c3b2fb9cc relocation entry for TLS callbacks is only needed when we do have TLS callbacks 2010-09-08 15:06:56 +02:00
Markus F.X.J. Oberhumer acef68d67e Bump version for next release. 2010-09-04 20:23:02 +02:00
Markus F.X.J. Oberhumer 7e393d5f1e Add tag for RELEASE_306. 2010-09-04 15:06:00 +00:00
361 changed files with 15451 additions and 11389 deletions
+3 -1
View File
@@ -42,7 +42,9 @@ src/*.ttp
stub/**MMakefile
stub/**.*-stamp
stub/tmp*/*
##stub/tmp*/*
stub/tmp*/*.{bin,bin.bindump,bin.disasm,d,map,o,o.disasm}
stub/tmp*/mips{,el}.r3000-*.{i,s}
stub/**/tmp*/*
stub/tools/armpe/armpe_tester{,.exe,.out}
+2
View File
@@ -7,6 +7,7 @@
396983c065fc743cb5b9703e266ca87eeff8a6ee RELEASE_291
46f3a6cca02603000fadc16637b02e30caddd909 RELEASE_302
70402aeee6e0e4fc2889658ed8cee44461c0b0a8 RELEASE_200
7c6747c82b167368344a238b1a3a87c2a4fa6a18 RELEASE_306
95c558f81a0b8d5bb2bede4c8208bb84ae7d1e58 RELEASE_303
a1c61174f54aac714f59ac20fcba839d71e64c5c RELEASE_292
a916a2fe22de45167d25abcb40008315f415221c RELEASE_201
@@ -20,3 +21,4 @@ eb1ce56dce7dd1835964362470610925963b9043 RELEASE_110
ed96891ef795bceec6b7ff3ca1ca7764431bfb39 RELEASE_191
ef9c7f2c9658d73a9b5ab2ed291483d2bbcd8bc7 RELEASE_300
efa52753e366300c0e0ebe20631adcb24ed3c15b RELEASE_293
fe7acf61147e7031fcc304aae47ca2352056815d RELEASE_307
+1 -1
View File
@@ -8,7 +8,7 @@
The Ultimate Packer for eXecutables
Copyright (c) 1996-2010 Markus Oberhumer, Laszlo Molnar & John Reiser
Copyright (c) 1996-2011 Markus Oberhumer, Laszlo Molnar & John Reiser
http://upx.sourceforge.net
+1 -1
View File
@@ -1,7 +1,7 @@
#
# UPX toplevel Makefile - needs GNU make 3.81 or better
#
# Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
#
MAKEFLAGS += -rR
+15
View File
@@ -2,6 +2,21 @@
User visible changes for UPX
==================================================================
Changes in 3.08 (12 Dec 2011):
* Fix allocation in runtime stub for darwin.macho-entry (i386 and amd64).
* Compress shared library on ELF i386 only [ld.so threatens even this case].
* Attempt to suport ELF on QNX 6.3.0 for armel (experimental).
* Better diangostic when ELF -fPIC is needed.
* PT_NOTE improvements for *BSD.
* Preserve more ELF .e_flags on ARM.
* Minor code improvements for ELF stubs
* Defend against another flavor of corrupt PE header.
* bug fixes
Changes in 3.07 (08 Sep 2010):
* win32/pe: fixed relocation handling for files with *no* TLS callbacks
[severe bug introduced in 3.06]
Changes in 3.06 (04 Sep 2010):
* win32/pe: TLS callback support contributed by Stefan Widmann. Thanks!
* bug fixes
+1 -1
View File
@@ -8,7 +8,7 @@
The Ultimate Packer for eXecutables
Copyright (c) 1996-2010 Markus Oberhumer, Laszlo Molnar & John Reiser
Copyright (c) 1996-2011 Markus Oberhumer, Laszlo Molnar & John Reiser
http://upx.sourceforge.net
+4 -4
View File
@@ -8,7 +8,7 @@
The Ultimate Packer for eXecutables
Copyright (c) 1996-2010 Markus Oberhumer, Laszlo Molnar & John Reiser
Copyright (c) 1996-2011 Markus Oberhumer, Laszlo Molnar & John Reiser
http://upx.sourceforge.net
@@ -108,9 +108,9 @@ THE FUTURE
COPYRIGHT
=========
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2000-2010 John F. Reiser
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
Copyright (C) 2000-2011 John F. Reiser
This program may be used freely, and you are welcome to
redistribute it under certain conditions.
+1 -1
View File
@@ -8,7 +8,7 @@
The Ultimate Packer for eXecutables
Copyright (c) 1996-2010 Markus Oberhumer, Laszlo Molnar & John Reiser
Copyright (c) 1996-2011 Markus Oberhumer, Laszlo Molnar & John Reiser
http://upx.sourceforge.net
+1 -1
View File
@@ -8,7 +8,7 @@
The Ultimate Packer for eXecutables
Copyright (c) 1996-2010 Markus Oberhumer, Laszlo Molnar & John Reiser
Copyright (c) 1996-2011 Markus Oberhumer, Laszlo Molnar & John Reiser
http://upx.sourceforge.net
+1 -1
View File
@@ -1,5 +1,5 @@
Decompressing ELF Directly to Memory on Linux/x86
Copyright (C) 2000-2010 John F. Reiser jreiser@BitWagon.com
Copyright (C) 2000-2011 John F. Reiser jreiser@BitWagon.com
References:
<elf.h> definitions for the ELF file format
+5 -5
View File
@@ -13,7 +13,7 @@ B<upx> S<[ I<command> ]> S<[ I<options> ]> I<filename>...
=head1 ABSTRACT
The Ultimate Packer for eXecutables
Copyright (c) 1996-2010 Markus Oberhumer, Laszlo Molnar & John Reiser
Copyright (c) 1996-2011 Markus Oberhumer, Laszlo Molnar & John Reiser
http://upx.sourceforge.net
@@ -933,13 +933,13 @@ Please report all bugs immediately to the authors.
=head1 COPYRIGHT
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Laszlo Molnar
Copyright (C) 2000-2010 John F. Reiser
Copyright (C) 2000-2011 John F. Reiser
Copyright (C) 2002-2010 Jens Medoch
Copyright (C) 2002-2011 Jens Medoch
This program may be used freely, and you are welcome to
redistribute it under certain conditions.
+1 -1
View File
@@ -1,7 +1,7 @@
#
# UPX Makefile - needs GNU make 3.81 or better
#
# Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
#
MAKEFLAGS += -rR
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -34,7 +34,7 @@ int compress_ucl_dummy = 0;
#else
#if 1 && !(UCL_USE_ASM) && (ACC_ARCH_I386)
# if (ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_MSC || ACC_CC_WATCOMC)
# if (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_MSC || ACC_CC_WATCOMC)
# define UCL_USE_ASM 1
# endif
#endif
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
+6 -6
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -326,7 +326,7 @@
#if (ACC_CC_INTELC && (__INTEL_COMPILER < 800))
#elif (0 && (ACC_ARCH_AMD64 || ACC_ARCH_I386))
#elif (ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_PATHSCALE)
#elif (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_PATHSCALE)
# define __packed_struct(s) struct s {
# define __packed_struct_end() } __attribute__((__packed__,__aligned__(1)));
#elif (ACC_CC_WATCOMC)
@@ -752,7 +752,7 @@ typedef ElfLinker Linker;
// main.cpp
extern const char *progname;
bool set_ec(int ec);
#if (ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
#if (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
void e_exit(int ec) __attribute__((__noreturn__));
#else
void e_exit(int ec);
@@ -764,7 +764,7 @@ void printSetNl(int need_nl);
void printClearLine(FILE *f = NULL);
void printErr(const char *iname, const Throwable *e);
void printUnhandledException(const char *iname, const std::exception *e);
#if (ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
#if (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
void __acc_cdecl_va printErr(const char *iname, const char *format, ...)
__attribute__((__format__(__printf__,2,3)));
void __acc_cdecl_va printWarn(const char *iname, const char *format, ...)
@@ -774,7 +774,7 @@ void __acc_cdecl_va printErr(const char *iname, const char *format, ...);
void __acc_cdecl_va printWarn(const char *iname, const char *format, ...);
#endif
#if (ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
#if (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
void __acc_cdecl_va infoWarning(const char *format, ...)
__attribute__((__format__(__printf__,1,2)));
void __acc_cdecl_va infoHeader(const char *format, ...)
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
+18 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -410,6 +410,22 @@ void OutputFile::seek(off_t off, int whence)
super::seek(off,whence);
}
int OutputFile::read(void *buf, int len)
{
InputFile infile;
infile.open(this->getName(), O_RDONLY);
infile.seek(this->tell(), SEEK_SET);
return infile.read(buf, len);
}
int OutputFile::readx(void *buf, int len)
{
InputFile infile;
infile.open(this->getName(), O_RDONLY);
infile.seek(this->tell(), SEEK_SET);
return infile.readx(buf, len);
}
void OutputFile::set_extent(off_t offset, off_t length)
{
super::set_extent(offset, length);
+4 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -141,6 +141,8 @@ public:
// FIXME - these won't work when using the '--stdout' option
virtual void seek(off_t off, int whence);
virtual void rewrite(const void *buf, int len);
virtual int read(void *buf, int len);
virtual int readx(void *buf, int len);
// util
static void dump(const char *name, const void *buf, int len, int flags=-1);
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2000-2010 John F. Reiser
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
Copyright (C) 2000-2011 John F. Reiser
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2000-2010 John F. Reiser
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
Copyright (C) 2000-2011 John F. Reiser
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2000-2010 John F. Reiser
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
Copyright (C) 2000-2011 John F. Reiser
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2004-2010 John F. Reiser
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
Copyright (C) 2004-2011 John F. Reiser
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
+6 -6
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -400,10 +400,10 @@ void show_version(int x)
if (v != NULL && v[0])
fprintf(fp, "LZMA SDK version %s\n", v);
#endif
fprintf(fp, "Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer\n");
fprintf(fp, "Copyright (C) 1996-2010 Laszlo Molnar\n");
fprintf(fp, "Copyright (C) 2000-2010 John F. Reiser\n");
fprintf(fp, "Copyright (C) 2002-2010 Jens Medoch\n");
fprintf(fp, "Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer\n");
fprintf(fp, "Copyright (C) 1996-2011 Laszlo Molnar\n");
fprintf(fp, "Copyright (C) 2000-2011 John F. Reiser\n");
fprintf(fp, "Copyright (C) 2002-2011 Jens Medoch\n");
#if (WITH_ZLIB)
fprintf(fp, "Copyright (C) 1995" "-2005 Jean-loup Gailly and Mark Adler\n");
#endif
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
+39 -59
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -45,6 +45,18 @@ static bool update_capacity(unsigned size, unsigned *capacity)
return true;
}
static void __acc_cdecl_va internal_error(const char *format, ...)
{
char buf[1024];
va_list ap;
va_start(ap, format);
vsnprintf(buf, sizeof(buf), format, ap);
va_end(ap);
throwInternalError(buf);
}
/*************************************************************************
// Section
@@ -317,10 +329,7 @@ ElfLinker::Section *ElfLinker::findSection(const char *name, bool fatal) const
if (strcmp(sections[ic]->name, name) == 0)
return sections[ic];
if (fatal)
{
printf("unknown section %s\n", name);
abort();
}
internal_error("unknown section %s\n", name);
return NULL;
}
@@ -330,10 +339,7 @@ ElfLinker::Symbol *ElfLinker::findSymbol(const char *name, bool fatal) const
if (strcmp(symbols[ic]->name, name) == 0)
return symbols[ic];
if (fatal)
{
printf("unknown symbol %s\n", name);
abort();
}
internal_error("unknown symbol %s\n", name);
return NULL;
}
@@ -492,7 +498,7 @@ void ElfLinker::relocate()
for (unsigned ic = 0; ic < nrelocations; ic++)
{
const Relocation *rel = relocations[ic];
unsigned value;
unsigned value = 0;
if (rel->section->output == NULL)
continue;
@@ -502,17 +508,11 @@ void ElfLinker::relocate()
}
else if (strcmp(rel->value->section->name, "*UND*") == 0 &&
rel->value->offset == 0xdeaddead)
{
printf("undefined symbol '%s' referenced\n", rel->value->name);
abort();
}
internal_error("undefined symbol '%s' referenced\n", rel->value->name);
else if (rel->value->section->output == NULL)
{
printf("can not apply reloc '%s:%x' without section '%s'\n",
rel->section->name, rel->offset,
rel->value->section->name);
abort();
}
internal_error("can not apply reloc '%s:%x' without section '%s'\n",
rel->section->name, rel->offset,
rel->value->section->name);
else
{
value = rel->value->section->offset +
@@ -529,10 +529,7 @@ void ElfLinker::defineSymbol(const char *name, unsigned value)
{
Symbol *symbol = findSymbol(name);
if (strcmp(symbol->section->name, "*ABS*") == 0)
{
printf("defineSymbol: symbol '%s' is *ABS*\n", name);
abort();
}
internal_error("defineSymbol: symbol '%s' is *ABS*\n", name);
else if (strcmp(symbol->section->name, "*UND*") == 0) // for undefined symbols
symbol->offset = value;
else if (strcmp(symbol->section->name, name) == 0) // for sections
@@ -545,10 +542,7 @@ void ElfLinker::defineSymbol(const char *name, unsigned value)
}
}
else
{
printf("defineSymbol: symbol '%s' already defined\n", name);
abort();
}
internal_error("defineSymbol: symbol '%s' already defined\n", name);
}
// debugging support
@@ -602,8 +596,7 @@ void ElfLinker::alignWithByte(unsigned len, unsigned char b)
void ElfLinker::relocate1(const Relocation *rel, upx_byte *,
unsigned, const char *)
{
printf("unknown relocation type '%s\n", rel->type);
abort();
internal_error("unknown relocation type '%s\n", rel->type);
}
@@ -616,16 +609,12 @@ void ElfLinker::relocate1(const Relocation *rel, upx_byte *,
#if 0 // FIXME
static void check8(const Relocation *rel, const upx_byte *location, int v, int d)
{
if (v < -128 || v > 127) {
printf("value out of range (%d) in reloc %s:%x\n",
v, rel->section->name, rel->offset);
abort();
}
if (d < -128 || d > 127) {
printf("displacement target out of range (%d) in reloc %s:%x\n",
v, rel->section->name, rel->offset);
abort();
}
if (v < -128 || v > 127)
internal_error("value out of range (%d) in reloc %s:%x\n",
v, rel->section->name, rel->offset);
if (d < -128 || d > 127)
internal_error("displacement target out of range (%d) in reloc %s:%x\n",
v, rel->section->name, rel->offset);
}
#endif
@@ -651,11 +640,8 @@ void ElfLinkerAMD64::relocate1(const Relocation *rel, upx_byte *location,
int displ = (signed char) *location + (int) value;
#endif
if (displ < -128 || displ > 127)
{
printf("target out of range (%d) in reloc %s:%x\n",
displ, rel->section->name, rel->offset);
abort();
}
internal_error("target out of range (%d) in reloc %s:%x\n",
displ, rel->section->name, rel->offset);
*location += value;
}
else if (strcmp(type, "16") == 0)
@@ -857,19 +843,15 @@ void ElfLinkerPpc32::relocate1(const Relocation *rel, upx_byte *location,
// Note that original (*location).displ is ignored.
if (strcmp(type, "24") == 0) {
if (3& value) {
printf("unaligned word diplacement");
abort();
}
if (3& value)
internal_error("unaligned word diplacement");
// FIXME: displacment overflow?
set_be32(location, (0xfc000003 & get_be32(location)) +
(0x03fffffc & value));
}
else if (strcmp(type, "14") == 0) {
if (3& value) {
printf("unaligned word diplacement");
abort();
}
if (3& value)
internal_error("unaligned word diplacement");
// FIXME: displacment overflow?
set_be32(location, (0xffff0003 & get_be32(location)) +
(0x0000fffc & value));
@@ -901,11 +883,9 @@ void ElfLinkerX86::relocate1(const Relocation *rel, upx_byte *location,
#else
int displ = (signed char) *location + (int) value;
#endif
if (range_check && (displ < -128 || displ > 127)) {
printf("target out of range (%d,%d,%d) in reloc %s:%x\n",
displ, *location, value, rel->section->name, rel->offset);
abort();
}
if (range_check && (displ < -128 || displ > 127))
internal_error("target out of range (%d,%d,%d) in reloc %s:%x\n",
displ, *location, value, rel->section->name, rel->offset);
*location += value;
}
else if (strcmp(type, "16") == 0)
+3 -3
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -84,7 +84,7 @@ public:
//virtual void setLoaderAlignOffset(int phase);
virtual int addLoader(const char *sname);
void addLoader(const char *s, va_list ap);
#if 1 && (ACC_CC_GNUC >= 0x040100)
#if 1 && (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x040100))
void __acc_cdecl_va addLoaderVA(const char *s, ...) __attribute__((__sentinel__));
#else
void __acc_cdecl_va addLoaderVA(const char *s, ...);
+10 -3
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -1285,9 +1285,13 @@ static bool test(void)
COMPILE_TIME_ASSERT_ALIGNED1(test2_t)
COMPILE_TIME_ASSERT(sizeof(t2) == 7 + 21*sizeof(T))
#if defined(__acc_alignof)
#if (ACC_CC_CLANG && ACC_ARCH_AMD64)
// CBUG: clang-2.8 bug in 64-bit mode
#else
COMPILE_TIME_ASSERT(__acc_alignof(t1) == 1)
COMPILE_TIME_ASSERT(__acc_alignof(t2) == 1)
#endif
#endif
#if 1 && (ACC_CC_WATCOMC)
test1_t t11; COMPILE_TIME_ASSERT(sizeof(t11.a) <= sizeof(t11.b))
test2_t t22; COMPILE_TIME_ASSERT(sizeof(t22.a) <= sizeof(t22.b))
@@ -1366,7 +1370,7 @@ void upx_sanity_check(void)
assert(TestBELE<BE64>::test());
{
static const unsigned char dd[32]
#if 1 && (ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_PATHSCALE) && defined(__ELF__)
#if 1 && (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_PATHSCALE) && defined(__ELF__)
__attribute__((__aligned__(16)))
#endif
= { 0, 0, 0, 0, 0, 0, 0,
@@ -1434,6 +1438,9 @@ int __acc_cdecl_main main(int argc, char *argv[])
#if 0 && defined(__DJGPP__)
// LFN=n may cause problems with 2.03's _rename and mkdir under WinME
putenv("LFN=y");
#endif
#if (ACC_OS_WIN32 || ACC_OS_WIN64) && (ACC_CC_MSC) && defined(_WRITE_ABORT_MSG) && defined(_CALL_REPORTFAULT)
_set_abort_behavior(_WRITE_ABORT_MSG, _WRITE_ABORT_MSG | _CALL_REPORTFAULT);
#endif
acc_wildargv(&argc, &argv);
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
+103 -92
View File
@@ -41,7 +41,7 @@
#ifndef __ACC_H_INCLUDED
#define __ACC_H_INCLUDED 1
#define ACC_VERSION 20100808L
#define ACC_VERSION 20101017L
#if defined(__CYGWIN32__) && !defined(__CYGWIN__)
# define __CYGWIN__ __CYGWIN32__
#endif
@@ -553,12 +553,27 @@
# define ACC_CC_PELLESC 1
# define ACC_INFO_CC "Pelles C"
# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__POCC__)
#elif defined(__llvm__) && defined(__GNUC__) && defined(__VERSION__)
# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
# define ACC_CC_LLVM (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
#elif defined(__clang__) && defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
# if defined(__GNUC_PATCHLEVEL__)
# define ACC_CC_CLANG_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
# else
# define ACC_CC_LLVM (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
# define ACC_CC_CLANG_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
# endif
# if defined(__clang_major__) && defined(__clang_minor__) && defined(__clang_patchlevel__)
# define ACC_CC_CLANG_CLANG (__clang_major__ * 0x10000L + __clang_minor__ * 0x100 + __clang_patchlevel__)
# else
# define ACC_CC_CLANG_CLANG 0x020700L
# endif
# define ACC_CC_CLANG ACC_CC_CLANG_GNUC
# define ACC_INFO_CC "clang"
# define ACC_INFO_CCVER __VERSION__
#elif defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
# if defined(__GNUC_PATCHLEVEL__)
# define ACC_CC_LLVM_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
# else
# define ACC_CC_LLVM_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
# endif
# define ACC_CC_LLVM ACC_CC_LLVM_GNUC
# define ACC_INFO_CC "llvm-gcc"
# define ACC_INFO_CCVER __VERSION__
#elif defined(__GNUC__) && defined(__VERSION__)
@@ -1175,7 +1190,7 @@ extern "C" {
#if (ACC_ARCH_I086 && ACC_CC_DMC)
#elif (ACC_CC_CILLY) && defined(__GNUC__)
# define ACC_SIZEOF_LONG_LONG 8
#elif (ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
#elif (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define ACC_SIZEOF_LONG_LONG 8
#elif ((ACC_OS_WIN32 || ACC_OS_WIN64 || defined(_WIN32)) && ACC_CC_MSC && (_MSC_VER >= 1400))
# define ACC_SIZEOF_LONG_LONG 8
@@ -1418,17 +1433,17 @@ extern "C" {
#if !defined(__acc_gnuc_extension__)
#if (ACC_CC_GNUC >= 0x020800ul)
# define __acc_gnuc_extension__ __extension__
#elif (ACC_CC_LLVM || ACC_CC_PATHSCALE)
#elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define __acc_gnuc_extension__ __extension__
#else
# define __acc_gnuc_extension__
# define __acc_gnuc_extension__ /*empty*/
#endif
#endif
#if !defined(__acc_ua_volatile)
# define __acc_ua_volatile volatile
#endif
#if !defined(__acc_alignof)
#if (ACC_CC_CILLY || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE || ACC_CC_PGI)
#if (ACC_CC_CILLY || ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE || ACC_CC_PGI)
# define __acc_alignof(e) __alignof__(e)
#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 700))
# define __acc_alignof(e) __alignof__(e)
@@ -1446,7 +1461,7 @@ extern "C" {
# define __acc_constructor __attribute__((__constructor__,__used__))
#elif (ACC_CC_GNUC >= 0x020700ul)
# define __acc_constructor __attribute__((__constructor__))
#elif (ACC_CC_LLVM || ACC_CC_PATHSCALE)
#elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define __acc_constructor __attribute__((__constructor__))
#endif
#endif
@@ -1458,7 +1473,7 @@ extern "C" {
# define __acc_destructor __attribute__((__destructor__,__used__))
#elif (ACC_CC_GNUC >= 0x020700ul)
# define __acc_destructor __attribute__((__destructor__))
#elif (ACC_CC_LLVM || ACC_CC_PATHSCALE)
#elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define __acc_destructor __attribute__((__destructor__))
#endif
#endif
@@ -1474,7 +1489,7 @@ extern "C" {
# define __acc_inline inline
#elif (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0550))
# define __acc_inline __inline
#elif (ACC_CC_CILLY || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE || ACC_CC_PGI)
#elif (ACC_CC_CILLY || ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE || ACC_CC_PGI)
# define __acc_inline __inline__
#elif (ACC_CC_DMC)
# define __acc_inline __inline
@@ -1493,7 +1508,7 @@ extern "C" {
#if defined(__acc_inline)
# define __acc_HAVE_inline 1
#else
# define __acc_inline
# define __acc_inline /*empty*/
#endif
#if !defined(__acc_forceinline)
#if (ACC_CC_GNUC >= 0x030200ul)
@@ -1502,7 +1517,7 @@ extern "C" {
# define __acc_forceinline __forceinline
#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 800) && ACC_CC_SYNTAX_GNUC)
# define __acc_forceinline __inline__ __attribute__((__always_inline__))
#elif (ACC_CC_LLVM || ACC_CC_PATHSCALE)
#elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define __acc_forceinline __inline__ __attribute__((__always_inline__))
#elif (ACC_CC_MSC && (_MSC_VER >= 1200))
# define __acc_forceinline __forceinline
@@ -1513,7 +1528,7 @@ extern "C" {
#if defined(__acc_forceinline)
# define __acc_HAVE_forceinline 1
#else
# define __acc_forceinline
# define __acc_forceinline /*empty*/
#endif
#if !defined(__acc_noinline)
#if 1 && (ACC_ARCH_I386) && (ACC_CC_GNUC >= 0x040000ul) && (ACC_CC_GNUC < 0x040003ul)
@@ -1524,7 +1539,7 @@ extern "C" {
# define __acc_noinline __declspec(noinline)
#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 800) && ACC_CC_SYNTAX_GNUC)
# define __acc_noinline __attribute__((__noinline__))
#elif (ACC_CC_LLVM || ACC_CC_PATHSCALE)
#elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define __acc_noinline __attribute__((__noinline__))
#elif (ACC_CC_MSC && (_MSC_VER >= 1300))
# define __acc_noinline __declspec(noinline)
@@ -1540,7 +1555,7 @@ extern "C" {
#if defined(__acc_noinline)
# define __acc_HAVE_noinline 1
#else
# define __acc_noinline
# define __acc_noinline /*empty*/
#endif
#if (__acc_HAVE_forceinline || __acc_HAVE_noinline) && !(__acc_HAVE_inline)
# error "this should not happen"
@@ -1552,7 +1567,7 @@ extern "C" {
# define __acc_noreturn __declspec(noreturn)
#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 600) && ACC_CC_SYNTAX_GNUC)
# define __acc_noreturn __attribute__((__noreturn__))
#elif (ACC_CC_LLVM || ACC_CC_PATHSCALE)
#elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define __acc_noreturn __attribute__((__noreturn__))
#elif (ACC_CC_MSC && (_MSC_VER >= 1200))
# define __acc_noreturn __declspec(noreturn)
@@ -1561,7 +1576,7 @@ extern "C" {
#if defined(__acc_noreturn)
# define __acc_HAVE_noreturn 1
#else
# define __acc_noreturn
# define __acc_noreturn /*empty*/
#endif
#if !defined(__acc_nothrow)
#if (ACC_CC_GNUC >= 0x030300ul)
@@ -1570,7 +1585,7 @@ extern "C" {
# define __acc_nothrow __declspec(nothrow)
#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 900) && ACC_CC_SYNTAX_GNUC)
# define __acc_nothrow __attribute__((__nothrow__))
#elif (ACC_CC_LLVM || ACC_CC_PATHSCALE)
#elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define __acc_nothrow __attribute__((__nothrow__))
#elif (ACC_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus)
# define __acc_nothrow __declspec(nothrow)
@@ -1579,14 +1594,14 @@ extern "C" {
#if defined(__acc_nothrow)
# define __acc_HAVE_nothrow 1
#else
# define __acc_nothrow
# define __acc_nothrow /*empty*/
#endif
#if !defined(__acc_restrict)
#if (ACC_CC_GNUC >= 0x030400ul)
# define __acc_restrict __restrict__
#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 600) && ACC_CC_SYNTAX_GNUC)
# define __acc_restrict __restrict__
#elif (ACC_CC_LLVM)
#elif (ACC_CC_CLANG || ACC_CC_LLVM)
# define __acc_restrict __restrict__
#elif (ACC_CC_MSC && (_MSC_VER >= 1400))
# define __acc_restrict __restrict
@@ -1595,7 +1610,7 @@ extern "C" {
#if defined(__acc_restrict)
# define __acc_HAVE_restrict 1
#else
# define __acc_restrict
# define __acc_restrict /*empty*/
#endif
#if !defined(__acc_likely) && !defined(__acc_unlikely)
#if (ACC_CC_GNUC >= 0x030200ul)
@@ -1604,7 +1619,7 @@ extern "C" {
#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 800))
# define __acc_likely(e) (__builtin_expect(!!(e),1))
# define __acc_unlikely(e) (__builtin_expect(!!(e),0))
#elif (ACC_CC_LLVM || ACC_CC_PATHSCALE)
#elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define __acc_likely(e) (__builtin_expect(!!(e),1))
# define __acc_unlikely(e) (__builtin_expect(!!(e),0))
#endif
@@ -1624,7 +1639,7 @@ extern "C" {
# define ACC_UNUSED(var) ((void) &var)
# elif (ACC_CC_BORLANDC || ACC_CC_HIGHC || ACC_CC_NDPC || ACC_CC_PELLESC || ACC_CC_TURBOC)
# define ACC_UNUSED(var) if (&var) ; else
# elif (ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# elif (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define ACC_UNUSED(var) ((void) var)
# elif (ACC_CC_MSC && (_MSC_VER < 900))
# define ACC_UNUSED(var) if (&var) ; else
@@ -1643,7 +1658,7 @@ extern "C" {
# define ACC_UNUSED_FUNC(func) ((void) func)
# elif (ACC_CC_BORLANDC || ACC_CC_NDPC || ACC_CC_TURBOC)
# define ACC_UNUSED_FUNC(func) if (func) ; else
# elif (ACC_CC_LLVM)
# elif (ACC_CC_CLANG || ACC_CC_LLVM)
# define ACC_UNUSED_FUNC(func) ((void) &func)
# elif (ACC_CC_MSC && (_MSC_VER < 900))
# define ACC_UNUSED_FUNC(func) if (func) ; else
@@ -1658,7 +1673,7 @@ extern "C" {
#if !defined(ACC_UNUSED_LABEL)
# if (ACC_CC_WATCOMC) && defined(__cplusplus)
# define ACC_UNUSED_LABEL(l) switch(0) case 1:goto l
# elif (ACC_CC_INTELC || ACC_CC_WATCOMC)
# elif (ACC_CC_CLANG || ACC_CC_INTELC || ACC_CC_WATCOMC)
# define ACC_UNUSED_LABEL(l) if (0) goto l
# else
# define ACC_UNUSED_LABEL(l) switch(0) case 1:goto l
@@ -1676,7 +1691,7 @@ extern "C" {
#if !defined(ACC_UNCONST_CAST)
# if 0 && defined(__cplusplus)
# define ACC_UNCONST_CAST(t,e) (const_cast<t> (e))
# elif (ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# elif (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define ACC_UNCONST_CAST(t,e) ((t) ((void *) ((char *) ((acc_uintptr_t) ((const void *) (e))))))
# else
# define ACC_UNCONST_CAST(t,e) ((t) ((void *) ((char *) ((const void *) (e)))))
@@ -1710,7 +1725,7 @@ extern "C" {
# if (ACC_CC_GNUC || ACC_CC_HIGHC || ACC_CC_NDPC || ACC_CC_PACIFICC)
# elif (ACC_CC_DMC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC)
# define __acc_cdecl __cdecl
# define __acc_cdecl_atexit
# define __acc_cdecl_atexit /*empty*/
# define __acc_cdecl_main __cdecl
# if (ACC_OS_OS2 && (ACC_CC_DMC || ACC_CC_SYMANTECC))
# define __acc_cdecl_qsort __pascal
@@ -1751,19 +1766,19 @@ extern "C" {
# define __acc_cdecl cdecl
#endif
#if !defined(__acc_cdecl)
# define __acc_cdecl
# define __acc_cdecl /*empty*/
#endif
#if !defined(__acc_cdecl_atexit)
# define __acc_cdecl_atexit
# define __acc_cdecl_atexit /*empty*/
#endif
#if !defined(__acc_cdecl_main)
# define __acc_cdecl_main
# define __acc_cdecl_main /*empty*/
#endif
#if !defined(__acc_cdecl_qsort)
# define __acc_cdecl_qsort
# define __acc_cdecl_qsort /*empty*/
#endif
#if !defined(__acc_cdecl_sighandler)
# define __acc_cdecl_sighandler
# define __acc_cdecl_sighandler /*empty*/
#endif
#if !defined(__acc_cdecl_va)
# define __acc_cdecl_va __acc_cdecl
@@ -1847,9 +1862,9 @@ extern "C" {
#elif (ACC_ARCH_I386 && (ACC_OS_DOS32 || ACC_OS_WIN32) && (ACC_CC_DMC || ACC_CC_INTELC || ACC_CC_MSC || ACC_CC_PELLESC))
# define ACC_ASM_SYNTAX_MSC 1
#elif (ACC_OS_WIN64 && (ACC_CC_DMC || ACC_CC_INTELC || ACC_CC_MSC || ACC_CC_PELLESC))
#elif (ACC_ARCH_I386 && (ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_PATHSCALE))
#elif (ACC_ARCH_I386 && (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_PATHSCALE))
# define ACC_ASM_SYNTAX_GNUC 1
#elif (ACC_ARCH_AMD64 && (ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_PATHSCALE))
#elif (ACC_ARCH_AMD64 && (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_PATHSCALE))
# define ACC_ASM_SYNTAX_GNUC 1
#endif
#if (ACC_ASM_SYNTAX_GNUC)
@@ -2533,7 +2548,7 @@ __acc_gnuc_extension__ typedef unsigned long long acc_ullong_t;
#elif (ACC_SIZEOF_SHORT == 2)
# define acc_int16e_t short int
# define acc_uint16e_t unsigned short int
#elif 1 && !(ACC_CFG_TYPE_NO_MODE_HI) && (ACC_CC_GNUC >= 0x025f00ul || ACC_CC_LLVM)
#elif 1 && !(ACC_CFG_TYPE_NO_MODE_HI) && (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x025f00ul) || ACC_CC_LLVM)
typedef int __acc_int16e_hi_t __attribute__((__mode__(__HI__)));
typedef unsigned int __acc_uint16e_hi_t __attribute__((__mode__(__HI__)));
# define acc_int16e_t __acc_int16e_hi_t
@@ -2560,7 +2575,7 @@ __acc_gnuc_extension__ typedef unsigned long long acc_ullong_t;
#elif (ACC_SIZEOF_LONG_LONG == 4)
# define acc_int32e_t acc_llong_t
# define acc_uint32e_t acc_ullong_t
#elif 1 && !(ACC_CFG_TYPE_NO_MODE_SI) && (ACC_CC_GNUC >= 0x025f00ul || ACC_CC_LLVM) && (__INT_MAX__+0 > 2147483647L)
#elif 1 && !(ACC_CFG_TYPE_NO_MODE_SI) && (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x025f00ul) || ACC_CC_LLVM) && (__INT_MAX__+0 > 2147483647L)
typedef int __acc_int32e_si_t __attribute__((__mode__(__SI__)));
typedef unsigned int __acc_uint32e_si_t __attribute__((__mode__(__SI__)));
# define acc_int32e_t __acc_int32e_si_t
@@ -2961,7 +2976,7 @@ __acc_gnuc_extension__ typedef unsigned long long acc_ullong_t;
#elif (ACC_SIZEOF_SHORT == 2)
# define acc_int16e_t short int
# define acc_uint16e_t unsigned short int
#elif 1 && !(ACC_CFG_TYPE_NO_MODE_HI) && (ACC_CC_GNUC >= 0x025f00ul || ACC_CC_LLVM)
#elif 1 && !(ACC_CFG_TYPE_NO_MODE_HI) && (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x025f00ul) || ACC_CC_LLVM)
typedef int __acc_int16e_hi_t __attribute__((__mode__(__HI__)));
typedef unsigned int __acc_uint16e_hi_t __attribute__((__mode__(__HI__)));
# define acc_int16e_t __acc_int16e_hi_t
@@ -2988,7 +3003,7 @@ __acc_gnuc_extension__ typedef unsigned long long acc_ullong_t;
#elif (ACC_SIZEOF_LONG_LONG == 4)
# define acc_int32e_t acc_llong_t
# define acc_uint32e_t acc_ullong_t
#elif 1 && !(ACC_CFG_TYPE_NO_MODE_SI) && (ACC_CC_GNUC >= 0x025f00ul || ACC_CC_LLVM) && (__INT_MAX__+0 > 2147483647L)
#elif 1 && !(ACC_CFG_TYPE_NO_MODE_SI) && (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x025f00ul) || ACC_CC_LLVM) && (__INT_MAX__+0 > 2147483647L)
typedef int __acc_int32e_si_t __attribute__((__mode__(__SI__)));
typedef unsigned int __acc_uint32e_si_t __attribute__((__mode__(__SI__)));
# define acc_int32e_t __acc_int32e_si_t
@@ -3642,9 +3657,9 @@ typedef unsigned short wchar_t;
# endif
#endif
#if !defined(__ACCLIB_CONST_CAST_RETURN)
#if 1 && (ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
#if 1 && (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define __ACCLIB_CONST_CAST_RETURN(type,var) return (type) (acc_uintptr_t) (var);
#elif (ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
#elif (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define __ACCLIB_CONST_CAST_RETURN(type,var) \
{ union { type a; const type b; } u; u.b = (var); return u.a; }
#else
@@ -4166,7 +4181,7 @@ ACCLIB_EXTERN(int, acc_spawnve) (int mode, const char* fn, const char* const * a
# define ACC_CXX_NOTHROW throw()
#endif
#if !defined(ACC_CXX_NOTHROW)
# define ACC_CXX_NOTHROW
# define ACC_CXX_NOTHROW /*empty*/
#endif
#if defined(__ACC_CXX_DO_NEW)
#elif (ACC_CC_NDPC || ACC_CC_PGI)
@@ -4203,7 +4218,7 @@ ACCLIB_EXTERN(int, acc_spawnve) (int mode, const char* fn, const char* const * a
# define __ACC_CXX_HAVE_PLACEMENT_DELETE 1
# elif (ACC_CC_MSC && (_MSC_VER >= 1200))
# define __ACC_CXX_HAVE_PLACEMENT_DELETE 1
# elif (ACC_CC_LLVM || ACC_CC_PATHSCALE)
# elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define __ACC_CXX_HAVE_PLACEMENT_DELETE 1
# elif (ACC_CC_PGI)
# define __ACC_CXX_HAVE_PLACEMENT_DELETE 1
@@ -4926,13 +4941,13 @@ ACCLIB_PUBLIC(void, acc_ua_set_le64) (acc_hvoid_p p, acc_uint64l_t v)
#if !defined(ACCLIB_PUBLIC_NOINLINE)
# if !defined(__acc_noinline)
# define ACCLIB_PUBLIC_NOINLINE(r,f) r __ACCLIB_FUNCNAME(f)
# elif (ACC_CC_GNUC >= 0x030400ul) || (ACC_CC_LLVM)
# elif (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x030400ul) || ACC_CC_LLVM)
# define ACCLIB_PUBLIC_NOINLINE(r,f) __acc_noinline __attribute__((__used__)) r __ACCLIB_FUNCNAME(f)
# else
# define ACCLIB_PUBLIC_NOINLINE(r,f) __acc_noinline r __ACCLIB_FUNCNAME(f)
# endif
#endif
#if (ACC_CC_GNUC >= 0x030400ul) || (ACC_CC_LLVM)
#if (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x030400ul) || ACC_CC_LLVM)
extern void* volatile __acc_vget_ptr;
void* volatile __attribute__((__used__)) __acc_vget_ptr = (void *) 0;
#else
@@ -5151,12 +5166,12 @@ ACCLIB_PUBLIC(acc_uint32l_t, acc_randmt_r32) (acc_randmt_p r)
{
acc_uint32l_t v;
if __acc_unlikely(r->n == 624) {
int i = 0, j;
unsigned i = 0, j;
r->n = 0;
do {
j = i - 623; if (j < 0) j += 624;
j = i - 623; if ((int) j < 0) j += 624;
v = (r->s[i] & ACC_UINT32_C(0x80000000)) ^ (r->s[j] & ACC_UINT32_C(0x7fffffff));
j = i - 227; if (j < 0) j += 624;
j = i - 227; if ((int) j < 0) j += 624;
r->s[i] = r->s[j] ^ (v >> 1);
if (v & 1) r->s[i] ^= ACC_UINT32_C(0x9908b0df);
} while (++i != 624);
@@ -5189,12 +5204,12 @@ ACCLIB_PUBLIC(acc_uint64l_t, acc_randmt64_r64) (acc_randmt64_p r)
{
acc_uint64l_t v;
if __acc_unlikely(r->n == 312) {
int i = 0, j;
unsigned i = 0, j;
r->n = 0;
do {
j = i - 311; if (j < 0) j += 312;
j = i - 311; if ((int) j < 0) j += 312;
v = (r->s[i] & ACC_UINT64_C(0xffffffff80000000)) ^ (r->s[j] & ACC_UINT64_C(0x7fffffff));
j = i - 156; if (j < 0) j += 312;
j = i - 156; if ((int) j < 0) j += 312;
r->s[i] = r->s[j] ^ (v >> 1);
if (v & 1) r->s[i] ^= ACC_UINT64_C(0xb5026f5aa96619e9);
} while (++i != 312);
@@ -5372,7 +5387,7 @@ static int __ACCLIB_FUNCNAME(acc_getopt_perror) (acc_getopt_p g, int ret, const
{
if (g->opterr)
{
#if HAVE_STDARG_H
#if (HAVE_STDARG_H)
struct { va_list ap; } s;
va_start(s.ap, f);
g->opterr(g, f, &s);
@@ -5425,70 +5440,66 @@ ACCLIB_PUBLIC(int, acc_getopt) (acc_getopt_p g,
a = g->argv[g->optind];
if (a[0] == '-' && a[1] == '-')
{
char* arg;
size_t a_len, i;
size_t l = 0;
const acc_getopt_longopt_p o;
const acc_getopt_longopt_p o1 = NULL;
const acc_getopt_longopt_p o2 = NULL;
int need_exact = 0;
const acc_getopt_longopt_p lo = NULL;
const acc_getopt_longopt_p l2 = NULL;
++g->optind;
if (!a[2])
goto acc_label_eof;
for (a += 2, arg = a; arg[0] && arg[0] != '=' && arg[0] != '#'; )
++arg;
a_len = (size_t) (arg - a);
for (i = 0; a_len && longopts && longopts[i].name; ++i)
for (a += 2; a[l] && a[l] != '=' && a[l] != '#'; )
++l;
for (o = longopts; l && o && o->name; ++o)
{
if (strncmp(a, longopts[i].name, a_len) != 0)
if (strncmp(a, o->name, l) != 0)
continue;
if (!longopts[i].name[a_len])
{
lo = &longopts[i];
goto acc_label_found_lo;
}
need_exact |= longopts[i].has_arg & ACC_GETOPT_EXACT_ARG;
if (lo)
l2 = &longopts[i];
else
lo = &longopts[i];
if (!o->name[l])
goto acc_label_found_o;
need_exact |= o->has_arg & ACC_GETOPT_EXACT_ARG;
if (o1) o2 = o;
else o1 = o;
}
if (!lo || need_exact)
if (!o1 || need_exact)
return pe(g, g->bad_option, "unrecognized option '--%s'", a);
if (l2)
return pe(g, g->bad_option, "option '--%s' is ambiguous (could be '--%s' or '--%s')", a, lo->name, l2->name);
acc_label_found_lo:
switch (lo->has_arg & 0x2f)
if (o2)
return pe(g, g->bad_option, "option '--%s' is ambiguous (could be '--%s' or '--%s')", a, o1->name, o2->name);
o = o1;
acc_label_found_o:
a += l;
switch (o->has_arg & 0x2f)
{
case ACC_GETOPT_OPTIONAL_ARG:
if (arg[0])
g->optarg = arg + 1;
if (a[0])
g->optarg = a + 1;
break;
case ACC_GETOPT_REQUIRED_ARG:
if (arg[0])
g->optarg = arg + 1;
if (a[0])
g->optarg = a + 1;
else if (g->optind < g->argc)
g->optarg = g->argv[g->optind++];
if (!g->optarg)
return pe(g, missing_arg_ret, "option '--%s' requires an argument", lo->name);
return pe(g, missing_arg_ret, "option '--%s' requires an argument", o->name);
break;
case ACC_GETOPT_REQUIRED_ARG | 0x20:
if (arg[0] && arg[1])
g->optarg = arg + 1;
if (a[0] && a[1])
g->optarg = a + 1;
if (!g->optarg)
return pe(g, missing_arg_ret, "option '--%s=' requires an argument", lo->name);
return pe(g, missing_arg_ret, "option '--%s=' requires an argument", o->name);
break;
default:
if (arg[0])
return pe(g, g->bad_option, "option '--%s' doesn't allow an argument", lo->name);
if (a[0])
return pe(g, g->bad_option, "option '--%s' doesn't allow an argument", o->name);
break;
}
if (longind)
*longind = (int) (lo - longopts);
if (lo->flag)
*longind = (int) (o - longopts);
if (o->flag)
{
*lo->flag = lo->val;
*o->flag = o->val;
return 0;
}
return lo->val;
return o->val;
}
if (a[0] == '-' && a[1])
{
@@ -6534,7 +6545,7 @@ ACCLIB_PUBLIC(int, acc_uclock_flush_cpu_cache) (acc_uclock_handle_p h, unsigned
#if !defined(ACCLIB_PUBLIC_NOINLINE)
# if !defined(__acc_noinline)
# define ACCLIB_PUBLIC_NOINLINE(r,f) r __ACCLIB_FUNCNAME(f)
# elif (ACC_CC_GNUC >= 0x030400ul) || (ACC_CC_LLVM)
# elif (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x030400ul) || ACC_CC_LLVM)
# define ACCLIB_PUBLIC_NOINLINE(r,f) __acc_noinline __attribute__((__used__)) r __ACCLIB_FUNCNAME(f)
# else
# define ACCLIB_PUBLIC_NOINLINE(r,f) __acc_noinline r __ACCLIB_FUNCNAME(f)
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
+13 -6
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -202,6 +202,7 @@ unsigned PackArmPe::processImports() // pass 1
unsigned iat;
LE32 *lookupt;
unsigned npos;
unsigned original_position;
bool isk32;
static int __acc_cdecl_qsort compare(const void *p1, const void *p2)
@@ -210,6 +211,8 @@ unsigned PackArmPe::processImports() // pass 1
const udll *u2 = * (const udll * const *) p2;
if (u1->isk32) return -1;
if (u2->isk32) return 1;
if (!*u1->lookupt) return 1;
if (!*u2->lookupt) return -1;
int rc = strcasecmp(u1->name,u2->name);
if (rc) return rc;
if (u1->ordinal) return -1;
@@ -236,11 +239,12 @@ unsigned PackArmPe::processImports() // pass 1
dlls[ic].iat = im->iat;
dlls[ic].lookupt = (LE32*) (ibuf + (im->oft ? im->oft : im->iat));
dlls[ic].npos = 0;
dlls[ic].original_position = ic;
dlls[ic].isk32 = strcasecmp(kernel32dll,dlls[ic].name) == 0;
soimport += strlen(dlls[ic].name) + 1 + 4;
for (LE32 *tarr = dlls[ic].lookupt; *tarr; tarr++)
for (IPTR_I(LE32, tarr, dlls[ic].lookupt); *tarr; tarr += 1)
{
if (*tarr & 0x80000000)
{
@@ -252,10 +256,11 @@ unsigned PackArmPe::processImports() // pass 1
}
else
{
unsigned len = strlen(ibuf + *tarr + 2);
IPTR_I(const upx_byte, n, ibuf + *tarr + 2);
unsigned len = strlen(n);
soimport += len + 1;
if (dlls[ic].shname == NULL || len < strlen (dlls[ic].shname))
dlls[ic].shname = ibuf + *tarr + 2;
dlls[ic].shname = n;
}
soimport++; // separator
}
@@ -343,8 +348,10 @@ unsigned PackArmPe::processImports() // pass 1
for (ic = 0; ic < dllnum; ic++)
{
LE32 *tarr = idlls[ic]->lookupt;
#if 0 && ENABLE_THIS_AND_UNCOMPRESSION_WILL_BREAK
if (!*tarr) // no imports from this dll
continue;
#endif
set_le32(ppi,idlls[ic]->npos);
set_le32(ppi+4,idlls[ic]->iat - rvamin);
ppi += 8;
@@ -412,7 +419,7 @@ unsigned PackArmPe::processImports() // pass 1
for (ic = 0; ic < dllnum; ic++, im++)
{
memset(im,FILLVAL,sizeof(*im));
im->dllname = ptr_diff(idlls[ic]->name,ibuf); // I only need this info
im->dllname = ptr_diff(dlls[idlls[ic]->original_position].name,ibuf);
}
}
else
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
+52 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -152,6 +152,7 @@
DT_RELENT = 19, /* Size of one Rel relocation */
DT_STRSZ = 10, /* Sizeof string table */
DT_PLTREL = 20, /* Type of reloc in PLT */
DT_TEXTREL = 22, /* Reloc might modify .text */
DT_JMPREL = 23, /* Address of PLT relocs */
DT_CHECKSUM = 0x6ffffdf8, /* Only for prelink? */
DT_GNU_HASH = 0x6ffffef5, /* GNU-style hash table */
@@ -195,6 +196,55 @@
#endif
#ifdef WANT_NHDR_ENUM
#undef WANT_NHDR_ENUM
enum { // ELF PT_NOTE types
#define ELF_NOTE_GNU_NAME "GNU\0"
NT_GNU_ABI_TAG = 1,
NT_GNU_HWCAP = 2,
NT_GNU_BUILD_ID = 3,
#define ELF_NOTE_OPENBSD_NAME "OpenBSD\0"
NHDR_OPENBSD_TAG = 1,
#define ELF_NOTE_NETBSD_NAME "NetBSD\0"
NHDR_NETBSD_TAG = 1,
NHDR_CHECKSUM_TAG = 2,
NHDR_PAX_TAG = 3
};
enum { // descsz descriptor sizes
GNU_ABI_DESCSZ = 16, // int GNU_OS, major, minor, subminor;
NETBSD_DESCSZ = 4, // major_ver * (10**8) + minor
OPENBSD_DESCSZ = 4, // 32-bit zero
// CHECKSUM_DESCSZ is 2*sizeof(short) + sizeof(checksum)
PAX_DESCSZ = 4 // 32-bit mask
};
enum { // GNU OS/version
GNU_OS_LINUX = 0,
GNU_OS_HURD = 1,
GNU_OS_SOLARIS = 2
};
enum { // NetBSD checksum methods
CHECKSUM_CRC32 = 1,
CHECKSUM_MD5 = 2,
CHECKSUM_SHA1 = 3,
CHECKSUM_SHA256 = 4
};
#define ELF_NOTE_PAX_NAME "PaX\0"
enum { // NetBSD PaX bit values
PAX_MPROTECT = (1<<0), /* force enable Mprotect */
PAX_NOMPROTECT = (1<<1), /* force disable Mprotect */
PAX_GUARD = (1<<2), /* force enable SEGVguard */
PAX_NOGUARD = (1<<3), /* force disable SEGVguard */
PAX_ASLR = (1<<4), /* force enable ASLR */
PAX_NOASLR = (1<<5) /* force disable ASLR */
};
#endif
/*
vi:ts=4:et
*/
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
+498 -153
View File
File diff suppressed because it is too large Load Diff
+50 -18
View File
@@ -2,9 +2,9 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2000-2010 John F. Reiser
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
Copyright (C) 2000-2011 John F. Reiser
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -63,8 +63,7 @@ protected:
virtual void addStubEntrySections(Filter const *);
virtual void unpack(OutputFile *fo);
virtual unsigned elf_get_offset_from_address(acc_uint64l_t) const = 0;
virtual void const *elf_find_dynamic(unsigned) const = 0;
//virtual void const *elf_find_dynamic(unsigned) const = 0;
virtual acc_uint64l_t elf_unsigned_dynamic(unsigned) const = 0;
protected:
@@ -75,6 +74,8 @@ protected:
unsigned sz_phdrs; // sizeof Phdr[]
unsigned sz_elf_hdrs; // all Elf headers
unsigned sz_pack2; // after pack2(), before loader
unsigned sz_pack2a; // after pack2() of all PT_LOAD
unsigned sz_pack2b; // after pack2() of all PT_LOAD and gaps
unsigned lg2_page; // log2(PAGE_SIZE)
unsigned page_size; // 1u<<lg2_page
unsigned xct_off; // shared library: file offset of SHT_EXECINSTR
@@ -103,6 +104,7 @@ protected:
// but the class hierarchy splits after this class.
virtual void ARM_defineSymbols(Filter const *ft);
virtual void ARM_updateLoader(OutputFile *);
virtual int ARM_is_QNX(void);
virtual void pack1(OutputFile *, Filter &); // generate executable header
virtual void pack2(OutputFile *, Filter &); // append compressed data
@@ -132,15 +134,18 @@ protected:
static unsigned elf_hash(char const *) /*const*/;
static unsigned gnu_hash(char const *) /*const*/;
virtual Elf32_Sym const *elf_lookup(char const *) const;
virtual unsigned elf_get_offset_from_address(acc_uint64l_t) const;
virtual unsigned elf_get_offset_from_address(unsigned) const;
Elf32_Shdr const *elf_find_section_name(char const *) const;
Elf32_Shdr const *elf_find_section_type(unsigned) const;
void const *elf_find_dynamic(unsigned) const;
Elf32_Dyn const *elf_has_dynamic(unsigned) const;
acc_uint64l_t elf_unsigned_dynamic(unsigned) const;
protected:
Elf32_Ehdr ehdri; // from input file
Elf32_Phdr *phdri; // for input file
unsigned char *note_body; // concatenated contents of PT_NOTEs, if any
unsigned note_size; // total size of PT_NOTEs
Elf32_Shdr const *shdri; // from input file
unsigned page_mask; // AND clears the offset-within-page
@@ -173,23 +178,30 @@ protected:
l_info linfo;
__packed_struct_end()
cprElfHdr3 elfout;
__packed_struct(cprElfHdrNetBSD)
Elf32_Ehdr ehdr;
Elf32_Phdr phdr[4];
unsigned char notes[512];
__packed_struct_end()
struct Elf32_Note {
unsigned namesz; // 8
unsigned descsz; // 4
unsigned type; // 1
char text[0x18 - 4*4]; // "OpenBSD"
unsigned end; // 0
} elfnote;
cprElfHdrNetBSD elfout;
struct Elf32_Nhdr {
unsigned namesz;
unsigned descsz;
unsigned type;
//unsigned char body[0];
};
static void compileTimeAssertions() {
COMPILE_TIME_ASSERT(sizeof(cprElfHdr1) == 52 + 1*32 + 12)
COMPILE_TIME_ASSERT(sizeof(cprElfHdr2) == 52 + 2*32 + 12)
COMPILE_TIME_ASSERT(sizeof(cprElfHdr3) == 52 + 3*32 + 12)
COMPILE_TIME_ASSERT(sizeof(cprElfHdrNetBSD) == 52 + 4*32 + 512)
COMPILE_TIME_ASSERT_ALIGNED1(cprElfHdr1)
COMPILE_TIME_ASSERT_ALIGNED1(cprElfHdr2)
COMPILE_TIME_ASSERT_ALIGNED1(cprElfHdr3)
COMPILE_TIME_ASSERT_ALIGNED1(cprElfHdrNetBSD)
}
};
@@ -229,15 +241,18 @@ protected:
virtual unsigned find_LOAD_gap(Elf64_Phdr const *const phdri, unsigned const k,
unsigned const e_phnum);
virtual unsigned elf_get_offset_from_address(acc_uint64l_t) const;
virtual acc_uint64l_t elf_get_offset_from_address(acc_uint64l_t) const;
Elf64_Shdr const *elf_find_section_name(char const *) const;
Elf64_Shdr const *elf_find_section_type(unsigned) const;
void const *elf_find_dynamic(unsigned) const;
Elf64_Dyn const *elf_has_dynamic(unsigned) const;
acc_uint64l_t elf_unsigned_dynamic(unsigned) const;
protected:
Elf64_Ehdr ehdri; // from input file
Elf64_Phdr *phdri; // for input file
unsigned char *note_body; // concatenated contents of PT_NOTEs, if any
unsigned note_size; // total size of PT_NOTEs
Elf64_Shdr const *shdri; // from input file
acc_uint64l_t page_mask; // AND clears the offset-within-page
@@ -270,15 +285,23 @@ protected:
l_info linfo;
__packed_struct_end()
cprElfHdr3 elfout;
__packed_struct(cprElfHdr4)
Elf64_Ehdr ehdr;
Elf64_Phdr phdr[4];
l_info linfo;
__packed_struct_end()
cprElfHdr4 elfout;
static void compileTimeAssertions() {
COMPILE_TIME_ASSERT(sizeof(cprElfHdr1) == 64 + 1*56 + 12)
COMPILE_TIME_ASSERT(sizeof(cprElfHdr2) == 64 + 2*56 + 12)
COMPILE_TIME_ASSERT(sizeof(cprElfHdr3) == 64 + 3*56 + 12)
COMPILE_TIME_ASSERT(sizeof(cprElfHdr4) == 64 + 4*56 + 12)
COMPILE_TIME_ASSERT_ALIGNED1(cprElfHdr1)
COMPILE_TIME_ASSERT_ALIGNED1(cprElfHdr2)
COMPILE_TIME_ASSERT_ALIGNED1(cprElfHdr3)
COMPILE_TIME_ASSERT_ALIGNED1(cprElfHdr4)
}
};
@@ -406,13 +429,21 @@ public:
virtual const char *getFullName(const options_t *) const { return "i386-freebsd.elf"; }
};
class PackNetBSDElf32x86 : public PackBSDElf32x86
class PackNetBSDElf32x86 : public PackLinuxElf32x86
{
typedef PackBSDElf32x86 super;
typedef PackLinuxElf32x86 super;
public:
PackNetBSDElf32x86(InputFile *f);
virtual ~PackNetBSDElf32x86();
virtual const char *getName() const { return "netbsd/elf386"; }
virtual const char *getFullName(const options_t *) const { return "i386-netbsd.elf"; }
protected:
virtual void buildLoader(const Filter *ft);
virtual void generateElfHdr(
OutputFile *,
void const *proto,
unsigned const brka
);
};
class PackOpenBSDElf32x86 : public PackBSDElf32x86
@@ -421,6 +452,7 @@ class PackOpenBSDElf32x86 : public PackBSDElf32x86
public:
PackOpenBSDElf32x86(InputFile *f);
virtual ~PackOpenBSDElf32x86();
virtual const char *getName() const { return "opnbsd/elf386"; }
virtual const char *getFullName(const options_t *) const { return "i386-openbsd.elf"; }
protected:
+5 -5
View File
@@ -2,9 +2,9 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2001-2010 John F. Reiser
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
Copyright (C) 2001-2011 John F. Reiser
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -601,11 +601,11 @@ void PackLinuxI386::patchLoaderChecksum()
// checksum for loader + p_info
lp->l_checksum = 0;
lp->l_magic = UPX_ELF_MAGIC;
lp->l_lsize = (unsigned short) lsize;
set_te16(&lp->l_lsize, (unsigned short) lsize);
lp->l_version = (unsigned char) ph.version;
lp->l_format = (unsigned char) ph.format;
// INFO: lp->l_checksum is currently unused
lp->l_checksum = upx_adler32(ptr, lsize);
set_te32(&lp->l_checksum, upx_adler32(ptr, lsize));
}
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
+4 -4
View File
@@ -2,9 +2,9 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2000-2010 John F. Reiser
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
Copyright (C) 2000-2011 John F. Reiser
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -114,7 +114,7 @@ void PackLinuxElf32x86interp::pack1(OutputFile *fo, Filter &)
h3.phdr[2].p_align = 1;
if (opt->o_unix.make_ptinterp) { // unusual "once per release"
elfout = h3;
*(cprElfHdr3 *)(void *)&elfout = h3;
elfout.ehdr.e_phnum = 1;
fo->write(&elfout, elfout.ehdr.e_ehsize + elfout.ehdr.e_phentsize);
}
+3 -3
View File
@@ -2,9 +2,9 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2000-2010 John F. Reiser
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
Copyright (C) 2000-2011 John F. Reiser
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2000-2010 John F. Reiser
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
Copyright (C) 2000-2011 John F. Reiser
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2000-2010 John F. Reiser
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
Copyright (C) 2000-2011 John F. Reiser
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
+20 -14
View File
@@ -2,7 +2,7 @@
This file is part of the UPX executable compressor.
Copyright (C) 2004-2010 John Reiser
Copyright (C) 2004-2011 John Reiser
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -429,11 +429,11 @@ void PackMachBase<T>::patchLoaderChecksum()
// checksum for loader; also some PackHeader info
lp->l_checksum = 0;
lp->l_magic = UPX_MAGIC_LE32; // LE32 always
lp->l_lsize = (unsigned short) lsize;
set_te16(&lp->l_lsize, (unsigned short) lsize);
lp->l_version = (unsigned char) ph.version;
lp->l_format = (unsigned char) ph.format;
// INFO: lp->l_checksum is currently unused
lp->l_checksum = upx_adler32(ptr, lsize);
set_te32(&lp->l_checksum, upx_adler32(ptr, lsize));
}
template <class T>
@@ -1351,15 +1351,19 @@ void PackMachFat::pack(OutputFile *fo)
void PackMachFat::unpack(OutputFile *fo)
{
fo->seek(0, SEEK_SET);
fo->write(&fat_head, sizeof(fat_head.fat) +
fat_head.fat.nfat_arch * sizeof(fat_head.arch[0]));
if (fo) { // test mode ("-t") sets fo = NULL
fo->seek(0, SEEK_SET);
fo->write(&fat_head, sizeof(fat_head.fat) +
fat_head.fat.nfat_arch * sizeof(fat_head.arch[0]));
}
unsigned length;
for (unsigned j=0; j < fat_head.fat.nfat_arch; ++j) {
unsigned base = fo->unset_extent(); // actual length
unsigned base = (fo ? fo->unset_extent() : 0); // actual length
base += ~(~0u<<fat_head.arch[j].align) & (0-base); // align up
fo->seek(base, SEEK_SET);
fo->set_extent(base, ~0u);
if (fo) {
fo->seek(base, SEEK_SET);
fo->set_extent(base, ~0u);
}
ph.u_file_size = fat_head.arch[j].size;
fi->set_extent(fat_head.arch[j].offset, fat_head.arch[j].size);
@@ -1418,13 +1422,15 @@ void PackMachFat::unpack(OutputFile *fo)
} break;
} // switch cputype
fat_head.arch[j].offset = base;
length = fo->unset_extent();
length = (fo ? fo->unset_extent() : 0);
fat_head.arch[j].size = length - base;
}
fo->unset_extent();
fo->seek(0, SEEK_SET);
fo->rewrite(&fat_head, sizeof(fat_head.fat) +
fat_head.fat.nfat_arch * sizeof(fat_head.arch[0]));
if (fo) {
fo->unset_extent();
fo->seek(0, SEEK_SET);
fo->rewrite(&fat_head, sizeof(fat_head.fat) +
fat_head.fat.nfat_arch * sizeof(fat_head.arch[0]));
}
}
bool PackMachFat::canPack()
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
+3 -2
View File
@@ -2,7 +2,7 @@
This file is part of the UPX executable compressor.
Copyright (C) 2007-2010 John F. Reiser
Copyright (C) 2007-2011 John F. Reiser
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -52,7 +52,8 @@
};
enum { // filetype
MH_EXECUTE = 2,
MH_DYLIB = 6
MH_DYLIB = 6,
MH_BUNDLE = 8 /* dynamically bound bundle file */
};
enum { // flags
MH_NOUNDEFS = 1
+3 -3
View File
@@ -2,9 +2,9 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2002-2010 Jens Medoch
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
Copyright (C) 2002-2011 Jens Medoch
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2002-2010 Jens Medoch
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
Copyright (C) 2002-2011 Jens Medoch
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
+5 -3
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -327,7 +327,9 @@ void PackTmt::unpack(OutputFile *fo)
{
Filter ft(ph.level);
ft.init(ph.filter, 0);
ft.cto = (unsigned char) (ph.version < 11 ? (get_le32(obuf+ph.u_len-12) >> 24) : ph.filter_cto);
ft.cto = (unsigned char) ph.filter_cto;
if (ph.version < 11)
ft.cto = (unsigned char) (get_le32(obuf+ph.u_len-12) >> 24);
ft.unfilter(obuf, ptr_diff(relocs, obuf));
}
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
+5 -5
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -231,11 +231,11 @@ PackUnix::patchLoaderChecksum()
l_info *const lp = &linfo;
// checksum for loader; also some PackHeader info
lp->l_magic = UPX_MAGIC_LE32; // LE32 always
lp->l_lsize = (unsigned short) lsize;
set_te16(&lp->l_lsize, (unsigned short) lsize);
lp->l_version = (unsigned char) ph.version;
lp->l_format = (unsigned char) ph.format;
// INFO: lp->l_checksum is currently unused
lp->l_checksum = upx_adler32(ptr, lsize);
set_te32(&lp->l_checksum, upx_adler32(ptr, lsize));
}
void PackUnix::pack3(OutputFile *fo, Filter &/*ft*/)
@@ -498,7 +498,7 @@ void PackUnix::unpackExtent(unsigned wanted, OutputFile *fo,
int PackUnix::canUnpack()
{
upx_byte buf[128];
upx_byte buf[sizeof(overlay_offset) + 32];
const int bufsize = sizeof(buf);
fi->seek(-bufsize, SEEK_END);
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
+5 -5
View File
@@ -2,9 +2,9 @@
This file is part of the UPX executable compressor.
Copyright (C) 2004-2010 John Reiser
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2004-2011 John Reiser
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -1079,8 +1079,8 @@ void PackVmlinuxAMD64::defineDecompressorSymbols()
// We assume a 32-bit boot loader, so we use the 32-bit convention
// of "enter at the beginning" (startup_32). The 64-bit convention
// would be to use ehdri.e_entry (startup_64).
linker->defineSymbol("ENTRY_POINT", phdri[0].p_paddr);
linker->defineSymbol("PHYSICAL_START", phdri[0].p_paddr);
linker->defineSymbol("ENTRY_POINT", (unsigned) phdri[0].p_paddr);
linker->defineSymbol("PHYSICAL_START", (unsigned) phdri[0].p_paddr);
}
unsigned PackVmlinuxARMEL::write_vmlinux_head(
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
+29 -21
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -183,6 +183,8 @@ int PackW32Pe::readFileHeader()
// the virtual memory manager only for pages which are not yet loaded.
// of course it was impossible to debug this ;-)
#define TLS_CB_ALIGNMENT 4u // alignment of tls callbacks
__packed_struct(tls)
LE32 datastart; // VA tls init data start
LE32 dataend; // VA tls init data end
@@ -211,13 +213,6 @@ void PackW32Pe::processTls(Interval *iv) // pass 1
unsigned v = get_le32(ibuf + tlsp->callbacks - ih.imagebase);
//NEW: TLS callback support - Stefan Widmann
#if 0
if (v != 0)
{
//fprintf(stderr, "TLS callbacks: 0x%0x -> 0x%0x\n", (int)tlsp->callbacks, v);
throwCantPack("TLS callbacks are not supported");
}
#endif
if(v != 0)
{
//count number of callbacks, just for information string - Stefan Widmann
@@ -248,13 +243,16 @@ void PackW32Pe::processTls(Interval *iv) // pass 1
if (pos >= tlsdatastart && pos < tlsdataend)
iv->add(pos,type);
//NEW: if TLS callbacks are used, we need two more DWORDS at the end of the TLS
sotls = sizeof(tls) + tlsdataend - tlsdatastart + (use_tls_callbacks ? 8 : 0);
sotls = sizeof(tls) + tlsdataend - tlsdatastart;
// if TLS callbacks are used, we need two more DWORDS at the end of the TLS
// ... and those dwords should be correctly aligned
if (use_tls_callbacks)
sotls = ALIGN_UP(sotls, TLS_CB_ALIGNMENT) + 8;
// the PE loader wants this stuff uncompressed
otls = new upx_byte[sotls];
memset(otls,0,sotls);
memcpy(otls,ibuf + IDADDR(PEDIR_TLS),0x18);
memcpy(otls,ibuf + IDADDR(PEDIR_TLS),sizeof(tls));
// WARNING: this can acces data in BSS
memcpy(otls + sizeof(tls),ibuf + tlsdatastart,sotls - sizeof(tls));
tlsindex = tlsp->tlsindex - ih.imagebase;
@@ -292,9 +290,9 @@ void PackW32Pe::processTls(Reloc *rel,const Interval *iv,unsigned newaddr) // pa
rel->add(kc - ih.imagebase,iv->ivarr[ic].len);
}
const unsigned tls_data_size = tlsp->dataend - tlsp->datastart;
tlsp->datastart = newaddr + sizeof(tls) + ih.imagebase;
//NEW: subtract the size of the callback chain from dataend - Stefan Widmann
tlsp->dataend = newaddr + sotls + ih.imagebase - (use_tls_callbacks ? 8 : 0);
tlsp->dataend = tlsp->datastart + tls_data_size;
//NEW: if we have TLS callbacks to handle, we create a pointer to the new callback chain - Stefan Widmann
tlsp->callbacks = (use_tls_callbacks ? newaddr + sotls + ih.imagebase - 8 : 0);
@@ -365,6 +363,7 @@ unsigned PackW32Pe::processImports() // pass 1
unsigned iat;
LE32 *lookupt;
unsigned npos;
unsigned original_position;
bool isk32;
static int __acc_cdecl_qsort compare(const void *p1, const void *p2)
@@ -373,6 +372,8 @@ unsigned PackW32Pe::processImports() // pass 1
const udll *u2 = * (const udll * const *) p2;
if (u1->isk32) return -1;
if (u2->isk32) return 1;
if (!*u1->lookupt) return 1;
if (!*u2->lookupt) return -1;
int rc = strcasecmp(u1->name,u2->name);
if (rc) return rc;
if (u1->ordinal) return -1;
@@ -399,11 +400,12 @@ unsigned PackW32Pe::processImports() // pass 1
dlls[ic].iat = im->iat;
dlls[ic].lookupt = (LE32*) (ibuf + (im->oft ? im->oft : im->iat));
dlls[ic].npos = 0;
dlls[ic].original_position = ic;
dlls[ic].isk32 = strcasecmp(kernel32dll,dlls[ic].name) == 0;
soimport += strlen(dlls[ic].name) + 1 + 4;
for (LE32 *tarr = dlls[ic].lookupt; *tarr; tarr++)
for (IPTR_I(LE32, tarr, dlls[ic].lookupt); *tarr; tarr += 1)
{
if (*tarr & 0x80000000)
{
@@ -415,10 +417,11 @@ unsigned PackW32Pe::processImports() // pass 1
}
else
{
unsigned len = strlen(ibuf + *tarr + 2);
IPTR_I(const upx_byte, n, ibuf + *tarr + 2);
unsigned len = strlen(n);
soimport += len + 1;
if (dlls[ic].shname == NULL || len < strlen (dlls[ic].shname))
dlls[ic].shname = ibuf + *tarr + 2;
dlls[ic].shname = n;
}
soimport++; // separator
}
@@ -510,8 +513,10 @@ unsigned PackW32Pe::processImports() // pass 1
for (ic = 0; ic < dllnum; ic++)
{
LE32 *tarr = idlls[ic]->lookupt;
#if 0 && ENABLE_THIS_AND_UNCOMPRESSION_WILL_BREAK
if (!*tarr) // no imports from this dll
continue;
#endif
set_le32(ppi,idlls[ic]->npos);
set_le32(ppi+4,idlls[ic]->iat - rvamin);
ppi += 8;
@@ -579,7 +584,7 @@ unsigned PackW32Pe::processImports() // pass 1
for (ic = 0; ic < dllnum; ic++, im++)
{
memset(im,FILLVAL,sizeof(*im));
im->dllname = ptr_diff(idlls[ic]->name,ibuf); // I only need this info
im->dllname = ptr_diff(dlls[idlls[ic]->original_position].name,ibuf);
}
}
else
@@ -1180,9 +1185,12 @@ void PackW32Pe::pack(OutputFile *fo)
//ic = s1addr + s1size - sotls - soloadconf; //ATTENTION: moved upwards to TLS callback handling - Stefan Widmann
//get address of TLS callback handler
tls_handler_offset = linker->getSymbolOffset("PETLSC2");
//add relocation entry for TLS callback handler
rel.add(tls_handler_offset + 4, 3);
if (use_tls_callbacks)
{
tls_handler_offset = linker->getSymbolOffset("PETLSC2");
//add relocation entry for TLS callback handler
rel.add(tls_handler_offset + 4, 3);
}
processTls(&rel,&tlsiv,ic);
ODADDR(PEDIR_TLS) = sotls ? ic : 0;
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
+5 -3
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -823,7 +823,9 @@ void PackWcle::unpack(OutputFile *fo)
Filter ft(ph.level);
ft.init(ph.filter, text_vaddr);
ft.cto = (unsigned char) (ph.version < 11 ? (get_le32(oimage+ph.u_len-9) >> 24) : ph.filter_cto);
ft.cto = (unsigned char) ph.filter_cto;
if (ph.version < 11)
ft.cto = (unsigned char) (get_le32(oimage+ph.u_len-9) >> 24);
ft.unfilter(oimage+text_vaddr, text_size);
}
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2011 Laszlo Molnar
All Rights Reserved.
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