Fix endian issue in execve formats.
This commit is contained in:
parent
4be3d79e12
commit
ba4a686d1c
@ -450,7 +450,7 @@ int PackLinuxI386::getLoaderPrefixSize() const
|
|||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
// basic check of an Linux ELF Ehdr
|
// 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;
|
const unsigned char * const buf = ehdr->e_ident;
|
||||||
|
|
||||||
@ -500,7 +500,7 @@ bool PackLinuxI386::canPack()
|
|||||||
if (exetype != 0)
|
if (exetype != 0)
|
||||||
return super::canPack();
|
return super::canPack();
|
||||||
|
|
||||||
Elf32_Ehdr ehdr;
|
Elf_LE32_Ehdr ehdr;
|
||||||
unsigned char *buf = ehdr.e_ident;
|
unsigned char *buf = ehdr.e_ident;
|
||||||
|
|
||||||
fi->seek(0, SEEK_SET);
|
fi->seek(0, SEEK_SET);
|
||||||
|
|||||||
@ -78,7 +78,7 @@ protected:
|
|||||||
virtual void updateLoader(OutputFile *);
|
virtual void updateLoader(OutputFile *);
|
||||||
|
|
||||||
// ELF util
|
// ELF util
|
||||||
virtual int checkEhdr(const Elf32_Ehdr *ehdr) const;
|
virtual int checkEhdr(const Elf_LE32_Ehdr *ehdr) const;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
UPX_ELF_MAGIC = 0x5850557f // "\x7fUPX"
|
UPX_ELF_MAGIC = 0x5850557f // "\x7fUPX"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user