Compare commits
92 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 626025d539 | |||
| 9e8a0a020f | |||
| 40f592eade | |||
| 5e899f0be4 | |||
| f2748284b1 | |||
| a15ce00934 | |||
| 9e3e80261b | |||
| c72c685434 | |||
| 0177a8d277 | |||
| b6a9b0a4c9 | |||
| f4f8bd8d42 | |||
| 6e4aeffc0c | |||
| dba256d384 | |||
| 910008e9e7 | |||
| 8cb9545c41 | |||
| 59c16da6fb | |||
| 630df5bbd2 | |||
| f550111400 | |||
| 77377195aa | |||
| 7e2e72bd40 | |||
| aa7a13bd02 | |||
| 5895058a17 | |||
| ffb60d5149 | |||
| 1e2cb279b0 | |||
| e7f766f5ba | |||
| 8de5aa9409 | |||
| bf28a4df49 | |||
| fe1a0ab371 | |||
| 01daccfaf7 | |||
| 94e861e298 | |||
| d36af2ed5c | |||
| 7104b33214 | |||
| 32998e5377 | |||
| af0c9ef092 | |||
| 3bc3b3d10e | |||
| f03f42ca4d | |||
| 79783abeb1 | |||
| 895b0bd602 | |||
| 2ee5ee92f8 | |||
| 3e619423b1 | |||
| b524e18bdf | |||
| 6aa4579db8 | |||
| 17fb86c0f1 | |||
| 62ecfe4873 | |||
| 04e55e6b9a | |||
| f432aa1090 | |||
| 7add104313 | |||
| 36de249066 | |||
| b7a54dcffd | |||
| 6bb28deab2 | |||
| 7f88d15c86 | |||
| 94c5014e23 | |||
| c5a8256500 | |||
| 5f39884bf7 | |||
| d96825a242 | |||
| 443a938091 | |||
| 6bc3197721 | |||
| 269cc91fd5 | |||
| c1ddea479d | |||
| 5f3a95962c | |||
| ee1a8e6a32 | |||
| eeae73296e | |||
| 4ca8357af4 | |||
| 8a5b8c87fb | |||
| 6ab04d7bbc | |||
| a5a1380636 | |||
| eeab1aef64 | |||
| 4e1c342e55 | |||
| d8ed259bce | |||
| 9f6cb5de4c | |||
| ba634118d7 | |||
| 63da091d36 | |||
| ad0dc88a33 | |||
| 147acf4b57 | |||
| 5085f3a15e | |||
| 22a95ad8ea | |||
| df4bd6a60c | |||
| 813e7b05e4 | |||
| ab8b486b4a | |||
| 590f666ec9 | |||
| 9adaee915b | |||
| bce0f06fe9 | |||
| 856ecb84a0 | |||
| 90ddc06c98 | |||
| 405abc4e95 | |||
| 549c59ecf5 | |||
| 0a485eafcb | |||
| e0c11956a6 | |||
| da6a9bf3eb | |||
| dacd11e1cc | |||
| fc854b4c77 | |||
| 4dcc1f0374 |
@@ -1,4 +1,5 @@
|
||||
140415ffbcef86a42b4d672249927364430d3d38 RELEASE_111
|
||||
155618b5b7930f97bd84b82befa7a4fd6672efb3 RELEASE_304
|
||||
1931f4f28074970ec53b4cd21c7fc181b4da8e5e RELEASE_301
|
||||
223ac5b23f9731ceac9ff8d65167df4900776e36 RELEASE_190
|
||||
2c753c5bf38e7322715e2a5c6c5381111bd7a61a RELEASE_194
|
||||
|
||||
@@ -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,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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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,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,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,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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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,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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
File diff suppressed because it is too large
Load Diff
+46
-11
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
Reference in New Issue
Block a user