From ba4a686d1c17342077f088d86e6353001ea66fa8 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Tue, 21 Nov 2006 18:42:38 +0100 Subject: [PATCH] Fix endian issue in execve formats. --- src/p_lx_exc.cpp | 4 ++-- src/p_lx_exc.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/p_lx_exc.cpp b/src/p_lx_exc.cpp index e85b5ccd..f15a289a 100644 --- a/src/p_lx_exc.cpp +++ b/src/p_lx_exc.cpp @@ -450,7 +450,7 @@ int PackLinuxI386::getLoaderPrefixSize() const **************************************************************************/ // basic check of an Linux ELF Ehdr -int PackLinuxI386::checkEhdr(const Elf32_Ehdr *ehdr) const +int PackLinuxI386::checkEhdr(const Elf_LE32_Ehdr *ehdr) const { const unsigned char * const buf = ehdr->e_ident; @@ -500,7 +500,7 @@ bool PackLinuxI386::canPack() if (exetype != 0) return super::canPack(); - Elf32_Ehdr ehdr; + Elf_LE32_Ehdr ehdr; unsigned char *buf = ehdr.e_ident; fi->seek(0, SEEK_SET); diff --git a/src/p_lx_exc.h b/src/p_lx_exc.h index 1c88c0ee..31953aeb 100644 --- a/src/p_lx_exc.h +++ b/src/p_lx_exc.h @@ -78,7 +78,7 @@ protected: virtual void updateLoader(OutputFile *); // ELF util - virtual int checkEhdr(const Elf32_Ehdr *ehdr) const; + virtual int checkEhdr(const Elf_LE32_Ehdr *ehdr) const; enum { UPX_ELF_MAGIC = 0x5850557f // "\x7fUPX"