From e225d7714687fe61338a6786581b928b8ca1cb57 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Thu, 12 Sep 2002 16:08:36 +0000 Subject: [PATCH] Bumped version in getVersion() for all formats. committer: mfx 1031846916 +0000 --- src/p_com.h | 2 +- src/p_djgpp2.h | 2 +- src/p_exe.h | 2 +- src/p_lx_elf.h | 2 +- src/p_lx_sh.h | 2 +- src/p_psx.h | 2 +- src/p_sys.h | 2 +- src/p_tmt.h | 2 +- src/p_tos.h | 2 +- src/p_unix.h | 2 +- src/p_vmlinz.h | 2 +- src/p_vxd.h | 2 +- src/p_w16ne.h | 2 +- src/p_w32pe.h | 2 +- src/p_wcle.h | 2 +- src/packer.cpp | 6 +++--- src/packmast.cpp | 1 + src/s_djgpp2.cpp | 2 ++ 18 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/p_com.h b/src/p_com.h index c958a76a..3da0d066 100644 --- a/src/p_com.h +++ b/src/p_com.h @@ -39,7 +39,7 @@ class PackCom : public Packer typedef Packer super; public: PackCom(InputFile *f) : super(f) { } - virtual int getVersion() const { return 11; } + virtual int getVersion() const { return 13; } virtual int getFormat() const { return UPX_F_DOS_COM; } virtual const char *getName() const { return "dos/com"; } virtual const int *getCompressionMethods(int method, int level) const; diff --git a/src/p_djgpp2.h b/src/p_djgpp2.h index 82fe40ce..3f8b7dd3 100644 --- a/src/p_djgpp2.h +++ b/src/p_djgpp2.h @@ -40,7 +40,7 @@ class PackDjgpp2 : public Packer public: PackDjgpp2(InputFile *f); - virtual int getVersion() const { return 11; } + virtual int getVersion() const { return 13; } virtual int getFormat() const { return UPX_F_DJGPP2_COFF; } virtual const char *getName() const { return "djgpp2/coff"; } virtual const int *getCompressionMethods(int method, int level) const; diff --git a/src/p_exe.h b/src/p_exe.h index ae4bc01c..902b4f46 100644 --- a/src/p_exe.h +++ b/src/p_exe.h @@ -39,7 +39,7 @@ class PackExe : public Packer typedef Packer super; public: PackExe(InputFile *f); - virtual int getVersion() const { return 11; } + virtual int getVersion() const { return 13; } virtual int getFormat() const { return UPX_F_DOS_EXE; } virtual const char *getName() const { return "dos/exe"; } virtual const int *getCompressionMethods(int method, int level) const; diff --git a/src/p_lx_elf.h b/src/p_lx_elf.h index ed4f654a..47043da6 100644 --- a/src/p_lx_elf.h +++ b/src/p_lx_elf.h @@ -41,7 +41,7 @@ class PackLinuxI386elf : public PackLinuxI386 public: PackLinuxI386elf(InputFile *f); virtual ~PackLinuxI386elf(); - virtual int getVersion() const { return 11; } + virtual int getVersion() const { return 13; } virtual int getFormat() const { return UPX_F_LINUX_ELF_i386; } virtual const char *getName() const { return "linux/elf386"; } virtual const int *getFilters() const; diff --git a/src/p_lx_sh.h b/src/p_lx_sh.h index c79909b6..f2eccfb0 100644 --- a/src/p_lx_sh.h +++ b/src/p_lx_sh.h @@ -41,7 +41,7 @@ class PackLinuxI386sh : public PackLinuxI386 public: PackLinuxI386sh(InputFile *f); virtual ~PackLinuxI386sh(); - virtual int getVersion() const { return 11; } + virtual int getVersion() const { return 13; } virtual int getFormat() const { return UPX_F_LINUX_SH_i386; } virtual const char *getName() const { return "linux/sh386"; } virtual const int *getFilters() const { return NULL; } diff --git a/src/p_psx.h b/src/p_psx.h index 517dee6a..f9d033cd 100644 --- a/src/p_psx.h +++ b/src/p_psx.h @@ -38,7 +38,7 @@ class PackPsx : public Packer typedef Packer super; public: PackPsx(InputFile *f); - virtual int getVersion() const { return 11; } + virtual int getVersion() const { return 13; } virtual int getFormat() const { return UPX_F_PSX_EXE; } virtual const char *getName() const { return "ps/exe"; } virtual const int *getCompressionMethods(int method, int level) const; diff --git a/src/p_sys.h b/src/p_sys.h index 02088ddd..7dd0ed02 100644 --- a/src/p_sys.h +++ b/src/p_sys.h @@ -39,7 +39,7 @@ class PackSys : public PackCom typedef PackCom super; public: PackSys(InputFile *f) : super(f) { } - virtual int getVersion() const { return 11; } + virtual int getVersion() const { return 13; } virtual int getFormat() const { return UPX_F_DOS_SYS; } virtual const char *getName() const { return "dos/sys"; } diff --git a/src/p_tmt.h b/src/p_tmt.h index cc70199e..52f0afaf 100644 --- a/src/p_tmt.h +++ b/src/p_tmt.h @@ -39,7 +39,7 @@ class PackTmt : public Packer typedef Packer super; public: PackTmt(InputFile *f); - virtual int getVersion() const { return 11; } + virtual int getVersion() const { return 13; } virtual int getFormat() const { return UPX_F_TMT_ADAM; } virtual const char *getName() const { return "tmt/adam"; } virtual const int *getCompressionMethods(int method, int level) const; diff --git a/src/p_tos.h b/src/p_tos.h index 00cf514a..d7d15d47 100644 --- a/src/p_tos.h +++ b/src/p_tos.h @@ -39,7 +39,7 @@ class PackTos : public Packer typedef Packer super; public: PackTos(InputFile *f); - virtual int getVersion() const { return 11; } + virtual int getVersion() const { return 13; } virtual int getFormat() const { return UPX_F_ATARI_TOS; } virtual const char *getName() const { return "atari/tos"; } virtual const int *getCompressionMethods(int method, int level) const; diff --git a/src/p_unix.h b/src/p_unix.h index 79df577d..30f98657 100644 --- a/src/p_unix.h +++ b/src/p_unix.h @@ -41,7 +41,7 @@ class PackUnix : public Packer protected: PackUnix(InputFile *f); public: - virtual int getVersion() const { return 11; } + virtual int getVersion() const { return 13; } virtual const int *getFilters() const { return NULL; } virtual int getStrategy(Filter &); diff --git a/src/p_vmlinz.h b/src/p_vmlinz.h index bdfd4bd8..3f59bb58 100644 --- a/src/p_vmlinz.h +++ b/src/p_vmlinz.h @@ -39,7 +39,7 @@ class PackVmlinuzI386 : public Packer typedef Packer super; public: PackVmlinuzI386(InputFile *f); - virtual int getVersion() const { return 11; } + virtual int getVersion() const { return 13; } virtual int getFormat() const { return UPX_F_VMLINUZ_i386; } virtual const char *getName() const { return "vmlinuz/386"; } virtual const int *getCompressionMethods(int method, int level) const; diff --git a/src/p_vxd.h b/src/p_vxd.h index 167adc82..d7dd87cc 100644 --- a/src/p_vxd.h +++ b/src/p_vxd.h @@ -40,7 +40,7 @@ class PackVxd : public PackWcle public: PackVxd(InputFile *f); ~PackVxd(); - virtual int getVersion() const { return 11; } + virtual int getVersion() const { return 13; } virtual int getFormat() const { return UPX_F_VXD_LE; } virtual const char *getName() const { return "vxd/le"; } virtual const int *getCompressionMethods(int method, int level) const; diff --git a/src/p_w16ne.h b/src/p_w16ne.h index 821c9884..351981f7 100644 --- a/src/p_w16ne.h +++ b/src/p_w16ne.h @@ -39,7 +39,7 @@ class PackW16Ne : public Packer typedef Packer super; public: PackW16Ne(InputFile *f); - virtual int getVersion() const { return 11; } + virtual int getVersion() const { return 13; } virtual int getFormat() const { return UPX_F_WIN16_NE; } virtual const char *getName() const { return "win16/ne"; } virtual const int *getCompressionMethods(int method, int level) const; diff --git a/src/p_w32pe.h b/src/p_w32pe.h index 05a41dc2..9f3d2233 100644 --- a/src/p_w32pe.h +++ b/src/p_w32pe.h @@ -47,7 +47,7 @@ class PackW32Pe : public Packer public: PackW32Pe(InputFile *f); ~PackW32Pe(); - virtual int getVersion() const { return 12; } + virtual int getVersion() const { return 13; } virtual int getFormat() const { return UPX_F_WIN32_PE; } virtual const char *getName() const { return isrtm ? "rtm32/pe" : "win32/pe"; } virtual const int *getCompressionMethods(int method, int level) const; diff --git a/src/p_wcle.h b/src/p_wcle.h index 04331768..58cf4fc5 100644 --- a/src/p_wcle.h +++ b/src/p_wcle.h @@ -39,7 +39,7 @@ class PackWcle : public Packer, public LeFile typedef Packer super; public: PackWcle(InputFile *f) : super(f), LeFile(f){}; - virtual int getVersion() const { return 12; } + virtual int getVersion() const { return 13; } virtual int getFormat() const { return UPX_F_WC_LE; } virtual const char *getName() const { return "watcom/le"; } virtual const int *getCompressionMethods(int method, int level) const; diff --git a/src/packer.cpp b/src/packer.cpp index 8635994c..485fbb85 100644 --- a/src/packer.cpp +++ b/src/packer.cpp @@ -630,7 +630,7 @@ bool Packer::getPackHeader(void *b, int blen) #endif } if (!isValidCompressionMethod(ph.method)) - throwCantUnpack("unknown compression method"); + throwCantUnpack("unknown compression method (try a newer version of UPX)"); // Some formats might be able to unpack "subformats". Ask them. if (!testUnpackFormat(ph.format)) @@ -912,12 +912,12 @@ unsigned Packer::unoptimizeReloc32(upx_byte **in, upx_byte *image, /************************************************************************* -// compression method util [static] +// compression method util **************************************************************************/ bool Packer::isValidCompressionMethod(int method) { - return (method >= M_NRV2B_LE32 && method <= M_NRV2D_LE16); + return (method >= M_NRV2B_LE32 && method <= M_NRV2E_LE16); } diff --git a/src/packmast.cpp b/src/packmast.cpp index d89c455e..946be2b4 100644 --- a/src/packmast.cpp +++ b/src/packmast.cpp @@ -252,6 +252,7 @@ static void assertPacker(const Packer *p) assert(p->getFormat() <= 255); assert(p->getVersion() >= 11); assert(p->getVersion() < 255); + assert(p->getVersion() == 13); assert(strlen(p->getName()) <= 13); } diff --git a/src/s_djgpp2.cpp b/src/s_djgpp2.cpp index 68cc9cfd..1642e4f5 100644 --- a/src/s_djgpp2.cpp +++ b/src/s_djgpp2.cpp @@ -198,6 +198,7 @@ static void setCursor(screen_t *this, int x, int y) } +/* // I added ScreenGetCursor, because when upx prints something longer than // 1 line (an error message for example), the this->data->cursor_y can // have a bad value - ml1050 @@ -206,6 +207,7 @@ static void setCursor(screen_t *this, int x, int y) // Laszlo: when does this happen ? This probably indicates a // bug in c_screen.cpp(print0) I've introduced with // the 2 passes implementation. +*/ static void getCursor(const screen_t *this, int *x, int *y) {