Compare commits

...

92 Commits

Author SHA1 Message Date
Markus F.X.J. Oberhumer 626025d539 Prepare release. 2010-04-27 16:09:41 +02:00
Markus F.X.J. Oberhumer 9e8a0a020f Remove outdated ChangeLog target. 2010-04-26 18:29:28 +02:00
Markus F.X.J. Oberhumer 40f592eade Add one .dump file. 2010-04-26 18:27:54 +02:00
Markus F.X.J. Oberhumer 5e899f0be4 Silence some annoying compiler warnings. 2010-04-19 03:15:22 +02:00
Markus F.X.J. Oberhumer f2748284b1 New ACC version. 2010-04-19 03:15:01 +02:00
Markus F.X.J. Oberhumer a15ce00934 Fix some small memory leaks. Minor cleanup. 2010-04-10 13:57:25 +02:00
John Reiser 9e3e80261b merge 2010-03-31 14:15:18 -07:00
John Reiser c72c685434 Diagnose PT_LOAD beyond end-of-file.
https://sourceforge.net/tracker/?func=detail&atid=102331&aid=2979240&group_id=2331
2010-03-31 14:09:28 -07:00
Markus F.X.J. Oberhumer 0177a8d277 Use upx_snprintf instead of snprintf. 2010-03-31 02:23:06 +02:00
Markus F.X.J. Oberhumer b6a9b0a4c9 Silence some compilation warnings. 2010-03-31 02:16:32 +02:00
John Reiser f4f8bd8d42 Fix for "upx --help" constructs with (0===f) 2010-03-17 18:33:30 -07:00
John Reiser 6e4aeffc0c Withdraw support for shared libraries (.dylib) on Darwin (Apple Mac OS X). 2010-03-12 10:20:18 -08:00
John Reiser dba256d384 Fix amd64-darwin.dylib-entry.S so it compiles. 2010-03-11 14:37:17 -08:00
John Reiser 910008e9e7 Hack on amd64-darwin.dylib-entry.S 2010-03-10 18:58:38 -08:00
John Reiser 8cb9545c41 Hack on amd64-darwin.dylib-entry.S 2010-03-10 15:19:18 -08:00
John Reiser 59c16da6fb PackMachBase::pack4dylib avoid sliding if offset or reloff is 0. 2010-03-10 13:14:52 -08:00
John Reiser 630df5bbd2 Fix structs from Apple mach-o/loader.h for 64-bit. (Apple goofed.) 2010-03-10 10:29:41 -08:00
John Reiser f550111400 PackDylibAMD64 (Mac OS X shared library on x86_64) 2010-03-09 19:02:25 -08:00
John Reiser 77377195aa Allow CPU_TYPE_X86_64 for MH_EXECUTE in fat (universal) binaries,
but no MH_DYLIB yet.  infoWarning() for unsupported cputype.
2010-03-09 13:35:06 -08:00
John Reiser 7e2e72bd40 infoWarning for shlib with no DT_INIT 2010-03-09 13:03:03 -08:00
John Reiser aa7a13bd02 Linux kernels must be ET_EXEC 2010-03-09 09:22:57 -08:00
John Reiser 5895058a17 Linux kernels must be ET_EXEC 2010-03-09 09:20:46 -08:00
John Reiser ffb60d5149 memmove instead of overlapping memcpy 2010-03-08 22:01:25 -08:00
John Reiser 1e2cb279b0 Fix memory leak in --lzma compression. 2010-03-08 22:00:35 -08:00
John Reiser e7f766f5ba i386-linux.shlib: stub commonality with non-shlib 2010-03-08 17:33:56 -08:00
John Reiser 8de5aa9409 Fix ET_DYN main program on amd64-linux.elf. 2010-03-08 16:59:53 -08:00
John Reiser bf28a4df49 MIPS stub NRV_HEAD always saves $ra on stack.
bits.ash has the only __MIPSEL__/__MIPSEB__ dependency: lwl/lwr swl/swr.
2010-03-08 10:49:11 -08:00
Markus F.X.J. Oberhumer fe1a0ab371 Bump tentative release date. 2010-03-06 16:50:17 +01:00
Markus F.X.J. Oberhumer 01daccfaf7 Avoid compiler warnings. 2010-03-06 16:35:18 +01:00
Markus F.X.J. Oberhumer 94e861e298 Rebuild stubs. 2010-03-06 16:34:05 +01:00
Jens Medoch d36af2ed5c Import 3-upx-hg_mips-r3k_base.patch. 2010-03-06 16:27:38 +01:00
Jens Medoch 7104b33214 Import 2-upx-hg_mips-r3k_makefile.patch. 2010-03-06 16:26:32 +01:00
Jens Medoch 32998e5377 Import 1-upx-hg_mips-stub_clean-up.patch. 2010-03-06 16:25:58 +01:00
Jens Medoch af0c9ef092 Import 0-upx-hg_mips-r3k_ucl.patch. 2010-03-06 16:25:29 +01:00
Markus F.X.J. Oberhumer 3bc3b3d10e Detabify. Remove trailing whitespace. 2010-03-01 01:28:03 +01:00
John Reiser f03f42ca4d Linux preserve /proc/self/exe; --unmap-all-pages option 2010-02-28 15:58:08 -08:00
John Reiser 79783abeb1 merge 2010-02-20 20:48:42 -08:00
John Reiser 895b0bd602 merge 2010-02-20 20:46:20 -08:00
John Reiser 2ee5ee92f8 merge 2010-02-20 20:44:54 -08:00
John Reiser 3e619423b1 merge 2010-02-20 20:40:32 -08:00
John Reiser b524e18bdf merge 2010-02-20 20:40:20 -08:00
John Reiser 6aa4579db8 merge 2010-02-20 20:40:04 -08:00
John Reiser 17fb86c0f1 merge 2010-02-20 20:39:52 -08:00
John Reiser 62ecfe4873 merge 2010-02-20 20:39:39 -08:00
John Reiser 04e55e6b9a merge 2010-02-20 20:39:19 -08:00
John Reiser f432aa1090 merge 2010-02-20 20:39:04 -08:00
John Reiser 7add104313 merge 2010-02-20 20:38:20 -08:00
John Reiser 36de249066 merge 2010-02-20 20:36:34 -08:00
John Reiser b7a54dcffd merge 2010-02-20 20:26:08 -08:00
John Reiser 6bb28deab2 merge 2010-02-20 20:24:55 -08:00
John Reiser 7f88d15c86 ELF ::unpack decompressing ElfXX_Ehdr changes .e_phnum 2010-02-20 19:57:34 -08:00
John Reiser 94c5014e23 merge 2010-02-15 11:09:28 -08:00
John Reiser c5a8256500 mention Elf32_auxv[AT_EXECFN] 2010-02-15 11:07:46 -08:00
Markus F.X.J. Oberhumer 5f39884bf7 Silence a compiler warning. 2010-02-07 00:10:49 +01:00
Markus F.X.J. Oberhumer d96825a242 Fix a typo. 2010-02-07 00:10:38 +01:00
Markus F.X.J. Oberhumer 443a938091 New ACC version. 2010-02-06 17:18:46 +01:00
Markus F.X.J. Oberhumer 6bc3197721 Enter 2010. 2010-02-06 17:15:49 +01:00
John Reiser 269cc91fd5 Support share libraries on i386 and amd64 under linux. 2010-01-17 19:58:58 -08:00
Markus F.X.J. Oberhumer c1ddea479d Minor portability fixes. 2009-12-03 19:58:23 +01:00
John Reiser 5f3a95962c PackLinuxElf32::unpack fix ARM (thumb) 2009-10-26 13:35:14 -07:00
John Reiser ee1a8e6a32 eabi-linux.shlib unfilter in thumb mode 2009-10-26 10:37:11 -07:00
John Reiser eeae73296e thumb-eabi-linux.shlib, and use it (for smaller size) instead of ARM.
[Consider compress-time option to choose ARM vs thumb?]
2009-10-26 09:05:12 -07:00
John Reiser 4ca8357af4 Merge 2009-10-26 08:11:37 -07:00
John Reiser 8a5b8c87fb arm.shlib-init: escape hatch is 8 bytes; speedup movsl 2009-10-25 20:40:26 -07:00
John Reiser 6ab04d7bbc ::buildLinuxLoader empty FOLDEXED for shlib 2009-10-25 13:52:41 -07:00
Markus F.X.J. Oberhumer a5a1380636 Add missing .dump files to repo. 2009-10-24 13:55:36 +02:00
John Reiser eeab1aef64 Synonyms R_ARM_THM_PC22 and R_ARM_THM_XPC22 for R_ARM_THM_CALL. 2009-10-22 21:05:05 -07:00
John Reiser 4e1c342e55 arm-linux.shlib escape hatch: munmap temporary pages 2009-10-21 09:32:42 -07:00
John Reiser d8ed259bce arm-linux.shlib allow thumb interworking for DT_INIT 2009-10-21 08:13:09 -07:00
John Reiser 9f6cb5de4c armel-eabi-linux.shlib: improve integration with system calls. 2009-10-20 09:53:45 -07:00
John Reiser ba634118d7 Shorten runtime copying for armel-eabi-linux.shlib. 2009-10-19 22:28:44 -07:00
John Reiser 63da091d36 Compress shared library for armel-eabi-linux. 2009-10-19 20:48:46 -07:00
John Reiser ad0dc88a33 Cleanup some FIXME. amd64-linux.shlib forces 4KiB page size to save space. 2009-10-18 16:03:26 -07:00
John Reiser 147acf4b57 Compress shared library for amd64-linux. 2009-10-17 21:55:03 -07:00
John Reiser 5085f3a15e Allow ET_DYN on amd64-linux.elf 2009-10-16 17:47:16 -07:00
John Reiser 22a95ad8ea fix comment 2009-10-16 17:46:41 -07:00
John Reiser df4bd6a60c move PackLinuxElf32x86::unpack up the class hierarchy to PackLinuxElf32 2009-10-16 11:00:33 -07:00
John Reiser 813e7b05e4 fix .ui_total_passes when shlib 2009-10-16 10:56:15 -07:00
John Reiser ab8b486b4a Fix -Wshadow complaints. 2009-10-16 10:01:29 -07:00
Markus F.X.J. Oberhumer 590f666ec9 Enable -Wshadow compiler option. 2009-10-16 18:06:16 +02:00
Markus F.X.J. Oberhumer 9adaee915b Detabify. 2009-10-16 16:29:09 +02:00
Markus F.X.J. Oberhumer bce0f06fe9 Rebuild stubs so that they actually match the source code! 2009-10-16 16:27:52 +02:00
John Reiser 856ecb84a0 Compress shared library for i386-linux. DT_INIT must exist. Everything
needed by ld-linux for runtime relocation must be at the beginning of the
first PT_LOAD, etc.
2009-10-15 20:35:07 -07:00
John Reiser 90ddc06c98 DT_INIT, DT_CHECKSUM, DT_VERSYM, DT_VERDEF, DT_VERNEEDED 2009-10-14 17:50:35 -07:00
John Reiser 405abc4e95 ::packExtent updates ph.u_adler to satisfy verifyOverlappingDecompression()
even when 0==hdr_u_len
2009-10-14 17:47:02 -07:00
John Reiser 549c59ecf5 fix OutputFile::seek() for SEEK_SET and SEEK_END 2009-10-14 17:44:29 -07:00
John Reiser 0a485eafcb Better detection of Position Independent main Executables (gcc -pie -FPIC). 2009-10-10 14:50:30 -07:00
John Reiser e0c11956a6 ElfXX_Rel, ElfXX_Rela 2009-10-10 14:41:01 -07:00
John Reiser da6a9bf3eb Move conditional side effect (reset .all_methods_use_lzma)
out of ::PackExe constructor, so that Visitor pattern avoids it.
2009-10-09 16:09:53 -07:00
John Reiser dacd11e1cc Fix sourceforge bug #2874848: Mach/fat needs seek() after set_extent(). 2009-10-08 12:53:02 -07:00
Markus F.X.J. Oberhumer fc854b4c77 Bump version for next release. 2009-09-27 20:08:49 +02:00
Markus F.X.J. Oberhumer 4dcc1f0374 Add tag for RELEASE_304. 2009-09-27 20:07:28 +02:00
368 changed files with 21822 additions and 9733 deletions
+1
View File
@@ -1,4 +1,5 @@
140415ffbcef86a42b4d672249927364430d3d38 RELEASE_111
155618b5b7930f97bd84b82befa7a4fd6672efb3 RELEASE_304
1931f4f28074970ec53b4cd21c7fc181b4da8e5e RELEASE_301
223ac5b23f9731ceac9ff8d65167df4900776e36 RELEASE_190
2c753c5bf38e7322715e2a5c6c5381111bd7a61a RELEASE_194
+1 -1
View File
@@ -8,7 +8,7 @@
The Ultimate Packer for eXecutables
Copyright (c) 1996-2009 Markus Oberhumer, Laszlo Molnar & John Reiser
Copyright (c) 1996-2010 Markus Oberhumer, Laszlo Molnar & John Reiser
http://upx.sourceforge.net
+1 -9
View File
@@ -1,7 +1,7 @@
#
# UPX toplevel Makefile - needs GNU make 3.81 or better
#
# Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
#
MAKEFLAGS += -rR
@@ -38,13 +38,5 @@ endif
$(MAKE) -C doc $@
ifneq ($(wildcard .hg/.),)
# automatically generate ChangeLog from local Mercurial repo
ChangeLog:
hg log --style=changelog > $@
.PHONY: ChangeLog
endif
.PHONY: default all mostlyclean clean distclean maintainer-clean
+9
View File
@@ -2,6 +2,15 @@
User visible changes for UPX
==================================================================
Changes in 3.05 (27 Apr 2010):
* i386-linux and amd64-linux support shared libraries (DT_INIT must
exist, all info needed by runtime loader must be first in .text, etc.)
* Linux /proc/self/exe now is preserved by default, by leaving behind
one page. New compress-time option --unmap-all-pages is available.
* Withdraw support for shared libraries on Darwin (Apple Mac OS X)
because upx does not understand enough about .dylib.
* bug fixes
Changes in 3.04 (27 Sep 2009):
* new format Mach/AMD64 supports 64-bit programs on Apple Macintosh.
* new formats Dylib/i386 and Dylib/ppc32 support shared libraries
+1 -1
View File
@@ -8,7 +8,7 @@
The Ultimate Packer for eXecutables
Copyright (c) 1996-2009 Markus Oberhumer, Laszlo Molnar & John Reiser
Copyright (c) 1996-2010 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-2009 Markus Oberhumer, Laszlo Molnar & John Reiser
Copyright (c) 1996-2010 Markus Oberhumer, Laszlo Molnar & John Reiser
http://upx.sourceforge.net
@@ -108,9 +108,9 @@ THE FUTURE
COPYRIGHT
=========
Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 2000-2009 John F. Reiser
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2000-2010 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-2009 Markus Oberhumer, Laszlo Molnar & John Reiser
Copyright (c) 1996-2010 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-2009 Markus Oberhumer, Laszlo Molnar & John Reiser
Copyright (c) 1996-2010 Markus Oberhumer, Laszlo Molnar & John Reiser
http://upx.sourceforge.net
+22 -11
View File
@@ -1,5 +1,5 @@
Decompressing ELF Directly to Memory on Linux/x86
Copyright (C) 2000-2009 John F. Reiser jreiser@BitWagon.com
Copyright (C) 2000-2010 John F. Reiser jreiser@BitWagon.com
References:
<elf.h> definitions for the ELF file format
@@ -64,16 +64,27 @@ assuming that its automatic stack variables are initialized to zero),
and remove (all but 4 bytes of) the decompression program (and
compressed executable) from the address space.
Because the UPX runtime stub removes all traces of the compressed file
from the address space, then the Linux kernel erases the symlink
/proc/self/exe. Linux stores the pathname argument that was specified
to execve() immediately after the '\0' which terminates the character
string of the last environment variable [as of execve()]. This is true
for at least all Linux 2.6, 2.4, and 2.2 kernels. The pathname is not
"bound" to the file as strongly as /proc/self/exe (the file may be changed
without affecting the pathname), but the pathname does provide some
information. The pathname may be relative to the working directory,
so look before any chdir().
As of upx-3.05, by default on Linux, upon decompression then one page
of the compressed executable remains mapped into the address space
of the process. If all of the pages of the compressed executable are
unmapped, then the Linux kernel erases the symlink /proc/self/exe,
and this can cause trouble for the runtime shared library loader
expanding $ORIGIN in -rpath, or for application code that relies on
/proc/self/exe. Use the compress-time command-line option
--unmap-all-pages to achieve that effect at run time. Upx-3.04
and previous versions did this by default with no option. However,
too much other software erroneously assumes that /proc/self/exe
always exists.
Linux stores the pathname argument that was specified to execve()
immediately after the '\0' which terminates the character string of the
last environment variable [as of execve()]. This is true for at least
all Linux 2.6, 2.4, and 2.2 kernels. Linux kernel 2.6.29 and later
records a pointer to that character string in Elf32_auxv[AT_EXECFN].
The pathname is not "bound" to the file as strongly as /proc/self/exe
(the file may be changed without affecting the pathname), but the
pathname does provide some information. The pathname may be relative
to the working directory, so look before any chdir().
The Elf formats for Linux add an environment variable named " " [three
spaces] which saves the results of readlink("/proc/self/exe",,) before
+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-2009 Markus Oberhumer, Laszlo Molnar & John Reiser
Copyright (c) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2000-2009 John F. Reiser
Copyright (C) 2000-2010 John F. Reiser
Copyright (C) 2002-2009 Jens Medoch
Copyright (C) 2002-2010 Jens Medoch
This program may be used freely, and you are welcome to
redistribute it under certain conditions.
+4 -3
View File
@@ -1,7 +1,7 @@
#
# UPX Makefile - needs GNU make 3.81 or better
#
# Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
#
MAKEFLAGS += -rR
@@ -38,8 +38,9 @@ CXXFLAGS += -O0 -g
else
CXXFLAGS += -O2
endif
CXXFLAGS += -Wall -W -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Werror
##CXXFLAGS += -Wshadow
CXXFLAGS_WERROR = -Werror
CXXFLAGS += -Wall -W -Wcast-align -Wcast-qual -Wpointer-arith -Wshadow -Wwrite-strings
CXXFLAGS += $(CXXFLAGS_WERROR)
endif
CPPFLAGS += $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)
CXXLD ?= $(CXX)
+5 -5
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -587,13 +587,13 @@ int __acc_cdecl_qsort le64_compare_signed(const void *, const void *);
// forward declarations
namespace N_BELE_CTP {
class BEPolicy; class LEPolicy;
struct BEPolicy; struct LEPolicy;
extern const BEPolicy be_policy;
extern const LEPolicy le_policy;
}
namespace N_BELE_RTP {
class AbstractPolicy;
class BEPolicy; class LEPolicy;
struct AbstractPolicy;
struct BEPolicy; struct LEPolicy;
extern const BEPolicy be_policy;
extern const LEPolicy le_policy;
}
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
+6 -5
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -51,6 +51,7 @@ void lzma_compress_config_t::reset()
extern int compress_lzma_dummy;
int compress_lzma_dummy = 0;
#else
#define opt compress_lzma_opt
#undef USE_LZMA_PROPERTIES
@@ -312,7 +313,7 @@ int upx_lzma_compress ( const upx_bytep src, unsigned src_len,
*dst_len += x_len;
if (rh == SZ_OK) {
#if defined(USE_LZMA_PROPERTIES)
dst[-1] = probs_buf[0];
dst[-1] = props_buf[0];
#endif
r = UPX_E_OK;
}
@@ -545,7 +546,7 @@ int upx_lzma_compress ( const upx_bytep src, unsigned src_len,
}
error:
*dst_len = os.b_pos;
*dst_len = (unsigned) os.b_pos;
//printf("\nlzma_compress: %d: %u %u %u %u %u, %u - > %u\n", r, res->pos_bits, res->lit_pos_bits, res->lit_context_bits, res->dict_size, res->num_probs, src_len, *dst_len);
//printf("%u %u %u\n", is.__m_RefCount, os.__m_RefCount, progress.__m_RefCount);
return r;
@@ -640,7 +641,7 @@ int upx_lzma_decompress ( const upx_bytep src, unsigned src_len,
}
error:
*dst_len = s.dicPos;
// LzmaDec_Free(&s, &cba); // FIXME - why does this crash ???
LzmaDec_FreeProbs(&s, &cba);
return r;
#undef Properties
}
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
+21 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -36,6 +36,21 @@
// ACC
**************************************************************************/
#if (defined(_WIN32) || defined(_WIN64)) && defined(_MSC_VER)
#ifndef _CRT_NONSTDC_NO_DEPRECATE
#define _CRT_NONSTDC_NO_DEPRECATE 1
#endif
#ifndef _CRT_NONSTDC_NO_WARNINGS
#define _CRT_NONSTDC_NO_WARNINGS 1
#endif
#ifndef _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_NO_DEPRECATE 1
#endif
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS 1
#endif
#endif
#include "miniacc.h"
#if ((ACC_OS_WIN32 || ACC_OS_WIN64) && ACC_CC_MWERKS) && defined(__MSL__)
# undef HAVE_UTIME_H /* this pulls in <windows.h> */
@@ -93,6 +108,7 @@
# error "need Visual C++ 5.0 or newer"
# endif
# pragma warning(error: 4096) // W2: '__cdecl' must be used with '...'
# pragma warning(error: 4138) // Wx: '*/' found outside of comment
# pragma warning(disable: 4097) // W3: typedef-name 'A' used as synonym for class-name 'B'
# pragma warning(disable: 4511) // W3: 'class': copy constructor could not be generated
# pragma warning(disable: 4512) // W4: 'class': assignment operator could not be generated
@@ -143,6 +159,9 @@
#endif
// just in case
#undef _
#undef __
#undef ___
#undef NDEBUG
#undef dos
#undef linux
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
+13 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -396,6 +396,17 @@ void OutputFile::rewrite(const void *buf, int len)
void OutputFile::seek(off_t off, int whence)
{
assert(!opt->to_stdout);
switch (whence) {
case SEEK_SET: {
if (bytes_written < off) {
bytes_written = off;
}
_length = bytes_written; // cheap, lazy update; needed?
} break;
case SEEK_END: {
_length = bytes_written; // necessary
} break;
}
super::seek(off,whence);
}
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 2000-2009 John F. Reiser
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2000-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 2000-2009 John F. Reiser
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2000-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 2000-2009 John F. Reiser
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2000-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 2004-2009 John F. Reiser
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2004-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
+9 -7
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -51,8 +51,9 @@ void show_head(void)
fg = con_fg(f,FG_GREEN);
con_fprintf(f,
" Ultimate Packer for eXecutables\n"
" Copyright (C) 1996 - 2009\n"
" Copyright (C) 1996 - %s\n"
"UPX %-10s Markus Oberhumer, Laszlo Molnar & John Reiser %14s\n\n",
UPX_VERSION_YEAR,
#if (ACC_OS_DOS16 || ACC_OS_DOS32)
V("d"),
#elif (ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
@@ -113,6 +114,7 @@ struct PackerNames
{
PackerNames *self = (PackerNames *) user;
self->add(p);
delete p; p = NULL;
return NULL;
}
static int __acc_cdecl_qsort cmp_fname(const void *a, const void *b) {
@@ -398,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-2009 Markus Franz Xaver Johannes Oberhumer\n");
fprintf(fp, "Copyright (C) 1996-2009 Laszlo Molnar\n");
fprintf(fp, "Copyright (C) 2000-2009 John F. Reiser\n");
fprintf(fp, "Copyright (C) 2002-2009 Jens Medoch\n");
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");
#if defined(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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
+11 -5
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -469,7 +469,7 @@ int ElfLinker::getSection(const char *sname, int *slen) const
const Section *section = findSection(sname);
if (slen)
*slen = section->size;
return section->output - output;
return (int) (section->output - output);
}
int ElfLinker::getSectionSize(const char *sname) const
@@ -679,7 +679,10 @@ void ElfLinkerArmBE::relocate1(const Relocation *rel, upx_byte *location,
{
set_be32(location, get_be32(location) + value);
}
else if (strcmp(type, "R_ARM_THM_CALL") == 0)
else if (strcmp(type, "R_ARM_THM_CALL") == 0
|| strcmp(type, "R_ARM_THM_XPC22") == 0
|| strcmp(type, "R_ARM_THM_PC22") == 0
)
{
value -= rel->section->offset + rel->offset;
value += ((get_be16(location) & 0x7ff) << 12);
@@ -711,7 +714,10 @@ void ElfLinkerArmLE::relocate1(const Relocation *rel, upx_byte *location,
{
set_le32(location, get_le32(location) + value);
}
else if (strcmp(type, "R_ARM_THM_CALL") == 0)
else if (strcmp(type, "R_ARM_THM_CALL") == 0
|| strcmp(type, "R_ARM_THM_XPC22") == 0
|| strcmp(type, "R_ARM_THM_PC22") == 0
)
{
value -= rel->section->offset + rel->offset;
value += ((get_le16(location) & 0x7ff) << 12);
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
+23 -6
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -883,6 +883,9 @@ static int do_option(int optc, const char *arg)
case 673:
opt->ps1_exe.do_8mib = false;
break;
case 674:
opt->o_unix.unmap_all_pages = true; // val ?
break;
case '\0':
return -1;
@@ -1032,6 +1035,7 @@ static const struct mfx_option longopts[] =
{"netbsd", 0x10, 0, 668},
{"OpenBSD", 0x10, 0, 669},
{"openbsd", 0x10, 0, 669},
{"unmap-all-pages", 0x10, 0, 674}, // linux /proc/self/exe vanishes
// watcom/le
{"le", 0x10, 0, 620}, // produce LE output
// win32/pe
@@ -1347,27 +1351,40 @@ void upx_sanity_check(void)
assert(TestBELE<BE32>::test());
assert(TestBELE<BE64>::test());
{
static const unsigned char dd[32] = { 0, 0, 0, 0, 0, 0, 0,
0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8,
0, 0, 0, 0,
0x7f, 0x7e, 0x7d, 0x7c, 0x7b, 0x7a, 0x79, 0x78,
static const unsigned char dd[32]
#if 1 && (ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_PATHSCALE) && defined(__ELF__)
__attribute__((__aligned__(16)))
#endif
= { 0, 0, 0, 0, 0, 0, 0,
0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8,
0, 0, 0, 0,
0x7f, 0x7e, 0x7d, 0x7c, 0x7b, 0x7a, 0x79, 0x78,
0, 0, 0, 0, 0 };
const unsigned char *d;
const N_BELE_RTP::AbstractPolicy *bele;
d = dd + 7;
assert(upx_adler32(d, 4) == 0x09f003f7);
assert(upx_adler32(d, 4, 0) == 0x09ec03f6);
assert(upx_adler32(d, 4, 1) == 0x09f003f7);
bele = &N_BELE_RTP::be_policy;
assert(get_be16(d) == 0xfffe);
assert(bele->get16(d) == 0xfffe);
assert(get_be16_signed(d) == -2);
assert(get_be24(d) == 0xfffefd);
assert(bele->get24(d) == 0xfffefd);
assert(get_be24_signed(d) == -259);
assert(get_be32(d) == 0xfffefdfc);
assert(bele->get32(d) == 0xfffefdfc);
assert(get_be32_signed(d) == -66052);
bele = &N_BELE_RTP::le_policy;
assert(get_le16(d) == 0xfeff);
assert(bele->get16(d) == 0xfeff);
assert(get_le16_signed(d) == -257);
assert(get_le24(d) == 0xfdfeff);
assert(bele->get24(d) == 0xfdfeff);
assert(get_le24_signed(d) == -131329);
assert(get_le32(d) == 0xfcfdfeff);
assert(bele->get32(d) == 0xfcfdfeff);
assert(get_le32_signed(d) == -50462977);
assert(get_le64_signed(d) == ACC_INT64_C(-506097522914230529));
assert(find_be16(d, 2, 0xfffe) == 0);
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
+181 -42
View File
@@ -2,6 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
@@ -39,7 +41,7 @@
#ifndef __ACC_H_INCLUDED
#define __ACC_H_INCLUDED 1
#define ACC_VERSION 20081229L
#define ACC_VERSION 20100419L
#if defined(__CYGWIN32__) && !defined(__CYGWIN__)
# define __CYGWIN__ __CYGWIN32__
#endif
@@ -756,6 +758,9 @@
#elif (UINT_MAX <= ACC_0xffffL) && defined(__AVR__)
# define ACC_ARCH_AVR 1
# define ACC_INFO_ARCH "avr"
#elif defined(__avr32__) || defined(__AVR32__)
# define ACC_ARCH_AVR32 1
# define ACC_INFO_ARCH "avr32"
#elif defined(__bfin__)
# define ACC_ARCH_BLACKFIN 1
# define ACC_INFO_ARCH "blackfin"
@@ -1314,9 +1319,11 @@ extern "C" {
#elif !defined(ACC_ABI_BIG_ENDIAN) && !defined(ACC_ABI_LITTLE_ENDIAN)
#if (ACC_ARCH_ALPHA) && (ACC_ARCH_CRAY_MPP)
# define ACC_ABI_BIG_ENDIAN 1
#elif (ACC_ARCH_IA64) && (ACC_OS_POSIX_LINUX || ACC_OS_WIN64)
# define ACC_ABI_LITTLE_ENDIAN 1
#elif (ACC_ARCH_ALPHA || ACC_ARCH_AMD64 || ACC_ARCH_BLACKFIN || ACC_ARCH_CRIS || ACC_ARCH_I086 || ACC_ARCH_I386 || ACC_ARCH_MSP430)
# define ACC_ABI_LITTLE_ENDIAN 1
#elif (ACC_ARCH_M68K || ACC_ARCH_S390)
#elif (ACC_ARCH_AVR32 || ACC_ARCH_M68K || ACC_ARCH_S390)
# define ACC_ABI_BIG_ENDIAN 1
#elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__)
# if (__LITTLE_ENDIAN__ == 1)
@@ -1561,7 +1568,7 @@ extern "C" {
# define __acc_nothrow __attribute__((__nothrow__))
#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 450) && ACC_CC_SYNTAX_MSC) && defined(__cplusplus)
# define __acc_nothrow __declspec(nothrow)
#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 800) && ACC_CC_SYNTAX_GNUC)
#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 900) && ACC_CC_SYNTAX_GNUC)
# define __acc_nothrow __attribute__((__nothrow__))
#elif (ACC_CC_LLVM || ACC_CC_PATHSCALE)
# define __acc_nothrow __attribute__((__nothrow__))
@@ -1666,6 +1673,15 @@ extern "C" {
# define ACC_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init
# endif
#endif
#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)
# 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)))))
# endif
#endif
#if !defined(ACC_COMPILE_TIME_ASSERT_HEADER)
# if (ACC_CC_AZTECC || ACC_CC_ZORTECHC)
# define ACC_COMPILE_TIME_ASSERT_HEADER(e) extern int __acc_cta[1-!(e)];
@@ -2301,8 +2317,12 @@ extern "C" {
# undef HAVE_SNPRINTF
# undef HAVE_VSNPRINTF
#elif (ACC_CC_INTELC)
# ifndef snprintf
# define snprintf _snprintf
# endif
# ifndef vsnprintf
# define vsnprintf _vsnprintf
# endif
#elif (ACC_CC_LCCWIN32)
# define utime _utime
#elif (ACC_CC_MSC)
@@ -2313,8 +2333,16 @@ extern "C" {
# undef HAVE_SNPRINTF
# undef HAVE_VSNPRINTF
# elif (_MSC_VER < 1500)
# ifndef snprintf
# define snprintf _snprintf
# endif
# ifndef vsnprintf
# define vsnprintf _vsnprintf
# endif
# else
# ifndef snprintf
# define snprintf _snprintf
# endif
# endif
# if ((_MSC_VER < 800) && ACC_OS_WIN16)
# undef HAVE_ALLOCA
@@ -3941,11 +3969,10 @@ typedef struct acc_pclock_t acc_pclock_t;
#define ACC_PCLOCK_MONOTONIC 1
#define ACC_PCLOCK_PROCESS_CPUTIME_ID 2
#define ACC_PCLOCK_THREAD_CPUTIME_ID 3
#define ACC_PCLOCK_REALTIME_HR 4
#define ACC_PCLOCK_MONOTONIC_HR 5
struct acc_pclock_handle_t {
acclib_handle_t h;
int mode;
int read_error;
const char* name;
int (*gettime) (acc_pclock_handle_p, acc_pclock_p);
#if defined(acc_int64l_t)
@@ -3982,6 +4009,7 @@ ACCLIB_EXTERN(int, acc_pclock_flush_cpu_cache) (acc_pclock_handle_p, unsigned);
typedef struct {
acclib_handle_t h;
int mode;
int read_error;
const char* name;
#if defined(__ACCLIB_UCLOCK_USE_PERFCTR)
acc_perfctr_handle_t pch;
@@ -5598,6 +5626,42 @@ ACCLIB_PUBLIC(long, acc_safe_hwrite) (int fd, const acc_hvoid_p buf, long size)
#if !defined(ACCLIB_PUBLIC)
# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
#endif
#if 0 && (ACC_OS_POSIX_LINUX && ACC_ARCH_AMD64 && ACC_ASM_SYNTAX_GNUC)
#ifndef acc_pclock_syscall_clock_gettime
#define acc_pclock_syscall_clock_gettime acc_pclock_syscall_clock_gettime
#endif
static __acc_noinline long acc_pclock_syscall_clock_gettime(long clockid, struct timespec *ts)
{
long r;
__asm__ __volatile__("syscall\n" : "=a" (r) : "0" (228), "D" (clockid), "S" (ts) : __ACC_ASM_CLOBBER);
return r;
}
#endif
#if 0 && (ACC_OS_POSIX_LINUX && ACC_ARCH_I386 && ACC_ASM_SYNTAX_GNUC)
#ifndef acc_pclock_syscall_clock_gettime
#define acc_pclock_syscall_clock_gettime acc_pclock_syscall_clock_gettime
#endif
static __acc_noinline long acc_pclock_syscall_clock_gettime(long clockid, struct timespec *ts)
{
long r;
__asm__ __volatile__("int $0x80\n" : "=a" (r) : "0" (265), "b" (clockid), "c" (ts) : __ACC_ASM_CLOBBER);
return r;
}
#endif
#if 0 && defined(acc_pclock_syscall_clock_gettime)
#ifndef acc_pclock_read_clock_gettime_r_syscall
#define acc_pclock_read_clock_gettime_r_syscall acc_pclock_read_clock_gettime_r_syscall
#endif
static int acc_pclock_read_clock_gettime_r_syscall(acc_pclock_handle_p h, acc_pclock_p c)
{
struct timespec ts;
if (acc_pclock_syscall_clock_gettime(0, &ts) != 0)
return -1;
c->tv_sec = ts.tv_sec;
c->tv_nsec = ts.tv_nsec;
ACC_UNUSED(h); return 0;
}
#endif
#if defined(HAVE_GETTIMEOFDAY)
#ifndef acc_pclock_read_gettimeofday
#define acc_pclock_read_gettimeofday acc_pclock_read_gettimeofday
@@ -5642,6 +5706,20 @@ static int acc_pclock_read_clock(acc_pclock_handle_p h, acc_pclock_p c)
ACC_UNUSED(h); return 0;
}
#endif
#if 1 && defined(acc_pclock_syscall_clock_gettime)
#ifndef acc_pclock_read_clock_gettime_m_syscall
#define acc_pclock_read_clock_gettime_m_syscall acc_pclock_read_clock_gettime_m_syscall
#endif
static int acc_pclock_read_clock_gettime_m_syscall(acc_pclock_handle_p h, acc_pclock_p c)
{
struct timespec ts;
if (acc_pclock_syscall_clock_gettime(1, &ts) != 0)
return -1;
c->tv_sec = ts.tv_sec;
c->tv_nsec = ts.tv_nsec;
ACC_UNUSED(h); return 0;
}
#endif
#if (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__) && defined(UCLOCKS_PER_SEC)
#ifndef acc_pclock_read_uclock
#define acc_pclock_read_uclock acc_pclock_read_uclock
@@ -5660,10 +5738,10 @@ static int acc_pclock_read_uclock(acc_pclock_handle_p h, acc_pclock_p c)
}
#endif
#if 0 && defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_PROCESS_CPUTIME_ID) && defined(acc_int64l_t)
#ifndef acc_pclock_read_clock_gettime_p
#define acc_pclock_read_clock_gettime_p acc_pclock_read_clock_gettime_p
#ifndef acc_pclock_read_clock_gettime_p_libc
#define acc_pclock_read_clock_gettime_p_libc acc_pclock_read_clock_gettime_p_libc
#endif
static int acc_pclock_read_clock_gettime_p(acc_pclock_handle_p h, acc_pclock_p c)
static int acc_pclock_read_clock_gettime_p_libc(acc_pclock_handle_p h, acc_pclock_p c)
{
struct timespec ts;
if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) != 0)
@@ -5673,6 +5751,20 @@ static int acc_pclock_read_clock_gettime_p(acc_pclock_handle_p h, acc_pclock_p c
ACC_UNUSED(h); return 0;
}
#endif
#if 1 && defined(acc_pclock_syscall_clock_gettime)
#ifndef acc_pclock_read_clock_gettime_p_syscall
#define acc_pclock_read_clock_gettime_p_syscall acc_pclock_read_clock_gettime_p_syscall
#endif
static int acc_pclock_read_clock_gettime_p_syscall(acc_pclock_handle_p h, acc_pclock_p c)
{
struct timespec ts;
if (acc_pclock_syscall_clock_gettime(2, &ts) != 0)
return -1;
c->tv_sec = ts.tv_sec;
c->tv_nsec = ts.tv_nsec;
ACC_UNUSED(h); return 0;
}
#endif
#if (ACC_OS_CYGWIN || ACC_OS_WIN32 || ACC_OS_WIN64) && (ACC_HAVE_WINDOWS_H) && defined(acc_int64l_t)
#ifndef acc_pclock_read_getprocesstimes
#define acc_pclock_read_getprocesstimes acc_pclock_read_getprocesstimes
@@ -5734,10 +5826,10 @@ static int acc_pclock_read_perfctr(acc_pclock_handle_p h, acc_pclock_p c)
}
#endif
#if 0 && defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_THREAD_CPUTIME_ID) && defined(acc_int64l_t)
#ifndef acc_pclock_read_clock_gettime_t
#define acc_pclock_read_clock_gettime_t acc_pclock_read_clock_gettime_t
#ifndef acc_pclock_read_clock_gettime_t_libc
#define acc_pclock_read_clock_gettime_t_libc acc_pclock_read_clock_gettime_t_libc
#endif
static int acc_pclock_read_clock_gettime_t(acc_pclock_handle_p h, acc_pclock_p c)
static int acc_pclock_read_clock_gettime_t_libc(acc_pclock_handle_p h, acc_pclock_p c)
{
struct timespec ts;
if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts) != 0)
@@ -5747,6 +5839,20 @@ static int acc_pclock_read_clock_gettime_t(acc_pclock_handle_p h, acc_pclock_p c
ACC_UNUSED(h); return 0;
}
#endif
#if 1 && defined(acc_pclock_syscall_clock_gettime)
#ifndef acc_pclock_read_clock_gettime_t_syscall
#define acc_pclock_read_clock_gettime_t_syscall acc_pclock_read_clock_gettime_t_syscall
#endif
static int acc_pclock_read_clock_gettime_t_syscall(acc_pclock_handle_p h, acc_pclock_p c)
{
struct timespec ts;
if (acc_pclock_syscall_clock_gettime(3, &ts) != 0)
return -1;
c->tv_sec = ts.tv_sec;
c->tv_nsec = ts.tv_nsec;
ACC_UNUSED(h); return 0;
}
#endif
#if (ACC_OS_CYGWIN || ACC_OS_WIN32 || ACC_OS_WIN64) && (ACC_HAVE_WINDOWS_H) && defined(acc_int64l_t)
#ifndef acc_pclock_read_getthreadtimes
#define acc_pclock_read_getthreadtimes acc_pclock_read_getthreadtimes
@@ -5773,6 +5879,7 @@ ACCLIB_PUBLIC(int, acc_pclock_open) (acc_pclock_handle_p h, int mode)
int i;
h->h = (acclib_handle_t) 0;
h->mode = -1;
h->read_error = 2;
h->name = NULL;
h->gettime = 0;
#if defined(acc_int64l_t)
@@ -5780,29 +5887,42 @@ ACCLIB_PUBLIC(int, acc_pclock_open) (acc_pclock_handle_p h, int mode)
#endif
switch (mode)
{
case ACC_PCLOCK_REALTIME_HR:
# if defined(acc_pclock_read_gettimeofday)
h->gettime = acc_pclock_read_gettimeofday;
h->name = "gettimeofday";
# endif
break;
case ACC_PCLOCK_REALTIME:
# if defined(acc_pclock_read_gettimeofday)
h->gettime = acc_pclock_read_gettimeofday;
h->name = "gettimeofday";
# if defined(acc_pclock_read_clock_gettime_r_syscall)
if (acc_pclock_read_clock_gettime_r_syscall(h, &c) == 0) {
h->gettime = acc_pclock_read_clock_gettime_r_syscall;
h->name = "CLOCK_REALTIME/syscall";
break;
}
# endif
break;
case ACC_PCLOCK_MONOTONIC_HR:
# if defined(acc_pclock_read_uclock)
h->gettime = acc_pclock_read_uclock;
h->name = "uclock";
# if defined(acc_pclock_read_gettimeofday)
if (acc_pclock_read_gettimeofday(h, &c) == 0) {
h->gettime = acc_pclock_read_gettimeofday;
h->name = "gettimeofday";
break;
}
# endif
break;
case ACC_PCLOCK_MONOTONIC:
# if defined(acc_pclock_read_clock_gettime_m_syscall)
if (acc_pclock_read_clock_gettime_m_syscall(h, &c) == 0) {
h->gettime = acc_pclock_read_clock_gettime_m_syscall;
h->name = "CLOCK_MONOTONIC/syscall";
break;
}
# endif
# if defined(acc_pclock_read_uclock)
if (acc_pclock_read_uclock(h, &c) == 0) {
h->gettime = acc_pclock_read_uclock;
h->name = "uclock";
break;
}
# endif
# if defined(acc_pclock_read_clock)
if (!h->gettime) {
if (acc_pclock_read_clock(h, &c) == 0) {
h->gettime = acc_pclock_read_clock;
h->name = "clock";
break;
}
# endif
break;
@@ -5815,35 +5935,52 @@ ACCLIB_PUBLIC(int, acc_pclock_open) (acc_pclock_handle_p h, int mode)
}
# endif
# if defined(acc_pclock_read_getprocesstimes)
if (!h->gettime && acc_pclock_read_getprocesstimes(h, &c) == 0) {
if (acc_pclock_read_getprocesstimes(h, &c) == 0) {
h->gettime = acc_pclock_read_getprocesstimes;
h->name = "GetProcessTimes";
break;
}
# endif
# if defined(acc_pclock_read_clock_gettime_p)
if (!h->gettime && acc_pclock_read_clock_gettime_p(h, &c) == 0) {
h->gettime = acc_pclock_read_clock_gettime_p;
h->name = "CLOCK_PROCESS_CPUTIME_ID";
# if defined(acc_pclock_read_clock_gettime_p_syscall)
if (acc_pclock_read_clock_gettime_p_syscall(h, &c) == 0) {
h->gettime = acc_pclock_read_clock_gettime_p_syscall;
h->name = "CLOCK_PROCESS_CPUTIME_ID/syscall";
break;
}
# endif
# if defined(acc_pclock_read_clock_gettime_p_libc)
if (acc_pclock_read_clock_gettime_p_libc(h, &c) == 0) {
h->gettime = acc_pclock_read_clock_gettime_p_libc;
h->name = "CLOCK_PROCESS_CPUTIME_ID/libc";
break;
}
# endif
# if defined(acc_pclock_read_getrusage)
h->gettime = acc_pclock_read_getrusage;
h->name = "getrusage";
if (acc_pclock_read_getrusage(h, &c) == 0) {
h->gettime = acc_pclock_read_getrusage;
h->name = "getrusage";
break;
}
# endif
break;
case ACC_PCLOCK_THREAD_CPUTIME_ID:
# if defined(acc_pclock_read_getthreadtimes)
if (!h->gettime && acc_pclock_read_getthreadtimes(h, &c) == 0) {
if (acc_pclock_read_getthreadtimes(h, &c) == 0) {
h->gettime = acc_pclock_read_getthreadtimes;
h->name = "GetThreadTimes";
}
# endif
# if defined(acc_pclock_read_clock_gettime_t)
if (!h->gettime && acc_pclock_read_clock_gettime_t(h, &c) == 0) {
h->gettime = acc_pclock_read_clock_gettime_t;
h->name = "CLOCK_THREAD_CPUTIME_ID";
# if defined(acc_pclock_read_clock_gettime_t_syscall)
if (acc_pclock_read_clock_gettime_t_syscall(h, &c) == 0) {
h->gettime = acc_pclock_read_clock_gettime_t_syscall;
h->name = "CLOCK_THREAD_CPUTIME_ID/syscall";
break;
}
# endif
# if defined(acc_pclock_read_clock_gettime_t_libc)
if (acc_pclock_read_clock_gettime_t_libc(h, &c) == 0) {
h->gettime = acc_pclock_read_clock_gettime_t_libc;
h->name = "CLOCK_THREAD_CPUTIME_ID/libc";
break;
}
# endif
@@ -5854,6 +5991,7 @@ ACCLIB_PUBLIC(int, acc_pclock_open) (acc_pclock_handle_p h, int mode)
if (!h->h)
h->h = (acclib_handle_t) 1;
h->mode = mode;
h->read_error = 0;
if (!h->name)
h->name = "unknown";
for (i = 0; i < 10; i++) {
@@ -5865,10 +6003,6 @@ ACCLIB_PUBLIC(int, acc_pclock_open_default) (acc_pclock_handle_p h)
{
if (acc_pclock_open(h, ACC_PCLOCK_PROCESS_CPUTIME_ID) == 0)
return 0;
if (acc_pclock_open(h, ACC_PCLOCK_MONOTONIC_HR) == 0)
return 0;
if (acc_pclock_open(h, ACC_PCLOCK_REALTIME_HR) == 0)
return 0;
if (acc_pclock_open(h, ACC_PCLOCK_MONOTONIC) == 0)
return 0;
if (acc_pclock_open(h, ACC_PCLOCK_REALTIME) == 0)
@@ -5894,6 +6028,7 @@ ACCLIB_PUBLIC(void, acc_pclock_read) (acc_pclock_handle_p h, acc_pclock_p c)
if (h->gettime(h, c) == 0)
return;
}
h->read_error = 1;
#if defined(acc_int64l_t)
c->tv_sec = 0;
#else
@@ -6009,6 +6144,7 @@ ACCLIB_PUBLIC(int, acc_uclock_open) (acc_uclock_handle_p h)
#endif
h->h = (acclib_handle_t) 1;
h->mode = 0;
h->read_error = 0;
h->name = NULL;
#if (__ACCLIB_UCLOCK_USE_PERFCTR)
h->pch.h = 0;
@@ -6062,6 +6198,7 @@ ACCLIB_PUBLIC(void, acc_uclock_read) (acc_uclock_handle_p h, acc_uclock_p c)
return;
} else {
h->mode = 0; h->qpf = 0.0; c->qpc = 0;
h->read_error = 1;
}
}
#endif
@@ -6354,6 +6491,8 @@ ACCLIB_PUBLIC(int, acc_mkdir) (const char* name, unsigned mode)
# else
return mkdir(name);
# endif
#elif (ACC_CC_WATCOMC)
return mkdir(name, (mode_t) mode);
#else
return mkdir(name, mode);
#endif
+3 -3
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -57,7 +57,7 @@ void printClearLine(FILE *f)
fflush(stdout); fflush(stderr);
if (f == NULL)
f = stdout;
con_fprintf(f,clear_line_msg);
con_fprintf(f, "%s", clear_line_msg);
fflush(f);
printSetNl(0);
}
+3 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -142,6 +142,7 @@ struct options_t {
bool is_ptinterp; // is PT_INTERP, so don't adjust auxv_t
bool use_ptinterp; // use PT_INTERP /opt/upx/run
bool make_ptinterp; // make PT_INTERP [ignore current file!]
bool unmap_all_pages; // thus /proc/self/exe vanishes
unsigned char osabi0; // replacement if 0==.e_ident[EI_OSABI]
enum { SCRIPT_MAX = 32 };
const char *script_name;
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
+51 -4
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -91,6 +91,27 @@ __packed_struct(Dyn)
__packed_struct_end()
template <class TElfITypes>
__packed_struct(Rel)
typedef typename TElfITypes::Xword Xword;
typedef typename TElfITypes::Addr Addr;
Addr r_offset;
Xword r_info;
__packed_struct_end()
template <class TElfITypes>
__packed_struct(Rela)
typedef typename TElfITypes::Xword Xword;
typedef typename TElfITypes::Addr Addr;
Addr r_offset;
Xword r_info;
Xword r_addend;
__packed_struct_end()
template <class TElfITypes>
__packed_struct(External_Note)
typedef typename TElfITypes::Word Word;
@@ -172,7 +193,8 @@ __packed_struct(Sym)
static unsigned int get_st_bind(unsigned x) { return 0xf & (x>>4); }
static unsigned int get_st_type(unsigned x) { return 0xf & x ; }
static unsigned char make_st_info(unsigned bind, unsigned type) { return (bind<<4) + (0xf & type); }
static unsigned char make_st_info(unsigned bind, unsigned type)
{ return (unsigned char) (((bind<<4) + (0xf & type)) & 0xff); }
__packed_struct_end()
@@ -248,7 +270,8 @@ __packed_struct(Sym)
static unsigned int get_st_bind(unsigned x) { return 0xf & (x>>4); }
static unsigned int get_st_type(unsigned x) { return 0xf & x ; }
static unsigned char make_st_info(unsigned bind, unsigned type) { return (bind<<4) + (0xf & type); }
static unsigned char make_st_info(unsigned bind, unsigned type)
{ return (unsigned char) (((bind<<4) + (0xf & type)) & 0xff); }
__packed_struct_end()
@@ -277,6 +300,8 @@ struct ElfClass_32
typedef N_Elf32::Phdr<ElfITypes> Phdr;
typedef N_Elf32::Shdr<ElfITypes> Shdr;
typedef N_Elf ::Dyn <ElfITypes> Dyn;
typedef N_Elf ::Rel <ElfITypes> Rel;
typedef N_Elf ::Rela<ElfITypes> Rela;
typedef N_Elf32::Sym <ElfITypes> Sym;
typedef N_Elf ::External_Note<ElfITypes> External_Note;
@@ -286,11 +311,15 @@ struct ElfClass_32
COMPILE_TIME_ASSERT(sizeof(Phdr) == 32)
COMPILE_TIME_ASSERT(sizeof(Shdr) == 40)
COMPILE_TIME_ASSERT(sizeof(Dyn) == 8)
COMPILE_TIME_ASSERT(sizeof(Rel) == 8)
COMPILE_TIME_ASSERT(sizeof(Rela) == 12)
COMPILE_TIME_ASSERT(sizeof(Sym) == 16)
COMPILE_TIME_ASSERT_ALIGNED1(Ehdr)
COMPILE_TIME_ASSERT_ALIGNED1(Phdr)
COMPILE_TIME_ASSERT_ALIGNED1(Shdr)
COMPILE_TIME_ASSERT_ALIGNED1(Dyn)
COMPILE_TIME_ASSERT_ALIGNED1(Rel)
COMPILE_TIME_ASSERT_ALIGNED1(Rela)
COMPILE_TIME_ASSERT_ALIGNED1(Sym)
}
};
@@ -312,6 +341,8 @@ struct ElfClass_64
typedef N_Elf64::Phdr<ElfITypes> Phdr;
typedef N_Elf64::Shdr<ElfITypes> Shdr;
typedef N_Elf ::Dyn <ElfITypes> Dyn;
typedef N_Elf ::Rel <ElfITypes> Rel;
typedef N_Elf ::Rela<ElfITypes> Rela;
typedef N_Elf64::Sym <ElfITypes> Sym;
typedef N_Elf ::External_Note<ElfITypes> External_Note;
@@ -321,11 +352,15 @@ struct ElfClass_64
COMPILE_TIME_ASSERT(sizeof(Phdr) == 56)
COMPILE_TIME_ASSERT(sizeof(Shdr) == 64)
COMPILE_TIME_ASSERT(sizeof(Dyn) == 16)
COMPILE_TIME_ASSERT(sizeof(Rel) == 16)
COMPILE_TIME_ASSERT(sizeof(Rela) == 24)
COMPILE_TIME_ASSERT(sizeof(Sym) == 24)
COMPILE_TIME_ASSERT_ALIGNED1(Ehdr)
COMPILE_TIME_ASSERT_ALIGNED1(Phdr)
COMPILE_TIME_ASSERT_ALIGNED1(Shdr)
COMPILE_TIME_ASSERT_ALIGNED1(Dyn)
COMPILE_TIME_ASSERT_ALIGNED1(Rel)
COMPILE_TIME_ASSERT_ALIGNED1(Rela)
COMPILE_TIME_ASSERT_ALIGNED1(Sym)
}
};
@@ -350,6 +385,8 @@ typedef ElfClass_Host32::Ehdr Elf32_Ehdr;
typedef ElfClass_Host32::Phdr Elf32_Phdr;
typedef ElfClass_Host32::Shdr Elf32_Shdr;
typedef ElfClass_Host32::Dyn Elf32_Dyn;
typedef ElfClass_Host32::Rel Elf32_Rel;
typedef ElfClass_Host32::Rela Elf32_Rela;
typedef ElfClass_Host32::Sym Elf32_Sym;
typedef ElfClass_Host32::External_Note Elf32_External_Note;
@@ -357,6 +394,8 @@ typedef ElfClass_Host64::Ehdr Elf64_Ehdr;
typedef ElfClass_Host64::Phdr Elf64_Phdr;
typedef ElfClass_Host64::Shdr Elf64_Shdr;
typedef ElfClass_Host64::Dyn Elf64_Dyn;
typedef ElfClass_Host64::Rel Elf64_Rel;
typedef ElfClass_Host64::Rela Elf64_Rela;
typedef ElfClass_Host64::Sym Elf64_Sym;
typedef ElfClass_Host64::External_Note Elf64_External_Note;
@@ -364,6 +403,8 @@ typedef ElfClass_BE32::Ehdr Elf_BE32_Ehdr;
typedef ElfClass_BE32::Phdr Elf_BE32_Phdr;
typedef ElfClass_BE32::Shdr Elf_BE32_Shdr;
typedef ElfClass_BE32::Dyn Elf_BE32_Dyn;
typedef ElfClass_BE32::Rel Elf_BE32_Rel;
typedef ElfClass_BE32::Rela Elf_BE32_Rela;
typedef ElfClass_BE32::Sym Elf_BE32_Sym;
typedef ElfClass_BE32::External_Note Elf_BE32_External_Note;
@@ -371,6 +412,8 @@ typedef ElfClass_BE64::Ehdr Elf_BE64_Ehdr;
typedef ElfClass_BE64::Phdr Elf_BE64_Phdr;
typedef ElfClass_BE64::Shdr Elf_BE64_Shdr;
typedef ElfClass_BE64::Dyn Elf_BE64_Dyn;
typedef ElfClass_BE64::Rel Elf_BE64_Rel;
typedef ElfClass_BE64::Rela Elf_BE64_Rela;
typedef ElfClass_BE64::Sym Elf_BE64_Sym;
typedef ElfClass_BE64::External_Note Elf_BE64_External_Note;
@@ -378,6 +421,8 @@ typedef ElfClass_LE32::Ehdr Elf_LE32_Ehdr;
typedef ElfClass_LE32::Phdr Elf_LE32_Phdr;
typedef ElfClass_LE32::Shdr Elf_LE32_Shdr;
typedef ElfClass_LE32::Dyn Elf_LE32_Dyn;
typedef ElfClass_LE32::Rel Elf_LE32_Rel;
typedef ElfClass_LE32::Rela Elf_LE32_Rela;
typedef ElfClass_LE32::Sym Elf_LE32_Sym;
typedef ElfClass_LE32::External_Note Elf_LE32_External_Note;
@@ -385,6 +430,8 @@ typedef ElfClass_LE64::Ehdr Elf_LE64_Ehdr;
typedef ElfClass_LE64::Phdr Elf_LE64_Phdr;
typedef ElfClass_LE64::Shdr Elf_LE64_Shdr;
typedef ElfClass_LE64::Dyn Elf_LE64_Dyn;
typedef ElfClass_LE64::Rel Elf_LE64_Rel;
typedef ElfClass_LE64::Rela Elf_LE64_Rela;
typedef ElfClass_LE64::Sym Elf_LE64_Sym;
typedef ElfClass_LE64::External_Note Elf_LE64_External_Note;
+12 -3
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -145,10 +145,19 @@
DT_HASH = 4, /* Hash table of symbol names */
DT_STRTAB = 5, /* String table */
DT_SYMTAB = 6, /* Symbol table */
DT_RELA = 7, /* Relocations which do contain an addend */
DT_RELAENT = 9, /* Size of one RELA relocation */
DT_INIT = 12, /* Address of init function */
DT_REL = 17, /* Relocations which contain no addend */
DT_RELENT = 19, /* Size of one Rel relocation */
DT_STRSZ = 10, /* Sizeof string table */
DT_PLTREL = 20, /* Type of reloc in PLT */
DT_JMPREL = 23, /* Address of PLT relocs */
DT_GNU_HASH = 0x6ffffef5 /* GNU-style hash table */
DT_CHECKSUM = 0x6ffffdf8, /* Only for prelink? */
DT_GNU_HASH = 0x6ffffef5, /* GNU-style hash table */
DT_VERSYM = 0x6ffffff0, /* version[] for each symbol */
DT_VERDEF = 0x6ffffffc, /* version definitions[] */
DT_VERNEEDED= 0x6ffffffe /* version[] needed */
};
#endif
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -56,16 +56,16 @@ PackExe::PackExe(InputFile *f) :
ih_exesize = ih_imagesize = ih_overlay = 0;
stack_for_lzma = 0;
use_clear_dirty_stack = false;
// disable lzma for "--brute" unless explicitly given "--lzma"
if (opt->all_methods_use_lzma && !opt->method_lzma_seen)
opt->all_methods_use_lzma = false;
}
const int *PackExe::getCompressionMethods(int method, int level) const
{
bool small = ih_imagesize <= 256*1024;
// disable lzma for "--brute" unless explicitly given "--lzma"
// WARNING: this side effect persists for later files!
if (opt->all_methods_use_lzma && !opt->method_lzma_seen)
opt->all_methods_use_lzma = false;
return Packer::getDefaultCompressionMethods_8(method, level, small);
}
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
+848 -315
View File
File diff suppressed because it is too large Load Diff
+46 -11
View File
@@ -2,9 +2,9 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 2000-2009 John F. Reiser
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2000-2010 John F. Reiser
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -61,9 +61,14 @@ protected:
) = 0;
virtual void defineSymbols(Filter const *);
virtual void addStubEntrySections(Filter const *);
virtual void unpack(OutputFile *fo) = 0;
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 acc_uint64l_t elf_unsigned_dynamic(unsigned) const = 0;
protected:
unsigned e_phnum; /* Program header table entry count */
char *file_image; // if ET_DYN investigation
char const *dynstr; // from DT_STRTAB
@@ -72,6 +77,10 @@ protected:
unsigned sz_pack2; // after pack2(), before loader
unsigned lg2_page; // log2(PAGE_SIZE)
unsigned page_size; // 1u<<lg2_page
unsigned xct_off; // shared library: file offset of SHT_EXECINSTR
unsigned hatch_off; // file offset of escape hatch
acc_uint64l_t load_va; // PT_LOAD[0].p_vaddr
acc_uint64l_t xct_va; // minimum SHT_EXECINSTR virtual address
unsigned short e_machine;
unsigned char ei_class;
@@ -122,11 +131,12 @@ protected:
static unsigned elf_hash(char const *) /*const*/;
static unsigned gnu_hash(char const *) /*const*/;
virtual void const *elf_find_dynamic(unsigned) const;
virtual Elf32_Sym const *elf_lookup(char const *) const;
virtual unsigned elf_get_offset_from_address(unsigned) const;
virtual unsigned elf_get_offset_from_address(acc_uint64l_t) 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;
acc_uint64l_t elf_unsigned_dynamic(unsigned) const;
protected:
Elf32_Ehdr ehdri; // from input file
@@ -219,11 +229,29 @@ 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;
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;
acc_uint64l_t elf_unsigned_dynamic(unsigned) const;
protected:
Elf64_Ehdr ehdri; // from input file
Elf64_Phdr *phdri; // for input file
Elf64_Shdr const *shdri; // from input file
acc_uint64l_t page_mask; // AND clears the offset-within-page
Elf64_Dyn const *dynseg; // from PT_DYNAMIC
unsigned int const *hashtab; // from DT_HASH
unsigned int const *gashtab; // from DT_GNU_HASH
Elf64_Sym const *dynsym; // from DT_SYMTAB
char const *shstrtab; // via Elf64_Shdr
int n_elf_shnum; // via e_shnum
Elf64_Shdr const *sec_strndx;
Elf64_Shdr const *sec_dynsym;
Elf64_Shdr const *sec_dynstr;
__packed_struct(cprElfHdr1)
Elf64_Ehdr ehdr;
Elf64_Phdr phdr[1];
@@ -258,21 +286,30 @@ class PackLinuxElf32Be : public PackLinuxElf32
{
typedef PackLinuxElf32 super;
protected:
PackLinuxElf32Be(InputFile *f) : super(f) { bele = &N_BELE_RTP::be_policy; }
PackLinuxElf32Be(InputFile *f) : super(f) {
bele = &N_BELE_RTP::be_policy;
e_phnum = get_te16(&ehdri.e_phnum);
}
};
class PackLinuxElf32Le : public PackLinuxElf32
{
typedef PackLinuxElf32 super;
protected:
PackLinuxElf32Le(InputFile *f) : super(f) { bele = &N_BELE_RTP::le_policy; }
PackLinuxElf32Le(InputFile *f) : super(f) {
bele = &N_BELE_RTP::le_policy;
e_phnum = get_te16(&ehdri.e_phnum);
}
};
class PackLinuxElf64Le : public PackLinuxElf64
{
typedef PackLinuxElf64 super;
protected:
PackLinuxElf64Le(InputFile *f) : super(f) { bele = &N_BELE_RTP::le_policy; }
PackLinuxElf64Le(InputFile *f) : super(f) {
bele = &N_BELE_RTP::le_policy;
e_phnum = get_te16(&ehdri.e_phnum);
}
};
@@ -336,8 +373,6 @@ public:
virtual const char *getFullName(const options_t *) const { return "i386-linux.elf"; }
virtual const int *getFilters() const;
virtual void unpack(OutputFile *fo);
protected:
virtual void pack1(OutputFile *, Filter &); // generate executable header
+3 -3
View File
@@ -2,9 +2,9 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 2001-2009 John F. Reiser
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2001-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 2000-2009 John F. Reiser
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2000-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 2000-2009 John F. Reiser
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2000-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 2000-2009 John F. Reiser
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2000-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 2000-2009 John F. Reiser
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2000-2010 John F. Reiser
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
+152 -14
View File
@@ -2,7 +2,7 @@
This file is part of the UPX executable compressor.
Copyright (C) 2004-2009 John Reiser
Copyright (C) 2004-2010 John Reiser
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -70,6 +70,8 @@ static const
static const
#include "stub/powerpc-darwin.dylib-entry.h"
static const
#include "stub/amd64-darwin.dylib-entry.h"
static const unsigned lc_segment[2] = {
0x1, 0x19
@@ -77,6 +79,12 @@ static const unsigned lc_segment[2] = {
//Mach_segment_command::LC_SEGMENT_64
};
static const unsigned lc_routines[2] = {
0x11, 0x1a
//Mach_segment_command::LC_ROUTINES,
//Mach_segment_command::LC_ROUTINES_64
};
template <class T>
PackMachBase<T>::PackMachBase(InputFile *f, unsigned cputype, unsigned filetype,
unsigned flavor, unsigned count, unsigned size) :
@@ -101,6 +109,11 @@ PackDylibI386::PackDylibI386(InputFile *f) : super(f)
my_filetype = Mach_header::MH_DYLIB;
}
PackDylibAMD64::PackDylibAMD64(InputFile *f) : super(f)
{
my_filetype = Mach_header::MH_DYLIB;
}
PackDylibPPC32::PackDylibPPC32(InputFile *f) : super(f)
{
my_filetype = Mach_header::MH_DYLIB;
@@ -262,7 +275,7 @@ void PackMachI386::addStubEntrySections(Filter const *ft)
addLoader("FOLDEXEC", NULL);
}
void PackMachAMD64::addStubEntrySections(Filter const */*ft*/)
void PackMachAMD64::addStubEntrySections(Filter const * /*ft*/)
{
addLoader("MACHMAINX", NULL);
//addLoader(getDecompressorSections(), NULL);
@@ -277,7 +290,7 @@ void PackMachAMD64::addStubEntrySections(Filter const */*ft*/)
addLoader("MACHMAINY,IDENTSTR,+40,MACHMAINZ,FOLDEXEC", NULL);
}
void PackMachARMEL::addStubEntrySections(Filter const */*ft*/)
void PackMachARMEL::addStubEntrySections(Filter const * /*ft*/)
{
addLoader("MACHMAINX", NULL);
//addLoader(getDecompressorSections(), NULL);
@@ -386,6 +399,14 @@ PackDylibI386::buildLoader(const Filter *ft)
0, 0, ft );
}
void
PackDylibAMD64::buildLoader(const Filter *ft)
{
buildMachLoader(
stub_amd64_darwin_dylib_entry, sizeof(stub_amd64_darwin_dylib_entry),
0, 0, ft );
}
void
PackDylibPPC32::buildLoader(const Filter *ft)
{
@@ -576,10 +597,60 @@ void PackMachBase<T>::pack4dylib( // append PackHeader
Mach_section_command seccmdtmp;
for (unsigned j = 0; j < nsects; ++secp, ++j) {
seccmdtmp = *secp;
seccmdtmp.offset += slide;
if (seccmdtmp.nreloc) {
seccmdtmp.reloff += slide;
if (o_end_txt <= seccmdtmp.offset) { seccmdtmp.offset += slide; }
if (o_end_txt <= seccmdtmp.reloff) { seccmdtmp.reloff += slide; }
if (0==strncmp(&seccmdtmp.sectname[0], "__mod_init_func", 1+ 15)) {
if (seccmdtmp.flags==9 // FIXME: S_MOD_INIT_FUNC_POINTERS
&& seccmdtmp.nreloc==0 && seccmdtmp.size==sizeof(Addr) ) {
seccmdtmp.addr = seccmdtmp.offset = init_address -4*4 - 8;
}
else
infoWarning("unknown __mod_init_func section");
}
#if 0 /*{*/
// 2010-03-12 Stop work because I don't understand what is going on,
// and I cannot find good documentation on the meaning of various parts
// of .dylib. amd64(x86_64) is almost certain to fail in the dynamic
// loader, before the upx stub gets control. For instance:
//
// Program received signal EXC_BAD_ACCESS, Could not access memory.
// Reason: KERN_INVALID_ADDRESS at address: 0x000000015f00329a
// 0x00007fff5fc10ce3 in __dyld__ZN16ImageLoaderMachO23setupLazyPointerHandlerERKN11ImageLoader11LinkContextE ()
// (gdb) bt
// #0 0x00007fff5fc10ce3 in __dyld__ZN16ImageLoaderMachO23setupLazyPointerHandlerERKN11ImageLoader11LinkContextE ()
// #1 0x00007fff5fc138c2 in __dyld__ZN16ImageLoaderMachO6doBindERKN11ImageLoader11LinkContextEb ()
// #2 0x00007fff5fc0c0ab in __dyld__ZN11ImageLoader13recursiveBindERKNS_11LinkContextEb ()
// #3 0x00007fff5fc0c08f in __dyld__ZN11ImageLoader13recursiveBindERKNS_11LinkContextEb ()
// #4 0x00007fff5fc0f49e in __dyld__ZN11ImageLoader4linkERKNS_11LinkContextEbbRKNS_10RPathChainE ()
// #5 0x00007fff5fc04c56 in __dyld__ZN4dyld4linkEP11ImageLoaderbRKNS0_10RPathChainE ()
// #6 0x00007fff5fc06e04 in __dyld__ZN4dyld5_mainEPK11mach_headermiPPKcS5_S5_ ()
// #7 0x00007fff5fc01695 in __dyld__ZN13dyldbootstrap5startEPK11mach_headeriPPKcl ()
// #8 0x00007fff5fc0103a in __dyld__dyld_start ()
// #9 0x0000000100000000 in ?? ()
// #10 0x0000000000000001 in ?? ()
// #11 0x00007fff5fbffbd0 in ?? ()
//
// The various paragraphs below are experiments in "commenting out" pieces of
// the compressed .dylib, trying to isolate the bug(s).
// FIXME
unsigned const t = seccmdtmp.flags & 0xff;
if (t==6 // FIXME: S_NON_LAZY_SYMBOL_POINTERS
|| t==7 // FIXME: S_LAZY_SYMBOL_POINTERS
|| t==8 // FIXME: S_SYMBOL_STUBS
|| t==11 // FIXME: S_COALESCED
) {
seccmdtmp.flags = 0; // FIXME: S_REGULAR
strcpy(seccmdtmp.sectname, "__data");
}
// FIXME
if (0==strncmp("__stub_helper", &seccmdtmp.sectname[0], 1+ 13)) {
strcpy(seccmdtmp.sectname, "__text");
}
// FIXME
if (0==strncmp("__dyld", &seccmdtmp.sectname[0], 1+ 6)) {
strcpy(seccmdtmp.sectname, "__text");
}
#endif /*}*/
fo->rewrite(&seccmdtmp, sizeof(seccmdtmp));
hdrpos += sizeof(seccmdtmp);
}
@@ -635,6 +706,11 @@ void PackDylibI386::pack4(OutputFile *fo, Filter &ft) // append PackHeader
pack4dylib(fo, ft, threado.state.eip);
}
void PackDylibAMD64::pack4(OutputFile *fo, Filter &ft) // append PackHeader
{
pack4dylib(fo, ft, threado.state.rip);
}
void PackDylibPPC32::pack4(OutputFile *fo, Filter &ft) // append PackHeader
{
pack4dylib(fo, ft, threado.state.srr0);
@@ -719,6 +795,33 @@ void PackDylibI386::pack3(OutputFile *fo, Filter &ft) // append loader
sz_mach_headers = save_sz_mach_headers;
}
void PackDylibAMD64::pack3(OutputFile *fo, Filter &ft) // append loader
{
TE32 disp;
TE64 disp64;
unsigned const zero = 0;
unsigned len = fo->getBytesWritten();
fo->write(&zero, 7& (0u-len));
len += (7& (0u-len)) + sizeof(disp64) + 4*sizeof(disp);
disp64= len;
fo->write(&disp64, sizeof(disp64)); // __mod_init_func
disp = prev_init_address;
fo->write(&disp, sizeof(disp)); // user .init_address
disp = sizeof(mhdro) + mhdro.sizeofcmds + sizeof(l_info) + sizeof(p_info);
fo->write(&disp, sizeof(disp)); // src offset(compressed __TEXT)
disp = len - disp - 3*sizeof(disp);
fo->write(&disp, sizeof(disp)); // length(compressed __TEXT)
unsigned const save_sz_mach_headers(sz_mach_headers);
sz_mach_headers = 0;
super::pack3(fo, ft);
sz_mach_headers = save_sz_mach_headers;
}
void PackDylibPPC32::pack3(OutputFile *fo, Filter &ft) // append loader
{
TE32 disp;
@@ -769,7 +872,7 @@ unsigned PackMachBase<T>::find_SEGMENT_gap(
}
if (lc_seg==msegcmd[j].cmd
&& 0!=msegcmd[j].filesize ) {
unsigned const t = msegcmd[j].fileoff;
unsigned const t = (unsigned) msegcmd[j].fileoff;
if ((t - hi) < (lo - hi)) {
lo = t;
if (hi==lo) {
@@ -832,7 +935,7 @@ void PackMachBase<T>::pack2(OutputFile *fo, Filter &ft) // append compressed bo
if (lc_seg==msegcmd[k].cmd
&& 0!=(Mach_segment_command::VM_PROT_EXECUTE & msegcmd[k].initprot)
&& exe_filesize_max < msegcmd[k].filesize) {
exe_filesize_max = msegcmd[k].filesize;
exe_filesize_max = (unsigned) msegcmd[k].filesize;
}
int nx = 0;
@@ -1069,10 +1172,11 @@ template <class T>
bool PackMachBase<T>::canPack()
{
unsigned const lc_seg = lc_segment[sizeof(Addr)>>3];
unsigned const lc_rout = lc_routines[sizeof(Addr)>>3];
fi->seek(0, SEEK_SET);
fi->readx(&mhdri, sizeof(mhdri));
if ((Mach_header::MH_MAGIC + (sizeof(Addr)>>3)) !=mhdri.magic
if (((unsigned) Mach_header::MH_MAGIC + (sizeof(Addr)>>3)) !=mhdri.magic
|| my_cputype !=mhdri.cputype
|| my_filetype !=mhdri.filetype
)
@@ -1086,10 +1190,10 @@ bool PackMachBase<T>::canPack()
unsigned char const *ptr = (unsigned char const *)rawmseg;
for (unsigned j= 0; j < ncmds; ++j) {
msegcmd[j] = *(Mach_segment_command const *)ptr;
if (((Mach_segment_command const *)ptr)->cmd ==
Mach_segment_command::LC_ROUTINES) {
if (((Mach_segment_command const *)ptr)->cmd == lc_rout) {
o_routines_cmd = (const char *)ptr - (const char *)rawmseg;
prev_init_address = ((Mach_routines_command const *)ptr)->init_address;
prev_init_address =
((Mach_routines_command const *)ptr)->init_address;
}
ptr += (unsigned) ((const Mach_segment_command *)ptr)->cmdsize;
}
@@ -1170,6 +1274,7 @@ void PackMachFat::pack(OutputFile *fo)
ph.u_file_size = fat_head.arch[j].size;
fi->set_extent(fat_head.arch[j].offset, fat_head.arch[j].size);
fi->seek(0, SEEK_SET);
switch (fat_head.arch[j].cputype) {
case PackMachFat::CPU_TYPE_I386: {
typedef N_Mach::Mach_header<MachClass_LE32::MachITypes> Mach_header;
@@ -1190,6 +1295,25 @@ void PackMachFat::pack(OutputFile *fo)
packer.pack(fo);
}
} break;
case PackMachFat::CPU_TYPE_X86_64: {
typedef N_Mach::Mach_header<MachClass_LE64::MachITypes> Mach_header;
Mach_header hdr;
fi->readx(&hdr, sizeof(hdr));
if (hdr.filetype==Mach_header::MH_EXECUTE) {
PackMachAMD64 packer(fi);
packer.initPackHeader();
packer.canPack();
packer.updatePackHeader();
packer.pack(fo);
}
else if (hdr.filetype==Mach_header::MH_DYLIB) {
PackDylibAMD64 packer(fi);
packer.initPackHeader();
packer.canPack();
packer.updatePackHeader();
packer.pack(fo);
}
} break;
case PackMachFat::CPU_TYPE_POWERPC: {
typedef N_Mach::Mach_header<MachClass_BE32::MachITypes> Mach_header;
Mach_header hdr;
@@ -1237,6 +1361,7 @@ void PackMachFat::unpack(OutputFile *fo)
ph.u_file_size = fat_head.arch[j].size;
fi->set_extent(fat_head.arch[j].offset, fat_head.arch[j].size);
fi->seek(0, SEEK_SET);
switch (fat_head.arch[j].cputype) {
case PackMachFat::CPU_TYPE_I386: {
N_Mach::Mach_header<MachClass_LE32::MachITypes> hdr;
@@ -1294,8 +1419,12 @@ bool PackMachFat::canPack()
}
for (unsigned j=0; j < fat_head.fat.nfat_arch; ++j) {
fi->set_extent(fat_head.arch[j].offset, fat_head.arch[j].size);
fi->seek(0, SEEK_SET);
switch (arch[j].cputype) {
default: return false;
default:
infoWarning("unknown cputype 0x%x: %s",
(unsigned)arch[j].cputype, fi->getName());
return false;
case PackMachFat::CPU_TYPE_I386: {
PackMachI386 packer(fi);
if (!packer.canPack()) {
@@ -1304,6 +1433,14 @@ bool PackMachFat::canPack()
return false;
}
} break;
case PackMachFat::CPU_TYPE_X86_64: {
PackMachAMD64 packer(fi);
if (!packer.canPack()) {
PackDylibI386 pack2r(fi);
if (!pack2r.canPack())
return false;
}
} break;
case PackMachFat::CPU_TYPE_POWERPC: {
PackMachPPC32 packer(fi);
if (!packer.canPack()) {
@@ -1335,6 +1472,7 @@ int PackMachFat::canUnpack()
}
for (unsigned j=0; j < fat_head.fat.nfat_arch; ++j) {
fi->set_extent(fat_head.arch[j].offset, fat_head.arch[j].size);
fi->seek(0, SEEK_SET);
switch (arch[j].cputype) {
default: return false;
case PackMachFat::CPU_TYPE_I386: {
@@ -1366,7 +1504,7 @@ int PackMachFat::canUnpack()
return 1;
}
void PackMachFat::buildLoader(const Filter */*ft*/)
void PackMachFat::buildLoader(const Filter * /*ft*/)
{
assert(false);
}
+78 -37
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -128,13 +128,37 @@ __packed_struct(Mach_section_command)
char segname[16];
Addr addr; /* memory address */
Addr size; /* size in bytes */
Word offset; /* file offset */ // FIXME: 64 bit?
Word offset; /* file offset */
Word align; /* power of 2 */
Word reloff; /* file offset of relocation entries */
Word nreloc; /* number of relocation entries */
Word flags; /* section type and attributes */
Word reserved1;
Word reserved2;
Word reserved1; /* for offset or index */
Word reserved2; /* for count or sizeof */
#define WANT_MACH_SECTION_ENUM 1
#include "p_mach_enum.h"
__packed_struct_end()
template <class TMachITypes>
__packed_struct(Mach_section_command_64)
typedef typename TMachITypes::Word Word;
typedef typename TMachITypes::Addr Addr;
typedef typename TMachITypes::Off Off;
typedef typename TMachITypes::Word Off32;
typedef typename TMachITypes::Xword Xword;
char sectname[16];
char segname[16];
Addr addr; /* memory address */
Addr size; /* size in bytes */
Off32 offset; /* file offset */
Word align; /* power of 2 */
Word reloff; /* file offset of relocation entries */
Word nreloc; /* number of relocation entries */
Word flags; /* section type and attributes */
Word reserved1; /* for offset or index */
Word reserved2; /* for count or sizeof */
Word reserved3; /* NOT IN 32-bit VERSION!! */
#define WANT_MACH_SECTION_ENUM 1
#include "p_mach_enum.h"
__packed_struct_end()
@@ -143,12 +167,13 @@ template <class TMachITypes>
__packed_struct(Mach_symtab_command)
typedef typename TMachITypes::Word Word;
typedef typename TMachITypes::Off Off;
typedef typename TMachITypes::Word Off32;
Word cmd; /* LC_SYMTAB */
Word cmdsize; /* sizeof(struct Mach_symtab_command) */
Off symoff; /* symbol table offset */
Off32 symoff; /* symbol table offset */
Word nsyms; /* number of symbol table entries */
Off stroff; /* string table offset */
Off32 stroff; /* string table offset */
Word strsize; /* string table size in bytes */
__packed_struct_end()
@@ -156,6 +181,7 @@ template <class TMachITypes>
__packed_struct(Mach_dysymtab_command)
typedef typename TMachITypes::Word Word;
typedef typename TMachITypes::Off Off;
typedef typename TMachITypes::Word Off32;
Word cmd; /* LC_DYSYMTAB */
Word cmdsize; /* sizeof(struct Mach_dysymtab_command) */
@@ -165,17 +191,17 @@ __packed_struct(Mach_dysymtab_command)
Word nextdefsym; /* number of externally defined symbols */
Word iundefsym; /* index to undefined symbols */
Word nundefsym; /* number of undefined symbols */
Off tocoff; /* file offset to table of contents */
Off32 tocoff; /* file offset to table of contents */
Word ntoc; /* number of entries in table of contents */
Off modtaboff; /* file offset to module table */
Off32 modtaboff; /* file offset to module table */
Word nmodtab; /* number of module table entries */
Off extrefsymoff; /* offset to referenced symbol table */
Off32 extrefsymoff; /* offset to referenced symbol table */
Word nextrefsymoff; /* number of referenced symbol table entries */
Off indirectsymoff; /* file offset to the indirect symbol table */
Off32 indirectsymoff; /* file offset to the indirect symbol table */
Word nindirectsyms; /* number of indirect symbol table entries */
Off extreloff; /* offset to external relocation entries */
Off32 extreloff; /* offset to external relocation entries */
Word nextrel; /* number of external relocation entries */
Off locreloff; /* offset to local relocation entries */
Off32 locreloff; /* offset to local relocation entries */
Word nlocrel; /* number of local relocation entries */
__packed_struct_end()
@@ -194,7 +220,6 @@ template <class TMachITypes>
__packed_struct(Mach_routines_command)
typedef typename TMachITypes::Word Word;
typedef typename TMachITypes::Addr Addr;
typedef typename TMachITypes::Off Off;
Word cmd;
Word cmdsize;
@@ -210,6 +235,26 @@ __packed_struct(Mach_routines_command)
#include "p_mach_enum.h"
__packed_struct_end()
template <class TMachITypes>
__packed_struct(Mach_routines_command_64)
typedef typename TMachITypes::Word Word;
typedef typename TMachITypes::Addr Addr;
typedef typename TMachITypes::Xword Xword;
Word cmd;
Word cmdsize;
Addr init_address;
Xword init_module;
Xword reserved1;
Xword reserved2;
Xword reserved3;
Xword reserved4;
Xword reserved5;
Xword reserved6;
#define WANT_MACH_SEGMENT_ENUM 1
#include "p_mach_enum.h"
__packed_struct_end()
template <class TMachITypes>
__packed_struct(Mach_twolevel_hints_command)
typedef typename TMachITypes::Word Word;
@@ -318,26 +363,6 @@ __packed_struct(Mach_ppc_thread_state64)
Word vrsave; /* Vector Save Register */
__packed_struct_end()
template <class TMachITypes>
__packed_struct(Mach_routines_command_64)
typedef typename TMachITypes::Word Word;
typedef typename TMachITypes::Addr Addr;
typedef typename TMachITypes::Xword Xword;
Word cmd;
Word cmdsize;
Addr init_address;
Xword init_module;
Xword reserved1;
Xword reserved2;
Xword reserved3;
Xword reserved4;
Xword reserved5;
Xword reserved6;
#define WANT_MACH_SEGMENT_ENUM 1
#include "p_mach_enum.h"
__packed_struct_end()
} // namespace N_Mach64
namespace N_Mach {
@@ -397,11 +422,11 @@ struct MachClass_64
// Mach types
typedef N_Mach::Mach_header64<MachITypes> Mach_header;
typedef N_Mach::Mach_segment_command<MachITypes> Mach_segment_command;
typedef N_Mach::Mach_section_command<MachITypes> Mach_section_command;
typedef N_Mach::Mach_section_command_64<MachITypes> Mach_section_command;
typedef N_Mach::Mach_symtab_command<MachITypes> Mach_symtab_command;
typedef N_Mach::Mach_dysymtab_command<MachITypes> Mach_dysymtab_command;
typedef N_Mach::Mach_segsplit_info_command<MachITypes> Mach_segsplit_info_command;
typedef N_Mach::Mach_routines_command<MachITypes> Mach_routines_command;
typedef N_Mach::Mach_routines_command_64<MachITypes> Mach_routines_command;
typedef N_Mach::Mach_twolevel_hints_command<MachITypes> Mach_twolevel_hints_command;
static void compileTimeAssertions() {
@@ -546,7 +571,7 @@ protected:
Mach_segment_command *rawmseg; // as input, with sections
Mach_segment_command *msegcmd; // LC_SEGMENT first, without sections
unsigned o_routines_cmd; // file offset to LC_ROUINTES
unsigned prev_init_address;
acc_uint64l_t prev_init_address;
Mach_header mhdri;
Mach_header mhdro;
@@ -720,6 +745,22 @@ protected:
Mach_thread_command threado;
};
class PackDylibAMD64 : public PackMachAMD64
{
typedef PackMachAMD64 super;
public:
PackDylibAMD64(InputFile *f);
virtual int getFormat() const { return UPX_F_DYLIB_AMD64; }
virtual const char *getName() const { return "Dylib/AMD64"; }
virtual const char *getFullName(const options_t *) const { return "AMD64-darwin.dylib"; }
protected:
virtual void pack3(OutputFile *, Filter &); // append loader
virtual void pack4(OutputFile *, Filter &); // append PackHeader
virtual void buildLoader(const Filter *ft);
};
class PackMachARMEL : public PackMachBase<MachClass_LE32>
{
typedef PackMachBase<MachClass_LE32> super;
+16 -8
View File
@@ -2,7 +2,7 @@
This file is part of the UPX executable compressor.
Copyright (C) 2007-2009 John F. Reiser
Copyright (C) 2007-2010 John F. Reiser
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -90,24 +90,32 @@
#ifdef WANT_MACH_SECTION_ENUM /*{*/
#undef WANT_MACH_SECTION_ENUM
enum { // section flags
enum { // section type (low byte only)
S_REGULAR = 0,
S_ZEROFILL,
S_CSTRING_LITERALS,
S_4BYTE_LITERALS,
S_8BYTE_LITERALS,
S_LITERAL_POINTERS,
S_NON_LAZY_SYMBOL_POINTERS,
S_LAZY_SYMBOL_POINTERS,
S_NON_LAZY_SYMBOL_POINTERS, // sectname __nl_symbol_ptr
S_LAZY_SYMBOL_POINTERS, // sectname __la_symbol_ptr
S_SYMBOL_STUBS,
S_MOD_INIT_FUNC_POINTERS,
S_MOD_TERM_FNC_POINTERS,
S_COALESCED
S_MOD_INIT_FUNC_POINTERS, // sectname __mod_init_func
S_MOD_TERM_FUNC_POINTERS,
S_COALESCED,
S_GB_ZEROFILL,
S_INTERPOSING,
S_16BYTE_LITERALS,
S_DTRACE_DOF
};
enum {
enum { // section flags (high 24 bits)
S_ATTR_PURE_INSTRUCTIONS = 0x80000000,
S_ATTR_NO_TOC = 0x40000000,
S_ATTR_STRIP_STATIC_SYMS = 0x20000000,
S_ATTR_NO_DEAD_STRIP = 0x10000000,
S_ATTR_LIVE_SUPPORT = 0x08000000,
S_ATTR_SELF_MODIFYING_CODE = 0x04000000,
S_ATTR_DEBUG = 0x02000000,
S_ATTR_SOME_INSTRUCTIONS = 0x00000400,
S_ATTR_EXT_RELOC = 0x00000200,
S_ATTR_LOC_RELOC = 0x00000100
+3 -3
View File
@@ -2,9 +2,9 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 2002-2009 Jens Medoch
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2002-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 2002-2009 Jens Medoch
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
Copyright (C) 2002-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 Laszlo Molnar
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
@@ -412,6 +412,9 @@ void PackUnix::packExtent(
fo->write(&tmp, sizeof(tmp));
b_len += sizeof(b_info);
if (ft) {
ph.u_adler = end_u_adler;
}
// write compressed data
if (ph.c_len < ph.u_len) {
fo->write(obuf, ph.c_len);
@@ -422,9 +425,6 @@ void PackUnix::packExtent(
fo->write(ibuf, ph.u_len);
}
if (ft) {
ph.u_adler = end_u_adler;
}
total_in += ph.u_len;
total_out += ph.c_len;
}
+2 -2
View File
@@ -2,8 +2,8 @@
This file is part of the UPX executable compressor.
Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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) 2004-2009 John Reiser
Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 2004-2010 John Reiser
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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-2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2009 Laszlo Molnar
Copyright (C) 1996-2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2010 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