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

::pack3 to set .p_filesz; also set blocksize to allow giant scripts as input

p_lx_sh.cpp p_lx_sh.h

committer: jreiser <jreiser> 1105479043 +0000
This commit is contained in:
John Reiser 2005-01-11 21:30:43 +00:00
parent 3ed786fb5c
commit 59668c5fc1
2 changed files with 13 additions and 1 deletions

View File

@ -104,7 +104,11 @@ bool PackLinuxI386sh::getShellName(char *buf)
return false;
for (int j = 0; NULL != shname[j]; ++j) {
if (0 == strcmp(shname[j], bname + 1)) {
return super::canPack();
bool const s = super::canPack();
if (s) {
opt->o_unix.blocksize = blocksize = file_size;
}
return s;
}
}
return false;
@ -139,6 +143,13 @@ PackLinuxI386sh::pack1(OutputFile *fo, Filter &)
generateElfHdr(fo, linux_i386sh_fold, 0x08048000);
}
void
PackLinuxI386sh::pack3(OutputFile *fo, Filter &ft)
{
super::pack3(fo,ft);
elfout.phdr[0].p_filesz = fo->getBytesWritten();
}
/*
vi:ts=4:et
*/

View File

@ -48,6 +48,7 @@ public:
virtual int buildLoader(const Filter *);
virtual void pack1(OutputFile *fo, Filter &ft);
virtual void pack3(OutputFile *fo, Filter &ft);
virtual bool canPack();
// virtual void unpack(OutputFile *fo) { super::unpack(fo); }