mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
::addStubEntrySections() with default ELFMAINX
This commit is contained in:
parent
6bd9805bcc
commit
1a0a64e4de
|
@ -150,19 +150,24 @@ PackLinuxElf::PackLinuxElf(InputFile *f)
|
|||
{
|
||||
}
|
||||
|
||||
Linker *PackLinuxElf::newLinker() const
|
||||
{
|
||||
return new ElfLinker;
|
||||
}
|
||||
|
||||
PackLinuxElf::~PackLinuxElf()
|
||||
{
|
||||
delete[] file_image;
|
||||
}
|
||||
|
||||
Linker* PackLinuxElf64amd::newLinker() const
|
||||
Linker *PackLinuxElf::newLinker() const
|
||||
{
|
||||
return new ElfLinkerAMD64;
|
||||
return new ElfLinker;
|
||||
}
|
||||
|
||||
void
|
||||
PackLinuxElf::addStubEntrySections(
|
||||
upx_byte const *const proto,
|
||||
unsigned const szproto
|
||||
)
|
||||
{
|
||||
linker->addSection("ELFMAINX", proto, szproto);
|
||||
addLoader("ELFMAINX", NULL);
|
||||
}
|
||||
|
||||
PackLinuxElf32::PackLinuxElf32(InputFile *f)
|
||||
|
@ -186,6 +191,11 @@ PackLinuxElf64::~PackLinuxElf64()
|
|||
delete[] phdri;
|
||||
}
|
||||
|
||||
Linker* PackLinuxElf64amd::newLinker() const
|
||||
{
|
||||
return new ElfLinkerAMD64;
|
||||
}
|
||||
|
||||
int const *
|
||||
PackLinuxElf::getCompressionMethods(int method, int level) const
|
||||
{
|
||||
|
@ -512,9 +522,8 @@ PackLinuxElf32::buildLinuxLoader(
|
|||
//int const GAP = 128; // must match stub/l_mac_ppc.S
|
||||
//segcmdo.vmsize += sz_unc - sz_cpr + GAP + 64;
|
||||
|
||||
linker->addSection("ELFMAINX", proto, szproto);
|
||||
addStubEntrySections(proto, szproto);
|
||||
|
||||
addLoader("ELFMAINX", NULL);
|
||||
addLoader("FOLDEXEC", NULL);
|
||||
freezeLoader();
|
||||
return getLoaderSize();
|
||||
|
@ -568,14 +577,22 @@ PackLinuxElf64::buildLinuxLoader(
|
|||
linker->addSection("FOLDEXEC", cprLoader, sizeof(h) + sz_cpr);
|
||||
delete [] cprLoader;
|
||||
|
||||
linker->addSection("ELFMAINX", proto, szproto);
|
||||
addStubEntrySections(proto, szproto);
|
||||
|
||||
addLoader("ELFMAINX", NULL);
|
||||
addLoader("FOLDEXEC", NULL);
|
||||
freezeLoader();
|
||||
return getLoaderSize();
|
||||
}
|
||||
|
||||
void
|
||||
PackLinuxElf64amd::addStubEntrySections(
|
||||
upx_byte const *const /*proto*/,
|
||||
unsigned const /*szproto*/
|
||||
)
|
||||
{
|
||||
// FIXME
|
||||
}
|
||||
|
||||
static const
|
||||
#include "stub/i386-linux.elf-entry.h"
|
||||
static const
|
||||
|
|
|
@ -60,6 +60,7 @@ protected:
|
|||
void const *proto,
|
||||
unsigned const brka
|
||||
) = 0;
|
||||
virtual void addStubEntrySections(upx_byte const *, unsigned);
|
||||
virtual void unpack(OutputFile *fo) = 0;
|
||||
|
||||
protected:
|
||||
|
@ -286,6 +287,7 @@ protected:
|
|||
virtual void pack3(OutputFile *, Filter &); // append loader
|
||||
virtual const int *getCompressionMethods(int method, int level) const;
|
||||
virtual int buildLoader(const Filter *);
|
||||
virtual void addStubEntrySections(upx_byte const *, unsigned);
|
||||
virtual Linker* newLinker() const;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user