From 9f20ddc800e3adeefdc87602aa58ed9e22f35996 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Mon, 21 Aug 2006 20:28:14 +0200 Subject: [PATCH] Removed Packer::patchVersion() and Packer::patchVersionYear(). --- src/p_tos.cpp | 5 ----- src/packer.cpp | 32 -------------------------------- src/packer.h | 2 -- 3 files changed, 39 deletions(-) diff --git a/src/p_tos.cpp b/src/p_tos.cpp index cc025a91..62843c2d 100644 --- a/src/p_tos.cpp +++ b/src/p_tos.cpp @@ -633,11 +633,6 @@ void PackTos::pack(OutputFile *fo) memcpy(obuf+d_off, getLoader() + e_len, d_len); patchPackHeader(loader, o_text); -#if 0 - patchVersionYear(loader, o_text); - if (!opt->small) - patchVersion(loader, o_text); -#endif // write new file header, loader and compressed file fo->write(&oh, FH_SIZE); diff --git a/src/packer.cpp b/src/packer.cpp index 6c0bfd94..c3e4e912 100644 --- a/src/packer.cpp +++ b/src/packer.cpp @@ -828,38 +828,6 @@ int Packer::patch_le32(void *b, int blen, const void *old, unsigned new_) } -// patch version into stub/ident_n.ash -int Packer::patchVersion(void *b, int blen) -{ - int boff = find(b, blen, "$Id: UPX UPXV ", 14); - checkPatch(b, blen, boff, 14); - - unsigned char *p = (unsigned char *)b + boff + 9; - if (opt->debug.fake_stub_version[0]) - memcpy(p, opt->debug.fake_stub_version, 4); - else - memcpy(p, UPX_VERSION_STRING4, 4); - - return boff; -} - - -// patch year into stub/ident_[ns].ash -int Packer::patchVersionYear(void *b, int blen) -{ - int boff = find(b, blen, " 1996-UPXY ", 11); - checkPatch(b, blen, boff, 11); - - unsigned char *p = (unsigned char *)b + boff + 6; - if (opt->debug.fake_stub_year[0]) - memcpy(p, opt->debug.fake_stub_year, 4); - else - memcpy(p, UPX_VERSION_YEAR, 4); - - return boff; -} - - /************************************************************************* // relocation util **************************************************************************/ diff --git a/src/packer.h b/src/packer.h index d44f1100..bb7d84b5 100644 --- a/src/packer.h +++ b/src/packer.h @@ -258,8 +258,6 @@ protected: int patch_le16(void *b, int blen, const void * old, unsigned new_); int patch_le32(void *b, int blen, unsigned old, unsigned new_); int patch_le32(void *b, int blen, const void * old, unsigned new_); - int patchVersion(void *b, int blen); - int patchVersionYear(void *b, int blen); void checkPatch(void *b, int blen, int boff, int size); // relocation util