JonathanSalwan/ROPgadget — pull request #50 by ephracis (2014-07-21 09:33:35+00:00)
Title: Add support for universal binaries

Add support to extract Mach-O binaries from Apple's Universal binaries (also known as Fat binaries). Specification available here: https://developer.apple.com/library/mac/documentation/developertools/conceptual/MachORuntime/Reference/reference.html#jumpTo_39

**Some caveats:**
The methods getEntryPoint, getArch and getArchMode will only return the corresponding value from the first binary inside the bundle. This is because ROPgadget currently expects to only work on a single binary file at a time. The methods getExecSections and getDataSections will however fetch the sections from all binaries in the bundle.

If ROPgadget is ever expanded to support working with multiple binaries, the UNIVERSAL class can easily be changed to instead return a list of entry points and so on.

The code has been tested on 64 bit Mac OS X 10.9 (Mavericks).