From df19f0d5ec258307b3ef1214f2639f19cc62c20d Mon Sep 17 00:00:00 2001 From: John Reiser Date: Sat, 24 Sep 2016 09:15:10 -0700 Subject: [PATCH] Try harder to decompress Mach-O I386, too. modified: p_mach.cpp modified: p_mach.h --- src/p_mach.cpp | 6 ++++++ src/p_mach.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/p_mach.cpp b/src/p_mach.cpp index 75852970..feb94932 100644 --- a/src/p_mach.cpp +++ b/src/p_mach.cpp @@ -1938,6 +1938,12 @@ upx_uint64_t PackMachBase::getEntryVMA(Mach_command const *ptr) return ptr->cmd; // FIXME must be specialized } +upx_uint64_t PackMachI386::getEntryVMA(Mach_command const *ptr) +{ + Mach_thread_command const *tc = (Mach_thread_command const *)ptr; + return tc->state.eip; +} + upx_uint64_t PackMachAMD64::getEntryVMA(Mach_command const *ptr) { Mach_thread_command const *tc = (Mach_thread_command const *)ptr; diff --git a/src/p_mach.h b/src/p_mach.h index edd43150..674ad7a8 100644 --- a/src/p_mach.h +++ b/src/p_mach.h @@ -875,6 +875,7 @@ protected: virtual Linker* newLinker() const; virtual void buildLoader(const Filter *ft); virtual void addStubEntrySections(Filter const *); + virtual upx_uint64_t getEntryVMA(Mach_command const *); __packed_struct(Mach_thread_command) LE32 cmd; /* LC_THREAD or LC_UNIXTHREAD */