mirror of https://github.com/upx/upx.git
Re-synced `identtiny' from 1.2 branch.
committer: mfx <mfx> 1034741770 +0000
This commit is contained in:
parent
cecfaaf63e
commit
ac245b39d5
|
@ -93,7 +93,7 @@ PackLinuxI386::generateElfHdr(
|
|||
|
||||
#if 0 //{
|
||||
unsigned identsize;
|
||||
char const *const ident = identstr(identsize);
|
||||
char const *const ident = getIdentstr(&identsize);
|
||||
#endif //}
|
||||
h2->phdr[0].p_filesz = sizeof(*h2); // + identsize;
|
||||
h2->phdr[0].p_memsz = h2->phdr[0].p_filesz;
|
||||
|
|
|
@ -1483,7 +1483,7 @@ bool PackW32Pe::canPack()
|
|||
int PackW32Pe::buildLoader(const Filter *ft)
|
||||
{
|
||||
// prepare loader
|
||||
initLoader(nrv_loader,sizeof(nrv_loader));
|
||||
initLoader(nrv_loader, sizeof(nrv_loader), -1, 2);
|
||||
addLoader(isdll ? "PEISDLL1" : "",
|
||||
"PEMAIN01",
|
||||
icondir_count > 1 ? (icondir_count == 2 ? "PEICONS1" : "PEICONS2") : "",
|
||||
|
|
|
@ -965,7 +965,7 @@ const int *Packer::getDefaultCompressionMethods_LE32(int method, int level, int
|
|||
// loader util
|
||||
**************************************************************************/
|
||||
|
||||
char const *Packer::identstr(unsigned &size)
|
||||
char const *Packer::getIdentstr(unsigned *size, int small)
|
||||
{
|
||||
static const char identbig[] =
|
||||
"\n\0"
|
||||
|
@ -981,20 +981,28 @@ char const *Packer::identstr(unsigned &size)
|
|||
"$Id: UPX "
|
||||
"(C) 1996-2002 the UPX Team. All Rights Reserved. http://upx.sf.net $"
|
||||
"\n";
|
||||
// static const char identtiny[] = UPX_VERSION_STRING4;
|
||||
// FIXME
|
||||
static const char identtiny[] = UPX_VERSION_STRING4;
|
||||
|
||||
if (opt->small) {
|
||||
size = sizeof(identsmall);
|
||||
if (small < 0)
|
||||
small = opt->small;
|
||||
if (small >= 2)
|
||||
{
|
||||
*size = sizeof(identtiny);
|
||||
return identtiny;
|
||||
}
|
||||
else if (small >= 1)
|
||||
{
|
||||
*size = sizeof(identsmall);
|
||||
return identsmall;
|
||||
}
|
||||
else {
|
||||
size = sizeof(identbig);
|
||||
else
|
||||
{
|
||||
*size = sizeof(identbig);
|
||||
return identbig;
|
||||
}
|
||||
}
|
||||
|
||||
void Packer::initLoader(const void *pdata, int plen, int pinfo)
|
||||
void Packer::initLoader(const void *pdata, int plen, int pinfo, int small)
|
||||
{
|
||||
if (pinfo < 0)
|
||||
{
|
||||
|
@ -1009,8 +1017,8 @@ void Packer::initLoader(const void *pdata, int plen, int pinfo)
|
|||
linker = new BeLinker(pdata, plen, pinfo); // big endian
|
||||
|
||||
unsigned size;
|
||||
char const *const ident = identstr(size);
|
||||
linker->addSection("IDENTSTR",ident,size);
|
||||
char const * const ident = getIdentstr(&size, small);
|
||||
linker->addSection("IDENTSTR", ident, size);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -207,12 +207,12 @@ protected:
|
|||
virtual int buildLoader(const Filter *) { return getLoaderSize(); }
|
||||
virtual const upx_byte *getLoader() const;
|
||||
virtual int getLoaderSize() const;
|
||||
virtual void initLoader(const void *pdata, int plen, int pinfo=-1);
|
||||
virtual void initLoader(const void *pdata, int plen, int pinfo=-1, int small=-1);
|
||||
virtual void addLoader(const char *s, ...);
|
||||
virtual int getLoaderSection(const char *name, int *slen=NULL) const;
|
||||
virtual int getLoaderSectionStart(const char *name, int *slen=NULL) const;
|
||||
virtual const char *getDecompressor() const;
|
||||
char const *identstr(unsigned &size);
|
||||
virtual const char *getIdentstr(unsigned *size, int small=-1);
|
||||
|
||||
// stub and overlay util
|
||||
static void handleStub(InputFile *fi, OutputFile *fo, long size);
|
||||
|
|
Loading…
Reference in New Issue