1 |
grobian 08/09/08 10:13:58 |
2 |
|
3 |
Modified: pax-utils.docbook |
4 |
Added: scanmacho.docbook |
5 |
Log: |
6 |
Add scanmacho manpage |
7 |
|
8 |
Revision Changes Path |
9 |
1.2 pax-utils/man/pax-utils.docbook |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/man/pax-utils.docbook?rev=1.2&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/man/pax-utils.docbook?rev=1.2&content-type=text/plain |
13 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/man/pax-utils.docbook?r1=1.1&r2=1.2 |
14 |
|
15 |
Index: pax-utils.docbook |
16 |
=================================================================== |
17 |
RCS file: /var/cvsroot/gentoo-projects/pax-utils/man/pax-utils.docbook,v |
18 |
retrieving revision 1.1 |
19 |
retrieving revision 1.2 |
20 |
diff -u -r1.1 -r1.2 |
21 |
--- pax-utils.docbook 9 Jan 2007 23:49:32 -0000 1.1 |
22 |
+++ pax-utils.docbook 8 Sep 2008 10:13:57 -0000 1.2 |
23 |
@@ -8,9 +8,10 @@ |
24 |
|
25 |
<!ENTITY project "pax-utils"> |
26 |
|
27 |
- <!ENTITY dumpelf SYSTEM "dumpelf.docbook"> |
28 |
- <!ENTITY pspax SYSTEM "pspax.docbook"> |
29 |
- <!ENTITY scanelf SYSTEM "scanelf.docbook"> |
30 |
+ <!ENTITY dumpelf SYSTEM "dumpelf.docbook"> |
31 |
+ <!ENTITY pspax SYSTEM "pspax.docbook"> |
32 |
+ <!ENTITY scanelf SYSTEM "scanelf.docbook"> |
33 |
+ <!ENTITY scanmacho SYSTEM "scanmacho.docbook"> |
34 |
]> |
35 |
|
36 |
<book id="pax-utils" lang="en"> |
37 |
@@ -31,6 +32,12 @@ |
38 |
<authorblurb><para>Maintainer</para></authorblurb> |
39 |
<email>vapier@g.o</email> |
40 |
</author> |
41 |
+ <author> |
42 |
+ <firstname>Fabian</firstname> |
43 |
+ <surname>Groffen</surname> |
44 |
+ <authorblurb><para>Mach-O Maintainer</para></authorblurb> |
45 |
+ <email>grobian@g.o</email> |
46 |
+ </author> |
47 |
</authorgroup> |
48 |
|
49 |
&version; |
50 |
@@ -40,5 +47,6 @@ |
51 |
&dumpelf; |
52 |
&pspax; |
53 |
&scanelf; |
54 |
+&scanmacho; |
55 |
|
56 |
</book> |
57 |
|
58 |
|
59 |
|
60 |
1.1 pax-utils/man/scanmacho.docbook |
61 |
|
62 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/man/scanmacho.docbook?rev=1.1&view=markup |
63 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/man/scanmacho.docbook?rev=1.1&content-type=text/plain |
64 |
|
65 |
Index: scanmacho.docbook |
66 |
=================================================================== |
67 |
<chapter> |
68 |
<refentry id='scanmacho.1'> |
69 |
|
70 |
<refmeta> |
71 |
<refentrytitle>scanmacho</refentrytitle> |
72 |
<manvolnum>1</manvolnum> |
73 |
<refmiscinfo class='source'>&project;</refmiscinfo> |
74 |
</refmeta> |
75 |
|
76 |
<refnamediv id='name'> |
77 |
<refname>scanmacho</refname> |
78 |
<refpurpose>user-space utility to scan Mach-O files</refpurpose> |
79 |
</refnamediv> |
80 |
|
81 |
<refsynopsisdiv id='synopsis'> |
82 |
<cmdsynopsis> |
83 |
<command>scanmacho</command> |
84 |
<arg choice='opt'> |
85 |
<replaceable>options</replaceable> |
86 |
</arg> |
87 |
<arg choice='plain'> |
88 |
<replaceable>Mach-Os</replaceable> |
89 |
or |
90 |
<replaceable>directories</replaceable> |
91 |
</arg> |
92 |
</cmdsynopsis> |
93 |
</refsynopsisdiv> |
94 |
|
95 |
<refsect1 id='description'> |
96 |
<title>DESCRIPTION</title> |
97 |
<para> |
98 |
<command>scanmacho</command> is a user-space utility to quickly scan given |
99 |
Mach-Os, directories, or common system paths for different information. This |
100 |
may include Mach-O types, their install_names, etc... |
101 |
</para> |
102 |
<para> |
103 |
Because Mach-O files can be "fat", it is possible for a single file |
104 |
to return multiple lines. Each line represents a single architecture, |
105 |
contained in the fat (universal) file. While there are no real |
106 |
restrictions, in practice, the entries can be distinguished by their |
107 |
arch type, e.g. ppc, ppc64, i386, x86_64, arm, ... |
108 |
</para> |
109 |
</refsect1> |
110 |
|
111 |
<refsect1 id='options'> |
112 |
<title>OPTIONS</title> |
113 |
<variablelist> |
114 |
<varlistentry> |
115 |
<term><option>-A</option>, <option>--archives</option></term> |
116 |
<listitem><para>Scan archives (.a files)</para></listitem> |
117 |
</varlistentry> |
118 |
<varlistentry> |
119 |
<term><option>-a</option>, <option>--all</option></term> |
120 |
<listitem><para>Print all scanned info (<option>-F"%o %O %D %b %F"</option>)</para></listitem> |
121 |
</varlistentry> |
122 |
<varlistentry> |
123 |
<term><option>-B</option>, <option>--banner</option></term> |
124 |
<listitem><para>Don't display the header</para></listitem> |
125 |
</varlistentry> |
126 |
<varlistentry> |
127 |
<term><option>-b</option>, <option>--bind</option></term> |
128 |
<listitem><para>Print flags from mach_header</para></listitem> |
129 |
</varlistentry> |
130 |
<varlistentry> |
131 |
<term><option>-E</option>, <option>--etype</option> <replaceable>filetype</replaceable></term> |
132 |
<listitem><para>Print only Mach-O files matching specified etype (like MH_EXECUTABLE, MH_DYLIB, etc...)</para></listitem> |
133 |
</varlistentry> |
134 |
<varlistentry> |
135 |
<term><option>-F</option>, <option>--format</option> <replaceable>FORMAT</replaceable></term> |
136 |
<listitem><para>Use specified format for output; see the <emphasis remap='B'>FORMAT</emphasis> section</para></listitem> |
137 |
</varlistentry> |
138 |
<varlistentry> |
139 |
<term><option>-f</option>, <option>--from</option> <replaceable>FILE</replaceable></term> |
140 |
<listitem><para>Read input stream from specified filename</para></listitem> |
141 |
</varlistentry> |
142 |
<varlistentry> |
143 |
<term><option>-g</option>, <option>--gmatch</option></term> |
144 |
<listitem><para>Use strncmp to match libraries (use with <option>-N</option>). Or regexp with symbol matching</para></listitem> |
145 |
</varlistentry> |
146 |
<varlistentry> |
147 |
<term><option>-h</option>, <option>--help</option></term> |
148 |
<listitem><para>Show condensed usage and exit</para></listitem> |
149 |
</varlistentry> |
150 |
<varlistentry> |
151 |
<term><option>-i</option>, <option>--interp</option></term> |
152 |
<listitem><para>Print LC_LOAD_DYLINKER information</para></listitem> |
153 |
</varlistentry> |
154 |
|
155 |
<varlistentry> |
156 |
<term><option>-M</option>, <option>--bits</option> <replaceable>BITS</replaceable></term> |
157 |
<listitem><para>Print only Mach-O files matching specified numeric bits (like 32/64)</para></listitem> |
158 |
</varlistentry> |
159 |
<varlistentry> |
160 |
<term><option>-D</option>, <option>--endian</option> </term> |
161 |
<listitem><para>Print Endianness</para></listitem> |
162 |
</varlistentry> |
163 |
<varlistentry> |
164 |
<term><option>-O</option>, <option>--perms</option> <replaceable>PERMS</replaceable></term> |
165 |
<listitem><para>Print only Mach-O files with matching specified octal bits (like 755)</para></listitem> |
166 |
</varlistentry> |
167 |
<varlistentry> |
168 |
<term><option>-Z</option>, <option>--size</option> <replaceable>SIZE</replaceable></term> |
169 |
<listitem><para>Print Mach-O file size</para></listitem> |
170 |
</varlistentry> |
171 |
<varlistentry> |
172 |
<term><option>-m</option>, <option>--mount</option></term> |
173 |
<listitem><para>Don't recursively cross mount points</para></listitem> |
174 |
</varlistentry> |
175 |
<varlistentry> |
176 |
<term><option>-N</option>, <option>--lib</option> <replaceable>INSTALLNAME</replaceable></term> |
177 |
<listitem><para>Find Mach-Os that need the specified INSTALL_NAME</para></listitem> |
178 |
</varlistentry> |
179 |
<varlistentry> |
180 |
<term><option>-n</option>, <option>--needed</option></term> |
181 |
<listitem><para>Print LC_LOAD_DYLIB information</para></listitem> |
182 |
</varlistentry> |
183 |
<varlistentry> |
184 |
<term><option>-o</option>, <option>--file</option> <replaceable>FILE</replaceable></term> |
185 |
<listitem><para>Write output stream to specified filename</para></listitem> |
186 |
</varlistentry> |
187 |
<varlistentry> |
188 |
<term><option>-p</option>, <option>--path</option></term> |
189 |
<listitem><para>Scan all directories in PATH environment</para></listitem> |
190 |
</varlistentry> |
191 |
<varlistentry> |
192 |
<term><option>-q</option>, <option>--quiet</option></term> |
193 |
<listitem><para>Only output 'bad' things.</para></listitem> |
194 |
</varlistentry> |
195 |
<varlistentry> |
196 |
<term><option>-R</option>, <option>--recursive</option></term> |
197 |
<listitem><para>Scan directories recursively</para></listitem> |
198 |
</varlistentry> |
199 |
<varlistentry> |
200 |
<term><option>-S</option>, <option>--soname</option></term> |
201 |
<listitem><para>Print install_name information</para></listitem> |
202 |
</varlistentry> |
203 |
<varlistentry> |
204 |
<term><option>-V</option>, <option>--version</option></term> |
205 |
<listitem><para>Print version and exit</para></listitem> |
206 |
</varlistentry> |
207 |
<varlistentry> |
208 |
<term><option>-v</option>, <option>--verbose</option></term> |
209 |
<listitem><para>Be verbose (can be used more than once)</para></listitem> |
210 |
</varlistentry> |
211 |
<varlistentry> |
212 |
<term><option>-y</option>, <option>--symlink</option></term> |
213 |
<listitem><para>Don't scan symlinks</para></listitem> |
214 |
</varlistentry> |
215 |
</variablelist> |
216 |
</refsect1> |
217 |
|
218 |
<refsect1 id='format'> |
219 |
<title>FORMAT</title> |
220 |
<para> |
221 |
The format string is much like a printf string in that it is a literal string |
222 |
with flags requesting different information. For example, you could use |
223 |
a format string and expect the following results. |
224 |
</para> |
225 |
<programlisting> |
226 |
# <command>scanmacho</command> <option>-BF</option> 'file %f needs %n; funky time!' /bin/bash |
227 |
file bash needs /usr/lib/libncurses.5.4.dylib,/usr/lib/libSystem.B.dylib; funky time! |
228 |
</programlisting> |
229 |
<para> |
230 |
Note that when you use a format string, generally information related flags |
231 |
should be omitted. In other words, you do not want to try and request NEEDED |
232 |
output (<option>-n</option>) and try to specify a format output at the sametime |
233 |
as these operations are mutually exclusive. Each information related flag has |
234 |
an equivalent conversion specifier, so use those instead. You can of course |
235 |
continue to use non-information related flags (such as <option>--verbose</option>). |
236 |
</para> |
237 |
<para> |
238 |
There are three characters that introduce conversion specifiers. |
239 |
<itemizedlist> |
240 |
<listitem><para><emphasis remap='B'>%</emphasis> - replace with info</para></listitem> |
241 |
<listitem><para><emphasis remap='B'>#</emphasis> - silent boolean match</para></listitem> |
242 |
<listitem><para><emphasis remap='B'>+</emphasis> - verbose match</para></listitem> |
243 |
</itemizedlist> |
244 |
</para> |
245 |
<para> |
246 |
And there are a number of conversion specifiers. We try to match up the |
247 |
specifier with corresponding option. |
248 |
<itemizedlist> |
249 |
<listitem><para><emphasis remap='B'>a</emphasis> - arch type</para></listitem> |
250 |
<listitem><para><emphasis remap='B'>b</emphasis> - mach_header flags</para></listitem> |
251 |
<listitem><para><emphasis remap='B'>D</emphasis> - endian</para></listitem> |
252 |
<listitem><para><emphasis remap='B'>F</emphasis> - long filename</para></listitem> |
253 |
<listitem><para><emphasis remap='B'>f</emphasis> - short filename</para></listitem> |
254 |
<listitem><para><emphasis remap='B'>i</emphasis> - dyld</para></listitem> |
255 |
<listitem><para><emphasis remap='B'>M</emphasis> - CPU_TYPE class</para></listitem> |
256 |
<listitem><para><emphasis remap='B'>N</emphasis> - specified needed</para></listitem> |
257 |
<listitem><para><emphasis remap='B'>n</emphasis> - needed libraries</para></listitem> |
258 |
<listitem><para><emphasis remap='B'>p</emphasis> - filename (minus search)</para></listitem> |
259 |
<listitem><para><emphasis remap='B'>o</emphasis> - mh_type</para></listitem> |
260 |
<listitem><para><emphasis remap='B'>O</emphasis> - perms</para></listitem> |
261 |
<listitem><para><emphasis remap='B'>S</emphasis> - install_name</para></listitem> |
262 |
</itemizedlist> |
263 |
</para> |
264 |
</refsect1> |
265 |
|
266 |
<refsect1 id='Mach-O-types'> |
267 |
<title>MACH-O FILETYPES</title> |
268 |
<para> |
269 |
You can narrow your search by specifying the Mach-O object file type. |
270 |
The commandline option takes the symbolic type name. |
271 |
Multiple values can be passed comma separated. Example -E MH_EXECUTABLE,MH_DYLIB |
272 |
</para> |
273 |
<para> |
274 |
Here is the normal list available for your pleasure. |
275 |
<itemizedlist> |
276 |
<listitem><para><emphasis remap='B'>MH_OBJECT</emphasis> - intermediate object file (.o)</para></listitem> |
277 |
<listitem><para><emphasis remap='B'>MH_EXECUTE</emphasis> - standard executable program</para></listitem> |
278 |
<listitem><para><emphasis remap='B'>MH_BUNDLE</emphasis> - dlopen plugin (.bundle)</para></listitem> |
279 |
<listitem><para><emphasis remap='B'>MH_DYLIB</emphasis> - dynamic shared library (.dylib)</para></listitem> |
280 |
<listitem><para><emphasis remap='B'>MH_PRELOAD</emphasis> - executable not loaded by Mac OS X kernel (ROM)</para></listitem> |
281 |
<listitem><para><emphasis remap='B'>MH_CORE</emphasis> - program crash core file</para></listitem> |
282 |
<listitem><para><emphasis remap='B'>MH_DYLINKER</emphasis> - dynamic linker shared library (dyld)</para></listitem> |
283 |
<listitem><para><emphasis remap='B'>MH_DYLIB_STUB</emphasis> - shared library stub for static only, no sections</para></listitem> |
284 |
<listitem><para><emphasis remap='B'>MH_DSYM</emphasis> - debug symbols file (in .dSYM dir)</para></listitem> |
285 |
</itemizedlist> |
286 |
</para> |
287 |
</refsect1> |
288 |
|
289 |
<refsect1 id='Mach-O-bits'> |
290 |
<title>MACH-O BITS</title> |
291 |
<para> |
292 |
You can also narrow your search by specifying the Mach-O bitsize. Specify |
293 |
the numeric value. |
294 |
<itemizedlist> |
295 |
<listitem><para><emphasis remap='B'>32</emphasis> - 32bit mach_header</para></listitem> |
296 |
<listitem><para><emphasis remap='B'>64</emphasis> - 64bit mach_header_64</para></listitem> |
297 |
</itemizedlist> |
298 |
</para> |
299 |
</refsect1> |
300 |
|
301 |
&reftail; |
302 |
|
303 |
</refentry> |
304 |
</chapter> |