mirror of
https://github.com/sashs/Ropper
synced 2026-06-08 17:20:46 +00:00
Add support for Mach-O universal binaries.
If the detected file is a Mach-O fat file, the arch specified to Ropper will be selected from the slice of Mach-O images within the fat file. If no arch is specified, the first slice is used. Closes sashs/filebytes#9.
This commit is contained in:
+1
-1
Submodule filebytes updated: dafdbe6ab6...f95a315a8c
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user