1SCANMACHO(1) Documentation for pax-utils SCANMACHO(1)
2
3
4
6 scanmacho - user-space utility to scan Mach-O files
7
9 scanmacho [options] Mach-Os or directories
10
12 scanmacho is a user-space utility to quickly scan given Mach-Os,
13 directories, or common system paths for different information. This may
14 include Mach-O types, their install_names, etc...
15
16 Because Mach-O files can be "fat", it is possible for a single file to
17 return multiple lines. Each line represents a single architecture,
18 contained in the fat (universal) file. While there are no real
19 restrictions, in practice, the entries can be distinguished by their
20 arch type, e.g. ppc, ppc64, i386, x86_64, arm, ...
21
23 -A, --archives
24 Scan archives (.a files)
25
26 -a, --all
27 Print all useful/simple info
28
29 -B, --nobanner
30 Don´t display the header
31
32 -b, --bind
33 Print flags from mach_header
34
35 -D, --endian
36 Print Mach-O endianness
37
38 -E, --etype filetype
39 Print only Mach-O files matching specified etype (like
40 MH_EXECUTABLE, MH_DYLIB, etc...)
41
42 -F, --format FORMAT
43 Use specified format for output; see the FORMAT section for more
44 information.
45
46 -f, --from FILE
47 Read input stream from specified filename
48
49 -g, --gmatch
50 Use strncmp to match libraries (use with -N). Or regexp with symbol
51 matching
52
53 -h, --help
54 Show condensed usage and exit
55
56 -i, --interp
57 Print the interpreter information (LC_LOAD_DYLINKER)
58
59 -M, --bits BITS
60 Print only Mach-O files matching specified numeric bits (like
61 32/64)
62
63 -m, --mount
64 Don´t recursively cross mount points
65
66 -N, --lib INSTALLNAME
67 Find Mach-Os that need the specified INSTALL_NAME
68
69 -n, --needed
70 Print libraries the Mach-O is linked against (LC_LOAD_DYLIB).
71
72 -O, --perms PERMS
73 Print only Mach-O files with matching specified octal bits (like
74 755).
75
76 -o, --file FILE
77 Write output stream to specified filename.
78
79 -p, --path
80 Scan all directories in PATH environment.
81
82 -q, --quiet
83 Only output ´bad´ things.
84
85 -R, --recursive
86 Scan directories recursively
87
88 -S, --soname
89 Print the Mach-O´s shared library name (install_name).
90
91 -V, --version
92 Print version and exit
93
94 -v, --verbose
95 Be verbose (can be used more than once)
96
97 -y, --symlink
98 Don´t scan symlinks
99
100 -Z, --size SIZE
101 Print Mach-O file size
102
104 The format string is much like a printf string in that it is a literal
105 string with flags requesting different information. For example, you
106 could use a format string and expect the following results.
107
108 # scanmacho -BF "file %f needs %n; funky time" /bin/bash
109 file bash needs /usr/lib/libncurses.5.4.dylib,/usr/lib/libSystem.B.dylib; funky time
110
111
112 Note that when you use a format string, generally information related
113 flags should be omitted. In other words, you do not want to try and
114 request NEEDED output (-n) and try to specify a format output at the
115 sametime as these operations are mutually exclusive. Each information
116 related flag has an equivalent conversion specifier, so use those
117 instead. You can of course continue to use non-information related
118 flags (such as --verbose).
119
120 There are three characters that introduce conversion specifiers.
121
122 · % - replace with info
123 · # - silent boolean match
124 · + - verbose match
125
126
127 And there are a number of conversion specifiers. We try to match up the
128 specifier with corresponding option.
129
130 · a - arch type
131 · b - mach_header flags
132 · D - endian
133 · F - long filename
134 · f - short filename
135 · i - dyld
136 · M - CPU_TYPE class
137 · N - specified needed
138 · n - needed libraries
139 · p - filename (minus search)
140 · o - mh_type
141 · O - perms
142 · S - install_name
143
144
146 You can narrow your search by specifying the Mach-O object file type.
147 The commandline option takes the symbolic type name. Multiple values
148 can be passed comma separated. Example -E MH_EXECUTE,MH_DYLIB
149
150 Here is the normal list available for your pleasure.
151
152 · MH_OBJECT - intermediate object file (.o)
153 · MH_EXECUTE - standard executable program
154 · MH_BUNDLE - dlopen plugin (.bundle)
155 · MH_DYLIB - dynamic shared library (.dylib)
156 · MH_PRELOAD - executable not loaded by Mac OS X kernel (ROM)
157 · MH_CORE - program crash core file
158 · MH_DYLINKER - dynamic linker shared library (dyld)
159 · MH_DYLIB_STUB - shared library stub for static only, no sections
160 · MH_DSYM - debug symbols file (in .dSYM dir)
161
162
164 You can also narrow your search by specifying the Mach-O bitsize.
165 Specify the numeric value.
166
167 · 32 - 32bit mach_header
168 · 64 - 64bit mach_header_64
169
170
172 http://hardened.gentoo.org/pax-utils.xml
173
175 Please include as much information as possible (using any available
176 debugging options) and send bug reports to the maintainers (see the
177 AUTHORS section). Please use the Gentoo bugzilla at
178 http://bugs.gentoo.org/ if possible.
179
181 chpax(1), dumpelf(1), paxctl(1), pspax(1), readelf(1), scanelf(1)
182
184 Ned Ludd <solar@gentoo.org>
185 Maintainer
186
187 Mike Frysinger <vapier@gentoo.org>
188 Maintainer
189
190 Fabian Groffen <grobian@gentoo.org>
191 Mach-O Maintainer
192
194 1. http://hardened.gentoo.org/pax-utils.xml
195
196 2. http://bugs.gentoo.org/
197
198
199
200pax-utils 0.2.1 02/14/2010 SCANMACHO(1)