diff --git a/filebytes b/filebytes index dafdbe6..f95a315 160000 --- a/filebytes +++ b/filebytes @@ -1 +1 @@ -Subproject commit dafdbe6ab642041bfdedd8d09676944e80e13ce2 +Subproject commit f95a315a8c0082dd6249d7d7a2e948653e6e268a diff --git a/ropper/loaders/mach_o.py b/ropper/loaders/mach_o.py index 24f59f4..f057f5a 100644 --- a/ropper/loaders/mach_o.py +++ b/ropper/loaders/mach_o.py @@ -98,7 +98,15 @@ class MachO(Loader): return {} def _loadFile(self, fileName, bytes=None): - return macho.MachO(fileName, bytes) + mf = macho.MachO(fileName, bytes) + if mf.isFat: + if not self._arch: + return mf.fatArches[0] + for arch in mf.fatArches: + if ARCH[arch.machHeader.header.cputype] == self._arch: + return arch + return mf + @classmethod def isSupportedFile(cls, fileName, bytes=None):