(mm) Hex and octal dumper
Search | Home | Software | Count
Software:
X/Motif
  ansi xterm
  grabc
  mdgclock
  miv
  mplaymidi
  mppp
  mxascii
  mcmap
  mxcmap
  mxconsole
  mxkill
  mxshowfont
  qtip
  xmastm
  yrolo
Web
  mhttpd
  web counter
  upload.pl
  TimeTrack.pl
  mod_auth_ldap
Games
  fltkmm
Java
   cdcl
   jdgclock
Libraries
  libcalen
  libmcfg
  libsll
  libmsock
Misc
  bangla font
  dpr
  genmake
  hod
  smtp.pl
  vhtml
  phones_ldap
  showpic_ldap
  mbasecalc
  fluid_hack
  kdialppp
MS Windows
  mwinclip.pl
  mbasecalc
  mailsend
  wiv
hod v1.6
(hexadeciman and octal data dumper)
by
Muhammad A Muquit
Released: Jul-17-1995
Last Updated (ChangeLog): Jun-25-2006

Hod is a nice little hexadecimal and octal data dumper. Originally I wrote it because I didn't like the ugly output of od. For the things I do for living, this little program is Indispensable. You might find it useful as well.

$ hod -h
usage: hod [options] 
Where the options are:
 -v      : show version information
 -h      : show this help
 -o      : dump in octal
 -8      : show as block of 8 bytes
 -x str  : convert a hex input to decimal
 -d      : show offsets in decimal
 -s      : show identical output lines
 -r      : reverse hod hexdump to binary
 -w      : reverse regular hex bytes to binary

If no filename specified, it will read from stdin

Example:
$ hod file
$ hod < file
$ cat file | hod
$ cat file | hod -
$ hod < file 
$ hod -o file
$ echo "hello" | hod
$ echo -n "hello" | hod
$ hod -x 1c0
1c0 : 448
$ echo "0a 01 ff ef 0b" | hod -w > bin.bin
$ hod bin.bin | hod -r > bin_again.bin

Note: -r and -w works with hexadecimal only.

Example (hex dump)

$ hod foo.bin
          0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f   0123456789abcdef
       0: 0c d6 9a aa 49 43 63 c2 d4 ce 6d 5a 75 e0 7f da  ....ICc...mZu...
      10: aa 9c 9a 69 5b 8d 1e 2a fd 32 34 b5 b1 2e 57 b7  ...i[..*.24...W.
      20: 20 6e 41 c3 dc 90 fc 4c ef 88 d7 22 f4 77 fb 0c   nA....L...".w..
      30: a9 fd 20 a7 b4 b5 9b 9b f3 f0 90 2c ca c9 73 ad  .. ........,..s.
      40: b3 da 6d 5a f7 e3 af 4d df 35 2e 7c 53 54 d7 4e  ..mZ...M.5.|ST.N
      50: 5d d7 74 ec ea ef b5 ff 8d 61 ef 4f 59 e2 51 50  ].t......a.OY.QP
      60: 39 b8 cd e6 13 3d ee dc f1 dd 33 b6 9e 5b f1 ca  9....=....3..[..
      70: 88 1a 2f b6 ea d9 2b 3b 7f c5 07 af 67 2f 5b d6  ../...+;....g/[.
      80: d4 f9 69 95 6a c7 8a a0 39 2a 7e 70 fe 1b 40 f4  ..i.j...9*~p..@.
      90: 06 3d 86 10 2e 00                                .=....          


To see the offset in decimal:
$ hod -d foo.bin
          0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f   0123456789abcdef
       0: 0c d6 9a aa 49 43 63 c2 d4 ce 6d 5a 75 e0 7f da  ....ICc...mZu...
      16: aa 9c 9a 69 5b 8d 1e 2a fd 32 34 b5 b1 2e 57 b7  ...i[..*.24...W.
      32: 20 6e 41 c3 dc 90 fc 4c ef 88 d7 22 f4 77 fb 0c   nA....L...".w..
      48: a9 fd 20 a7 b4 b5 9b 9b f3 f0 90 2c ca c9 73 ad  .. ........,..s.
      64: b3 da 6d 5a f7 e3 af 4d df 35 2e 7c 53 54 d7 4e  ..mZ...M.5.|ST.N
      80: 5d d7 74 ec ea ef b5 ff 8d 61 ef 4f 59 e2 51 50  ].t......a.OY.QP
      96: 39 b8 cd e6 13 3d ee dc f1 dd 33 b6 9e 5b f1 ca  9....=....3..[..
     112: 88 1a 2f b6 ea d9 2b 3b 7f c5 07 af 67 2f 5b d6  ../...+;....g/[.
     128: d4 f9 69 95 6a c7 8a a0 39 2a 7e 70 fe 1b 40 f4  ..i.j...9*~p..@.
     144: 06 3d 86 10 2e 00                                .=....          

$ hod -o README
          0   1   2   3   4   5   6   7    01234567
       0: 014 326 232 252 111 103 143 302  ....ICc.
      10: 324 316 155 132 165 340 177 332  ..mZu...
      20: 252 234 232 151 133 215 036 052  ...i[..*
      30: 375 062 064 265 261 056 127 267  .24...W.
      40: 040 156 101 303 334 220 374 114   nA....L
      50: 357 210 327 042 364 167 373 014  ...".w..
      60: 251 375 040 247 264 265 233 233  .. .....
      70: 363 360 220 054 312 311 163 255  ...,..s.
     100: 263 332 155 132 367 343 257 115  ..mZ...M
     110: 337 065 056 174 123 124 327 116  .5.|ST.N
     120: 135 327 164 354 352 357 265 377  ].t.....
     130: 215 141 357 117 131 342 121 120  .a.OY.QP
     140: 071 270 315 346 023 075 356 334  9....=..
     150: 361 335 063 266 236 133 361 312  ..3..[..
     160: 210 032 057 266 352 331 053 073  ../...+;
     170: 177 305 007 257 147 057 133 326  ....g/[.
     200: 324 371 151 225 152 307 212 240  ..i.j...
     210: 071 052 176 160 376 033 100 364  9*~p..@.
     220: 006 075 206 020 056 000          .=....  

$ hod x.db
          0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f   0123456789abcdef
       0: 00 06 15 61 00 00 00 02 00 00 04 d2 00 00 10 00  ...a............
      10: 00 00 00 0c 00 00 01 00 00 00 01 00 00 00 00 08  ................
      20: 00 00 00 01 00 00 00 02 00 00 00 01 00 00 00 03  ................
      30: 00 00 00 01 00 01 00 00 00 00 00 02 00 00 00 01  ................
      40: 95 6e 7d e3 00 00 00 00 00 00 00 02 00 00 00 02  .n}.............
      50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
       *
      c0: 00 00 00 00 08 01 00 00 00 00 00 00 00 00 00 00  ................
      d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
       *
    1000: 04 00 f9 0f f8 0f ed 0f dd 0f cf 0f dd 0f ff ff  ................
    1010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
       *
    1fd0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff 27 27  ..............''
    1fe0: 9b 65 b7 4b b4 fc 90 2e db 8c 11 f4 6c 67 6c 6f  .e.K........lglo
    1ff0: 62 61 6c 2d 73 61 6c 74 03 56 65 72 73 69 6f 6e  bal-salt.Version
    2000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
       *
    3000: fd ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
    3010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
       *
Here, * indicates identical lines. To show identical lines use the flag -s

Sometimes you need to find out the offset in a file. Use the -x flag to convert a hex number to decimal. For example, in the hexdump above,

    $ hod -x 40
    40: 64
The offset it at 64 bytes. If you add 2 bytes to it, it's the size of the file. Or you can use the flag -d to show the offset in decimal (available in v1.5+).

Download

Source
File: hod1.6.tar.gz
Size: 4800 bytes
MD5 Checksum: feb24d1da5e7fbc973e0e8f4baefd669
Last updated: Jun-25-2006

Compiled binary for MS Windows
File: hod.exe.zip
Size: 17822 bytes
MD5 Checksum: 5af2a33eea8f3ceb698997afb1a57a31
Last updated: Jun-25-2006

Compiled binary for SimpleTech SimpleShare NAS
File: hod_ss
Size: 14148 bytes
MD5 Checksum: fcd47c42e7ab772af7c6621fc37990f6
Last updated: Jun-08-2007

ChangeLog

    v1.6
  • In windows under cygin stdout was not binary, so reverse hexdump was getting corrupted. Thanks to Sebastien Trottier.
    (Jun-25-2006)

    v1.5

  • In Windows files were opened in text mode, which caused truncated dump sometimes. Thanks to Alec Devlin for reporting the bug.
    (Sep-06-2004).

  • A new flag -d is added to show the offset in decimal.
    (Sep-06-2004)

    v1.4

  • Added flag -r (reverse hex dump to binary) and -w (reverse hex bytes to binary).
    (Sep-13-2003)

    v1.3

  • Added flag -s to show identical lines. Default is not to show identical lines. Thanks to Soewono Effendi for adding this feature and making the program faster.
    (Mar-11-2003)

    v1.2

  • Can read from stdin. Added flags -x, -8
    (Feb-07-2003)

URL of this page: http://www.muquit.com/muquit/software/hod/hod.html

back Page updated: Sat Jun 9 16:23:00 2007 GMT   Copyright © 2007 muquit@muquit.com.
Get Firefox!