scanmacho
Because Mach-O files can be "fat", it is possible for a single file to return multiple lines. Each line represents a single architecture, contained in the fat (universal) file. While there are no real restrictions, in practice, the entries can be distinguished by their arch type, e.g. ppc, ppc64, i386, x86_64, arm, ...
-A, --archives
-a, --all
-B, --nobanner
-b, --bind
-D, --endian
-E, --etype filetype
-F, --format FORMAT
-f, --from FILE
-g, --gmatch
-h, --help
-i, --interp
-M, --bits BITS
-m, --mount
-N, --lib INSTALLNAME
-n, --needed
-O, --perms PERMS
-o, --file FILE
-p, --path
-q, --quiet
-R, --recursive
-r, --rpath
-S, --soname
-V, --version
-v, --verbose
-y, --symlink
-Z, --size SIZE
The format string is much like a printf string in that it is a literal string with flags requesting different information. For example, you could use a format string and expect the following results.
# scanmacho -BF "file %f needs %n; funky time" /bin/bash file bash needs /usr/lib/libncurses.5.4.dylib,/usr/lib/libSystem.B.dylib; funky time
Note that when you use a format string, generally information related flags should be omitted. In other words, you do not want to try and request NEEDED output (-n) and try to specify a format output at the same time as these operations are mutually exclusive. Each information related flag has an equivalent conversion specifier, so use those instead. You can of course continue to use non-information related flags (such as --verbose).
There are three characters that introduce conversion specifiers.
• % - replace with info
And there are a number of conversion specifiers. We try to match up the specifier with corresponding option.
• a - arch type
You can narrow your search by specifying the Mach-O object file type. The commandline option takes the symbolic type name. Multiple values can be passed comma separated. Example -E MH_EXECUTE,MH_DYLIB
Here is the normal list available for your pleasure.
• MH_OBJECT - intermediate object file (.o)
You can also narrow your search by specifying the Mach-O bitsize. Specify the numeric value.
• 32 - 32bit mach_header
m[blue]http://hardened.gentoo.org/pax-utils.xmlm[]
Please include as much information as possible (using any available debugging options) and send bug reports to the maintainers (see the AUTHORS section). Please use the Gentoo bugzilla at m[blue]http://bugs.gentoo.org/m[] if possible.
chpax(1), dumpelf(1), paxctl(1), pspax(1), readelf(1), scanelf(1), elf(5)
Ned Ludd <solar@gentoo.org>
Mike Frysinger <vapier@gentoo.org>
Fabian Groffen <grobian@gentoo.org>