5 :man manual: The Netwide Assembler Project
9 ndisasm - the Netwide Disassembler, an 80x86 binary file disassembler
13 *ndisasm* [ *-o* origin ] [ *-s* sync-point [...]] [ *-a* | *-i* ]
14 [ *-b* bits ] [ *-u* ] [ *-e* hdrlen ] [ *-p* vendor ]
15 [ *-k* offset,length [...]] infile
19 The *ndisasm* command generates a disassembly listing of the binary file
20 infile and directs it to stdout.
25 Causes *ndisasm* to exit immediately, after giving a summary
26 of its invocation options.
29 Causes *ndisasm* to exit immediately, after displaying its
33 Specifies the notional load address for the file. This
34 option causes *ndisasm* to get the addresses it lists
35 down the left hand margin, and the target addresses
36 of PC-relative jumps and calls, right.
39 Manually specifies a synchronisation address, such that
40 *ndisasm* will not output any machine instruction which
41 encompasses bytes on both sides of the address. Hence
42 the instruction which starts at that address will be
43 correctly disassembled.
46 Specifies a number of bytes to discard from the beginning
47 of the file before starting disassembly. This does not
48 count towards the calculation of the disassembly offset:
49 the first 'disassembled' instruction will be shown starting
50 at the given load address.
52 *-k* 'offset,length'::
53 Specifies that 'length' bytes, starting from disassembly
54 offset 'offset', should be skipped over without generating
55 any output. The skipped bytes still count towards the
56 calculation of the disassembly offset.
59 Enables automatic (or intelligent) sync mode, in which
60 *ndisasm* will attempt to guess where synchronisation should
61 be performed, by means of examining the target addresses
62 of the relative jumps and calls it disassembles.
65 Specifies 16-, 32- or 64-bit mode. The default is 16-bit
69 Specifies 32-bit mode, more compactly than using `-b 32'.
72 Prefers instructions as defined by 'vendor' in case of
73 a conflict. Known 'vendor' names include *intel*, *amd*,
74 *cyrix*, and *idt*. The default is *intel*.
78 *ndisasm* only disassembles binary files: it has no understanding of
79 the header information present in object or executable files.
80 If you want to disassemble an object file, you should probably
81 be using *objdump*(1).
83 Auto-sync mode won't necessarily cure all your synchronisation
84 problems: a sync marker can only be placed automatically if a
85 jump or call instruction is found to refer to it 'before'
86 *ndisasm* actually disassembles that part of the code. Also,
87 if spurious jumps or calls result from disassembling
88 non-machine-code data, sync markers may get placed in strange
89 places. Feel free to turn auto-sync off and go back to doing
90 it manually if necessary.