diff --git a/src/p_vmlinz.cpp b/src/p_vmlinz.cpp index 337e2690..88bc5091 100644 --- a/src/p_vmlinz.cpp +++ b/src/p_vmlinz.cpp @@ -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); diff --git a/src/stub/src/arch/i386/lzma_d.S b/src/stub/src/arch/i386/lzma_d.S index 40cc56e0..02c4b187 100644 --- a/src/stub/src/arch/i386/lzma_d.S +++ b/src/stub/src/arch/i386/lzma_d.S @@ -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