mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
Bvmlinuz: linker->defineSymbol() instead of patchDecompressor()
This commit is contained in:
parent
c8d54b324b
commit
1a219e62ba
|
@ -397,7 +397,19 @@ void PackBvmlinuzI386::pack(OutputFile *fo)
|
|||
|
||||
const unsigned lsize = getLoaderSize();
|
||||
|
||||
// FIXME patchDecompressor(loader, lsize);
|
||||
if (ph.method == M_LZMA) {
|
||||
const lzma_compress_result_t *res = &ph.compress_result.result_lzma;
|
||||
unsigned const properties = // lc, lp, pb, dummy
|
||||
(res->lit_context_bits << 0) |
|
||||
(res->lit_pos_bits << 8) |
|
||||
(res->pos_bits << 16);
|
||||
linker->defineSymbol("UPXd", properties);
|
||||
// -2 for properties
|
||||
linker->defineSymbol("UPXc", ph.c_len - 2);
|
||||
linker->defineSymbol("UPXb", ph.u_len);
|
||||
unsigned const stack = getDecompressorWrkmemSize();
|
||||
linker->defineSymbol("UPXa", 0u - stack);
|
||||
}
|
||||
|
||||
const int e_len = getLoaderSectionStart("LZCUTPOI");
|
||||
assert(e_len > 0);
|
||||
|
|
|
@ -76,7 +76,7 @@ section LZMA_DEC00
|
|||
|
||||
|
||||
section LZMA_ELF00
|
||||
// Preceded by LEXEC010 which tunes for NRV, including "pusha; push $cto"
|
||||
// Preceded by LEXEC010 which tunes for NRV, including 'pusha'
|
||||
|
||||
#define LZMA_BASE_SIZE 1846
|
||||
#define LZMA_LIT_SIZE 768
|
||||
|
|
Loading…
Reference in New Issue
Block a user