Added new field PackHeader::overlap_overhead.

committer: mfx <mfx> 978190533 +0000
This commit is contained in:
Markus F.X.J. Oberhumer
2000-12-30 15:35:33 +00:00
parent 85bebf0b43
commit a8177201ef
21 changed files with 139 additions and 114 deletions
+7 -7
View File
@@ -132,15 +132,15 @@ int PackTos::getLoaderSize() const
// util
**************************************************************************/
bool PackTos::readFileHeader()
int PackTos::readFileHeader()
{
fi->seek(0,SEEK_SET);
fi->readx(&ih, FH_SIZE);
if (ih.fh_magic != 0x601a)
return false;
return 0;
if (FH_SIZE + ih.fh_text + ih.fh_data + ih.fh_sym > (unsigned) file_size)
return false;
return true;
return 0;
return UPX_F_ATARI_TOS;
}
@@ -412,8 +412,8 @@ void PackTos::pack(OutputFile *fo)
throwNotCompressible();
// The decompressed data will now get placed at this offset:
const unsigned overlapoh = findOverlapOverhead(obuf, 512);
unsigned offset = (ph.u_len + overlapoh) - ph.c_len;
ph.overlap_overhead = findOverlapOverhead(obuf, 512);
unsigned offset = (ph.u_len + ph.overlap_overhead) - ph.c_len;
// compute addresses
unsigned o_text, o_data, o_bss;
@@ -538,7 +538,7 @@ void PackTos::pack(OutputFile *fo)
fo->write("\x00\x00\x00\x00",4);
// verify
verifyOverlappingDecompression(&obuf, overlapoh);
verifyOverlappingDecompression(&obuf, ph.overlap_overhead);
// copy the overlay
copyOverlay(fo, overlay, &obuf);