mirror of
https://github.com/upx/upx.git
synced 2024-11-30 16:11:08 +00:00
PE: Fix stripped relocation handling
This commit is contained in:
parent
966b571b7c
commit
cc100be26e
@ -2316,7 +2316,10 @@ void PeFile::pack0(OutputFile *fo, ht &ih, ht &oh,
|
||||
if (IDSIZE(PEDIR_SEC))
|
||||
IDSIZE(PEDIR_SEC) = IDADDR(PEDIR_SEC) = 0;
|
||||
|
||||
ih.flags |= handleStripRelocs(ih.imagebase, default_imagebase, ih.dllflags);
|
||||
if (ih.flags & RELOCS_STRIPPED)
|
||||
opt->win32_pe.strip_relocs = true;
|
||||
else
|
||||
ih.flags |= handleStripRelocs(ih.imagebase, default_imagebase, ih.dllflags);
|
||||
|
||||
handleStub(fi,fo,pe_offset);
|
||||
unsigned overlaystart = readSections(objs, ih.imagesize, ih.filealign, ih.datasize);
|
||||
@ -2568,7 +2571,7 @@ void PeFile::pack0(OutputFile *fo, ht &ih, ht &oh,
|
||||
// this one is tricky: it seems windoze touches 4 bytes after
|
||||
// the end of the relocation data - so we have to increase
|
||||
// the virtual size of this section
|
||||
const unsigned ncsize_virt_increase = (ncsize & oam1) == 0 ? 8 : 0;
|
||||
const unsigned ncsize_virt_increase = soxrelocs && (ncsize & oam1) == 0 ? 8 : 0;
|
||||
|
||||
// fill the sections
|
||||
strcpy(osection[0].name,"UPX0");
|
||||
|
Loading…
Reference in New Issue
Block a user