From 044f612feee5ba872cd84eeb52fc45d5f4dfd9f3 Mon Sep 17 00:00:00 2001 From: Christoffer Brodd-Reijer Date: Sun, 20 Jul 2014 21:35:28 +0200 Subject: [PATCH] Change binary.py to support the new universal binary format --- ropgadget/binary.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ropgadget/binary.py b/ropgadget/binary.py index f2dcc00..f2c1004 100644 --- a/ropgadget/binary.py +++ b/ropgadget/binary.py @@ -11,10 +11,11 @@ ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. -from loaders.elf import * -from loaders.pe import * -from loaders.raw import * -from loaders.macho import * +from loaders.elf import * +from loaders.pe import * +from loaders.raw import * +from loaders.macho import * +from loaders.universal import * class Binary: def __init__(self, options): @@ -36,6 +37,8 @@ class Binary: self.__binary = ELF(self.__rawBinary) elif self.__rawBinary[:2] == "4d5a".decode("hex"): self.__binary = PE(self.__rawBinary) + elif self.__rawBinary[:4] == "cafebabe".decode("hex"): + self.__binary = UNIVERSAL(self.__rawBinary) elif self.__rawBinary[:4] == "cefaedfe".decode("hex") or self.__rawBinary[:4] == "cffaedfe".decode("hex"): self.__binary = MACHO(self.__rawBinary) else: