|
|
@ -1,6 +1,6 @@ |
|
|
|
--- a/src/compress.cpp
|
|
|
|
--- a/src/compress.cpp
|
|
|
|
+++ b/src/compress.cpp
|
|
|
|
+++ b/src/compress.cpp
|
|
|
|
@@ -41,7 +41,7 @@
|
|
|
|
@@ -41,7 +41,7 @@ unsigned upx_adler32(const void *buf, un
|
|
|
|
if (len == 0)
|
|
|
|
if (len == 0)
|
|
|
|
return adler;
|
|
|
|
return adler;
|
|
|
|
assert(buf != NULL);
|
|
|
|
assert(buf != NULL);
|
|
|
@ -20,7 +20,7 @@ |
|
|
|
# define WITH_UCL 1
|
|
|
|
# define WITH_UCL 1
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if 0 && !defined(WITH_LZMA)
|
|
|
|
#if 0 && !defined(WITH_LZMA)
|
|
|
|
@@ -645,7 +645,11 @@
|
|
|
|
@@ -640,7 +640,11 @@ struct lzma_compress_config_t
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -32,7 +32,7 @@ |
|
|
|
{
|
|
|
|
{
|
|
|
|
void reset() { memset(this, 0xff, sizeof(*this)); }
|
|
|
|
void reset() { memset(this, 0xff, sizeof(*this)); }
|
|
|
|
};
|
|
|
|
};
|
|
|
|
@@ -697,7 +701,9 @@
|
|
|
|
@@ -692,7 +696,9 @@ struct lzma_compress_result_t
|
|
|
|
|
|
|
|
|
|
|
|
struct ucl_compress_result_t
|
|
|
|
struct ucl_compress_result_t
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -44,7 +44,7 @@ |
|
|
|
};
|
|
|
|
};
|
|
|
|
--- a/src/main.cpp
|
|
|
|
--- a/src/main.cpp
|
|
|
|
+++ b/src/main.cpp
|
|
|
|
+++ b/src/main.cpp
|
|
|
|
@@ -618,7 +618,9 @@
|
|
|
|
@@ -618,7 +618,9 @@ static int do_option(int optc, const cha
|
|
|
|
opt->method = -1;
|
|
|
|
opt->method = -1;
|
|
|
|
opt->all_filters = true;
|
|
|
|
opt->all_filters = true;
|
|
|
|
opt->filter = -1;
|
|
|
|
opt->filter = -1;
|
|
|
@ -54,7 +54,7 @@ |
|
|
|
/* fallthrough */
|
|
|
|
/* fallthrough */
|
|
|
|
case 900: // --best
|
|
|
|
case 900: // --best
|
|
|
|
if (!set_method(-1, 10))
|
|
|
|
if (!set_method(-1, 10))
|
|
|
|
@@ -709,6 +711,7 @@
|
|
|
|
@@ -709,6 +711,7 @@ static int do_option(int optc, const cha
|
|
|
|
opt->exact = true;
|
|
|
|
opt->exact = true;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
// compression runtime parameters
|
|
|
|
// compression runtime parameters
|
|
|
@ -62,7 +62,7 @@ |
|
|
|
case 801:
|
|
|
|
case 801:
|
|
|
|
getoptvar(&opt->crp.crp_ucl.c_flags, 0, 3, arg);
|
|
|
|
getoptvar(&opt->crp.crp_ucl.c_flags, 0, 3, arg);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
@@ -730,6 +733,7 @@
|
|
|
|
@@ -730,6 +733,7 @@ static int do_option(int optc, const cha
|
|
|
|
case 807:
|
|
|
|
case 807:
|
|
|
|
getoptvar(&opt->crp.crp_ucl.m_size, 10000u, 999999u, arg);
|
|
|
|
getoptvar(&opt->crp.crp_ucl.m_size, 10000u, 999999u, arg);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -72,7 +72,7 @@ |
|
|
|
break;
|
|
|
|
break;
|
|
|
|
--- a/src/Makefile
|
|
|
|
--- a/src/Makefile
|
|
|
|
+++ b/src/Makefile
|
|
|
|
+++ b/src/Makefile
|
|
|
|
@@ -57,7 +57,10 @@
|
|
|
|
@@ -57,7 +57,10 @@ ifneq ($(wildcard $(UPX_UCLDIR)/include/
|
|
|
|
INCLUDES += -I$(UPX_UCLDIR)/include
|
|
|
|
INCLUDES += -I$(UPX_UCLDIR)/include
|
|
|
|
LIBS += $(addprefix -L,$(dir $(wildcard $(UPX_UCLDIR)/libucl$(libext) $(UPX_UCLDIR)/src/.libs/libucl$(libext))))
|
|
|
|
LIBS += $(addprefix -L,$(dir $(wildcard $(UPX_UCLDIR)/libucl$(libext) $(UPX_UCLDIR)/src/.libs/libucl$(libext))))
|
|
|
|
endif
|
|
|
|
endif
|
|
|
@ -86,7 +86,7 @@ |
|
|
|
ifneq ($(UPX_LZMA_VERSION),)
|
|
|
|
ifneq ($(UPX_LZMA_VERSION),)
|
|
|
|
--- a/src/packer.cpp
|
|
|
|
--- a/src/packer.cpp
|
|
|
|
+++ b/src/packer.cpp
|
|
|
|
+++ b/src/packer.cpp
|
|
|
|
@@ -199,6 +199,7 @@
|
|
|
|
@@ -199,6 +199,7 @@ bool Packer::compress(upx_bytep i_ptr, u
|
|
|
|
if (cconf_parm)
|
|
|
|
if (cconf_parm)
|
|
|
|
cconf = *cconf_parm;
|
|
|
|
cconf = *cconf_parm;
|
|
|
|
// cconf options
|
|
|
|
// cconf options
|
|
|
@ -94,7 +94,7 @@ |
|
|
|
if (M_IS_NRV2B(ph.method) || M_IS_NRV2D(ph.method) || M_IS_NRV2E(ph.method))
|
|
|
|
if (M_IS_NRV2B(ph.method) || M_IS_NRV2D(ph.method) || M_IS_NRV2E(ph.method))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (opt->crp.crp_ucl.c_flags != -1)
|
|
|
|
if (opt->crp.crp_ucl.c_flags != -1)
|
|
|
|
@@ -216,6 +217,7 @@
|
|
|
|
@@ -216,6 +217,7 @@ bool Packer::compress(upx_bytep i_ptr, u
|
|
|
|
step = 0;
|
|
|
|
step = 0;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -102,7 +102,7 @@ |
|
|
|
if (M_IS_LZMA(ph.method))
|
|
|
|
if (M_IS_LZMA(ph.method))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
oassign(cconf.conf_lzma.pos_bits, opt->crp.crp_lzma.pos_bits);
|
|
|
|
oassign(cconf.conf_lzma.pos_bits, opt->crp.crp_lzma.pos_bits);
|
|
|
|
@@ -250,6 +252,7 @@
|
|
|
|
@@ -250,6 +252,7 @@ bool Packer::compress(upx_bytep i_ptr, u
|
|
|
|
if (r != UPX_E_OK)
|
|
|
|
if (r != UPX_E_OK)
|
|
|
|
throwInternalError("compression failed");
|
|
|
|
throwInternalError("compression failed");
|
|
|
|
|
|
|
|
|
|
|
@ -110,7 +110,7 @@ |
|
|
|
if (M_IS_NRV2B(ph.method) || M_IS_NRV2D(ph.method) || M_IS_NRV2E(ph.method))
|
|
|
|
if (M_IS_NRV2B(ph.method) || M_IS_NRV2D(ph.method) || M_IS_NRV2E(ph.method))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const ucl_uint *res = ph.compress_result.result_ucl.result;
|
|
|
|
const ucl_uint *res = ph.compress_result.result_ucl.result;
|
|
|
|
@@ -267,6 +270,7 @@
|
|
|
|
@@ -267,6 +270,7 @@ bool Packer::compress(upx_bytep i_ptr, u
|
|
|
|
assert(cconf.conf_ucl.max_match == 0 || cconf.conf_ucl.max_match >= ph.max_match_found);
|
|
|
|
assert(cconf.conf_ucl.max_match == 0 || cconf.conf_ucl.max_match >= ph.max_match_found);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -120,7 +120,7 @@ |
|
|
|
if (!checkCompressionRatio(ph.u_len, ph.c_len))
|
|
|
|
if (!checkCompressionRatio(ph.u_len, ph.c_len))
|
|
|
|
--- a/src/p_exe.cpp
|
|
|
|
--- a/src/p_exe.cpp
|
|
|
|
+++ b/src/p_exe.cpp
|
|
|
|
+++ b/src/p_exe.cpp
|
|
|
|
@@ -506,7 +506,9 @@
|
|
|
|
@@ -506,7 +506,9 @@ void PackExe::pack(OutputFile *fo)
|
|
|
|
Filter ft(ph.level);
|
|
|
|
Filter ft(ph.level);
|
|
|
|
// compress (max_match = 8192)
|
|
|
|
// compress (max_match = 8192)
|
|
|
|
upx_compress_config_t cconf; cconf.reset();
|
|
|
|
upx_compress_config_t cconf; cconf.reset();
|
|
|
@ -132,7 +132,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
--- a/src/p_ps1.cpp
|
|
|
|
--- a/src/p_ps1.cpp
|
|
|
|
+++ b/src/p_ps1.cpp
|
|
|
|
+++ b/src/p_ps1.cpp
|
|
|
|
@@ -499,7 +499,9 @@
|
|
|
|
@@ -499,7 +499,9 @@ void PackPs1::pack(OutputFile *fo)
|
|
|
|
|
|
|
|
|
|
|
|
// compress (max_match = 65535)
|
|
|
|
// compress (max_match = 65535)
|
|
|
|
upx_compress_config_t cconf; cconf.reset();
|
|
|
|
upx_compress_config_t cconf; cconf.reset();
|
|
|
@ -144,7 +144,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
--- a/src/p_tos.cpp
|
|
|
|
--- a/src/p_tos.cpp
|
|
|
|
+++ b/src/p_tos.cpp
|
|
|
|
+++ b/src/p_tos.cpp
|
|
|
|
@@ -506,7 +506,9 @@
|
|
|
|
@@ -506,7 +506,9 @@ void PackTos::pack(OutputFile *fo)
|
|
|
|
Filter ft(ph.level);
|
|
|
|
Filter ft(ph.level);
|
|
|
|
// compress (max_match = 65535)
|
|
|
|
// compress (max_match = 65535)
|
|
|
|
upx_compress_config_t cconf; cconf.reset();
|
|
|
|
upx_compress_config_t cconf; cconf.reset();
|
|
|
|