Compare commits
54 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 747e8370e0 | |||
| 2c67875781 | |||
| c96e8a8c19 | |||
| 5f203fc082 | |||
| b943c9b471 | |||
| 1a90a1daa8 | |||
| 72dfc743fd | |||
| 465307655b | |||
| 6ce71e6694 | |||
| 7f01b3b92a | |||
| 76950d56b9 | |||
| c11e0d02b3 | |||
| 4c798c1718 | |||
| 450d7e9ad4 | |||
| b8ab79c83e | |||
| 6934bdd533 | |||
| 84dedb73a5 | |||
| 8964aa5221 | |||
| 3481ae236c | |||
| 46adc5f8a4 | |||
| 5296df5899 | |||
| 13dad4be16 | |||
| b5d0c343b4 | |||
| b00b945264 | |||
| 3bda09e105 | |||
| 32d32c4e4a | |||
| 497441b54e | |||
| 9c564fd4c7 | |||
| 0c2263d0e9 | |||
| 3d4d30766d | |||
| 99d84d44fc | |||
| 41ba7077ad | |||
| 8a929a91c3 | |||
| 0604f06841 | |||
| 229924adf9 | |||
| df988b7c69 | |||
| e8106e2e34 | |||
| c21d3e24f8 | |||
| 2d87aa0753 | |||
| b2ad4dc9a0 | |||
| 370f2ea98f | |||
| a05ca565ff | |||
| 52255637f2 | |||
| 0fcaa3a2f5 | |||
| 0e2fa6eb9d | |||
| 1aac462c83 | |||
| 2a0edfd8f7 | |||
| 1f59a9f846 | |||
| 80c20a90ea | |||
| 56a35649fe | |||
| f07cea0b79 | |||
| 4c1b08a281 | |||
| 117f9eddcd | |||
| 7bbbfce482 |
@@ -13,3 +13,4 @@ c2e0cd4d621b047f254f2def42132a03683ff52c RELEASE_192
|
||||
d276aa09033c24d0981bc3f4fee5628aecc988ad RELEASE_290
|
||||
eb1ce56dce7dd1835964362470610925963b9043 RELEASE_110
|
||||
ed96891ef795bceec6b7ff3ca1ca7764431bfb39 RELEASE_191
|
||||
efa52753e366300c0e0ebe20631adcb24ed3c15b RELEASE_293
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
#
|
||||
# UPX toplevel Makefile - needs GNU make 3.80 or better
|
||||
# UPX toplevel Makefile - needs GNU make 3.81 or better
|
||||
#
|
||||
|
||||
MAKEFLAGS += -rR
|
||||
.SUFFIXES:
|
||||
export SHELL = /bin/sh
|
||||
|
||||
ifneq ($(findstring $(firstword $(MAKE_VERSION)),3.77 3.78 3.78.1 3.79 3.79.1 3.80),)
|
||||
$(error GNU make 3.81 or better is required)
|
||||
endif
|
||||
|
||||
srcdir = .
|
||||
top_srcdir = .
|
||||
-include $(top_srcdir)/Makevars.global ./Makevars.local
|
||||
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
|
||||
|
||||
|
||||
# info: src/stub needs GNU make 3.81 and special build tools
|
||||
# info: src/stub needs special build tools
|
||||
BUILD_STUB = 0
|
||||
ifneq ($(wildcard $(HOME)/local/bin/bin-upx/.),)
|
||||
BUILD_STUB = 1
|
||||
@@ -19,9 +23,6 @@ endif
|
||||
ifneq ($(wildcard $(HOME)/bin/bin-upx/.),)
|
||||
BUILD_STUB = 1
|
||||
endif
|
||||
ifneq ($(findstring $(firstword $(MAKE_VERSION)),3.79 3.79.1 3.80),)
|
||||
BUILD_STUB = 0
|
||||
endif
|
||||
|
||||
|
||||
default:
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
User visible changes for UPX
|
||||
==================================================================
|
||||
|
||||
Changes in 3.00 (27 Apr 2007):
|
||||
* watcom/le & tmt/adam: fixed a problem when using certain filters
|
||||
|
||||
Changes in 2.93 beta (08 Mar 2007):
|
||||
* new formats Mach/i386 and Mach/fat support Mac OS X i686 and
|
||||
Universal binaries [i686 and PowerPC only]
|
||||
|
||||
@@ -684,6 +684,9 @@ Notes:
|
||||
- UPX creates as default a suitable executable for CD-Mastering
|
||||
and console transfer. For a CD-Master main executable you could also try
|
||||
the special option "--boot-only" as described below.
|
||||
It has been reported that upx packed executables are fully compatible with
|
||||
the Sony PlayStation 2 (PS2, PStwo) and Sony PlayStation Portable (PSP) in
|
||||
Sony PlayStation (PSone) emulation mode.
|
||||
|
||||
- Normally the packed files use the same memory areas like the uncompressed
|
||||
versions, so they will not override other memory areas while unpacking.
|
||||
|
||||
+27
-8
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# UPX Makefile - needs GNU make 3.80 or better
|
||||
# UPX Makefile - needs GNU make 3.81 or better
|
||||
#
|
||||
|
||||
MAKEFLAGS += -rR
|
||||
@@ -7,6 +7,10 @@ MAKEFLAGS += -rR
|
||||
export SHELL = /bin/sh
|
||||
override e = $($1) $(EXTRA_$1) $(upx_$1) $($(basename $(notdir $@)).$1)
|
||||
|
||||
ifneq ($(findstring $(firstword $(MAKE_VERSION)),3.77 3.78 3.78.1 3.79 3.79.1 3.80),)
|
||||
$(error GNU make 3.81 or better is required)
|
||||
endif
|
||||
|
||||
ifndef srcdir
|
||||
srcdir := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
|
||||
srcdir := $(shell echo '$(srcdir)' | sed 's,/*$$,,')
|
||||
@@ -14,7 +18,7 @@ endif
|
||||
ifndef top_srcdir
|
||||
top_srcdir := $(srcdir)/..
|
||||
endif
|
||||
-include $(top_srcdir)/Makevars.global ./Makevars.local
|
||||
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
|
||||
ifneq ($(srcdir),.)
|
||||
##$(info Info: using VPATH . $(srcdir))
|
||||
VPATH := . $(srcdir)
|
||||
@@ -27,7 +31,6 @@ ifneq ($(findstring $(firstword $(CXX)),g++),)
|
||||
USE_GNUC ?= 1
|
||||
endif
|
||||
ifeq ($(USE_GNUC),1)
|
||||
CXXFLAGS += -MMD
|
||||
ifeq ($(DEBUG),1)
|
||||
CXXFLAGS += -O0 -g
|
||||
else
|
||||
@@ -59,17 +62,26 @@ INCLUDES += -I$(UPX_LZMADIR)
|
||||
endif
|
||||
|
||||
|
||||
all: upx$(exeext)
|
||||
.DELETE_ON_ERROR: upx$(exeext) $(upx_OBJECTS)
|
||||
all: upx$(exeext) | .depend
|
||||
.DELETE_ON_ERROR: upx$(exeext) $(upx_OBJECTS) .depend
|
||||
|
||||
upx$(exeext): $(upx_OBJECTS) $(upx_DEPENDENCIES)
|
||||
$($(notdir $@).PRE_LINK_STEP)
|
||||
$(strip $(CXXLD) $(call e,CPPFLAGS) $(call e,CXXFLAGS) $(call e,LDFLAGS) -o $@ $(upx_OBJECTS) $(call e,LDADD) $(call e,LIBS))
|
||||
$($(notdir $@).POST_LINK_STEP)
|
||||
|
||||
%.o : %.cpp
|
||||
%.o : %.cpp | .depend
|
||||
$(strip $(CXX) $(call e,CPPFLAGS) $(call e,CXXFLAGS) -o $@ -c $<)
|
||||
|
||||
.depend: $(wildcard $(srcdir)/*.cpp $(srcdir)/*.h) $(MAKEFILE_LIST)
|
||||
@rm -f $@
|
||||
ifeq ($(USE_GNUC),1)
|
||||
@echo "Updating $@"
|
||||
@$(strip $(CXX) $(call e,CPPFLAGS) -MM) $(filter %.cpp,$^) > $@
|
||||
else
|
||||
touch $@
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(USE_GNUC),1)
|
||||
##compress_lzma$(objext) : CXXFLAGS += -O3 -fomit-frame-pointer
|
||||
@@ -82,7 +94,14 @@ endif
|
||||
|
||||
|
||||
mostlyclean clean distclean maintainer-clean:
|
||||
rm -f *.d *.map *.o *.obj *.res upx.exe upx.out upx.ttp upx$(exeext)
|
||||
rm -f *.d *.map *.o *.obj *.res .depend upx.exe upx.out upx.ttp upx$(exeext)
|
||||
|
||||
-include *.d
|
||||
.PHONY: all mostlyclean clean distclean maintainer-clean
|
||||
|
||||
ifeq ($(MAKECMDGOALS),mostlyclean)
|
||||
else ifeq ($(MAKECMDGOALS),clean)
|
||||
else ifeq ($(MAKECMDGOALS),distclean)
|
||||
else ifeq ($(MAKECMDGOALS),maintainer-clean)
|
||||
else
|
||||
-include .depend
|
||||
endif
|
||||
|
||||
+7
-5
@@ -182,8 +182,10 @@ int upx_decompress ( const upx_bytep src, unsigned src_len,
|
||||
//
|
||||
**************************************************************************/
|
||||
|
||||
int upx_test_overlap ( const upx_bytep buf, unsigned src_off,
|
||||
unsigned src_len, unsigned* dst_len,
|
||||
int upx_test_overlap ( const upx_bytep buf,
|
||||
const upx_bytep tbuf,
|
||||
unsigned src_off, unsigned src_len,
|
||||
unsigned* dst_len,
|
||||
int method,
|
||||
const upx_compress_result_t *cresult )
|
||||
{
|
||||
@@ -201,15 +203,15 @@ int upx_test_overlap ( const upx_bytep buf, unsigned src_off,
|
||||
}
|
||||
#if defined(WITH_LZMA)
|
||||
else if (M_IS_LZMA(method))
|
||||
r = upx_lzma_test_overlap(buf, src_off, src_len, dst_len, method, cresult);
|
||||
r = upx_lzma_test_overlap(buf, tbuf, src_off, src_len, dst_len, method, cresult);
|
||||
#endif
|
||||
#if defined(WITH_NRV)
|
||||
else if (M_IS_NRV2B(method) || M_IS_NRV2D(method) || M_IS_NRV2E(method))
|
||||
r = upx_nrv_test_overlap(buf, src_off, src_len, dst_len, method, cresult);
|
||||
r = upx_nrv_test_overlap(buf, tbuf, src_off, src_len, dst_len, method, cresult);
|
||||
#endif
|
||||
#if defined(WITH_UCL)
|
||||
else if (M_IS_NRV2B(method) || M_IS_NRV2D(method) || M_IS_NRV2E(method))
|
||||
r = upx_ucl_test_overlap(buf, src_off, src_len, dst_len, method, cresult);
|
||||
r = upx_ucl_test_overlap(buf, tbuf, src_off, src_len, dst_len, method, cresult);
|
||||
#endif
|
||||
else {
|
||||
throwInternalError("unknown decompression method");
|
||||
|
||||
+16
-8
@@ -46,8 +46,10 @@ int upx_lzma_decompress ( const upx_bytep src, unsigned src_len,
|
||||
upx_bytep dst, unsigned* dst_len,
|
||||
int method,
|
||||
const upx_compress_result_t *cresult );
|
||||
int upx_lzma_test_overlap ( const upx_bytep buf, unsigned src_off,
|
||||
unsigned src_len, unsigned* dst_len,
|
||||
int upx_lzma_test_overlap ( const upx_bytep buf,
|
||||
const upx_bytep tbuf,
|
||||
unsigned src_off, unsigned src_len,
|
||||
unsigned* dst_len,
|
||||
int method,
|
||||
const upx_compress_result_t *cresult );
|
||||
#endif
|
||||
@@ -65,8 +67,10 @@ int upx_nrv_decompress ( const upx_bytep src, unsigned src_len,
|
||||
upx_bytep dst, unsigned* dst_len,
|
||||
int method,
|
||||
const upx_compress_result_t *cresult );
|
||||
int upx_nrv_test_overlap ( const upx_bytep buf, unsigned src_off,
|
||||
unsigned src_len, unsigned* dst_len,
|
||||
int upx_nrv_test_overlap ( const upx_bytep buf,
|
||||
const upx_bytep tbuf,
|
||||
unsigned src_off, unsigned src_len,
|
||||
unsigned* dst_len,
|
||||
int method,
|
||||
const upx_compress_result_t *cresult );
|
||||
#endif
|
||||
@@ -84,8 +88,10 @@ int upx_ucl_decompress ( const upx_bytep src, unsigned src_len,
|
||||
upx_bytep dst, unsigned* dst_len,
|
||||
int method,
|
||||
const upx_compress_result_t *cresult );
|
||||
int upx_ucl_test_overlap ( const upx_bytep buf, unsigned src_off,
|
||||
unsigned src_len, unsigned* dst_len,
|
||||
int upx_ucl_test_overlap ( const upx_bytep buf,
|
||||
const upx_bytep tbuf,
|
||||
unsigned src_off, unsigned src_len,
|
||||
unsigned* dst_len,
|
||||
int method,
|
||||
const upx_compress_result_t *cresult );
|
||||
#endif
|
||||
@@ -102,8 +108,10 @@ int upx_zlib_decompress ( const upx_bytep src, unsigned src_len,
|
||||
upx_bytep dst, unsigned* dst_len,
|
||||
int method,
|
||||
const upx_compress_result_t *cresult );
|
||||
int upx_zlib_test_overlap ( const upx_bytep buf, unsigned src_off,
|
||||
unsigned src_len, unsigned* dst_len,
|
||||
int upx_zlib_test_overlap ( const upx_bytep buf,
|
||||
const upx_bytep tbuf,
|
||||
unsigned src_off, unsigned src_len,
|
||||
unsigned* dst_len,
|
||||
int method,
|
||||
const upx_compress_result_t *cresult );
|
||||
#endif
|
||||
|
||||
+20
-15
@@ -28,6 +28,7 @@
|
||||
|
||||
#include "conf.h"
|
||||
#include "compress.h"
|
||||
#include "mem.h"
|
||||
|
||||
|
||||
void lzma_compress_config_t::reset()
|
||||
@@ -483,28 +484,32 @@ error:
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
// test_overlap
|
||||
// test_overlap - see <ucl/ucl.h> for semantics
|
||||
**************************************************************************/
|
||||
|
||||
int upx_lzma_test_overlap ( const upx_bytep buf, unsigned src_off,
|
||||
unsigned src_len, unsigned* dst_len,
|
||||
int upx_lzma_test_overlap ( const upx_bytep buf,
|
||||
const upx_bytep tbuf,
|
||||
unsigned src_off, unsigned src_len,
|
||||
unsigned* dst_len,
|
||||
int method,
|
||||
const upx_compress_result_t *cresult )
|
||||
{
|
||||
assert(M_IS_LZMA(method));
|
||||
|
||||
// FIXME - implement this
|
||||
// Note that Packer::verifyOverlappingDecompression() will
|
||||
// verify the final result in any case.
|
||||
UNUSED(buf);
|
||||
|
||||
unsigned overlap_overhead = src_off + src_len - *dst_len;
|
||||
//printf("upx_lzma_test_overlap: %d\n", overlap_overhead);
|
||||
if ((int)overlap_overhead >= 256)
|
||||
return UPX_E_OK;
|
||||
|
||||
UNUSED(cresult);
|
||||
return UPX_E_ERROR;
|
||||
MemBuffer b(src_off + src_len);
|
||||
memcpy(b + src_off, buf + src_off, src_len);
|
||||
unsigned saved_dst_len = *dst_len;
|
||||
int r = upx_lzma_decompress(b + src_off, src_len, b, dst_len, method, cresult);
|
||||
if (r != UPX_E_OK)
|
||||
return r;
|
||||
if (*dst_len != saved_dst_len)
|
||||
return UPX_E_ERROR;
|
||||
// NOTE: there is a very tiny possibility that decompression has
|
||||
// succeeded but the data is not restored correctly because of
|
||||
// in-place buffer overlapping.
|
||||
if (tbuf != NULL && memcmp(tbuf, b, *dst_len) != 0)
|
||||
return UPX_E_ERROR;
|
||||
return UPX_E_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -228,12 +228,15 @@ int upx_ucl_decompress ( const upx_bytep src, unsigned src_len,
|
||||
//
|
||||
**************************************************************************/
|
||||
|
||||
int upx_ucl_test_overlap ( const upx_bytep buf, unsigned src_off,
|
||||
unsigned src_len, unsigned* dst_len,
|
||||
int upx_ucl_test_overlap ( const upx_bytep buf,
|
||||
const upx_bytep tbuf,
|
||||
unsigned src_off, unsigned src_len,
|
||||
unsigned* dst_len,
|
||||
int method,
|
||||
const upx_compress_result_t *cresult )
|
||||
{
|
||||
int r;
|
||||
UNUSED(tbuf); // not needed for UCL
|
||||
|
||||
switch (method)
|
||||
{
|
||||
|
||||
+20
-15
@@ -28,6 +28,7 @@
|
||||
|
||||
#include "conf.h"
|
||||
#include "compress.h"
|
||||
#include "mem.h"
|
||||
|
||||
|
||||
void zlib_compress_config_t::reset()
|
||||
@@ -188,28 +189,32 @@ done:
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
// test_overlap
|
||||
// test_overlap - see <ucl/ucl.h> for semantics
|
||||
**************************************************************************/
|
||||
|
||||
int upx_zlib_test_overlap ( const upx_bytep buf, unsigned src_off,
|
||||
unsigned src_len, unsigned* dst_len,
|
||||
int upx_zlib_test_overlap ( const upx_bytep buf,
|
||||
const upx_bytep tbuf,
|
||||
unsigned src_off, unsigned src_len,
|
||||
unsigned* dst_len,
|
||||
int method,
|
||||
const upx_compress_result_t *cresult )
|
||||
{
|
||||
assert(method == M_DEFLATE);
|
||||
|
||||
// FIXME - implement this
|
||||
// Note that Packer::verifyOverlappingDecompression() will
|
||||
// verify the final result in any case.
|
||||
UNUSED(buf);
|
||||
|
||||
unsigned overlap_overhead = src_off + src_len - *dst_len;
|
||||
//printf("upx_zlib_test_overlap: %d\n", overlap_overhead);
|
||||
if ((int)overlap_overhead >= 256)
|
||||
return UPX_E_OK;
|
||||
|
||||
UNUSED(cresult);
|
||||
return UPX_E_ERROR;
|
||||
MemBuffer b(src_off + src_len);
|
||||
memcpy(b + src_off, buf + src_off, src_len);
|
||||
unsigned saved_dst_len = *dst_len;
|
||||
int r = upx_zlib_decompress(b + src_off, src_len, b, dst_len, method, cresult);
|
||||
if (r != UPX_E_OK)
|
||||
return r;
|
||||
if (*dst_len != saved_dst_len)
|
||||
return UPX_E_ERROR;
|
||||
// NOTE: there is a very tiny possibility that decompression has
|
||||
// succeeded but the data is not restored correctly because of
|
||||
// in-place buffer overlapping.
|
||||
if (tbuf != NULL && memcmp(tbuf, b, *dst_len) != 0)
|
||||
return UPX_E_ERROR;
|
||||
return UPX_E_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+8
-5
@@ -448,13 +448,13 @@ private:
|
||||
#define UPX_F_LINUX_ELFI_i386 20
|
||||
#define UPX_F_WINCE_ARM_PE 21
|
||||
#define UPX_F_LINUX_ELF64_AMD 22
|
||||
#define UPX_F_LINUX_ELF32_ARMLE 23
|
||||
#define UPX_F_LINUX_ELF32_ARMEL 23
|
||||
#define UPX_F_BSD_i386 24
|
||||
#define UPX_F_BSD_ELF_i386 25
|
||||
#define UPX_F_BSD_SH_i386 26
|
||||
|
||||
#define UPX_F_VMLINUX_AMD64 27
|
||||
#define UPX_F_VMLINUX_ARM 28
|
||||
#define UPX_F_VMLINUX_ARMEL 28
|
||||
#define UPX_F_MACH_i386 29
|
||||
|
||||
#define UPX_F_PLAIN_TEXT 127
|
||||
@@ -463,8 +463,9 @@ private:
|
||||
#define UPX_F_SOLARIS_SPARC 130
|
||||
#define UPX_F_MACH_PPC32 131
|
||||
#define UPX_F_LINUX_ELFPPC32 132
|
||||
#define UPX_F_LINUX_ELF32_ARMBE 133
|
||||
#define UPX_F_LINUX_ELF32_ARMEB 133
|
||||
#define UPX_F_MACH_FAT 134
|
||||
#define UPX_F_VMLINUX_ARMEB 135
|
||||
|
||||
|
||||
// compression methods
|
||||
@@ -778,8 +779,10 @@ int upx_decompress ( const upx_bytep src, unsigned src_len,
|
||||
upx_bytep dst, unsigned* dst_len,
|
||||
int method,
|
||||
const upx_compress_result_t *cresult );
|
||||
int upx_test_overlap ( const upx_bytep buf, unsigned src_off,
|
||||
unsigned src_len, unsigned* dst_len,
|
||||
int upx_test_overlap ( const upx_bytep buf,
|
||||
const upx_bytep tbuf,
|
||||
unsigned src_off, unsigned src_len,
|
||||
unsigned* dst_len,
|
||||
int method,
|
||||
const upx_compress_result_t *cresult );
|
||||
|
||||
|
||||
+2
-2
@@ -205,8 +205,8 @@ void show_help(int verbose)
|
||||
con_fprintf(f,"\nCompression tuning options:\n");
|
||||
fg = con_fg(f,fg);
|
||||
con_fprintf(f,
|
||||
" --brute try all available compression methods & filters\n"
|
||||
" --ultra-brute try even more compression variants\n"
|
||||
" --brute try all available compression methods & filters [slow]\n"
|
||||
" --ultra-brute try even more compression variants [very slow]\n"
|
||||
"\n");
|
||||
fg = con_fg(f,FG_YELLOW);
|
||||
con_fprintf(f,"Backup options:\n");
|
||||
|
||||
+7
-2
@@ -228,15 +228,20 @@ void ElfLinker::preprocessSymbols(char *start, char *end)
|
||||
assert(nextl != NULL);
|
||||
|
||||
if (sscanf(start, "%x g *ABS* %x %1023s",
|
||||
&value, &offset, symbol) == 3)
|
||||
&value, &offset, symbol) == 3)
|
||||
{
|
||||
char *s = strstr(start, symbol);
|
||||
s[strlen(symbol)] = 0;
|
||||
addSymbol(s, "*ABS*", value);
|
||||
assert(offset == 0);
|
||||
}
|
||||
#if 0
|
||||
else if (sscanf(start, "%x%*8c %1023s %*x %1023s",
|
||||
&offset, section, symbol) == 3)
|
||||
#else
|
||||
// work around broken scanf implementations
|
||||
else if (sscanf(start, "%x%*c%*c%*c%*c%*c%*c%*c%*c %1023s %*x %1023s",
|
||||
#endif
|
||||
&offset, section, symbol) == 3)
|
||||
{
|
||||
char *s = strstr(start, symbol);
|
||||
s[strlen(symbol)] = 0;
|
||||
|
||||
+2
-1
@@ -76,10 +76,11 @@ const int *PackDjgpp2::getFilters() const
|
||||
|
||||
|
||||
unsigned PackDjgpp2::findOverlapOverhead(const upx_bytep buf,
|
||||
const upx_bytep tbuf,
|
||||
unsigned range,
|
||||
unsigned upper_limit) const
|
||||
{
|
||||
unsigned o = super::findOverlapOverhead(buf, range, upper_limit);
|
||||
unsigned o = super::findOverlapOverhead(buf, tbuf, range, upper_limit);
|
||||
o = (o + 0x3ff) &~ 0x1ff;
|
||||
return o;
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ protected:
|
||||
virtual int readFileHeader();
|
||||
|
||||
virtual unsigned findOverlapOverhead(const upx_bytep buf,
|
||||
const upx_bytep tbuf,
|
||||
unsigned range = 0,
|
||||
unsigned upper_limit = ~0u) const;
|
||||
virtual void buildLoader(const Filter *ft);
|
||||
|
||||
+4
-4
@@ -416,8 +416,8 @@ class PackLinuxElf32armLe : public PackLinuxElf32Le
|
||||
public:
|
||||
PackLinuxElf32armLe(InputFile *f);
|
||||
virtual ~PackLinuxElf32armLe();
|
||||
virtual int getFormat() const { return UPX_F_LINUX_ELF32_ARMLE; }
|
||||
virtual const char *getName() const { return "linux/armLE"; }
|
||||
virtual int getFormat() const { return UPX_F_LINUX_ELF32_ARMEL; }
|
||||
virtual const char *getName() const { return "linux/armel"; }
|
||||
virtual const char *getFullName(const options_t *) const { return "arm-linux.elf"; }
|
||||
virtual const int *getFilters() const;
|
||||
|
||||
@@ -436,8 +436,8 @@ class PackLinuxElf32armBe : public PackLinuxElf32Be
|
||||
public:
|
||||
PackLinuxElf32armBe(InputFile *f);
|
||||
virtual ~PackLinuxElf32armBe();
|
||||
virtual int getFormat() const { return UPX_F_LINUX_ELF32_ARMBE; }
|
||||
virtual const char *getName() const { return "linux/armBE"; }
|
||||
virtual int getFormat() const { return UPX_F_LINUX_ELF32_ARMEB; }
|
||||
virtual const char *getName() const { return "linux/armeb"; }
|
||||
virtual const char *getFullName(const options_t *) const { return "armeb-linux.elf"; }
|
||||
virtual const int *getFilters() const;
|
||||
|
||||
|
||||
+19
-8
@@ -318,7 +318,8 @@ void PackPs1::buildLoader(const Filter *)
|
||||
sa_tmp += overlap = ALIGN_UP((ph.overlap_overhead - sa_tmp), 4u);
|
||||
}
|
||||
|
||||
foundBss = findBssSection();
|
||||
if (isCon || !isCon && M_IS_LZMA(ph.method))
|
||||
foundBss = findBssSection();
|
||||
|
||||
if (M_IS_LZMA(ph.method) && !buildPart2)
|
||||
{
|
||||
@@ -370,16 +371,20 @@ void PackPs1::buildLoader(const Filter *)
|
||||
else
|
||||
{
|
||||
if (M_IS_LZMA(ph.method))
|
||||
addLoader("cdb.start.lzma", "pad.code", "cdb.entry.lzma", method, "cdb.lzma.cpr",
|
||||
addLoader(!foundBss ? "cdb.start.lzma" : "bss.cdb.start.lzma", "pad.code",
|
||||
!foundBss ? "cdb.entry.lzma" : "bss.cdb.entry.lzma",
|
||||
method, "cdb.lzma.cpr",
|
||||
ih.tx_ptr & 0xffff ? "dec.ptr" : "dec.ptr.hi",
|
||||
"lzma.exec", NULL);
|
||||
else
|
||||
{
|
||||
assert(foundBss != true);
|
||||
addLoader("cdb.start", "pad.code", "cdb.entry",
|
||||
ih.tx_ptr & 0xffff ? "cdb.dec.ptr" : "cdb.dec.ptr.hi",
|
||||
method,
|
||||
sa_cnt ? sa_cnt > (0x10000 << 2) ? "memset.long" : "memset.short" : "",
|
||||
!foundBss ? "cdb.exit" : "bss.exit",
|
||||
"pad.code", NULL);
|
||||
"cdb.exit", NULL);
|
||||
}
|
||||
}
|
||||
addLoader("UPX1HEAD", "IDENTSTR", NULL);
|
||||
}
|
||||
@@ -554,7 +559,9 @@ void PackPs1::pack(OutputFile *fo)
|
||||
}
|
||||
else
|
||||
{
|
||||
d_len = (lsize - h_len) - getLoaderSectionStart(M_IS_LZMA(ph.method) ? "cdb.entry.lzma" : "cdb.entry");
|
||||
const char* entry_lzma = !foundBss ? "cdb.entry.lzma" : "bss.cdb.entry.lzma";
|
||||
|
||||
d_len = (lsize - h_len) - getLoaderSectionStart(M_IS_LZMA(ph.method) ? entry_lzma : "cdb.entry");
|
||||
e_len = (lsize - d_len) - h_len;
|
||||
}
|
||||
|
||||
@@ -578,7 +585,7 @@ void PackPs1::pack(OutputFile *fo)
|
||||
|
||||
unsigned pad = 0;
|
||||
|
||||
if (!opt->ps1_exe.no_align)
|
||||
if (!opt->ps1_exe.no_align || !isCon)
|
||||
{
|
||||
pad = oh.tx_len;
|
||||
oh.tx_len = ALIGN_UP(oh.tx_len, CD_SEC);
|
||||
@@ -611,8 +618,12 @@ void PackPs1::pack(OutputFile *fo)
|
||||
linker->defineSymbol("PSVR", FIX_PSVR);
|
||||
linker->defineSymbol("CPDO", comp_data_start);
|
||||
if (M_IS_LZMA(ph.method))
|
||||
linker->defineSymbol("lzma_cpr", getLoaderSectionStart("lzma.exec")
|
||||
- getLoaderSectionStart("cdb.entry.lzma"));
|
||||
{
|
||||
unsigned entry_lzma = getLoaderSectionStart( !foundBss ? "cdb.entry.lzma" :
|
||||
"bss.cdb.entry.lzma");
|
||||
|
||||
linker->defineSymbol("lzma_cpr", getLoaderSectionStart("lzma.exec") - entry_lzma);
|
||||
}
|
||||
}
|
||||
|
||||
relocateLoader();
|
||||
|
||||
+2
-1
@@ -67,11 +67,12 @@ const int *PackTmt::getFilters() const
|
||||
|
||||
|
||||
unsigned PackTmt::findOverlapOverhead(const upx_bytep buf,
|
||||
const upx_bytep tbuf,
|
||||
unsigned range,
|
||||
unsigned upper_limit) const
|
||||
{
|
||||
// make sure the decompressor will be paragraph aligned
|
||||
unsigned o = super::findOverlapOverhead(buf, range, upper_limit);
|
||||
unsigned o = super::findOverlapOverhead(buf, tbuf, range, upper_limit);
|
||||
o = ((o + 0x20) &~ 0xf) - (ph.u_len & 0xf);
|
||||
return o;
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ protected:
|
||||
virtual int readFileHeader();
|
||||
|
||||
virtual unsigned findOverlapOverhead(const upx_bytep buf,
|
||||
const upx_bytep tbuf,
|
||||
unsigned range = 0,
|
||||
unsigned upper_limit = ~0u) const;
|
||||
virtual void buildLoader(const Filter *ft);
|
||||
|
||||
+7
-3
@@ -173,8 +173,10 @@ void PackUnix::pack2(OutputFile *fo, Filter &ft)
|
||||
compressWithFilters(&ft, OVERHEAD, NULL_cconf, filter_strategy);
|
||||
|
||||
if (ph.c_len < ph.u_len) {
|
||||
const upx_bytep tbuf = NULL;
|
||||
if (ft.id == 0) tbuf = ibuf;
|
||||
ph.overlap_overhead = OVERHEAD;
|
||||
if (!testOverlappingDecompression(obuf, ph.overlap_overhead)) {
|
||||
if (!testOverlappingDecompression(obuf, tbuf, ph.overlap_overhead)) {
|
||||
// not in-place compressible
|
||||
ph.c_len = ph.u_len;
|
||||
}
|
||||
@@ -353,8 +355,10 @@ void PackUnix::packExtent(
|
||||
}
|
||||
|
||||
if (ph.c_len < ph.u_len) {
|
||||
const upx_bytep tbuf = NULL;
|
||||
if (ft == NULL || ft->id == 0) tbuf = ibuf;
|
||||
ph.overlap_overhead = OVERHEAD;
|
||||
if (!testOverlappingDecompression(obuf, ph.overlap_overhead)) {
|
||||
if (!testOverlappingDecompression(obuf, tbuf, ph.overlap_overhead)) {
|
||||
// not in-place compressible
|
||||
ph.c_len = ph.u_len;
|
||||
}
|
||||
@@ -499,7 +503,7 @@ int PackUnix::canUnpack()
|
||||
|
||||
fi->seek(-bufsize, SEEK_END);
|
||||
fi->readx(buf, bufsize);
|
||||
if (!getPackHeader(buf, bufsize))
|
||||
if (!getPackHeader(buf, bufsize, true)) // allow incompressible extents
|
||||
return false;
|
||||
|
||||
int l = ph.buf_offset + ph.getPackHeaderSize();
|
||||
|
||||
+101
-8
@@ -44,6 +44,8 @@ static const
|
||||
#include "stub/amd64-linux.kernel.vmlinux.h"
|
||||
static const
|
||||
#include "stub/arm-linux.kernel.vmlinux.h"
|
||||
static const
|
||||
#include "stub/armeb-linux.kernel.vmlinux.h"
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
@@ -547,18 +549,29 @@ const int *PackVmlinuxI386::getFilters() const
|
||||
return filters;
|
||||
}
|
||||
|
||||
const int *PackVmlinuxARM::getCompressionMethods(int method, int level) const
|
||||
const int *PackVmlinuxARMEL::getCompressionMethods(int method, int level) const
|
||||
{
|
||||
return Packer::getDefaultCompressionMethods_8(method, level);
|
||||
}
|
||||
|
||||
const int *PackVmlinuxARMEB::getCompressionMethods(int method, int level) const
|
||||
{
|
||||
return Packer::getDefaultCompressionMethods_8(method, level);
|
||||
}
|
||||
|
||||
|
||||
const int *PackVmlinuxARM::getFilters() const
|
||||
const int *PackVmlinuxARMEL::getFilters() const
|
||||
{
|
||||
static const int f50[] = { 0x50, FT_END };
|
||||
return f50;
|
||||
}
|
||||
|
||||
const int *PackVmlinuxARMEB::getFilters() const
|
||||
{
|
||||
static const int f51[] = { 0x51, FT_END };
|
||||
return f51;
|
||||
}
|
||||
|
||||
//
|
||||
// Examples as of 2004-07-16 [readelf --segments vmlinux # before fiddling]:
|
||||
//
|
||||
@@ -646,18 +659,29 @@ void PackVmlinuxAMD64::buildLoader(const Filter *ft)
|
||||
"LINUX992,IDENTSTR,UPX1HEAD", NULL);
|
||||
}
|
||||
|
||||
bool PackVmlinuxARM::is_valid_e_entry(Addr e_entry)
|
||||
bool PackVmlinuxARMEL::is_valid_e_entry(Addr e_entry)
|
||||
{
|
||||
return 0xc0008000==e_entry;
|
||||
}
|
||||
|
||||
Linker* PackVmlinuxARM::newLinker() const
|
||||
bool PackVmlinuxARMEB::is_valid_e_entry(Addr e_entry)
|
||||
{
|
||||
return 0xc0008000==e_entry;
|
||||
}
|
||||
|
||||
Linker* PackVmlinuxARMEL::newLinker() const
|
||||
{
|
||||
return new ElfLinkerArmLE;
|
||||
}
|
||||
|
||||
Linker* PackVmlinuxARMEB::newLinker() const
|
||||
{
|
||||
return new ElfLinkerArmBE;
|
||||
}
|
||||
|
||||
void PackVmlinuxARM::buildLoader(const Filter *ft)
|
||||
|
||||
|
||||
void PackVmlinuxARMEL::buildLoader(const Filter *ft)
|
||||
{
|
||||
// prepare loader
|
||||
initLoader(stub_arm_linux_kernel_vmlinux, sizeof(stub_arm_linux_kernel_vmlinux));
|
||||
@@ -679,6 +703,28 @@ void PackVmlinuxARM::buildLoader(const Filter *ft)
|
||||
addLoader("IDENTSTR,UPX1HEAD", NULL);
|
||||
}
|
||||
|
||||
void PackVmlinuxARMEB::buildLoader(const Filter *ft)
|
||||
{
|
||||
// prepare loader
|
||||
initLoader(stub_armeb_linux_kernel_vmlinux, sizeof(stub_armeb_linux_kernel_vmlinux));
|
||||
addLoader("LINUX000", NULL);
|
||||
if (ft->id) {
|
||||
assert(ft->calls > 0);
|
||||
addLoader("LINUX010", NULL);
|
||||
}
|
||||
addLoader("LINUX020", NULL);
|
||||
if (ft->id) {
|
||||
addFilter32(ft->id);
|
||||
}
|
||||
addLoader("LINUX030", NULL);
|
||||
if (ph.method == M_NRV2E_8) addLoader("NRV2E", NULL);
|
||||
else if (ph.method == M_NRV2B_8) addLoader("NRV2B", NULL);
|
||||
else if (ph.method == M_NRV2D_8) addLoader("NRV2D", NULL);
|
||||
else if (M_IS_LZMA(ph.method)) addLoader("LZMA_ELF00,LZMA_DEC10,LZMA_DEC30", NULL);
|
||||
else throwBadLoader();
|
||||
addLoader("IDENTSTR,UPX1HEAD", NULL);
|
||||
}
|
||||
|
||||
|
||||
static const
|
||||
#include "stub/i386-linux.kernel.vmlinux-head.h"
|
||||
@@ -686,6 +732,8 @@ static const
|
||||
#include "stub/amd64-linux.kernel.vmlinux-head.h"
|
||||
static const
|
||||
#include "stub/arm-linux.kernel.vmlinux-head.h"
|
||||
static const
|
||||
#include "stub/armeb-linux.kernel.vmlinux-head.h"
|
||||
|
||||
unsigned PackVmlinuxI386::write_vmlinux_head(
|
||||
OutputFile *const fo,
|
||||
@@ -719,7 +767,15 @@ printf("UnCompressed length=0x%x\n", ph.u_len);
|
||||
return sizeof(stub_amd64_linux_kernel_vmlinux_head);
|
||||
}
|
||||
|
||||
void PackVmlinuxARM::defineDecompressorSymbols()
|
||||
void PackVmlinuxARMEL::defineDecompressorSymbols()
|
||||
{
|
||||
super::defineDecompressorSymbols();
|
||||
linker->defineSymbol( "COMPRESSED_LENGTH", ph.c_len);
|
||||
linker->defineSymbol("UNCOMPRESSED_LENGTH", ph.u_len);
|
||||
linker->defineSymbol("METHOD", ph.method);
|
||||
}
|
||||
|
||||
void PackVmlinuxARMEB::defineDecompressorSymbols()
|
||||
{
|
||||
super::defineDecompressorSymbols();
|
||||
linker->defineSymbol( "COMPRESSED_LENGTH", ph.c_len);
|
||||
@@ -744,7 +800,7 @@ void PackVmlinuxAMD64::defineDecompressorSymbols()
|
||||
linker->defineSymbol("PHYSICAL_START", phdri[0].p_paddr);
|
||||
}
|
||||
|
||||
unsigned PackVmlinuxARM::write_vmlinux_head(
|
||||
unsigned PackVmlinuxARMEL::write_vmlinux_head(
|
||||
OutputFile *const fo,
|
||||
Shdr *const stxt
|
||||
)
|
||||
@@ -766,8 +822,30 @@ unsigned PackVmlinuxARM::write_vmlinux_head(
|
||||
return sizeof(stub_arm_linux_kernel_vmlinux_head);
|
||||
}
|
||||
|
||||
unsigned PackVmlinuxARMEB::write_vmlinux_head(
|
||||
OutputFile *const fo,
|
||||
Shdr *const stxt
|
||||
)
|
||||
{
|
||||
// First word from vmlinux-head.S
|
||||
fo->write(&stub_armeb_linux_kernel_vmlinux_head[0], 4);
|
||||
|
||||
bool PackVmlinuxARM::has_valid_vmlinux_head()
|
||||
// Second word
|
||||
U32 tmp_u32;
|
||||
unsigned const t = (0xff000000 &
|
||||
BeLePolicy::get32(&stub_armeb_linux_kernel_vmlinux_head[4]))
|
||||
| (0x00ffffff & (0u - 1 + ((3+ ph.c_len)>>2)));
|
||||
tmp_u32 = t;
|
||||
fo->write(&tmp_u32, 4);
|
||||
|
||||
stxt->sh_addralign = 4;
|
||||
stxt->sh_size += sizeof(stub_armeb_linux_kernel_vmlinux_head);
|
||||
|
||||
return sizeof(stub_armeb_linux_kernel_vmlinux_head);
|
||||
}
|
||||
|
||||
|
||||
bool PackVmlinuxARMEL::has_valid_vmlinux_head()
|
||||
{
|
||||
U32 buf[2];
|
||||
fi->seek(p_text->sh_offset + sizeof(stub_arm_linux_kernel_vmlinux_head) -8, SEEK_SET);
|
||||
@@ -781,6 +859,20 @@ bool PackVmlinuxARM::has_valid_vmlinux_head()
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PackVmlinuxARMEB::has_valid_vmlinux_head()
|
||||
{
|
||||
U32 buf[2];
|
||||
fi->seek(p_text->sh_offset + sizeof(stub_armeb_linux_kernel_vmlinux_head) -8, SEEK_SET);
|
||||
fi->readx(buf, sizeof(buf));
|
||||
//unsigned const word0 = buf[0];
|
||||
unsigned const word1 = buf[1];
|
||||
if (0xeb==(word1>>24)
|
||||
&& (0x00ffffff& word1)==(0u - 1 + ((3+ ph.c_len)>>2))) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PackVmlinuxI386::has_valid_vmlinux_head()
|
||||
{
|
||||
unsigned char buf[5];
|
||||
@@ -1058,6 +1150,7 @@ Linker* PackVmlinuxAMD64::newLinker() const
|
||||
|
||||
// instantiate instances
|
||||
template class PackVmlinuxBase<ElfClass_LE32>;
|
||||
template class PackVmlinuxBase<ElfClass_BE32>;
|
||||
template class PackVmlinuxBase<ElfClass_LE64>;
|
||||
|
||||
|
||||
|
||||
+28
-4
@@ -119,14 +119,14 @@ protected:
|
||||
};
|
||||
|
||||
|
||||
class PackVmlinuxARM : public PackVmlinuxBase<ElfClass_LE32>
|
||||
class PackVmlinuxARMEL : public PackVmlinuxBase<ElfClass_LE32>
|
||||
{
|
||||
typedef PackVmlinuxBase<ElfClass_LE32> super;
|
||||
public:
|
||||
PackVmlinuxARM(InputFile *f) : super(f, Ehdr::EM_ARM,
|
||||
PackVmlinuxARMEL(InputFile *f) : super(f, Ehdr::EM_ARM,
|
||||
Ehdr::ELFCLASS32, Ehdr::ELFDATA2LSB, "decompress_kernel") { }
|
||||
virtual int getFormat() const { return UPX_F_VMLINUX_ARM; }
|
||||
virtual const char *getName() const { return "vmlinux/ARM"; }
|
||||
virtual int getFormat() const { return UPX_F_VMLINUX_ARMEL; }
|
||||
virtual const char *getName() const { return "vmlinux/armel"; }
|
||||
virtual const char *getFullName(const options_t *) const { return "arm-linux.kernel.vmlinux"; }
|
||||
virtual const int *getCompressionMethods(int method, int level) const;
|
||||
virtual const int *getFilters() const;
|
||||
@@ -143,6 +143,30 @@ protected:
|
||||
);
|
||||
};
|
||||
|
||||
class PackVmlinuxARMEB : public PackVmlinuxBase<ElfClass_BE32>
|
||||
{
|
||||
typedef PackVmlinuxBase<ElfClass_BE32> super;
|
||||
public:
|
||||
PackVmlinuxARMEB(InputFile *f) : super(f, Ehdr::EM_ARM,
|
||||
Ehdr::ELFCLASS32, Ehdr::ELFDATA2MSB, "decompress_kernel") { }
|
||||
virtual int getFormat() const { return UPX_F_VMLINUX_ARMEB; }
|
||||
virtual const char *getName() const { return "vmlinux/armeb"; }
|
||||
virtual const char *getFullName(const options_t *) const { return "armeb-linux.kernel.vmlinux"; }
|
||||
virtual const int *getCompressionMethods(int method, int level) const;
|
||||
virtual const int *getFilters() const;
|
||||
|
||||
protected:
|
||||
virtual void buildLoader(const Filter *ft);
|
||||
virtual void defineDecompressorSymbols();
|
||||
virtual Linker* newLinker() const;
|
||||
virtual bool is_valid_e_entry(Addr);
|
||||
virtual bool has_valid_vmlinux_head();
|
||||
virtual unsigned write_vmlinux_head(
|
||||
OutputFile *const fo,
|
||||
Shdr *const stxt
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
class PackVmlinuxAMD64 : public PackVmlinuxBase<ElfClass_LE64>
|
||||
{
|
||||
|
||||
+5
-1
@@ -607,7 +607,8 @@ void PackW32Pe::pack(OutputFile *fo)
|
||||
(ih.cpu < 0x14c || ih.cpu > 0x150)
|
||||
|| (ih.opthdrsize != 0xe0)
|
||||
|| ((ih.flags & EXECUTABLE) == 0)
|
||||
|| (ih.subsystem != 2 && ih.subsystem != 3 && ih.subsystem != 1)
|
||||
|| (ih.subsystem != 2 && ih.subsystem != 3
|
||||
&& ih.subsystem != 1 && ih.subsystem != 9)
|
||||
|| (ih.entry == 0 && !isdll)
|
||||
|| (ih.ddirsentries != 16)
|
||||
|| IDSIZE(PEDIR_EXCEPTION) // is this used on i386?
|
||||
@@ -615,6 +616,9 @@ void PackW32Pe::pack(OutputFile *fo)
|
||||
))
|
||||
throwCantPack("unexpected value in PE header (try --force)");
|
||||
|
||||
if (ih.subsystem == 9)
|
||||
throwCantPack("x86/wince files are not yet supported");
|
||||
|
||||
if (IDSIZE(PEDIR_SEC))
|
||||
IDSIZE(PEDIR_SEC) = IDADDR(PEDIR_SEC) = 0;
|
||||
if (IDSIZE(PEDIR_COMRT))
|
||||
|
||||
+26
-17
@@ -386,13 +386,16 @@ void Packer::decompress(const upx_bytep in, upx_bytep out,
|
||||
// overlapping decompression
|
||||
**************************************************************************/
|
||||
|
||||
bool ph_testOverlappingDecompression(const PackHeader &ph, const upx_bytep buf,
|
||||
bool ph_testOverlappingDecompression(const PackHeader &ph,
|
||||
const upx_bytep buf,
|
||||
const upx_bytep tbuf,
|
||||
unsigned overlap_overhead)
|
||||
{
|
||||
if (ph.c_len >= ph.u_len)
|
||||
return false;
|
||||
|
||||
assert((int)overlap_overhead >= 0);
|
||||
assert((int) overlap_overhead >= 0);
|
||||
assert((int) (ph.u_len + overlap_overhead) >= 0);
|
||||
|
||||
// Because upx_test_overlap() does not use the asm_fast decompressor
|
||||
// we must account for extra 3 bytes that asm_fast does use,
|
||||
@@ -406,16 +409,17 @@ bool ph_testOverlappingDecompression(const PackHeader &ph, const upx_bytep buf,
|
||||
|
||||
unsigned src_off = ph.u_len + overlap_overhead - ph.c_len;
|
||||
unsigned new_len = ph.u_len;
|
||||
int r = upx_test_overlap(buf - src_off, src_off,
|
||||
ph.c_len, &new_len, ph.method, &ph.compress_result);
|
||||
int r = upx_test_overlap(buf - src_off, tbuf,
|
||||
src_off, ph.c_len, &new_len,
|
||||
ph.method, &ph.compress_result);
|
||||
return (r == UPX_E_OK && new_len == ph.u_len);
|
||||
}
|
||||
|
||||
|
||||
bool Packer::testOverlappingDecompression(const upx_bytep buf,
|
||||
bool Packer::testOverlappingDecompression(const upx_bytep buf, const upx_bytep tbuf,
|
||||
unsigned overlap_overhead) const
|
||||
{
|
||||
return ph_testOverlappingDecompression(ph, buf, overlap_overhead);
|
||||
return ph_testOverlappingDecompression(ph, buf, tbuf, overlap_overhead);
|
||||
}
|
||||
|
||||
|
||||
@@ -474,6 +478,7 @@ void Packer::verifyOverlappingDecompression(upx_bytep o_ptr, unsigned o_size, Fi
|
||||
**************************************************************************/
|
||||
|
||||
unsigned Packer::findOverlapOverhead(const upx_bytep buf,
|
||||
const upx_bytep tbuf,
|
||||
unsigned range,
|
||||
unsigned upper_limit) const
|
||||
{
|
||||
@@ -481,7 +486,7 @@ unsigned Packer::findOverlapOverhead(const upx_bytep buf,
|
||||
|
||||
// prepare to deal with very pessimistic values
|
||||
unsigned low = 1;
|
||||
unsigned high = UPX_MIN(ph.u_len / 4 + 512, upper_limit);
|
||||
unsigned high = UPX_MIN(ph.u_len + 512, upper_limit);
|
||||
// but be optimistic for first try (speedup)
|
||||
unsigned m = UPX_MIN(16u, high);
|
||||
//
|
||||
@@ -493,21 +498,23 @@ unsigned Packer::findOverlapOverhead(const upx_bytep buf,
|
||||
assert(m >= low); assert(m <= high);
|
||||
assert(m < overhead || overhead == 0);
|
||||
nr++;
|
||||
bool success = testOverlappingDecompression(buf, m);
|
||||
//printf("testOverlapOverhead: %d %d -> %d\n", nr, m, (int)success);
|
||||
bool success = testOverlappingDecompression(buf, tbuf, m);
|
||||
//printf("testOverlapOverhead(%d): %d %d: %d -> %d\n", nr, low, high, m, (int)success);
|
||||
if (success)
|
||||
{
|
||||
overhead = m;
|
||||
// Succeed early if m lies in [low .. low+range-1], i.e. if
|
||||
// if the range of the current interval is <= range.
|
||||
//if (m <= low + range - 1)
|
||||
if (m + 1 <= low + range) // avoid underflow
|
||||
// if (m <= low + range - 1)
|
||||
// if (m < low + range)
|
||||
if (m - low < range) // avoid underflow
|
||||
break;
|
||||
high = m - 1;
|
||||
}
|
||||
else
|
||||
low = m + 1;
|
||||
m = (low + high) / 2;
|
||||
////m = (low + high) / 2;
|
||||
m = (low & high) + ((low ^ high) >> 1); // avoid overflow
|
||||
}
|
||||
|
||||
//printf("findOverlapOverhead: %d (%d tries)\n", overhead, nr);
|
||||
@@ -684,7 +691,7 @@ int Packer::patchPackHeader(void *b, int blen)
|
||||
}
|
||||
|
||||
|
||||
bool Packer::getPackHeader(void *b, int blen)
|
||||
bool Packer::getPackHeader(void *b, int blen, bool allow_incompressible)
|
||||
{
|
||||
if (!ph.fillPackHeader((unsigned char *)b, blen))
|
||||
return false;
|
||||
@@ -697,7 +704,9 @@ bool Packer::getPackHeader(void *b, int blen)
|
||||
if (!testUnpackVersion(ph.version))
|
||||
return false;
|
||||
|
||||
if (ph.c_len >= ph.u_len || (off_t)ph.c_len >= file_size
|
||||
if (ph.c_len > ph.u_len
|
||||
|| (ph.c_len == ph.u_len && !allow_incompressible)
|
||||
|| (off_t)ph.c_len >= file_size
|
||||
|| ph.version <= 0 || ph.version >= 0xff)
|
||||
throwCantUnpack("header corrupted");
|
||||
else if ((off_t)ph.u_len > ph.u_file_size)
|
||||
@@ -722,14 +731,14 @@ bool Packer::getPackHeader(void *b, int blen)
|
||||
}
|
||||
|
||||
|
||||
bool Packer::readPackHeader(int len)
|
||||
bool Packer::readPackHeader(int len, bool allow_incompressible)
|
||||
{
|
||||
assert((int)len > 0);
|
||||
MemBuffer buf(len);
|
||||
len = fi->read(buf, len);
|
||||
if (len <= 0)
|
||||
return false;
|
||||
return getPackHeader(buf, len);
|
||||
return getPackHeader(buf, len, allow_incompressible);
|
||||
}
|
||||
|
||||
|
||||
@@ -1409,7 +1418,7 @@ void Packer::compressWithFilters(upx_bytep i_ptr, unsigned i_len,
|
||||
if (ph.c_len + lsize + hdr_c_len <= best_ph.c_len + best_ph_lsize + best_hdr_c_len)
|
||||
{
|
||||
// get results
|
||||
ph.overlap_overhead = findOverlapOverhead(o_tmp, overlap_range);
|
||||
ph.overlap_overhead = findOverlapOverhead(o_tmp, i_ptr, overlap_range);
|
||||
buildLoader(&ft);
|
||||
lsize = getLoaderSize();
|
||||
assert(lsize > 0);
|
||||
|
||||
+4
-2
@@ -203,9 +203,11 @@ protected:
|
||||
// util for verifying overlapping decompresion
|
||||
// non-destructive test
|
||||
virtual bool testOverlappingDecompression(const upx_bytep buf,
|
||||
const upx_bytep tbuf,
|
||||
unsigned overlap_overhead) const;
|
||||
// non-destructive find
|
||||
virtual unsigned findOverlapOverhead(const upx_bytep buf,
|
||||
const upx_bytep tbuf,
|
||||
unsigned range = 0,
|
||||
unsigned upper_limit = ~0u) const;
|
||||
// destructive decompress + verify
|
||||
@@ -214,8 +216,8 @@ protected:
|
||||
|
||||
// packheader handling
|
||||
virtual int patchPackHeader(void *b, int blen);
|
||||
virtual bool getPackHeader(void *b, int blen);
|
||||
virtual bool readPackHeader(int len);
|
||||
virtual bool getPackHeader(void *b, int blen, bool allow_incompressible=false);
|
||||
virtual bool readPackHeader(int len, bool allow_incompressible=false);
|
||||
virtual void checkAlreadyPacked(const void *b, int blen);
|
||||
|
||||
// loader core
|
||||
|
||||
+8
-6
@@ -208,11 +208,12 @@ const char *Packer::getDecompressorSections() const
|
||||
if (UPX_F_LINUX_ELF_i386 ==ph.format
|
||||
|| UPX_F_LINUX_ELFI_i386 ==ph.format
|
||||
|| UPX_F_LINUX_ELF64_AMD ==ph.format
|
||||
|| UPX_F_LINUX_ELF32_ARMLE==ph.format
|
||||
|| UPX_F_LINUX_ELF32_ARMEL==ph.format
|
||||
|| UPX_F_LINUX_ELFPPC32 ==ph.format
|
||||
|| UPX_F_LINUX_ELF32_ARMBE==ph.format
|
||||
|| UPX_F_LINUX_ELF32_ARMEB==ph.format
|
||||
|| UPX_F_BSD_ELF_i386 ==ph.format
|
||||
|| UPX_F_VMLINUX_ARM ==ph.format
|
||||
|| UPX_F_VMLINUX_ARMEL ==ph.format
|
||||
|| UPX_F_VMLINUX_ARMEB ==ph.format
|
||||
|| UPX_F_MACH_PPC32 ==ph.format
|
||||
|| UPX_F_MACH_i386 ==ph.format
|
||||
) {
|
||||
@@ -244,11 +245,12 @@ void Packer::defineDecompressorSymbols()
|
||||
if (UPX_F_LINUX_ELF_i386 ==ph.format
|
||||
|| UPX_F_LINUX_ELFI_i386 ==ph.format
|
||||
|| UPX_F_LINUX_ELF64_AMD ==ph.format
|
||||
|| UPX_F_LINUX_ELF32_ARMLE==ph.format
|
||||
|| UPX_F_LINUX_ELF32_ARMEL==ph.format
|
||||
|| UPX_F_LINUX_ELFPPC32 ==ph.format
|
||||
|| UPX_F_LINUX_ELF32_ARMBE==ph.format
|
||||
|| UPX_F_LINUX_ELF32_ARMEB==ph.format
|
||||
|| UPX_F_BSD_ELF_i386 ==ph.format
|
||||
|| UPX_F_VMLINUX_ARM ==ph.format
|
||||
|| UPX_F_VMLINUX_ARMEL ==ph.format
|
||||
|| UPX_F_VMLINUX_ARMEB ==ph.format
|
||||
|| UPX_F_MACH_PPC32 ==ph.format
|
||||
|| UPX_F_MACH_i386 ==ph.format
|
||||
) {
|
||||
|
||||
+3
-1
@@ -192,7 +192,9 @@ Packer* PackMaster::visitAllPackers(visit_func_t func, InputFile *f, const optio
|
||||
//
|
||||
// linux kernel
|
||||
//
|
||||
if ((p = func(new PackVmlinuxARM(f), user)) != NULL)
|
||||
if ((p = func(new PackVmlinuxARMEL(f), user)) != NULL)
|
||||
return p;
|
||||
if ((p = func(new PackVmlinuxARMEB(f), user)) != NULL)
|
||||
return p;
|
||||
if ((p = func(new PackVmlinuxAMD64(f), user)) != NULL)
|
||||
return p;
|
||||
|
||||
+26
-2
@@ -18,7 +18,7 @@ empty :=
|
||||
space := $(empty) $(empty)
|
||||
tab := $(empty) $(empty)
|
||||
|
||||
ifneq ($(findstring $(firstword $(MAKE_VERSION)),3.79 3.79.1 3.80),)
|
||||
ifneq ($(findstring $(firstword $(MAKE_VERSION)),3.77 3.78 3.78.1 3.79 3.79.1 3.80),)
|
||||
$(error GNU make 3.81 or better is required)
|
||||
endif
|
||||
|
||||
@@ -29,7 +29,7 @@ endif
|
||||
ifndef top_srcdir
|
||||
top_srcdir := $(srcdir)/../..
|
||||
endif
|
||||
-include $(top_srcdir)/Makevars.global ./Makevars.local
|
||||
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
|
||||
|
||||
# update $PATH for our special stub build tools
|
||||
ifneq ($(wildcard $(HOME)/local/bin/bin-upx/.),)
|
||||
@@ -56,6 +56,8 @@ STUBS += arm-linux.kernel.vmlinux.h
|
||||
STUBS += arm-linux.kernel.vmlinux-head.h
|
||||
STUBS += armeb-linux.elf-entry.h
|
||||
STUBS += armeb-linux.elf-fold.h
|
||||
STUBS += armeb-linux.kernel.vmlinux.h
|
||||
STUBS += armeb-linux.kernel.vmlinux-head.h
|
||||
STUBS += arm.v4a-wince.pe.h
|
||||
STUBS += arm.v4t-wince.pe.h
|
||||
STUBS += i086-dos16.com.h
|
||||
@@ -336,6 +338,28 @@ arm-linux.kernel.vmlinux-head.h : $(srcdir)/src/$$T.S
|
||||
$(call tc,bin2h) tmp/$T.bin $@
|
||||
|
||||
|
||||
# /***********************************************************************
|
||||
# // armeb-linux.kernel.vmlinux
|
||||
# // armeb-linux.kernel.vmlinuz
|
||||
# // armeb-linux.kernel.vmlinux-head
|
||||
# ************************************************************************/
|
||||
|
||||
armeb-linux.kernel.vmlinu%.h : tc_list = armeb-linux.kernel default
|
||||
armeb-linux.kernel.vmlinu%.h : tc_bfdname = elf32-bigarm
|
||||
|
||||
tc.armeb-linux.kernel.gcc = $(tc.arm-linux.elf.gcc) -mbig-endian
|
||||
|
||||
armeb-linux.kernel.vmlinu%.h : $(srcdir)/src/$$T.S
|
||||
$(call tc,gcc) -c -x assembler-with-cpp $< -o tmp/$T.bin
|
||||
$(call tc,f-embed_objinfo,tmp/$T.bin)
|
||||
$(call tc,bin2h-c) tmp/$T.bin $@
|
||||
|
||||
armeb-linux.kernel.vmlinux-head.h : $(srcdir)/src/$$T.S
|
||||
$(call tc,gcc) -c -x assembler-with-cpp $< -o tmp/$T.o
|
||||
$(call tc,objcopy) --output-target binary --only-section .text tmp/$T.o tmp/$T.bin
|
||||
$(call tc,bin2h) tmp/$T.bin $@
|
||||
|
||||
|
||||
# /***********************************************************************
|
||||
# // armeb-linux.elf
|
||||
# ************************************************************************/
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
|
||||
|
||||
#define STUB_ARM_LINUX_ELF_ENTRY_SIZE 16296
|
||||
#define STUB_ARM_LINUX_ELF_ENTRY_ADLER32 0x9b815c2e
|
||||
#define STUB_ARM_LINUX_ELF_ENTRY_CRC32 0x3b801af9
|
||||
#define STUB_ARM_LINUX_ELF_ENTRY_ADLER32 0xdf115bee
|
||||
#define STUB_ARM_LINUX_ELF_ENTRY_CRC32 0x8704e1a1
|
||||
|
||||
unsigned char stub_arm_linux_elf_entry[16296] = {
|
||||
127, 69, 76, 70, 1, 1, 1, 97, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */
|
||||
@@ -44,7 +44,7 @@ unsigned char stub_arm_linux_elf_entry[16296] = {
|
||||
254, 1,160,232, 15, 0, 0, 58, 9, 64, 64,224, 80, 80,143,226, /* 0x 80 */
|
||||
0,224,160,225, 4, 80,133,224, 5, 0,160,225, 4, 16,137,224, /* 0x 90 */
|
||||
0, 32,160,227, 2, 0,159,239, 0,144,156,229,140,144, 73,226, /* 0x a0 */
|
||||
9,160, 76,224, 4,160,138,224, 8, 0,219,229, 1, 64, 45,233, /* 0x b0 */
|
||||
9,160, 76,224, 4,160,138,224, 8, 0,155,229, 1, 64, 45,233, /* 0x b0 */
|
||||
0, 48,155,229, 12, 0,139,226, 4, 16,155,229, 14, 32,160,225, /* 0x c0 */
|
||||
8, 48,141,229, 8, 48,141,226, 15,224,160,225, 5,240,160,225, /* 0x d0 */
|
||||
2,128,189,232,252, 64, 45,233, 0,112,129,224, 0, 80,224,227, /* 0x e0 */
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
|
||||
|
||||
#define STUB_ARM_LINUX_KERNEL_VMLINUX_SIZE 17091
|
||||
#define STUB_ARM_LINUX_KERNEL_VMLINUX_ADLER32 0x3d6cea16
|
||||
#define STUB_ARM_LINUX_KERNEL_VMLINUX_CRC32 0xab8eacad
|
||||
#define STUB_ARM_LINUX_KERNEL_VMLINUX_ADLER32 0x2af6ea3d
|
||||
#define STUB_ARM_LINUX_KERNEL_VMLINUX_CRC32 0x12d16cc6
|
||||
|
||||
unsigned char stub_arm_linux_kernel_vmlinux[17091] = {
|
||||
127, 69, 76, 70, 1, 1, 1, 97, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */
|
||||
@@ -570,7 +570,7 @@ unsigned char stub_arm_linux_kernel_vmlinux[17091] = {
|
||||
10, 79, 70, 70, 83, 69, 84, 32, 32, 32, 84, 89, 80, 69, 32, 32, /* 0x2160 */
|
||||
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 86, 65, 76, 85, /* 0x2170 */
|
||||
69, 10, 48, 48, 48, 48, 48, 48, 49, 52, 32, 82, 95, 65, 82, 77, /* 0x2180 */
|
||||
95, 65, 66, 83, 56, 32, 32, 32, 32, 32, 32, 32, 32, 77, 69, 84, /* 0x2190 */
|
||||
95, 65, 66, 83, 51, 50, 32, 32, 32, 32, 32, 32, 32, 77, 69, 84, /* 0x2190 */
|
||||
72, 79, 68, 10, 48, 48, 48, 48, 48, 48, 51, 48, 32, 82, 95, 65, /* 0x21a0 */
|
||||
82, 77, 95, 80, 67, 50, 52, 32, 32, 32, 32, 32, 32, 32, 32, 76, /* 0x21b0 */
|
||||
73, 78, 85, 88, 48, 51, 48, 10, 48, 48, 48, 48, 48, 48, 51, 52, /* 0x21c0 */
|
||||
@@ -589,9 +589,9 @@ unsigned char stub_arm_linux_kernel_vmlinux[17091] = {
|
||||
79, 70, 70, 83, 69, 84, 32, 32, 32, 84, 89, 80, 69, 32, 32, 32, /* 0x2290 */
|
||||
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 86, 65, 76, 85, 69, /* 0x22a0 */
|
||||
10, 48, 48, 48, 48, 48, 48, 48, 56, 32, 82, 95, 65, 82, 77, 95, /* 0x22b0 */
|
||||
65, 66, 83, 56, 32, 32, 32, 32, 32, 32, 32, 32,102,105,108,116, /* 0x22c0 */
|
||||
65, 66, 83, 51, 50, 32, 32, 32, 32, 32, 32, 32,102,105,108,116, /* 0x22c0 */
|
||||
101,114, 95, 99,116,111, 10, 48, 48, 48, 48, 48, 48, 48, 99, 32, /* 0x22d0 */
|
||||
82, 95, 65, 82, 77, 95, 65, 66, 83, 56, 32, 32, 32, 32, 32, 32, /* 0x22e0 */
|
||||
82, 95, 65, 82, 77, 95, 65, 66, 83, 51, 50, 32, 32, 32, 32, 32, /* 0x22e0 */
|
||||
32, 32,102,105,108,116,101,114, 95,105,100, 10, 48, 48, 48, 48, /* 0x22f0 */
|
||||
48, 48, 49, 48, 32, 82, 95, 65, 82, 77, 95, 80, 67, 50, 52, 32, /* 0x2300 */
|
||||
32, 32, 32, 32, 32, 32, 32, 99,116,111,107, 51, 50, 46, 48, 48, /* 0x2310 */
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
|
||||
|
||||
#define STUB_ARMEB_LINUX_ELF_ENTRY_SIZE 16295
|
||||
#define STUB_ARMEB_LINUX_ELF_ENTRY_ADLER32 0x87435b9a
|
||||
#define STUB_ARMEB_LINUX_ELF_ENTRY_CRC32 0x7cf93476
|
||||
#define STUB_ARMEB_LINUX_ELF_ENTRY_ADLER32 0xcad35b5a
|
||||
#define STUB_ARMEB_LINUX_ELF_ENTRY_CRC32 0xc07dcf2e
|
||||
|
||||
unsigned char stub_armeb_linux_elf_entry[16295] = {
|
||||
127, 69, 76, 70, 1, 2, 1, 97, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */
|
||||
@@ -44,7 +44,7 @@ unsigned char stub_armeb_linux_elf_entry[16295] = {
|
||||
232,160, 1,254, 58, 0, 0, 15,224, 64, 64, 9,226,143, 80, 80, /* 0x 80 */
|
||||
225,160,224, 0,224,133, 80, 4,225,160, 0, 5,224,137, 16, 4, /* 0x 90 */
|
||||
227,160, 32, 0,239,159, 0, 2,229,156,144, 0,226, 73,144,140, /* 0x a0 */
|
||||
224, 76,160, 9,224,138,160, 4,229,219, 0, 8,233, 45, 64, 1, /* 0x b0 */
|
||||
224, 76,160, 9,224,138,160, 4,229,155, 0, 8,233, 45, 64, 1, /* 0x b0 */
|
||||
229,155, 48, 0,226,139, 0, 12,229,155, 16, 4,225,160, 32, 14, /* 0x c0 */
|
||||
229,141, 48, 8,226,141, 48, 8,225,160,224, 15,225,160,240, 5, /* 0x d0 */
|
||||
232,189,128, 2,233, 45, 64,252,224,129,112, 0,227,224, 80, 0, /* 0x e0 */
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/* armeb-linux.kernel.vmlinux-head.h
|
||||
created from armeb-linux.kernel.vmlinux-head.bin, 8 (0x8) bytes
|
||||
|
||||
This file is part of the UPX executable compressor.
|
||||
|
||||
Copyright (C) 1996-2007 Markus Franz Xaver Johannes Oberhumer
|
||||
Copyright (C) 1996-2007 Laszlo Molnar
|
||||
Copyright (C) 2000-2007 John F. Reiser
|
||||
All Rights Reserved.
|
||||
|
||||
UPX and the UCL library are free software; you can redistribute them
|
||||
and/or modify them under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; see the file COPYING.
|
||||
If not, write to the Free Software Foundation, Inc.,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||
<mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
|
||||
*/
|
||||
|
||||
|
||||
#define STUB_ARMEB_LINUX_KERNEL_VMLINUX_HEAD_SIZE 8
|
||||
#define STUB_ARMEB_LINUX_KERNEL_VMLINUX_HEAD_ADLER32 0x19db0637
|
||||
#define STUB_ARMEB_LINUX_KERNEL_VMLINUX_HEAD_CRC32 0xb5ec5990
|
||||
|
||||
unsigned char stub_armeb_linux_kernel_vmlinux_head[8] = {
|
||||
225,160,192, 14,235,255,255,254 /* 0x 0 */
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -29,15 +29,15 @@
|
||||
|
||||
|
||||
#define STUB_I386_BSD_ELF_ENTRY_SIZE 37562
|
||||
#define STUB_I386_BSD_ELF_ENTRY_ADLER32 0xb6d5917d
|
||||
#define STUB_I386_BSD_ELF_ENTRY_CRC32 0x57a02d3a
|
||||
#define STUB_I386_BSD_ELF_ENTRY_ADLER32 0x0c31915d
|
||||
#define STUB_I386_BSD_ELF_ENTRY_CRC32 0x68fd1b14
|
||||
|
||||
unsigned char stub_i386_bsd_elf_entry[37562] = {
|
||||
127, 69, 76, 70, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */
|
||||
1, 0, 3, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 10 */
|
||||
116, 34, 0, 0, 0, 0, 0, 0, 52, 0, 0, 0, 0, 0, 40, 0, /* 0x 20 */
|
||||
243, 0,240, 0,232,123, 0, 0, 0, 96,139,116, 36, 40,139,124, /* 0x 30 */
|
||||
36, 48,131,205,255,235, 3,164,235, 3,138, 6, 70,136, 7, 71, /* 0x 40 */
|
||||
243, 0,240, 0,232,123, 0, 0, 0, 96,139,116, 36, 36,139,124, /* 0x 30 */
|
||||
36, 44,131,205,255,235, 3,164,235, 3,138, 6, 70,136, 7, 71, /* 0x 40 */
|
||||
1,219,117, 7,139, 30,131,238,252, 17,219,114, 1, 49,192, 64, /* 0x 50 */
|
||||
138, 7,114,255,184, 1, 0, 0, 0, 1,219,117, 7,139, 30,131, /* 0x 60 */
|
||||
238,252, 17,219, 17,192, 1,219,117, 7,139, 30,131,238,252, 17, /* 0x 70 */
|
||||
@@ -88,10 +88,10 @@ unsigned char stub_i386_bsd_elf_entry[37562] = {
|
||||
4,119,241, 1,207,233,252,255,255,255,137,229,141,156, 36, 0, /* 0x 340 */
|
||||
0, 0, 0, 49,192, 80, 57,220,117,251, 70, 70, 83,104, 0, 0, /* 0x 350 */
|
||||
0, 0, 87,131,195, 4, 83,104, 0, 0, 0, 0, 86,131,195, 4, /* 0x 360 */
|
||||
83, 80,199, 3, 0, 0, 0, 0,137,229,139, 85, 44,172, 74,136, /* 0x 370 */
|
||||
83, 80,199, 3, 0, 0, 0, 0,137,229,139, 85, 40,172, 74,136, /* 0x 370 */
|
||||
193, 36, 7,192,233, 3,187, 0,253,255,255,211,227,141,164, 92, /* 0x 380 */
|
||||
144,241,255,255,131,228,224,106, 0,106, 0,137,227, 83,131,195, /* 0x 390 */
|
||||
4,139, 77, 52,255, 49, 87, 83,131,195, 4,136, 67, 2,172, 74, /* 0x 3a0 */
|
||||
4,139, 77, 48,255, 49, 87, 83,131,195, 4,136, 67, 2,172, 74, /* 0x 3a0 */
|
||||
136,193, 36, 15,136, 3,192,233, 4,136, 75, 1, 82, 86, 83, 80, /* 0x 3b0 */
|
||||
85, 87, 86, 83,131,236,124,139,148, 36,144, 0, 0, 0,199, 68, /* 0x 3c0 */
|
||||
36,116, 0, 0, 0, 0,198, 68, 36,115, 0,139,172, 36,156, 0, /* 0x 3d0 */
|
||||
@@ -431,8 +431,8 @@ unsigned char stub_i386_bsd_elf_entry[37562] = {
|
||||
148, 36,156, 0, 0, 0,139, 76, 36,116,137, 26,139,156, 36,168, /* 0x18b0 */
|
||||
0, 0, 0,137, 11,131,196,124, 91, 94, 95, 93, 3,115,252, 3, /* 0x18c0 */
|
||||
123,248, 49,192,141,140, 36, 0,255,255,255,137,236, 80, 57,204, /* 0x18d0 */
|
||||
117,251,137,236, 49,201,139, 84, 36, 40, 3, 84, 36, 44, 57,214, /* 0x18e0 */
|
||||
116, 1, 72, 43,124, 36, 48,139, 84, 36, 52,137, 58,137, 68, 36, /* 0x18f0 */
|
||||
117,251,137,236, 49,201,139, 84, 36, 36, 3, 84, 36, 40, 57,214, /* 0x18e0 */
|
||||
116, 1, 72, 43,124, 36, 44,139, 84, 36, 48,137, 58,137, 68, 36, /* 0x18f0 */
|
||||
28, 97,195,235, 4, 90, 88, 89,151, 96, 49,219,187, 0, 0, 0, /* 0x1900 */
|
||||
0,106, 15, 88,138,100, 36, 32,106, 15, 91,138,124, 36, 32,138, /* 0x1910 */
|
||||
84, 36, 32,233,252,255,255,255, 15,183, 47, 43,110, 12, 41,221, /* 0x1920 */
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
|
||||
|
||||
#define STUB_I386_DOS32_TMT_SIZE 27032
|
||||
#define STUB_I386_DOS32_TMT_ADLER32 0xe058a94c
|
||||
#define STUB_I386_DOS32_TMT_CRC32 0x76e13290
|
||||
#define STUB_I386_DOS32_TMT_ADLER32 0x60faa944
|
||||
#define STUB_I386_DOS32_TMT_CRC32 0x1e38f90e
|
||||
|
||||
unsigned char stub_i386_dos32_tmt[27032] = {
|
||||
127, 69, 76, 70, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */
|
||||
@@ -444,7 +444,7 @@ unsigned char stub_i386_dos32_tmt[27032] = {
|
||||
0, 0,235, 30,138, 7,131,199, 1, 60,128,114, 10, 60,143,119, /* 0x1980 */
|
||||
6,128,127,254, 15,116, 5, 44,232, 60, 1,119,255,128, 63, 0, /* 0x1990 */
|
||||
117,255,139, 7,102,193,232, 8,193,192, 16,134,196, 41,248, 1, /* 0x19a0 */
|
||||
240,137, 7,131,199, 4,131,233, 4,138, 7,131,199, 1,226, 13, /* 0x19b0 */
|
||||
232,137, 7,131,199, 4,131,233, 4,138, 7,131,199, 1,226, 13, /* 0x19b0 */
|
||||
131,233, 1,127, 6,141,125,252, 49,192,138, 6, 70, 9,192,116, /* 0x19c0 */
|
||||
1, 60,239,119, 17, 1,199,139, 7,134,196,193,192, 16,134,196, /* 0x19d0 */
|
||||
1,232,137, 7,235,226, 36, 15,193,224, 16,102,139, 6,131,198, /* 0x19e0 */
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
|
||||
|
||||
#define STUB_I386_DOS32_WATCOM_LE_SIZE 27436
|
||||
#define STUB_I386_DOS32_WATCOM_LE_ADLER32 0x1fda144c
|
||||
#define STUB_I386_DOS32_WATCOM_LE_CRC32 0xd84b8031
|
||||
#define STUB_I386_DOS32_WATCOM_LE_ADLER32 0x946d1444
|
||||
#define STUB_I386_DOS32_WATCOM_LE_CRC32 0x39b33888
|
||||
|
||||
unsigned char stub_i386_dos32_watcom_le[27436] = {
|
||||
127, 69, 76, 70, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */
|
||||
@@ -445,7 +445,7 @@ unsigned char stub_i386_dos32_watcom_le[27436] = {
|
||||
4,185, 0, 0, 0, 0,235, 30,138, 7,131,199, 1, 60,128,114, /* 0x1990 */
|
||||
10, 60,143,119, 6,128,127,254, 15,116, 5, 44,232, 60, 1,119, /* 0x19a0 */
|
||||
255,128, 63, 0,117,255,139, 7,102,193,232, 8,193,192, 16,134, /* 0x19b0 */
|
||||
196, 41,248, 1,240,137, 7,131,199, 4,131,233, 4,138, 7,131, /* 0x19c0 */
|
||||
196, 41,248, 1,232,137, 7,131,199, 4,131,233, 4,138, 7,131, /* 0x19c0 */
|
||||
199, 1,226, 13,131,233, 1,127, 6,141,125,252, 49,192,138, 6, /* 0x19d0 */
|
||||
70, 9,192,116, 1, 60,239,119, 17, 1,199,139, 7,134,196,193, /* 0x19e0 */
|
||||
192, 16,134,196, 1,232,137, 7,235,226, 36, 15,193,224, 16,102, /* 0x19f0 */
|
||||
|
||||
+1320
-1297
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,7 @@ __dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
|
||||
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
|
||||
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
|
||||
endif
|
||||
-include $(top_srcdir)/Makevars.global ./Makevars.local
|
||||
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
|
||||
vpath %.c $(top_srcdir)/src/stub/src/c
|
||||
|
||||
STUBS =
|
||||
|
||||
@@ -8,7 +8,7 @@ __dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
|
||||
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
|
||||
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
|
||||
endif
|
||||
-include $(top_srcdir)/Makevars.global ./Makevars.local
|
||||
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
|
||||
vpath %.c $(top_srcdir)/src/stub/src/c
|
||||
|
||||
STUBS =
|
||||
|
||||
@@ -8,7 +8,7 @@ __dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
|
||||
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
|
||||
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
|
||||
endif
|
||||
-include $(top_srcdir)/Makevars.global ./Makevars.local
|
||||
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
|
||||
vpath %.c $(top_srcdir)/src/stub/src/c
|
||||
|
||||
STUBS =
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
.endm
|
||||
|
||||
.macro loadcon8 reg,val8
|
||||
.byte \val8, \reg<<4, 0xa0, 0xe3 /* mov \reg,#\val8 */
|
||||
.long (0xe3<<24)|(0xa0<<16)|((\reg<<4)<<8)+(\val8) /* mov \reg,#\val8 */
|
||||
.endm
|
||||
|
||||
// vi:ts=8:et:nowrap
|
||||
|
||||
@@ -14,7 +14,7 @@ __dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
|
||||
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
|
||||
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
|
||||
endif
|
||||
-include $(top_srcdir)/Makevars.global ./Makevars.local
|
||||
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
|
||||
vpath %.c $(top_srcdir)/src/stub/src/c
|
||||
|
||||
STUBS =
|
||||
|
||||
@@ -8,7 +8,7 @@ __dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
|
||||
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
|
||||
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
|
||||
endif
|
||||
-include $(top_srcdir)/Makevars.global ./Makevars.local
|
||||
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
|
||||
vpath %.c $(top_srcdir)/src/stub/src/c
|
||||
|
||||
STUBS =
|
||||
|
||||
@@ -300,8 +300,10 @@ ctend:
|
||||
// 2nd param: where is cto8 (dl, bl, or literal)
|
||||
|
||||
section ctok32.00
|
||||
.ifnc \addvalue, 0
|
||||
.ifc \addvalue, edi
|
||||
mov esi, \addvalue
|
||||
mov esi, edi
|
||||
.endif
|
||||
.endif
|
||||
jmps ckstart
|
||||
ckloop3:
|
||||
@@ -333,7 +335,11 @@ ckmark:
|
||||
|
||||
sub eax, edi
|
||||
.ifnc \addvalue, 0
|
||||
.ifc \addvalue, edi
|
||||
add eax, esi
|
||||
.else
|
||||
add eax, \addvalue
|
||||
.endif
|
||||
.endif
|
||||
mov [edi], eax
|
||||
add edi, 4
|
||||
|
||||
@@ -8,7 +8,7 @@ __dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
|
||||
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
|
||||
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
|
||||
endif
|
||||
-include $(top_srcdir)/Makevars.global ./Makevars.local
|
||||
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
|
||||
vpath %.c $(top_srcdir)/src/stub/src/c
|
||||
|
||||
STUBS =
|
||||
|
||||
@@ -8,7 +8,7 @@ __dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
|
||||
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
|
||||
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
|
||||
endif
|
||||
-include $(top_srcdir)/Makevars.global ./Makevars.local
|
||||
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
|
||||
vpath %.c $(top_srcdir)/src/stub/src/c
|
||||
|
||||
STUBS =
|
||||
|
||||
@@ -8,7 +8,7 @@ __dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
|
||||
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
|
||||
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
|
||||
endif
|
||||
-include $(top_srcdir)/Makevars.global ./Makevars.local
|
||||
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
|
||||
vpath %.c $(top_srcdir)/src/stub/src/c
|
||||
|
||||
STUBS =
|
||||
|
||||
@@ -34,11 +34,15 @@
|
||||
#ifndef _MR3K_STD_CONF_
|
||||
#define _MR3K_STD_CONF_
|
||||
|
||||
#define JOHN 1
|
||||
#define ALT_SMALL 1
|
||||
|
||||
|
||||
;//////////////////////////////////////
|
||||
;// register defines
|
||||
;//////////////////////////////////////
|
||||
|
||||
#if 1
|
||||
#define tmp at
|
||||
|
||||
#define dst t0
|
||||
@@ -58,6 +62,31 @@
|
||||
#define m_off t7
|
||||
#define m_pos t7
|
||||
|
||||
#else
|
||||
|
||||
.print "\nwarning redefined src / dst\n"
|
||||
|
||||
#define tmp v1
|
||||
|
||||
#define src a0
|
||||
#define dst a1
|
||||
|
||||
#define pc v0
|
||||
#define cnt a2
|
||||
|
||||
#define src_ilen src
|
||||
#define bb t1
|
||||
#define ilen t2
|
||||
#define last_m_off t3
|
||||
#define m_len t4
|
||||
#define bc t5
|
||||
|
||||
#define var t6
|
||||
#define m_off t7
|
||||
#define m_pos t7
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
;//////////////////////////////////////
|
||||
;// init bitaccess
|
||||
@@ -89,12 +118,32 @@
|
||||
|
||||
.macro init
|
||||
|
||||
init_sz = .
|
||||
|
||||
.if (JOHN == 0)
|
||||
move bc,zero
|
||||
|
||||
.else // John's method
|
||||
|
||||
.if (UCL_SMALL == 1)
|
||||
.if (ALT_SMALL == 1)
|
||||
lui bc,1 << (31 - 16)
|
||||
move bb,bc
|
||||
.else
|
||||
move bc,zero
|
||||
.endif
|
||||
.else
|
||||
lui bc,1 << (31 - 16)
|
||||
move bb,bc
|
||||
.endif
|
||||
.endif
|
||||
li last_m_off,1
|
||||
.if (src != src_ilen)
|
||||
move src_ilen,src
|
||||
.endif
|
||||
|
||||
init_sz = . - init_sz
|
||||
|
||||
.endm
|
||||
|
||||
|
||||
@@ -104,6 +153,7 @@
|
||||
|
||||
.macro ADDBITS
|
||||
|
||||
.if (JOHN == 0)
|
||||
.if (UCL_SMALL == 1)
|
||||
addiu bc, -1
|
||||
bltz bc, 2b
|
||||
@@ -112,32 +162,92 @@
|
||||
addiu bc, -1
|
||||
.endif
|
||||
|
||||
.else // John's method
|
||||
|
||||
.if (UCL_SMALL == 1)
|
||||
.if (ALT_SMALL == 1)
|
||||
beq bc,bb,2b # detect flag bit [empty]
|
||||
.else
|
||||
addiu bc,-1
|
||||
bltz bc,2b
|
||||
.endif
|
||||
.else
|
||||
srl var,bb,31 # var= most significant bit of bb
|
||||
bne bc,bb,2f # detect flag bit [empty]
|
||||
sll bb,1
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.endm
|
||||
|
||||
.macro ADDBITS_DONE
|
||||
|
||||
.if (JOHN == 0)
|
||||
srlv var,bb,bc
|
||||
.if (UCL_SMALL == 1)
|
||||
jr ra
|
||||
.endif
|
||||
andi var,0x0001
|
||||
|
||||
.else // John's method
|
||||
|
||||
.if (UCL_SMALL == 1)
|
||||
.if (ALT_SMALL == 1)
|
||||
srl var,bb,31 # var= most significant bit of bb
|
||||
jr ra
|
||||
sll bb,1
|
||||
.else
|
||||
srlv var,bb,bc
|
||||
jr ra
|
||||
andi var,0x0001
|
||||
.endif
|
||||
.else
|
||||
.if (UCL_NRV_BB == 8)
|
||||
sll bb,1
|
||||
addiu bb,1 # the flag bit
|
||||
srl var,bb,8 # var= most significant bit of bb
|
||||
sll bb,24 # left-justify in register
|
||||
.else
|
||||
srl var,bb,31 # var= most significant bit of bb
|
||||
sll bb,1
|
||||
addiu bb,1
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.endif
|
||||
|
||||
.endm
|
||||
|
||||
.macro FILLBYTES_8
|
||||
|
||||
.if (UCL_SMALL == 1)
|
||||
li bc,8
|
||||
.else
|
||||
.if (JOHN == 0)
|
||||
li bc,7
|
||||
.endif
|
||||
lbu bb,0(src_ilen)
|
||||
addiu src_ilen,1
|
||||
|
||||
.else // John's method
|
||||
|
||||
.if (ALT_SMALL == 0)
|
||||
.if (UCL_SMALL == 1)
|
||||
li bc,8
|
||||
.endif
|
||||
.endif
|
||||
lbu bb,0(src_ilen)
|
||||
addiu src_ilen,1
|
||||
.if ((ALT_SMALL == 1) && (UCL_SMALL == 1))
|
||||
sll bb,1
|
||||
addiu bb,1 # the flag bit
|
||||
sll bb,24-1 # left-justify in register
|
||||
.endif
|
||||
|
||||
.endif
|
||||
|
||||
.endm
|
||||
|
||||
|
||||
.macro FILLBYTES_32
|
||||
|
||||
.if (JOHN == 0)
|
||||
.if (UCL_SMALL == 1)
|
||||
li bc,32
|
||||
.else
|
||||
@@ -147,9 +257,27 @@
|
||||
lwl bb,3(src_ilen)
|
||||
addiu src_ilen,4
|
||||
|
||||
.else // John's method
|
||||
|
||||
.if (ALT_SMALL == 0)
|
||||
.if (UCL_SMALL == 1)
|
||||
li bc,32
|
||||
.endif
|
||||
.endif
|
||||
lwr bb,0(src_ilen)
|
||||
lwl bb,3(src_ilen)
|
||||
addiu src_ilen,4
|
||||
.if ((ALT_SMALL == 1) && (UCL_SMALL == 1))
|
||||
srl var,bb,31 # var= most significant bit of bb
|
||||
sll bb,1
|
||||
jr ra
|
||||
addiu bb,1
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.endm
|
||||
|
||||
.macro FILLBYTES
|
||||
.macro FILLBITS
|
||||
|
||||
.if (UCL_NRV_BB == 8)
|
||||
FILLBYTES_8
|
||||
@@ -159,79 +287,29 @@
|
||||
|
||||
.endm
|
||||
|
||||
// This alternate for UCL_SMALL is 1 cycle faster for most getbit
|
||||
// at a cost of 1 cycle (32 bits) or 3 cycles (8 bits) during refill.
|
||||
// [Refill could save 1 cycle if MIPS had "set CarryIn" for ADD or SHIFT.]
|
||||
// Call 'getbit'; it returns the next bit (0 or 1), in register 'var'.
|
||||
// Register 'bb' is the bit buffer; register 'bc' contains the 'empty' value.
|
||||
// The cases for widths 8 and 32 are not as similar as before,
|
||||
// and 64-bit registers would require other code.
|
||||
// But it is 1 cycle faster 31/32 of the time.
|
||||
// [Indentation after control transfer emphasizes delay slot.]
|
||||
//
|
||||
//init:
|
||||
// lui bc,1<<(31 - 16) # 1<<31 the flag bit
|
||||
// lui bb,1<<(31 - 16) # 1<<31 empty
|
||||
//--
|
||||
// .if (8==UCL_NRV_BB)
|
||||
//refill:
|
||||
// lbu bb,0(src_ilen)
|
||||
// addiu src_len,1
|
||||
// sll bb,1
|
||||
// ori bb,1 # the flag bit
|
||||
// sll bb,24-1 # left-justify in register
|
||||
// // falling through the 'beq' below saves 3 words of space
|
||||
// .endif
|
||||
//getbit:
|
||||
// beq bc,bb,refill # detect flag bit [empty]
|
||||
// srl var,bb,31 # var= most significant bit of bb
|
||||
// jr ra
|
||||
// sll bb,1
|
||||
// .if (32==UCL_NRV_BB)
|
||||
//refill:
|
||||
// lwr bb,0(src_ilen)
|
||||
// lwl bb,3(src_ilen)
|
||||
// addiu src_ilen,4
|
||||
// srl var,bb,31 # var= most significant bit of bb
|
||||
// sll bb,1
|
||||
// jr ra
|
||||
// ori bb,1 # the flag bit
|
||||
// .endif
|
||||
|
||||
// 2006-09-06 Faster by 3 cycles for inline expansion:
|
||||
// beq bc,bb,7f # detect flag bit [empty]
|
||||
// srl var,bb,31 # var= most significant bit of bb
|
||||
// sll bb,1
|
||||
//6:
|
||||
// .subsection 1 # somewhere out-of-line
|
||||
//7:
|
||||
// b refill
|
||||
// addi ra,r_bd_base,6b - bd_base # return past the 'sll' above
|
||||
// .subsection 0 # return to main in-line code
|
||||
//
|
||||
// which is 3 cycles usually, +2 cycles for entering refill,
|
||||
// +8 bytes (2 instructions) per getbit [7 in nrv2b, 9 in nrv2e]
|
||||
// and requires another register r_bd_base which holds a handy
|
||||
// address within +/- 32KB of the returns from refill.
|
||||
//
|
||||
|
||||
.macro GBIT
|
||||
|
||||
.if (UCL_SMALL == 1)
|
||||
2:
|
||||
FILLBYTES
|
||||
FILLBITS
|
||||
1:
|
||||
ADDBITS
|
||||
ADDBITS_DONE
|
||||
.else
|
||||
ADDBITS
|
||||
FILLBYTES
|
||||
FILLBITS
|
||||
.if (JOHN == 1)
|
||||
ADDBITS_DONE
|
||||
2:
|
||||
.else
|
||||
2:
|
||||
ADDBITS_DONE
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.endm
|
||||
|
||||
|
||||
;//////////////////////////////////////
|
||||
;// getbit call macro for SMALL version
|
||||
;//////////////////////////////////////
|
||||
@@ -247,8 +325,23 @@
|
||||
.ifb p1
|
||||
bal t // gb_sub
|
||||
.else
|
||||
|
||||
.if (JOHN == 0)
|
||||
bal t+4 // gb_sub+4
|
||||
addiu bc,-1
|
||||
|
||||
.else // John's method
|
||||
|
||||
.if (UCL_SMALL == 1)
|
||||
.if (ALT_SMALL == 0)
|
||||
bal t+4 // gb_sub+4
|
||||
addiu bc,-1
|
||||
.else
|
||||
bal t // gb_sub+4
|
||||
nop
|
||||
.endif
|
||||
.endif
|
||||
.endif
|
||||
.endif
|
||||
.else
|
||||
GBIT
|
||||
@@ -271,20 +364,20 @@
|
||||
.endif
|
||||
\type decomp_done
|
||||
.if (UCL_SMALL == 1)
|
||||
WITHOUT_SUB = 0
|
||||
GBIT
|
||||
.endif
|
||||
.else
|
||||
.ifc "\option", "sub_only"
|
||||
|
||||
2:
|
||||
FILLBYTES
|
||||
.ifnb label
|
||||
FILLBITS
|
||||
.ifnb label
|
||||
.global \label
|
||||
\label:
|
||||
.endif
|
||||
.endif
|
||||
ADDBITS
|
||||
ADDBITS_DONE
|
||||
|
||||
.else
|
||||
.ifc "\option", "without_sub"
|
||||
.if (UCL_SMALL == 1)
|
||||
@@ -309,12 +402,12 @@
|
||||
|
||||
.macro uclmcpy ret
|
||||
|
||||
local wordchk, bcpy
|
||||
local bcpy_chk, skip
|
||||
local wordchk, prepbcpy
|
||||
local bcopy, skip
|
||||
|
||||
.if (UCL_FAST == 1)
|
||||
.if (UCL_FAST == 1)
|
||||
slti var,m_off,4
|
||||
bnez var,bcpy
|
||||
bnez var,prepbcpy
|
||||
subu m_pos,dst,m_off
|
||||
wordchk:
|
||||
slti var,m_len,4
|
||||
@@ -327,22 +420,66 @@ wordchk:
|
||||
addiu m_pos,4
|
||||
bnez m_len,wordchk
|
||||
addiu dst,4
|
||||
|
||||
.if (UCL_SMALL == 1)
|
||||
.if (WITHOUT_SUB == 1)
|
||||
t = gb_e
|
||||
.else
|
||||
t = 1f
|
||||
.endif
|
||||
.if (1 == 1)
|
||||
b \ret
|
||||
nop
|
||||
.else
|
||||
bal t
|
||||
addiu ra, (\ret + 4) - (. + 4)
|
||||
.endif
|
||||
.else
|
||||
subu m_pos,dst,m_off
|
||||
.if (JOHN == 0)
|
||||
b \ret
|
||||
nop
|
||||
.else
|
||||
b \ret + 4
|
||||
srl var,bb,31 # var= most significant bit of bb
|
||||
.endif
|
||||
.endif
|
||||
bcpy_chk:
|
||||
beqz m_len,\ret
|
||||
bcpy:
|
||||
prepbcpy:
|
||||
.else
|
||||
subu m_pos,dst,m_off
|
||||
.endif
|
||||
bcopy:
|
||||
lbu var,0(m_pos)
|
||||
skip:
|
||||
addiu m_len,-1
|
||||
sb var,0(dst)
|
||||
addiu m_pos,1
|
||||
b bcpy_chk
|
||||
addiu dst,1
|
||||
bnez m_len,bcopy
|
||||
sb var,-1(dst)
|
||||
|
||||
.if (UCL_SMALL == 1)
|
||||
.if (WITHOUT_SUB == 1)
|
||||
t = gb_e
|
||||
.else
|
||||
t = 1f
|
||||
.endif
|
||||
.if (1 == 1)
|
||||
b \ret
|
||||
nop
|
||||
.else
|
||||
bal t
|
||||
addiu ra, (\ret + 4) - (. + 4)
|
||||
.endif
|
||||
.else
|
||||
.if (JOHN == 0)
|
||||
b \ret
|
||||
nop
|
||||
.else
|
||||
b \ret + 4
|
||||
srl var,bb,31 # var= most significant bit of bb
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.endm
|
||||
|
||||
|
||||
#endif //_MR3K_STD_CONF_
|
||||
|
||||
@@ -8,7 +8,7 @@ __dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
|
||||
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
|
||||
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
|
||||
endif
|
||||
-include $(top_srcdir)/Makevars.global ./Makevars.local
|
||||
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
|
||||
vpath %.c $(top_srcdir)/src/stub/src/c
|
||||
|
||||
STUBS =
|
||||
|
||||
@@ -103,7 +103,7 @@ copy:
|
||||
sub r10,r12,r9 // &b_info
|
||||
add r10,r10,r4 // relocated &b_info
|
||||
|
||||
ldrb r0,[r11,# b_method ] // 5th param
|
||||
ldr r0,[r11,# b_method ] // 5th param (whole word: endian issues!)
|
||||
stmdb sp!,{r0,lr}
|
||||
ldr r3,[r11,# sz_unc]
|
||||
add r0, r11,# sz_b_info
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
; armeb-linux.kernel.vmlinux-head.S -- set up stack for vmlinux/armeb format
|
||||
;
|
||||
; This file is part of the UPX executable compressor.
|
||||
;
|
||||
; Copyright (C) 2006-2007 John Reiser
|
||||
; All Rights Reserved.
|
||||
;
|
||||
; UPX and the UCL library are free software; you can redistribute them
|
||||
; and/or modify them under the terms of the GNU General Public License as
|
||||
; published by the Free Software Foundation; either version 2 of
|
||||
; the License, or (at your option) any later version.
|
||||
;
|
||||
; This program is distributed in the hope that it will be useful,
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
; GNU General Public License for more details.
|
||||
;
|
||||
; You should have received a copy of the GNU General Public License
|
||||
; along with this program; see the file COPYING.
|
||||
; If not, write to the Free Software Foundation, Inc.,
|
||||
; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
;
|
||||
; John Reiser
|
||||
; <jreiser@users.sourceforge.net>
|
||||
*/
|
||||
|
||||
#include "arm-linux.kernel.vmlinux-head.S"
|
||||
|
||||
// vi:ts=8:et:nowrap
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
; armeb-linux.kernel.vmlinux.S -- loader & decompressor for the vmlinux/armeb format
|
||||
;
|
||||
; This file is part of the UPX executable compressor.
|
||||
;
|
||||
; Copyright (C) 1996-2007 Markus Franz Xaver Johannes Oberhumer
|
||||
; Copyright (C) 1996-2007 Laszlo Molnar
|
||||
; Copyright (C) 2004-2007 John Reiser
|
||||
; All Rights Reserved.
|
||||
;
|
||||
; UPX and the UCL library are free software; you can redistribute them
|
||||
; and/or modify them under the terms of the GNU General Public License as
|
||||
; published by the Free Software Foundation; either version 2 of
|
||||
; the License, or (at your option) any later version.
|
||||
;
|
||||
; This program is distributed in the hope that it will be useful,
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
; GNU General Public License for more details.
|
||||
;
|
||||
; You should have received a copy of the GNU General Public License
|
||||
; along with this program; see the file COPYING.
|
||||
; If not, write to the Free Software Foundation, Inc.,
|
||||
; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
;
|
||||
; Markus F.X.J. Oberhumer Laszlo Molnar
|
||||
; <mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
|
||||
;
|
||||
; John Reiser
|
||||
; <jreiser@users.sourceforge.net>
|
||||
*/
|
||||
|
||||
#include "arm-linux.kernel.vmlinux.S"
|
||||
|
||||
// vi:ts=8:et:nowrap
|
||||
@@ -67,12 +67,12 @@ decompress:
|
||||
// // C callable decompressor
|
||||
// **************************************************************************/
|
||||
|
||||
// /* Offsets to parameters, allowing for {push + pusha + call} */
|
||||
#define O_INP (4+ 8*4 +1*4)
|
||||
#define O_INS (4+ 8*4 +2*4)
|
||||
#define O_OUTP (4+ 8*4 +3*4)
|
||||
#define O_OUTS (4+ 8*4 +4*4)
|
||||
#define O_PARAM (4+ 8*4 +5*4)
|
||||
// /* Offsets to parameters, allowing for {pusha + call} */
|
||||
#define O_INP (8*4 +1*4)
|
||||
#define O_INS (8*4 +2*4)
|
||||
#define O_OUTP (8*4 +3*4)
|
||||
#define O_OUTS (8*4 +4*4)
|
||||
#define O_PARAM (8*4 +5*4)
|
||||
|
||||
#define INP dword ptr [esp+O_INP]
|
||||
#define INS dword ptr [esp+O_INS]
|
||||
|
||||
@@ -237,13 +237,13 @@ section con.exit
|
||||
section bss.cdb.start.lzma
|
||||
la t0,PSVR // prepare to compute value
|
||||
subu t0,s0,t0 // get stored header offset in mem
|
||||
lui var,%hi(wrkmem-REG_SZ) // size of decomp. routine
|
||||
la var,wrkmem-REG_SZ
|
||||
jr t0
|
||||
addiu var,%lo(wrkmem-REG_SZ) // adjust the stack with this size
|
||||
move tmp,sp
|
||||
|
||||
section bss.cdb.entry.lzma
|
||||
move tmp,sp
|
||||
push 1,var // push used regs
|
||||
move sp,var
|
||||
addiu src,t0,lzma_cpr // compressed lzma decoder offset
|
||||
addiu dst,sp,REG_SZ
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ SYMBOL TABLE:
|
||||
|
||||
RELOCATION RECORDS FOR [LINUX000]:
|
||||
OFFSET TYPE VALUE
|
||||
00000014 R_ARM_ABS8 METHOD
|
||||
00000014 R_ARM_ABS32 METHOD
|
||||
00000030 R_ARM_PC24 LINUX030
|
||||
00000034 R_ARM_PC24 LINUX000
|
||||
00000038 R_ARM_ABS32 COMPRESSED_LENGTH
|
||||
@@ -55,8 +55,8 @@ OFFSET TYPE VALUE
|
||||
|
||||
RELOCATION RECORDS FOR [LINUX010]:
|
||||
OFFSET TYPE VALUE
|
||||
00000008 R_ARM_ABS8 filter_cto
|
||||
0000000c R_ARM_ABS8 filter_id
|
||||
00000008 R_ARM_ABS32 filter_cto
|
||||
0000000c R_ARM_ABS32 filter_id
|
||||
00000010 R_ARM_PC24 ctok32.00
|
||||
|
||||
RELOCATION RECORDS FOR [ctok32.10]:
|
||||
|
||||
@@ -0,0 +1,289 @@
|
||||
tmp/armeb-linux.kernel.vmlinux.bin: file format elf32-bigarm
|
||||
|
||||
Sections:
|
||||
Idx Name Size VMA LMA File off Algn Flags
|
||||
0 LINUX000 00000048 00000000 00000000 00000034 2**0 CONTENTS, RELOC, READONLY
|
||||
1 LINUX010 00000014 00000000 00000000 0000007c 2**0 CONTENTS, RELOC, READONLY
|
||||
2 LINUX020 0000000c 00000000 00000000 00000090 2**0 CONTENTS, READONLY
|
||||
3 ctok32.00 00000004 00000000 00000000 0000009c 2**0 CONTENTS, READONLY
|
||||
4 ctok32.50 00000004 00000000 00000000 000000a0 2**0 CONTENTS, READONLY
|
||||
5 ctok32.51 00000004 00000000 00000000 000000a4 2**0 CONTENTS, READONLY
|
||||
6 ctok32.10 00000044 00000000 00000000 000000a8 2**0 CONTENTS, RELOC, READONLY
|
||||
7 LINUX030 00000000 00000000 00000000 000000ec 2**0 CONTENTS, READONLY
|
||||
8 NRV2B 000000c4 00000000 00000000 000000ec 2**0 CONTENTS, RELOC, READONLY
|
||||
9 NRV2D 00000100 00000000 00000000 000001b0 2**0 CONTENTS, RELOC, READONLY
|
||||
10 NRV2E 00000114 00000000 00000000 000002b0 2**0 CONTENTS, RELOC, READONLY
|
||||
11 LZMA_ELF00 0000008c 00000000 00000000 000003c4 2**0 CONTENTS, RELOC, READONLY
|
||||
12 LZMA_DEC10 00000938 00000000 00000000 00000450 2**0 CONTENTS, RELOC, READONLY
|
||||
13 LZMA_DEC20 00000938 00000000 00000000 00000d88 2**0 CONTENTS, RELOC, READONLY
|
||||
14 LZMA_DEC30 00000000 00000000 00000000 000016c0 2**0 CONTENTS, READONLY
|
||||
15 UPX1HEAD 00000020 00000000 00000000 000016c0 2**0 CONTENTS, READONLY
|
||||
SYMBOL TABLE:
|
||||
00000000 l d LINUX000 00000000 LINUX000
|
||||
00000000 l d ctok32.00 00000000 ctok32.00
|
||||
00000000 l d ctok32.10 00000000 ctok32.10
|
||||
00000000 l d LINUX030 00000000 LINUX030
|
||||
00000000 l d NRV2B 00000000 NRV2B
|
||||
00000000 l d NRV2D 00000000 NRV2D
|
||||
00000000 l d NRV2E 00000000 NRV2E
|
||||
00000000 l d LZMA_ELF00 00000000 LZMA_ELF00
|
||||
00000000 l d LZMA_DEC10 00000000 LZMA_DEC10
|
||||
00000000 l d LZMA_DEC20 00000000 LZMA_DEC20
|
||||
00000000 l d LZMA_DEC30 00000000 LZMA_DEC30
|
||||
00000000 l d LINUX010 00000000 LINUX010
|
||||
00000000 l d LINUX020 00000000 LINUX020
|
||||
00000000 l d ctok32.50 00000000 ctok32.50
|
||||
00000000 l d ctok32.51 00000000 ctok32.51
|
||||
00000000 l d UPX1HEAD 00000000 UPX1HEAD
|
||||
00000000 *UND* 00000000 METHOD
|
||||
00000000 *UND* 00000000 COMPRESSED_LENGTH
|
||||
00000000 *UND* 00000000 UNCOMPRESSED_LENGTH
|
||||
00000000 *UND* 00000000 filter_cto
|
||||
00000000 *UND* 00000000 filter_id
|
||||
00000000 g F NRV2B 000000c4 ucl_nrv2b_decompress_8
|
||||
00000000 g F NRV2D 00000100 ucl_nrv2d_decompress_8
|
||||
00000000 g F NRV2E 00000114 ucl_nrv2e_decompress_8
|
||||
|
||||
RELOCATION RECORDS FOR [LINUX000]:
|
||||
OFFSET TYPE VALUE
|
||||
00000014 R_ARM_ABS32 METHOD
|
||||
00000030 R_ARM_PC24 LINUX030
|
||||
00000034 R_ARM_PC24 LINUX000
|
||||
00000038 R_ARM_ABS32 COMPRESSED_LENGTH
|
||||
0000003c R_ARM_ABS32 UNCOMPRESSED_LENGTH
|
||||
00000044 R_ARM_PC24 LINUX000
|
||||
|
||||
RELOCATION RECORDS FOR [LINUX010]:
|
||||
OFFSET TYPE VALUE
|
||||
00000008 R_ARM_ABS32 filter_cto
|
||||
0000000c R_ARM_ABS32 filter_id
|
||||
00000010 R_ARM_PC24 ctok32.00
|
||||
|
||||
RELOCATION RECORDS FOR [ctok32.10]:
|
||||
OFFSET TYPE VALUE
|
||||
00000020 R_ARM_PC24 ctok32.10
|
||||
0000003c R_ARM_PC24 ctok32.10
|
||||
|
||||
RELOCATION RECORDS FOR [NRV2B]:
|
||||
OFFSET TYPE VALUE
|
||||
00000010 R_ARM_PC24 NRV2B
|
||||
00000048 R_ARM_PC24 NRV2B
|
||||
00000050 R_ARM_PC24 NRV2B
|
||||
00000054 R_ARM_PC24 NRV2B
|
||||
00000064 R_ARM_PC24 NRV2B
|
||||
00000068 R_ARM_PC24 NRV2B
|
||||
0000006c R_ARM_PC24 NRV2B
|
||||
00000078 R_ARM_PC24 NRV2B
|
||||
00000088 R_ARM_PC24 NRV2B
|
||||
0000008c R_ARM_PC24 NRV2B
|
||||
00000094 R_ARM_PC24 NRV2B
|
||||
0000009c R_ARM_PC24 NRV2B
|
||||
000000a0 R_ARM_PC24 NRV2B
|
||||
000000bc R_ARM_PC24 NRV2B
|
||||
000000c0 R_ARM_PC24 NRV2B
|
||||
|
||||
RELOCATION RECORDS FOR [NRV2D]:
|
||||
OFFSET TYPE VALUE
|
||||
00000010 R_ARM_PC24 NRV2D
|
||||
00000044 R_ARM_PC24 NRV2D
|
||||
00000048 R_ARM_PC24 NRV2D
|
||||
00000050 R_ARM_PC24 NRV2D
|
||||
0000005c R_ARM_PC24 NRV2D
|
||||
00000068 R_ARM_PC24 NRV2D
|
||||
00000074 R_ARM_PC24 NRV2D
|
||||
00000078 R_ARM_PC24 NRV2D
|
||||
00000084 R_ARM_PC24 NRV2D
|
||||
00000094 R_ARM_PC24 NRV2D
|
||||
0000009c R_ARM_PC24 NRV2D
|
||||
000000a4 R_ARM_PC24 NRV2D
|
||||
000000b0 R_ARM_PC24 NRV2D
|
||||
000000b8 R_ARM_PC24 NRV2D
|
||||
000000c4 R_ARM_PC24 NRV2D
|
||||
000000d0 R_ARM_PC24 NRV2D
|
||||
000000d4 R_ARM_PC24 NRV2D
|
||||
000000f8 R_ARM_PC24 NRV2D
|
||||
000000fc R_ARM_PC24 NRV2D
|
||||
|
||||
RELOCATION RECORDS FOR [NRV2E]:
|
||||
OFFSET TYPE VALUE
|
||||
00000010 R_ARM_PC24 NRV2E
|
||||
00000044 R_ARM_PC24 NRV2E
|
||||
00000048 R_ARM_PC24 NRV2E
|
||||
00000050 R_ARM_PC24 NRV2E
|
||||
0000005c R_ARM_PC24 NRV2E
|
||||
00000068 R_ARM_PC24 NRV2E
|
||||
00000074 R_ARM_PC24 NRV2E
|
||||
00000078 R_ARM_PC24 NRV2E
|
||||
00000084 R_ARM_PC24 NRV2E
|
||||
00000094 R_ARM_PC24 NRV2E
|
||||
0000009c R_ARM_PC24 NRV2E
|
||||
000000a0 R_ARM_PC24 NRV2E
|
||||
000000a8 R_ARM_PC24 NRV2E
|
||||
000000ac R_ARM_PC24 NRV2E
|
||||
000000b8 R_ARM_PC24 NRV2E
|
||||
000000bc R_ARM_PC24 NRV2E
|
||||
000000c4 R_ARM_PC24 NRV2E
|
||||
000000d0 R_ARM_PC24 NRV2E
|
||||
000000d4 R_ARM_PC24 NRV2E
|
||||
000000dc R_ARM_PC24 NRV2E
|
||||
000000e4 R_ARM_PC24 NRV2E
|
||||
0000010c R_ARM_PC24 NRV2E
|
||||
00000110 R_ARM_PC24 NRV2E
|
||||
|
||||
RELOCATION RECORDS FOR [LZMA_ELF00]:
|
||||
OFFSET TYPE VALUE
|
||||
00000008 R_ARM_PC24 LZMA_DEC30
|
||||
0000004c R_ARM_PC24 LZMA_ELF00
|
||||
00000080 R_ARM_PC24 LZMA_ELF00
|
||||
|
||||
RELOCATION RECORDS FOR [LZMA_DEC10]:
|
||||
OFFSET TYPE VALUE
|
||||
00000074 R_ARM_PC24 LZMA_DEC10
|
||||
00000090 R_ARM_PC24 LZMA_DEC10
|
||||
000000b8 R_ARM_PC24 LZMA_DEC10
|
||||
000000cc R_ARM_PC24 LZMA_DEC10
|
||||
000000f4 R_ARM_PC24 LZMA_DEC10
|
||||
00000100 R_ARM_PC24 LZMA_DEC10
|
||||
00000108 R_ARM_PC24 LZMA_DEC10
|
||||
00000144 R_ARM_PC24 LZMA_DEC10
|
||||
00000190 R_ARM_PC24 LZMA_DEC10
|
||||
000001cc R_ARM_PC24 LZMA_DEC10
|
||||
000001d8 R_ARM_PC24 LZMA_DEC10
|
||||
00000204 R_ARM_PC24 LZMA_DEC10
|
||||
00000218 R_ARM_PC24 LZMA_DEC10
|
||||
00000220 R_ARM_PC24 LZMA_DEC10
|
||||
00000234 R_ARM_PC24 LZMA_DEC10
|
||||
0000023c R_ARM_PC24 LZMA_DEC10
|
||||
00000240 R_ARM_PC24 LZMA_DEC10
|
||||
0000024c R_ARM_PC24 LZMA_DEC10
|
||||
00000258 R_ARM_PC24 LZMA_DEC10
|
||||
000002a4 R_ARM_PC24 LZMA_DEC10
|
||||
000002c8 R_ARM_PC24 LZMA_DEC10
|
||||
000002e8 R_ARM_PC24 LZMA_DEC10
|
||||
00000304 R_ARM_PC24 LZMA_DEC10
|
||||
0000030c R_ARM_PC24 LZMA_DEC10
|
||||
0000033c R_ARM_PC24 LZMA_DEC10
|
||||
00000388 R_ARM_PC24 LZMA_DEC10
|
||||
000003a0 R_ARM_PC24 LZMA_DEC10
|
||||
000003a8 R_ARM_PC24 LZMA_DEC10
|
||||
000003cc R_ARM_PC24 LZMA_DEC10
|
||||
000003e0 R_ARM_PC24 LZMA_DEC10
|
||||
000003e8 R_ARM_PC24 LZMA_DEC10
|
||||
00000424 R_ARM_PC24 LZMA_DEC10
|
||||
00000438 R_ARM_PC24 LZMA_DEC10
|
||||
0000046c R_ARM_PC24 LZMA_DEC10
|
||||
00000484 R_ARM_PC24 LZMA_DEC10
|
||||
0000048c R_ARM_PC24 LZMA_DEC10
|
||||
000004b0 R_ARM_PC24 LZMA_DEC10
|
||||
000004d4 R_ARM_PC24 LZMA_DEC10
|
||||
000004ec R_ARM_PC24 LZMA_DEC10
|
||||
000004f4 R_ARM_PC24 LZMA_DEC10
|
||||
00000518 R_ARM_PC24 LZMA_DEC10
|
||||
0000053c R_ARM_PC24 LZMA_DEC10
|
||||
00000598 R_ARM_PC24 LZMA_DEC10
|
||||
000005a0 R_ARM_PC24 LZMA_DEC10
|
||||
000005c0 R_ARM_PC24 LZMA_DEC10
|
||||
000005e4 R_ARM_PC24 LZMA_DEC10
|
||||
000005fc R_ARM_PC24 LZMA_DEC10
|
||||
00000604 R_ARM_PC24 LZMA_DEC10
|
||||
00000624 R_ARM_PC24 LZMA_DEC10
|
||||
00000648 R_ARM_PC24 LZMA_DEC10
|
||||
00000680 R_ARM_PC24 LZMA_DEC10
|
||||
0000068c R_ARM_PC24 LZMA_DEC10
|
||||
000006d0 R_ARM_PC24 LZMA_DEC10
|
||||
000006ec R_ARM_PC24 LZMA_DEC10
|
||||
0000071c R_ARM_PC24 LZMA_DEC10
|
||||
00000728 R_ARM_PC24 LZMA_DEC10
|
||||
0000076c R_ARM_PC24 LZMA_DEC10
|
||||
0000077c R_ARM_PC24 LZMA_DEC10
|
||||
0000079c R_ARM_PC24 LZMA_DEC10
|
||||
000007b8 R_ARM_PC24 LZMA_DEC10
|
||||
000007c4 R_ARM_PC24 LZMA_DEC10
|
||||
000007d0 R_ARM_PC24 LZMA_DEC10
|
||||
000007f4 R_ARM_PC24 LZMA_DEC10
|
||||
00000820 R_ARM_PC24 LZMA_DEC10
|
||||
0000082c R_ARM_PC24 LZMA_DEC10
|
||||
0000087c R_ARM_PC24 LZMA_DEC10
|
||||
00000888 R_ARM_PC24 LZMA_DEC10
|
||||
000008a0 R_ARM_PC24 LZMA_DEC10
|
||||
000008e8 R_ARM_PC24 LZMA_DEC10
|
||||
000008f4 R_ARM_PC24 LZMA_DEC10
|
||||
000008fc R_ARM_PC24 LZMA_DEC10
|
||||
00000904 R_ARM_PC24 LZMA_DEC10
|
||||
00000928 R_ARM_PC24 LZMA_DEC10
|
||||
|
||||
RELOCATION RECORDS FOR [LZMA_DEC20]:
|
||||
OFFSET TYPE VALUE
|
||||
00000074 R_ARM_PC24 LZMA_DEC20
|
||||
00000090 R_ARM_PC24 LZMA_DEC20
|
||||
000000b8 R_ARM_PC24 LZMA_DEC20
|
||||
000000cc R_ARM_PC24 LZMA_DEC20
|
||||
000000f4 R_ARM_PC24 LZMA_DEC20
|
||||
00000100 R_ARM_PC24 LZMA_DEC20
|
||||
00000108 R_ARM_PC24 LZMA_DEC20
|
||||
00000144 R_ARM_PC24 LZMA_DEC20
|
||||
00000190 R_ARM_PC24 LZMA_DEC20
|
||||
000001cc R_ARM_PC24 LZMA_DEC20
|
||||
000001d8 R_ARM_PC24 LZMA_DEC20
|
||||
00000204 R_ARM_PC24 LZMA_DEC20
|
||||
00000218 R_ARM_PC24 LZMA_DEC20
|
||||
00000220 R_ARM_PC24 LZMA_DEC20
|
||||
00000234 R_ARM_PC24 LZMA_DEC20
|
||||
0000023c R_ARM_PC24 LZMA_DEC20
|
||||
00000240 R_ARM_PC24 LZMA_DEC20
|
||||
0000024c R_ARM_PC24 LZMA_DEC20
|
||||
00000258 R_ARM_PC24 LZMA_DEC20
|
||||
000002a4 R_ARM_PC24 LZMA_DEC20
|
||||
000002c8 R_ARM_PC24 LZMA_DEC20
|
||||
000002e8 R_ARM_PC24 LZMA_DEC20
|
||||
00000304 R_ARM_PC24 LZMA_DEC20
|
||||
0000030c R_ARM_PC24 LZMA_DEC20
|
||||
0000033c R_ARM_PC24 LZMA_DEC20
|
||||
00000388 R_ARM_PC24 LZMA_DEC20
|
||||
000003a0 R_ARM_PC24 LZMA_DEC20
|
||||
000003a8 R_ARM_PC24 LZMA_DEC20
|
||||
000003cc R_ARM_PC24 LZMA_DEC20
|
||||
000003e0 R_ARM_PC24 LZMA_DEC20
|
||||
000003e8 R_ARM_PC24 LZMA_DEC20
|
||||
00000424 R_ARM_PC24 LZMA_DEC20
|
||||
00000438 R_ARM_PC24 LZMA_DEC20
|
||||
0000046c R_ARM_PC24 LZMA_DEC20
|
||||
00000484 R_ARM_PC24 LZMA_DEC20
|
||||
0000048c R_ARM_PC24 LZMA_DEC20
|
||||
000004b0 R_ARM_PC24 LZMA_DEC20
|
||||
000004d4 R_ARM_PC24 LZMA_DEC20
|
||||
000004ec R_ARM_PC24 LZMA_DEC20
|
||||
000004f4 R_ARM_PC24 LZMA_DEC20
|
||||
00000518 R_ARM_PC24 LZMA_DEC20
|
||||
0000053c R_ARM_PC24 LZMA_DEC20
|
||||
00000598 R_ARM_PC24 LZMA_DEC20
|
||||
000005a0 R_ARM_PC24 LZMA_DEC20
|
||||
000005c0 R_ARM_PC24 LZMA_DEC20
|
||||
000005e4 R_ARM_PC24 LZMA_DEC20
|
||||
000005fc R_ARM_PC24 LZMA_DEC20
|
||||
00000604 R_ARM_PC24 LZMA_DEC20
|
||||
00000624 R_ARM_PC24 LZMA_DEC20
|
||||
00000648 R_ARM_PC24 LZMA_DEC20
|
||||
00000680 R_ARM_PC24 LZMA_DEC20
|
||||
0000068c R_ARM_PC24 LZMA_DEC20
|
||||
000006d0 R_ARM_PC24 LZMA_DEC20
|
||||
000006ec R_ARM_PC24 LZMA_DEC20
|
||||
0000071c R_ARM_PC24 LZMA_DEC20
|
||||
00000728 R_ARM_PC24 LZMA_DEC20
|
||||
0000076c R_ARM_PC24 LZMA_DEC20
|
||||
0000077c R_ARM_PC24 LZMA_DEC20
|
||||
0000079c R_ARM_PC24 LZMA_DEC20
|
||||
000007b8 R_ARM_PC24 LZMA_DEC20
|
||||
000007c4 R_ARM_PC24 LZMA_DEC20
|
||||
000007d0 R_ARM_PC24 LZMA_DEC20
|
||||
000007f4 R_ARM_PC24 LZMA_DEC20
|
||||
00000820 R_ARM_PC24 LZMA_DEC20
|
||||
0000082c R_ARM_PC24 LZMA_DEC20
|
||||
0000087c R_ARM_PC24 LZMA_DEC20
|
||||
00000888 R_ARM_PC24 LZMA_DEC20
|
||||
000008a0 R_ARM_PC24 LZMA_DEC20
|
||||
000008e8 R_ARM_PC24 LZMA_DEC20
|
||||
000008f4 R_ARM_PC24 LZMA_DEC20
|
||||
000008fc R_ARM_PC24 LZMA_DEC20
|
||||
00000904 R_ARM_PC24 LZMA_DEC20
|
||||
00000928 R_ARM_PC24 LZMA_DEC20
|
||||
@@ -18,29 +18,29 @@ Idx Name Size VMA LMA File off Algn Flags
|
||||
13 dec.ptr.hi 00000008 00000000 00000000 00000138 2**0 CONTENTS, RELOC, READONLY
|
||||
14 con.entry 00000000 00000000 00000000 00000140 2**0 CONTENTS, READONLY
|
||||
15 con.exit 0000002c 00000000 00000000 00000140 2**0 CONTENTS, RELOC, READONLY
|
||||
16 bss.cdb.start.lzma 00000018 00000000 00000000 0000016c 2**0 CONTENTS, RELOC, READONLY
|
||||
17 bss.cdb.entry.lzma 00000024 00000000 00000000 00000184 2**0 CONTENTS, RELOC, READONLY
|
||||
18 bss.con.start 00000038 00000000 00000000 000001a8 2**0 CONTENTS, RELOC, READONLY
|
||||
19 bss.exit 0000002c 00000000 00000000 000001e0 2**0 CONTENTS, RELOC, READONLY
|
||||
20 memset.short 00000014 00000000 00000000 0000020c 2**0 CONTENTS, RELOC, READONLY
|
||||
21 memset.long 00000018 00000000 00000000 00000220 2**0 CONTENTS, RELOC, READONLY
|
||||
22 nrv2b.8bit 000001ac 00000000 00000000 00000238 2**0 CONTENTS, RELOC, READONLY
|
||||
23 nrv2d.8bit 000001e0 00000000 00000000 000003e4 2**0 CONTENTS, RELOC, READONLY
|
||||
24 nrv2e.8bit 00000200 00000000 00000000 000005c4 2**0 CONTENTS, RELOC, READONLY
|
||||
25 nrv2b.32bit 000001c8 00000000 00000000 000007c4 2**0 CONTENTS, RELOC, READONLY
|
||||
26 nrv2d.32bit 00000200 00000000 00000000 0000098c 2**0 CONTENTS, RELOC, READONLY
|
||||
27 nrv2e.32bit 00000224 00000000 00000000 00000b8c 2**0 CONTENTS, RELOC, READONLY
|
||||
28 8bit.sub 00000020 00000000 00000000 00000db0 2**0 CONTENTS, READONLY
|
||||
29 32bit.sub 00000024 00000000 00000000 00000dd0 2**0 CONTENTS, READONLY
|
||||
30 nrv2b.small 000000d0 00000000 00000000 00000df4 2**0 CONTENTS, RELOC, READONLY
|
||||
31 nrv2d.small 000000e8 00000000 00000000 00000ec4 2**0 CONTENTS, RELOC, READONLY
|
||||
32 nrv2e.small 000000f8 00000000 00000000 00000fac 2**0 CONTENTS, RELOC, READONLY
|
||||
33 nrv.done 00000000 00000000 00000000 000010a4 2**0 CONTENTS, READONLY
|
||||
34 decompressor.start 00000000 00000000 00000000 000010a4 2**0 CONTENTS, READONLY
|
||||
35 lzma.init 00000050 00000000 00000000 000010a4 2**0 CONTENTS, RELOC, READONLY
|
||||
36 LZMA_DEC10 00000ad8 00000000 00000000 000010f4 2**0 CONTENTS, READONLY
|
||||
37 LZMA_DEC20 00000ad8 00000000 00000000 00001bcc 2**0 CONTENTS, READONLY
|
||||
38 UPX1HEAD 00000020 00000000 00000000 000026a4 2**0 CONTENTS, READONLY
|
||||
16 bss.cdb.start.lzma 0000001c 00000000 00000000 0000016c 2**0 CONTENTS, RELOC, READONLY
|
||||
17 bss.cdb.entry.lzma 00000024 00000000 00000000 00000188 2**0 CONTENTS, RELOC, READONLY
|
||||
18 bss.con.start 00000038 00000000 00000000 000001ac 2**0 CONTENTS, RELOC, READONLY
|
||||
19 bss.exit 0000002c 00000000 00000000 000001e4 2**0 CONTENTS, RELOC, READONLY
|
||||
20 memset.short 00000014 00000000 00000000 00000210 2**0 CONTENTS, RELOC, READONLY
|
||||
21 memset.long 00000018 00000000 00000000 00000224 2**0 CONTENTS, RELOC, READONLY
|
||||
22 nrv2b.8bit 000001ec 00000000 00000000 0000023c 2**0 CONTENTS, RELOC, READONLY
|
||||
23 nrv2d.8bit 00000228 00000000 00000000 00000428 2**0 CONTENTS, RELOC, READONLY
|
||||
24 nrv2e.8bit 00000250 00000000 00000000 00000650 2**0 CONTENTS, RELOC, READONLY
|
||||
25 nrv2b.32bit 000001ec 00000000 00000000 000008a0 2**0 CONTENTS, RELOC, READONLY
|
||||
26 nrv2d.32bit 00000228 00000000 00000000 00000a8c 2**0 CONTENTS, RELOC, READONLY
|
||||
27 nrv2e.32bit 00000250 00000000 00000000 00000cb4 2**0 CONTENTS, RELOC, READONLY
|
||||
28 8bit.sub 00000024 00000000 00000000 00000f04 2**0 CONTENTS, READONLY
|
||||
29 32bit.sub 0000002c 00000000 00000000 00000f28 2**0 CONTENTS, READONLY
|
||||
30 nrv2b.small 000000d8 00000000 00000000 00000f54 2**0 CONTENTS, RELOC, READONLY
|
||||
31 nrv2d.small 000000f0 00000000 00000000 0000102c 2**0 CONTENTS, RELOC, READONLY
|
||||
32 nrv2e.small 00000100 00000000 00000000 0000111c 2**0 CONTENTS, RELOC, READONLY
|
||||
33 nrv.done 00000000 00000000 00000000 0000121c 2**0 CONTENTS, READONLY
|
||||
34 decompressor.start 00000000 00000000 00000000 0000121c 2**0 CONTENTS, READONLY
|
||||
35 lzma.init 00000050 00000000 00000000 0000121c 2**0 CONTENTS, RELOC, READONLY
|
||||
36 LZMA_DEC10 00000ad8 00000000 00000000 0000126c 2**0 CONTENTS, READONLY
|
||||
37 LZMA_DEC20 00000ad8 00000000 00000000 00001d44 2**0 CONTENTS, READONLY
|
||||
38 UPX1HEAD 00000020 00000000 00000000 0000281c 2**0 CONTENTS, READONLY
|
||||
SYMBOL TABLE:
|
||||
00000000 l d nrv.done 00000000 nrv.done
|
||||
00000000 l d decompressor.start 00000000 decompressor.start
|
||||
@@ -92,8 +92,8 @@ SYMBOL TABLE:
|
||||
00000000 *UND* 00000000 PAD
|
||||
00000000 *UND* 00000000 wrkmem
|
||||
00000000 *UND* 00000000 SC
|
||||
0000000c g O 8bit.sub 00000000 gb8_e
|
||||
00000010 g O 32bit.sub 00000000 gb32_e
|
||||
00000014 g O 8bit.sub 00000000 gb8_e
|
||||
0000001c g O 32bit.sub 00000000 gb32_e
|
||||
00000000 *UND* 00000000 gb_e
|
||||
00000000 *UND* 00000000 lzma_stack_adjust
|
||||
00000000 *UND* 00000000 lzma_c_len
|
||||
@@ -174,7 +174,7 @@ OFFSET TYPE VALUE
|
||||
00000000 R_MIPS_HI16 PSVR
|
||||
00000004 R_MIPS_LO16 PSVR
|
||||
0000000c R_MIPS_HI16 wrkmem
|
||||
00000014 R_MIPS_LO16 wrkmem
|
||||
00000010 R_MIPS_LO16 wrkmem
|
||||
|
||||
RELOCATION RECORDS FOR [bss.cdb.entry.lzma]:
|
||||
OFFSET TYPE VALUE
|
||||
@@ -201,63 +201,63 @@ OFFSET TYPE VALUE
|
||||
|
||||
RELOCATION RECORDS FOR [nrv2b.8bit]:
|
||||
OFFSET TYPE VALUE
|
||||
000000a8 R_MIPS_PC16 nrv.done
|
||||
000000c4 R_MIPS_PC16 nrv.done
|
||||
|
||||
RELOCATION RECORDS FOR [nrv2d.8bit]:
|
||||
OFFSET TYPE VALUE
|
||||
000000f0 R_MIPS_PC16 nrv.done
|
||||
0000011c R_MIPS_PC16 nrv.done
|
||||
|
||||
RELOCATION RECORDS FOR [nrv2e.8bit]:
|
||||
OFFSET TYPE VALUE
|
||||
000000f0 R_MIPS_PC16 nrv.done
|
||||
0000011c R_MIPS_PC16 nrv.done
|
||||
|
||||
RELOCATION RECORDS FOR [nrv2b.32bit]:
|
||||
OFFSET TYPE VALUE
|
||||
000000b4 R_MIPS_PC16 nrv.done
|
||||
000000c4 R_MIPS_PC16 nrv.done
|
||||
|
||||
RELOCATION RECORDS FOR [nrv2d.32bit]:
|
||||
OFFSET TYPE VALUE
|
||||
00000104 R_MIPS_PC16 nrv.done
|
||||
0000011c R_MIPS_PC16 nrv.done
|
||||
|
||||
RELOCATION RECORDS FOR [nrv2e.32bit]:
|
||||
OFFSET TYPE VALUE
|
||||
00000104 R_MIPS_PC16 nrv.done
|
||||
0000011c R_MIPS_PC16 nrv.done
|
||||
|
||||
RELOCATION RECORDS FOR [nrv2b.small]:
|
||||
OFFSET TYPE VALUE
|
||||
00000008 R_MIPS_PC16 gb_e
|
||||
00000028 R_MIPS_PC16 gb_e
|
||||
00000030 R_MIPS_PC16 gb_e
|
||||
00000060 R_MIPS_PC16 nrv.done
|
||||
0000006c R_MIPS_PC16 gb_e
|
||||
00000078 R_MIPS_PC16 gb_e
|
||||
00000090 R_MIPS_PC16 gb_e
|
||||
00000098 R_MIPS_PC16 gb_e
|
||||
0000000c R_MIPS_PC16 gb_e
|
||||
0000002c R_MIPS_PC16 gb_e
|
||||
00000034 R_MIPS_PC16 gb_e
|
||||
00000064 R_MIPS_PC16 nrv.done
|
||||
00000070 R_MIPS_PC16 gb_e
|
||||
0000007c R_MIPS_PC16 gb_e
|
||||
00000094 R_MIPS_PC16 gb_e
|
||||
0000009c R_MIPS_PC16 gb_e
|
||||
|
||||
RELOCATION RECORDS FOR [nrv2d.small]:
|
||||
OFFSET TYPE VALUE
|
||||
00000008 R_MIPS_PC16 gb_e
|
||||
00000028 R_MIPS_PC16 gb_e
|
||||
00000030 R_MIPS_PC16 gb_e
|
||||
00000040 R_MIPS_PC16 gb_e
|
||||
00000058 R_MIPS_PC16 gb_e
|
||||
00000078 R_MIPS_PC16 nrv.done
|
||||
00000090 R_MIPS_PC16 gb_e
|
||||
000000a8 R_MIPS_PC16 gb_e
|
||||
000000b0 R_MIPS_PC16 gb_e
|
||||
0000000c R_MIPS_PC16 gb_e
|
||||
0000002c R_MIPS_PC16 gb_e
|
||||
00000034 R_MIPS_PC16 gb_e
|
||||
00000044 R_MIPS_PC16 gb_e
|
||||
0000005c R_MIPS_PC16 gb_e
|
||||
0000007c R_MIPS_PC16 nrv.done
|
||||
00000094 R_MIPS_PC16 gb_e
|
||||
000000ac R_MIPS_PC16 gb_e
|
||||
000000b4 R_MIPS_PC16 gb_e
|
||||
|
||||
RELOCATION RECORDS FOR [nrv2e.small]:
|
||||
OFFSET TYPE VALUE
|
||||
00000008 R_MIPS_PC16 gb_e
|
||||
00000028 R_MIPS_PC16 gb_e
|
||||
00000030 R_MIPS_PC16 gb_e
|
||||
00000040 R_MIPS_PC16 gb_e
|
||||
00000058 R_MIPS_PC16 gb_e
|
||||
00000078 R_MIPS_PC16 nrv.done
|
||||
00000090 R_MIPS_PC16 gb_e
|
||||
000000a8 R_MIPS_PC16 gb_e
|
||||
000000b8 R_MIPS_PC16 gb_e
|
||||
000000c0 R_MIPS_PC16 gb_e
|
||||
0000000c R_MIPS_PC16 gb_e
|
||||
0000002c R_MIPS_PC16 gb_e
|
||||
00000034 R_MIPS_PC16 gb_e
|
||||
00000044 R_MIPS_PC16 gb_e
|
||||
0000005c R_MIPS_PC16 gb_e
|
||||
0000007c R_MIPS_PC16 nrv.done
|
||||
00000094 R_MIPS_PC16 gb_e
|
||||
000000ac R_MIPS_PC16 gb_e
|
||||
000000bc R_MIPS_PC16 gb_e
|
||||
000000c4 R_MIPS_PC16 gb_e
|
||||
|
||||
RELOCATION RECORDS FOR [lzma.init]:
|
||||
OFFSET TYPE VALUE
|
||||
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
#define UPX_VERSION_HEX 0x029300 /* 02.93.00 */
|
||||
#define UPX_VERSION_STRING "2.93 beta"
|
||||
#define UPX_VERSION_STRING4 "2.93"
|
||||
#define UPX_VERSION_DATE "Mar 8th 2007"
|
||||
#define UPX_VERSION_DATE_ISO "2007-03-08"
|
||||
#define UPX_VERSION_HEX 0x030000 /* 03.00.00 */
|
||||
#define UPX_VERSION_STRING "3.00"
|
||||
#define UPX_VERSION_STRING4 "3.00"
|
||||
#define UPX_VERSION_DATE "Apr 27th 2007"
|
||||
#define UPX_VERSION_DATE_ISO "2007-04-27"
|
||||
#define UPX_VERSION_YEAR "2007"
|
||||
|
||||
+9
-5
@@ -58,12 +58,13 @@
|
||||
|
||||
void do_one_file(const char *iname, char *oname)
|
||||
{
|
||||
int r;
|
||||
struct stat st;
|
||||
memset(&st, 0, sizeof(st));
|
||||
#if defined(HAVE_LSTAT)
|
||||
int r = lstat(iname,&st);
|
||||
r = lstat(iname,&st);
|
||||
#else
|
||||
int r = stat(iname,&st);
|
||||
r = stat(iname,&st);
|
||||
#endif
|
||||
|
||||
if (r != 0)
|
||||
@@ -211,15 +212,18 @@ void do_one_file(const char *iname, char *oname)
|
||||
struct utimbuf u;
|
||||
u.actime = st.st_atime;
|
||||
u.modtime = st.st_mtime;
|
||||
(void) ::utime(name,&u);
|
||||
r = utime(name, &u);
|
||||
UNUSED(r);
|
||||
#endif
|
||||
#if defined(HAVE_CHMOD)
|
||||
// copy permissions
|
||||
(void) ::chmod(name, st.st_mode);
|
||||
r = chmod(name, st.st_mode);
|
||||
UNUSED(r);
|
||||
#endif
|
||||
#if defined(HAVE_CHOWN)
|
||||
// copy the ownership
|
||||
(void) ::chown(name, st.st_uid, st.st_gid);
|
||||
r = chown(name, st.st_uid, st.st_gid);
|
||||
UNUSED(r);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user