1
0
mirror of https://github.com/upx/upx synced 2025-10-05 19:20:23 +08:00

checkPatch() resets

p_lx_elf.cpp p_lx_exc.cpp p_unix.cpp

committer: jreiser <jreiser> 1034906580 +0000
This commit is contained in:
John Reiser 2002-10-18 02:03:00 +00:00
parent 66206e8dd7
commit 69cec874a1
3 changed files with 6 additions and 2 deletions

View File

@ -84,6 +84,7 @@ PackLinuxI386elf::buildLoader(const Filter *ft)
{
unsigned char tmp[sizeof(linux_i386elf_fold)];
memcpy(tmp, linux_i386elf_fold, sizeof(linux_i386elf_fold));
checkPatch(0,0,0,0); // reset
if (opt->unix.ptinterp) {
unsigned j;
for (j = 0; j < sizeof(linux_i386elf_fold)-1; ++j) {

View File

@ -197,6 +197,8 @@ PackLinuxI386::buildLinuxLoader(
if (r != UPX_E_OK || h.sz_cpr >= h.sz_unc)
throwInternalError("loader compression failed");
memcpy(cprLoader, &h, sizeof(h));
// This adds the definition to the "library", to be used later.
linker->addSection("FOLDEXEC", cprLoader, sizeof(h) + h.sz_cpr);
delete cprLoader;
@ -287,6 +289,7 @@ PackLinuxI386::buildLinuxLoader(
int sz_cto = getLoaderSize();
if (0x20==(ft->id & 0xF0) || 0x30==(ft->id & 0xF0)) { // push byte '?' ; cto8
patch_le16(ptr_cto, sz_cto, "\x6a?", 0x6a + (ft->cto << 8));
checkPatch(0,0,0,0); // reset
}
// PackHeader and overlay_offset at the end of the output file,
// after the compressed data.

View File

@ -89,9 +89,9 @@ void PackUnix::writePackHeader(OutputFile *fo)
set_le32(buf+0, UPX_MAGIC_LE32);
set_le32(buf+4, UPX_MAGIC2_LE32);
checkPatch(NULL, 0, 0, 0);
checkPatch(NULL, 0, 0, 0); // reset
patchPackHeader(buf, hsize);
checkPatch(NULL, 0, 0, 0);
checkPatch(NULL, 0, 0, 0); // reset
fo->write(buf, hsize);
}