1
0
mirror of https://github.com/upx/upx synced 2025-09-28 19:06:07 +08:00

Removed Packer::patchDecompressor().

This commit is contained in:
Markus F.X.J. Oberhumer 2006-08-22 11:05:18 +02:00
parent a27af7dd7e
commit f11673ae3f
2 changed files with 0 additions and 32 deletions

View File

@ -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]

View File

@ -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