ndisasm.txt 2.9 KB

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