diff --git a/src/packer.h b/src/packer.h index bb7d84b5..eb1c2ced 100644 --- a/src/packer.h +++ b/src/packer.h @@ -226,7 +226,6 @@ protected: const int *getDefaultCompressionMethods_le32(int method, int level, int small=-1) const; virtual const char *getDecompressorSections() const; virtual unsigned getDecompressorWrkmemSize() const; - virtual void patchDecompressor(void *, int); virtual void defineDecompressorSymbols(); // filter handling [see packer_f.cpp] diff --git a/src/packer_c.cpp b/src/packer_c.cpp index af374dd0..feb124a3 100644 --- a/src/packer_c.cpp +++ b/src/packer_c.cpp @@ -236,37 +236,6 @@ unsigned Packer::getDecompressorWrkmemSize() const return size; } - -void Packer::patchDecompressor(void *loader, int lsize) -{ - 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_ELFPPC32 ==ph.format - || UPX_F_LINUX_ELF32_ARMBE==ph.format - || UPX_F_BSD_ELF_i386 ==ph.format - ) { - // ELF calls the decompressor many times; the parameters change! - return; - } - if (ph.method == M_LZMA) - { - const lzma_compress_result_t *res = &ph.compress_result.result_lzma; - // FIXME - this is for i386 only - unsigned properties = // lc, lp, pb, dummy - (res->lit_context_bits << 0) | - (res->lit_pos_bits << 8) | - (res->pos_bits << 16); - patch_le32(loader, lsize, "UPXd", properties); - // -2 for properties - patch_le32(loader, lsize, "UPXc", ph.c_len - 2); - patch_le32(loader, lsize, "UPXb", ph.u_len); - unsigned stack = getDecompressorWrkmemSize(); - patch_le32(loader, lsize, "UPXa", 0u - stack); - } -} - void Packer::defineDecompressorSymbols() { if (UPX_F_LINUX_ELF_i386 ==ph.format