Skip to content
/ xd Public

an enhanced hex dump utility, like "od -x" but print the printable characters

License

MIT, GPL-2.0 licenses found

Licenses found

MIT
LICENSE.txt
GPL-2.0
COPYING
Notifications You must be signed in to change notification settings

lueckenhoff/xd

Repository files navigation

xd - hex dumper Build Status

xd is a simple command-line hex dump program. It lists 16 bytes per line, in hex and in ASCII. (unprintable characters are simply shown as ".")

Usage

It can handle one or multiple files as arguments. If no arguments are given, it reads from STDIN.

Sample output below comes from running xd on a binary file (the Google Chrome browser .EXE file). A couple of points:

  1. offsets are given in hex
  2. repeated lines are compressed (as in offset 2c0--400 below)
  3. for big files, piping xd output to less, or head, or tail is advisable.

$ xd chrome.exe
000000 4d5a 9000 0300 0000 0400 0000 ffff 0000    MZ..............
000010 b800 0000 0000 0000 4000 0000 0000 0000    ........@.......
000020 0000 0000 0000 0000 0000 0000 0000 0000    ................
000030 0000 0000 0000 0000 0000 0000 f800 0000    ................
000040 0e1f ba0e 00b4 09cd 21b8 014c cd21 5468    ........!..L.!Th
000050 6973 2070 726f 6772 616d 2063 616e 6e6f    is program canno
000060 7420 6265 2072 756e 2069 6e20 444f 5320    t be run in DOS 
000070 6d6f 6465 2e0d 0d0a 2400 0000 0000 0000    mode....$.......
000080 4b0c 3184 0f6d 5fd7 0f6d 5fd7 0f6d 5fd7    K.1..m_..m_..m_.
000090 98a9 21d7 0e6d 5fd7 28ab 22d7 106d 5fd7    ..!..m_.(."..m_.
0000a0 28ab 31d7 4b6d 5fd7 28ab 32d7 b26d 5fd7    (.1.Km_.(.2..m_.
0000b0 28ab 24d7 006d 5fd7 0f6d 5ed7 fd6d 5fd7    (.$..m_..m^..m_.
0000c0 28ab 2dd7 ae6d 5fd7 28ab 25d7 0e6d 5fd7    (.-..m_.(.%..m_.
0000d0 28ab 23d7 0e6d 5fd7 28ab 27d7 0e6d 5fd7    (.#..m_.(.'..m_.
0000e0 5269 6368 0f6d 5fd7 0000 0000 0000 0000    Rich.m_.........
0000f0 0000 0000 0000 0000 5045 0000 4c01 0500    ........PE..L...
000100 14a5 b848 0000 0000 0000 0000 e000 0201    ...H............
000110 0b01 0800 0074 0300 0036 0600 0000 0000    .....t...6......
000120 ea29 0200 0010 0000 0090 0300 0000 4000    .)............@.
000130 0010 0000 0002 0000 0400 0000 0000 0000    ................
000140 0400 0000 0000 0000 0010 0a00 0004 0000    ................
000150 ec74 0a00 0200 4000 0000 1000 0010 0000    .t....@.........
000160 0000 1000 0010 0000 0000 0000 1000 0000    ................
000170 70f2 0800 4900 0000 9ce0 0800 7800 0000    p...I.......x...
000180 0050 0900 145f 0000 0000 0000 0000 0000    .P..._..........
000190 0000 0000 0000 0000 00b0 0900 5c3d 0000    ............\=..
0001a0 5093 0300 1c00 0000 0000 0000 0000 0000    P...............
0001b0 0000 0000 0000 0000 0000 0000 0000 0000    ................
0001c0 70d2 0800 4000 0000 0000 0000 0000 0000    p...@...........
0001d0 0090 0300 f802 0000 0000 0000 0000 0000    ................
0001e0 0000 0000 0000 0000 0000 0000 0000 0000    ................
0001f0 2e74 6578 7400 0000 6072 0300 0010 0000    .text...`r......
000200 0074 0300 0004 0000 0000 0000 0000 0000    .t..............
000210 0000 0000 2000 0060 2e72 6461 7461 0000    .... ..`.rdata..
000220 b962 0500 0090 0300 0064 0500 0078 0300    .b.......d...x..
000230 0000 0000 0000 0000 0000 0000 4000 0040    ............@..@
000240 2e64 6174 6100 0000 e849 0000 0000 0900    .data....I......
000250 0018 0000 00dc 0800 0000 0000 0000 0000    ................
000260 0000 0000 4000 00c0 2e72 7372 6300 0000    [email protected]...
000270 145f 0000 0050 0900 0060 0000 00f4 0800    ._...P...`......
000280 0000 0000 0000 0000 0000 0000 4000 0040    ............@..@
000290 2e72 656c 6f63 0000 f459 0000 00b0 0900    .reloc...Y......
0002a0 005a 0000 0054 0900 0000 0000 0000 0000    .Z...T..........
0002b0 0000 0000 4000 0042 0000 0000 0000 0000    [email protected]........
0002c0 0000 0000 0000 0000 0000 0000 0000 0000    ................
*
000400 8b41 04c3 a1e0 1749 0085 c074 0456 ffd0    .A.....I...t.V..
000410 598b 068b ceff 5008 56e8 6106 0200 59c3    Y.....P.V.a...Y.
000420 c351 e858 0602 0059 c3f6 4424 0401 568b    .Q.X...Y..D$..V.
:
:
<many, many lines of output truncated>
:
:

Credits

Created by: Bruce Lueckenhoff

Contributors: YOUR NAME HERE ?

I'd love to hear about any bugs/improvements/patches that you may have and will always credit people where appropriate. Thanks.

About

an enhanced hex dump utility, like "od -x" but print the printable characters

Topics

Resources

License

MIT, GPL-2.0 licenses found

Licenses found

MIT
LICENSE.txt
GPL-2.0
COPYING

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published