Rewrote PackHeader handling. In particuliar, Packer::putPackHeader()

was renamed to patchPackHeader(), and it is now under control of
the usual checkPatch() patch-order.

committer: mfx <mfx> 976601615 +0000
This commit is contained in:
Markus F.X.J. Oberhumer
2000-12-12 06:13:35 +00:00
parent a8eac4f2f8
commit c6481575f9
16 changed files with 175 additions and 175 deletions
+2 -3
View File
@@ -295,7 +295,7 @@ bool PackTos::canPack()
unsigned char buf[512];
fi->readx(buf,sizeof(buf));
if (find_le32(buf,sizeof(buf),UPX_MAGIC_LE32))
if (find_le32(buf,sizeof(buf),UPX_MAGIC_LE32) >= 0)
throwAlreadyPacked();
if (!checkFileHeader())
@@ -467,6 +467,7 @@ void PackTos::pack(OutputFile *fo)
memcpy(loader,getLoader(),o_text);
// patch loader
patchPackHeader(loader,o_text);
if (!opt->small)
patchVersion(loader,o_text);
// patch "subq.l #1,d0" or "subq.w #1,d0" - see "up41" below
@@ -494,8 +495,6 @@ void PackTos::pack(OutputFile *fo)
patch_be32(loader,o_text,"up12",i_data); // p_dlen
patch_be32(loader,o_text,"up11",i_text); // p_tlen
putPackHeader(loader,o_text);
// patch decompressor
upx_byte *p = obuf + d_off;
// patch "moveq.l #1,d3" or "jmp (a5)"