Repository files navigation

Table Of Contents

Introduction

hod is a very simple, nice little hexadecimal and octal data dumper. It is very useful when dealing with binary data. I wrote it long long time ago, because I did not like the complexities and the output format of od and such programs. I hope you will find it useful.

Suggestions, bug reports are always welcome.

Synopsis

 hod v1.8
https://www.muquit.com/
usage: ./hod [options] <filename>
Where the options are:
-v : show version information
-h : show this help
-i : output C header file
-g : output golang byte array
-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

Version

The latest version is 1.8.

Please look at ChangeLog for details.

Examples

hexdump a binary file

$ 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 .=....

Octal dump

$ hod -o foo.bin
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 006 075 .=.....=
230: 206 020 056 000 ....

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 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

Create C header file

$ hod -i square.gif > square.h

The header file square.h will look like:

/*
** This file is created by hod 1.7 by running:
** hod -i square.gif
** on Sun May 13 14:44:25 2012
** hod is a free software available from: http://www.muquit.com/
*/
#ifndef square_gif_H
#define square_gif_H 1
const unsigned char square_gif[]=
{
0x47,0x49,0x46,0x38,0x39,0x61,0x10,0x00,0x10,0x00,0xf3,0x00,0x00,0x00,0x00,
0x00,0x10,0x0f,0x0e,0x20,0x1e,0x1b,0x30,0x2d,0x29,0x3f,0x3b,0x36,0x4f,0x4a,
0x44,0x5f,0x59,0x52,0x6f,0x68,0x5f,0x7f,0x77,0x6d,0x8f,0x86,0x7a,0x9f,0x95,
0x88,0xaf,0xa4,0x96,0xbe,0xb2,0xa3,0xce,0xc1,0xb1,0xde,0xd0,0xbe,0xee,0xdf,
0xcc,0x21,0xf9,0x04,0x00,0x00,0x00,0x00,0x00,0x2c,0x00,0x00,0x00,0x00,0x10,
0x00,0x10,0x00,0x00,0x04,0x4e,0xf0,0xc9,0x49,0xeb,0x73,0x38,0xeb,0xed,0x9a,
0xff,0x60,0xd8,0x30,0x64,0x69,0x9e,0xcc,0xa2,0xae,0x6c,0xbb,0x28,0x70,0x2c,
0xcf,0x4a,0x62,0xdf,0x78,0x9e,0x20,0x7c,0xef,0xff,0x88,0x83,0x70,0x48,0x2c,
0x1e,0x0c,0xc8,0xa4,0x72,0x69,0x28,0x38,0x9f,0xd0,0x68,0x81,0x40,0xad,0x5a,
0xaf,0x84,0x81,0x76,0xcb,0xed,0x0e,0x04,0xe0,0xb0,0x78,0x2c,0x08,0x98,0xcf,
0xe8,0x74,0x00,0xc0,0x6e,0xbb,0xdf,0x80,0x08,0x00,0x3b,
};
const unsigned int square_gif_len=161;
#endif /* square_gif_H */

Create Go byte array

$ hod -g icon.png > icon.go

The icon.go file will look like:

/
// This file is created by hod 1.8 by running:
// hod -g icon.png
// hod is a free software available from: https://www.muquit.com/
//
package Icon
var Data []byte = []byte {
0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,
0x52,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x04,0x03,0x00,0x00,0x00,0xed,
0xdd,0xe2,0x52,0x00,0x00,0x00,0x20,0x63,0x48,0x52,0x4d,0x00,0x00,0x7a,0x26,
0x00,0x00,0x80,0x84,0x00,0x00,0xfa,0x00,0x00,0x00,0x80,0xe8,0x00,0x00,0x75,
0x30,0x00,0x00,0xea,0x60,0x00,0x00,0x3a,0x98,0x00,0x00,0x17,0x70,0x9c,0xba,
0x51,0x3c,0x00,0x00,0x00,0x30,0x50,0x4c,0x54,0x45,0xee,0xdf,0xcc,0xde,0xd0,
0xbe,0xce,0xc1,0xb1,0xbe,0xb2,0xa3,0xaf,0xa4,0x96,0x9f,0x95,0x88,0x8f,0x86,
0x7a,0x7f,0x77,0x6d,0x6f,0x68,0x5f,0x5f,0x59,0x52,0x4f,0x4a,0x44,0x3f,0x3b,
0x36,0x30,0x2d,0x29,0x20,0x1e,0x1b,0x10,0x0f,0x0e,0x00,0x00,0x00,0xb6,0x15,
0xcf,0x2d,0x00,0x00,0x00,0x01,0x62,0x4b,0x47,0x44,0x0f,0x18,0xba,0x00,0xd9,
0x00,0x00,0x00,0x07,0x74,0x49,0x4d,0x45,0x07,0xe9,0x09,0x0f,0x15,0x1b,0x0a,
0xfb,0xe2,0xd1,0xd2,0x00,0x00,0x00,0x3b,0x49,0x44,0x41,0x54,0x08,0xd7,0x35,
0xc1,0xc1,0x00,0x00,0x21,0x00,0x00,0xc1,0x55,0x48,0x21,0x85,0x14,0x52,0x48,
0x21,0x85,0x14,0x52,0x48,0x21,0x85,0x53,0x38,0x85,0x14,0x52,0xa8,0xcf,0x36,
0x03,0x4f,0x10,0x51,0x24,0x91,0x45,0x11,0x55,0x34,0xd1,0xc5,0x10,0x53,0x7c,
0xe2,0x17,0x4b,0x6c,0x71,0x74,0x01,0x95,0x95,0x3f,0xc1,0x40,0x15,0x38,0x32,
0x00,0x00,0x00,0x25,0x74,0x45,0x58,0x74,0x64,0x61,0x74,0x65,0x3a,0x63,0x72,
0x65,0x61,0x74,0x65,0x00,0x32,0x30,0x32,0x35,0x2d,0x30,0x39,0x2d,0x31,0x35,
0x54,0x32,0x31,0x3a,0x30,0x36,0x3a,0x33,0x33,0x2b,0x30,0x30,0x3a,0x30,0x30,
0xea,0x28,0x6a,0xab,0x00,0x00,0x00,0x25,0x74,0x45,0x58,0x74,0x64,0x61,0x74,
0x65,0x3a,0x6d,0x6f,0x64,0x69,0x66,0x79,0x00,0x32,0x30,0x32,0x35,0x2d,0x30,
0x34,0x2d,0x31,0x35,0x54,0x32,0x31,0x3a,0x35,0x37,0x3a,0x31,0x39,0x2b,0x30,
0x30,0x3a,0x30,0x30,0xd4,0x9e,0xdd,0x67,0x00,0x00,0x00,0x28,0x74,0x45,0x58,
0x74,0x64,0x61,0x74,0x65,0x3a,0x74,0x69,0x6d,0x65,0x73,0x74,0x61,0x6d,0x70,
0x00,0x32,0x30,0x32,0x35,0x2d,0x30,0x39,0x2d,0x31,0x35,0x54,0x32,0x31,0x3a,
0x32,0x37,0x3a,0x31,0x30,0x2b,0x30,0x30,0x3a,0x30,0x30,0x08,0x03,0x3c,0xd7,
0x00,0x00,0x00,0x00,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
}

Look at icon_example/ directory for an example how a 16.x16 PNG file is converted to Go byte array to use as an icon for the systray.

Download

Pre-compiled binaries for Windows and Ubuntu are available from Releases page

Install

Linux Debian package

A pre-built Debian package is available. To install the package, type

sudo dpkg -i hod_1.8-ubuntu_amd64.deb

To remove the package, type:

sudo dpkg -r hod

Windows

Build from Source

Linux/Unix/MacOS

Go to the source directory and type:

$ sh ./configure
$ make clean
$ make
# make install

or

$ sudo make install

Microsoft Windows

MINGW64

This time I used MING64 (Sep-17-2025) to compile. To compile, just like Linux/Mac:

./configure
make

Visual Studio

A compiled binary for MS Windows is already supplied. However, if you need to modify something or want to compile it yourself, you will need MS Visual Studio (I used MS Visual Studio 10, freely available from Microsoft). To compile, open a command shell and type:

c:\> nmake -f Makefile.win clean
c:\> nmake -f Makefile.win

TOC is created by https://github.com/muquit/markdown-toc-go on Sep-17-2025

About

hexadecimal or octal data dumper

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Repository files navigation

Table Of Contents

Introduction

hod is a very simple, nice little hexadecimal and octal data dumper. It is very useful when dealing with binary data. I wrote it long long time ago, because I did not like the complexities and the output format of od and such programs. I hope you will find it useful.

Suggestions, bug reports are always welcome.

Synopsis

 hod v1.8
https://www.muquit.com/
usage: ./hod [options] <filename>
Where the options are:
-v : show version information
-h : show this help
-i : output C header file
-g : output golang byte array
-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

Version

The latest version is 1.8.

Please look at ChangeLog for details.

Examples

hexdump a binary file

$ 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 .=....

Octal dump

$ hod -o foo.bin
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 006 075 .=.....=
230: 206 020 056 000 ....

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 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

Create C header file

$ hod -i square.gif > square.h

The header file square.h will look like:

/*
** This file is created by hod 1.7 by running:
** hod -i square.gif
** on Sun May 13 14:44:25 2012
** hod is a free software available from: http://www.muquit.com/
*/
#ifndef square_gif_H
#define square_gif_H 1
const unsigned char square_gif[]=
{
0x47,0x49,0x46,0x38,0x39,0x61,0x10,0x00,0x10,0x00,0xf3,0x00,0x00,0x00,0x00,
0x00,0x10,0x0f,0x0e,0x20,0x1e,0x1b,0x30,0x2d,0x29,0x3f,0x3b,0x36,0x4f,0x4a,
0x44,0x5f,0x59,0x52,0x6f,0x68,0x5f,0x7f,0x77,0x6d,0x8f,0x86,0x7a,0x9f,0x95,
0x88,0xaf,0xa4,0x96,0xbe,0xb2,0xa3,0xce,0xc1,0xb1,0xde,0xd0,0xbe,0xee,0xdf,
0xcc,0x21,0xf9,0x04,0x00,0x00,0x00,0x00,0x00,0x2c,0x00,0x00,0x00,0x00,0x10,
0x00,0x10,0x00,0x00,0x04,0x4e,0xf0,0xc9,0x49,0xeb,0x73,0x38,0xeb,0xed,0x9a,
0xff,0x60,0xd8,0x30,0x64,0x69,0x9e,0xcc,0xa2,0xae,0x6c,0xbb,0x28,0x70,0x2c,
0xcf,0x4a,0x62,0xdf,0x78,0x9e,0x20,0x7c,0xef,0xff,0x88,0x83,0x70,0x48,0x2c,
0x1e,0x0c,0xc8,0xa4,0x72,0x69,0x28,0x38,0x9f,0xd0,0x68,0x81,0x40,0xad,0x5a,
0xaf,0x84,0x81,0x76,0xcb,0xed,0x0e,0x04,0xe0,0xb0,0x78,0x2c,0x08,0x98,0xcf,
0xe8,0x74,0x00,0xc0,0x6e,0xbb,0xdf,0x80,0x08,0x00,0x3b,
};
const unsigned int square_gif_len=161;
#endif /* square_gif_H */

Create Go byte array

$ hod -g icon.png > icon.go

The icon.go file will look like:

/
// This file is created by hod 1.8 by running:
// hod -g icon.png
// hod is a free software available from: https://www.muquit.com/
//
package Icon
var Data []byte = []byte {
0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,
0x52,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x04,0x03,0x00,0x00,0x00,0xed,
0xdd,0xe2,0x52,0x00,0x00,0x00,0x20,0x63,0x48,0x52,0x4d,0x00,0x00,0x7a,0x26,
0x00,0x00,0x80,0x84,0x00,0x00,0xfa,0x00,0x00,0x00,0x80,0xe8,0x00,0x00,0x75,
0x30,0x00,0x00,0xea,0x60,0x00,0x00,0x3a,0x98,0x00,0x00,0x17,0x70,0x9c,0xba,
0x51,0x3c,0x00,0x00,0x00,0x30,0x50,0x4c,0x54,0x45,0xee,0xdf,0xcc,0xde,0xd0,
0xbe,0xce,0xc1,0xb1,0xbe,0xb2,0xa3,0xaf,0xa4,0x96,0x9f,0x95,0x88,0x8f,0x86,
0x7a,0x7f,0x77,0x6d,0x6f,0x68,0x5f,0x5f,0x59,0x52,0x4f,0x4a,0x44,0x3f,0x3b,
0x36,0x30,0x2d,0x29,0x20,0x1e,0x1b,0x10,0x0f,0x0e,0x00,0x00,0x00,0xb6,0x15,
0xcf,0x2d,0x00,0x00,0x00,0x01,0x62,0x4b,0x47,0x44,0x0f,0x18,0xba,0x00,0xd9,
0x00,0x00,0x00,0x07,0x74,0x49,0x4d,0x45,0x07,0xe9,0x09,0x0f,0x15,0x1b,0x0a,
0xfb,0xe2,0xd1,0xd2,0x00,0x00,0x00,0x3b,0x49,0x44,0x41,0x54,0x08,0xd7,0x35,
0xc1,0xc1,0x00,0x00,0x21,0x00,0x00,0xc1,0x55,0x48,0x21,0x85,0x14,0x52,0x48,
0x21,0x85,0x14,0x52,0x48,0x21,0x85,0x53,0x38,0x85,0x14,0x52,0xa8,0xcf,0x36,
0x03,0x4f,0x10,0x51,0x24,0x91,0x45,0x11,0x55,0x34,0xd1,0xc5,0x10,0x53,0x7c,
0xe2,0x17,0x4b,0x6c,0x71,0x74,0x01,0x95,0x95,0x3f,0xc1,0x40,0x15,0x38,0x32,
0x00,0x00,0x00,0x25,0x74,0x45,0x58,0x74,0x64,0x61,0x74,0x65,0x3a,0x63,0x72,
0x65,0x61,0x74,0x65,0x00,0x32,0x30,0x32,0x35,0x2d,0x30,0x39,0x2d,0x31,0x35,
0x54,0x32,0x31,0x3a,0x30,0x36,0x3a,0x33,0x33,0x2b,0x30,0x30,0x3a,0x30,0x30,
0xea,0x28,0x6a,0xab,0x00,0x00,0x00,0x25,0x74,0x45,0x58,0x74,0x64,0x61,0x74,
0x65,0x3a,0x6d,0x6f,0x64,0x69,0x66,0x79,0x00,0x32,0x30,0x32,0x35,0x2d,0x30,
0x34,0x2d,0x31,0x35,0x54,0x32,0x31,0x3a,0x35,0x37,0x3a,0x31,0x39,0x2b,0x30,
0x30,0x3a,0x30,0x30,0xd4,0x9e,0xdd,0x67,0x00,0x00,0x00,0x28,0x74,0x45,0x58,
0x74,0x64,0x61,0x74,0x65,0x3a,0x74,0x69,0x6d,0x65,0x73,0x74,0x61,0x6d,0x70,
0x00,0x32,0x30,0x32,0x35,0x2d,0x30,0x39,0x2d,0x31,0x35,0x54,0x32,0x31,0x3a,
0x32,0x37,0x3a,0x31,0x30,0x2b,0x30,0x30,0x3a,0x30,0x30,0x08,0x03,0x3c,0xd7,
0x00,0x00,0x00,0x00,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
}

Look at icon_example/ directory for an example how a 16.x16 PNG file is converted to Go byte array to use as an icon for the systray.

Download

Pre-compiled binaries for Windows and Ubuntu are available from Releases page

Install

Linux Debian package

A pre-built Debian package is available. To install the package, type

sudo dpkg -i hod_1.8-ubuntu_amd64.deb

To remove the package, type:

sudo dpkg -r hod

Windows

Build from Source

Linux/Unix/MacOS

Go to the source directory and type:

$ sh ./configure
$ make clean
$ make
# make install

or

$ sudo make install

Microsoft Windows

MINGW64

This time I used MING64 (Sep-17-2025) to compile. To compile, just like Linux/Mac:

./configure
make

Visual Studio

A compiled binary for MS Windows is already supplied. However, if you need to modify something or want to compile it yourself, you will need MS Visual Studio (I used MS Visual Studio 10, freely available from Microsoft). To compile, open a command shell and type:

c:\> nmake -f Makefile.win clean
c:\> nmake -f Makefile.win

TOC is created by https://github.com/muquit/markdown-toc-go on Sep-17-2025

About

hexadecimal or octal data dumper

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Table Of Contents

Introduction

hod is a very simple, nice little hexadecimal and octal data dumper. It is very useful when dealing with binary data. I wrote it long long time ago, because I did not like the complexities and the output format of od and such programs. I hope you will find it useful.

Suggestions, bug reports are always welcome.

Synopsis

 hod v1.8
https://www.muquit.com/
usage: ./hod [options] <filename>
Where the options are:
-v : show version information
-h : show this help
-i : output C header file
-g : output golang byte array
-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

Version

The latest version is 1.8.

Please look at ChangeLog for details.

Examples

hexdump a binary file

$ 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 .=....

Octal dump

$ hod -o foo.bin
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 006 075 .=.....=
230: 206 020 056 000 ....

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 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

Create C header file

$ hod -i square.gif > square.h

The header file square.h will look like:

/*
** This file is created by hod 1.7 by running:
** hod -i square.gif
** on Sun May 13 14:44:25 2012
** hod is a free software available from: http://www.muquit.com/
*/
#ifndef square_gif_H
#define square_gif_H 1
const unsigned char square_gif[]=
{
0x47,0x49,0x46,0x38,0x39,0x61,0x10,0x00,0x10,0x00,0xf3,0x00,0x00,0x00,0x00,
0x00,0x10,0x0f,0x0e,0x20,0x1e,0x1b,0x30,0x2d,0x29,0x3f,0x3b,0x36,0x4f,0x4a,
0x44,0x5f,0x59,0x52,0x6f,0x68,0x5f,0x7f,0x77,0x6d,0x8f,0x86,0x7a,0x9f,0x95,
0x88,0xaf,0xa4,0x96,0xbe,0xb2,0xa3,0xce,0xc1,0xb1,0xde,0xd0,0xbe,0xee,0xdf,
0xcc,0x21,0xf9,0x04,0x00,0x00,0x00,0x00,0x00,0x2c,0x00,0x00,0x00,0x00,0x10,
0x00,0x10,0x00,0x00,0x04,0x4e,0xf0,0xc9,0x49,0xeb,0x73,0x38,0xeb,0xed,0x9a,
0xff,0x60,0xd8,0x30,0x64,0x69,0x9e,0xcc,0xa2,0xae,0x6c,0xbb,0x28,0x70,0x2c,
0xcf,0x4a,0x62,0xdf,0x78,0x9e,0x20,0x7c,0xef,0xff,0x88,0x83,0x70,0x48,0x2c,
0x1e,0x0c,0xc8,0xa4,0x72,0x69,0x28,0x38,0x9f,0xd0,0x68,0x81,0x40,0xad,0x5a,
0xaf,0x84,0x81,0x76,0xcb,0xed,0x0e,0x04,0xe0,0xb0,0x78,0x2c,0x08,0x98,0xcf,
0xe8,0x74,0x00,0xc0,0x6e,0xbb,0xdf,0x80,0x08,0x00,0x3b,
};
const unsigned int square_gif_len=161;
#endif /* square_gif_H */

Create Go byte array

$ hod -g icon.png > icon.go

The icon.go file will look like:

/
// This file is created by hod 1.8 by running:
// hod -g icon.png
// hod is a free software available from: https://www.muquit.com/
//
package Icon
var Data []byte = []byte {
0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,
0x52,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x04,0x03,0x00,0x00,0x00,0xed,
0xdd,0xe2,0x52,0x00,0x00,0x00,0x20,0x63,0x48,0x52,0x4d,0x00,0x00,0x7a,0x26,
0x00,0x00,0x80,0x84,0x00,0x00,0xfa,0x00,0x00,0x00,0x80,0xe8,0x00,0x00,0x75,
0x30,0x00,0x00,0xea,0x60,0x00,0x00,0x3a,0x98,0x00,0x00,0x17,0x70,0x9c,0xba,
0x51,0x3c,0x00,0x00,0x00,0x30,0x50,0x4c,0x54,0x45,0xee,0xdf,0xcc,0xde,0xd0,
0xbe,0xce,0xc1,0xb1,0xbe,0xb2,0xa3,0xaf,0xa4,0x96,0x9f,0x95,0x88,0x8f,0x86,
0x7a,0x7f,0x77,0x6d,0x6f,0x68,0x5f,0x5f,0x59,0x52,0x4f,0x4a,0x44,0x3f,0x3b,
0x36,0x30,0x2d,0x29,0x20,0x1e,0x1b,0x10,0x0f,0x0e,0x00,0x00,0x00,0xb6,0x15,
0xcf,0x2d,0x00,0x00,0x00,0x01,0x62,0x4b,0x47,0x44,0x0f,0x18,0xba,0x00,0xd9,
0x00,0x00,0x00,0x07,0x74,0x49,0x4d,0x45,0x07,0xe9,0x09,0x0f,0x15,0x1b,0x0a,
0xfb,0xe2,0xd1,0xd2,0x00,0x00,0x00,0x3b,0x49,0x44,0x41,0x54,0x08,0xd7,0x35,
0xc1,0xc1,0x00,0x00,0x21,0x00,0x00,0xc1,0x55,0x48,0x21,0x85,0x14,0x52,0x48,
0x21,0x85,0x14,0x52,0x48,0x21,0x85,0x53,0x38,0x85,0x14,0x52,0xa8,0xcf,0x36,
0x03,0x4f,0x10,0x51,0x24,0x91,0x45,0x11,0x55,0x34,0xd1,0xc5,0x10,0x53,0x7c,
0xe2,0x17,0x4b,0x6c,0x71,0x74,0x01,0x95,0x95,0x3f,0xc1,0x40,0x15,0x38,0x32,
0x00,0x00,0x00,0x25,0x74,0x45,0x58,0x74,0x64,0x61,0x74,0x65,0x3a,0x63,0x72,
0x65,0x61,0x74,0x65,0x00,0x32,0x30,0x32,0x35,0x2d,0x30,0x39,0x2d,0x31,0x35,
0x54,0x32,0x31,0x3a,0x30,0x36,0x3a,0x33,0x33,0x2b,0x30,0x30,0x3a,0x30,0x30,
0xea,0x28,0x6a,0xab,0x00,0x00,0x00,0x25,0x74,0x45,0x58,0x74,0x64,0x61,0x74,
0x65,0x3a,0x6d,0x6f,0x64,0x69,0x66,0x79,0x00,0x32,0x30,0x32,0x35,0x2d,0x30,
0x34,0x2d,0x31,0x35,0x54,0x32,0x31,0x3a,0x35,0x37,0x3a,0x31,0x39,0x2b,0x30,
0x30,0x3a,0x30,0x30,0xd4,0x9e,0xdd,0x67,0x00,0x00,0x00,0x28,0x74,0x45,0x58,
0x74,0x64,0x61,0x74,0x65,0x3a,0x74,0x69,0x6d,0x65,0x73,0x74,0x61,0x6d,0x70,
0x00,0x32,0x30,0x32,0x35,0x2d,0x30,0x39,0x2d,0x31,0x35,0x54,0x32,0x31,0x3a,
0x32,0x37,0x3a,0x31,0x30,0x2b,0x30,0x30,0x3a,0x30,0x30,0x08,0x03,0x3c,0xd7,
0x00,0x00,0x00,0x00,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
}

Look at icon_example/ directory for an example how a 16.x16 PNG file is converted to Go byte array to use as an icon for the systray.

Download

Pre-compiled binaries for Windows and Ubuntu are available from Releases page

Install

Linux Debian package

A pre-built Debian package is available. To install the package, type

sudo dpkg -i hod_1.8-ubuntu_amd64.deb

To remove the package, type:

sudo dpkg -r hod

Windows

Build from Source

Linux/Unix/MacOS

Go to the source directory and type:

$ sh ./configure
$ make clean
$ make
# make install

or

$ sudo make install

Microsoft Windows

MINGW64

This time I used MING64 (Sep-17-2025) to compile. To compile, just like Linux/Mac:

./configure
make

Visual Studio

A compiled binary for MS Windows is already supplied. However, if you need to modify something or want to compile it yourself, you will need MS Visual Studio (I used MS Visual Studio 10, freely available from Microsoft). To compile, open a command shell and type:

c:\> nmake -f Makefile.win clean
c:\> nmake -f Makefile.win

TOC is created by https://github.com/muquit/markdown-toc-go on Sep-17-2025

About

hexadecimal or octal data dumper

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Table Of Contents

Introduction

hod is a very simple, nice little hexadecimal and octal data dumper. It is very useful when dealing with binary data. I wrote it long long time ago, because I did not like the complexities and the output format of od and such programs. I hope you will find it useful.

Suggestions, bug reports are always welcome.

Synopsis

 hod v1.8
https://www.muquit.com/
usage: ./hod [options] <filename>
Where the options are:
-v : show version information
-h : show this help
-i : output C header file
-g : output golang byte array
-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

Version

The latest version is 1.8.

Please look at ChangeLog for details.

Examples

hexdump a binary file

$ 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 .=....

Octal dump

$ hod -o foo.bin
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 006 075 .=.....=
230: 206 020 056 000 ....

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 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

Create C header file

$ hod -i square.gif > square.h

The header file square.h will look like:

/*
** This file is created by hod 1.7 by running:
** hod -i square.gif
** on Sun May 13 14:44:25 2012
** hod is a free software available from: http://www.muquit.com/
*/
#ifndef square_gif_H
#define square_gif_H 1
const unsigned char square_gif[]=
{
0x47,0x49,0x46,0x38,0x39,0x61,0x10,0x00,0x10,0x00,0xf3,0x00,0x00,0x00,0x00,
0x00,0x10,0x0f,0x0e,0x20,0x1e,0x1b,0x30,0x2d,0x29,0x3f,0x3b,0x36,0x4f,0x4a,
0x44,0x5f,0x59,0x52,0x6f,0x68,0x5f,0x7f,0x77,0x6d,0x8f,0x86,0x7a,0x9f,0x95,
0x88,0xaf,0xa4,0x96,0xbe,0xb2,0xa3,0xce,0xc1,0xb1,0xde,0xd0,0xbe,0xee,0xdf,
0xcc,0x21,0xf9,0x04,0x00,0x00,0x00,0x00,0x00,0x2c,0x00,0x00,0x00,0x00,0x10,
0x00,0x10,0x00,0x00,0x04,0x4e,0xf0,0xc9,0x49,0xeb,0x73,0x38,0xeb,0xed,0x9a,
0xff,0x60,0xd8,0x30,0x64,0x69,0x9e,0xcc,0xa2,0xae,0x6c,0xbb,0x28,0x70,0x2c,
0xcf,0x4a,0x62,0xdf,0x78,0x9e,0x20,0x7c,0xef,0xff,0x88,0x83,0x70,0x48,0x2c,
0x1e,0x0c,0xc8,0xa4,0x72,0x69,0x28,0x38,0x9f,0xd0,0x68,0x81,0x40,0xad,0x5a,
0xaf,0x84,0x81,0x76,0xcb,0xed,0x0e,0x04,0xe0,0xb0,0x78,0x2c,0x08,0x98,0xcf,
0xe8,0x74,0x00,0xc0,0x6e,0xbb,0xdf,0x80,0x08,0x00,0x3b,
};
const unsigned int square_gif_len=161;
#endif /* square_gif_H */

Create Go byte array

$ hod -g icon.png > icon.go

The icon.go file will look like:

/
// This file is created by hod 1.8 by running:
// hod -g icon.png
// hod is a free software available from: https://www.muquit.com/
//
package Icon
var Data []byte = []byte {
0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,
0x52,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x04,0x03,0x00,0x00,0x00,0xed,
0xdd,0xe2,0x52,0x00,0x00,0x00,0x20,0x63,0x48,0x52,0x4d,0x00,0x00,0x7a,0x26,
0x00,0x00,0x80,0x84,0x00,0x00,0xfa,0x00,0x00,0x00,0x80,0xe8,0x00,0x00,0x75,
0x30,0x00,0x00,0xea,0x60,0x00,0x00,0x3a,0x98,0x00,0x00,0x17,0x70,0x9c,0xba,
0x51,0x3c,0x00,0x00,0x00,0x30,0x50,0x4c,0x54,0x45,0xee,0xdf,0xcc,0xde,0xd0,
0xbe,0xce,0xc1,0xb1,0xbe,0xb2,0xa3,0xaf,0xa4,0x96,0x9f,0x95,0x88,0x8f,0x86,
0x7a,0x7f,0x77,0x6d,0x6f,0x68,0x5f,0x5f,0x59,0x52,0x4f,0x4a,0x44,0x3f,0x3b,
0x36,0x30,0x2d,0x29,0x20,0x1e,0x1b,0x10,0x0f,0x0e,0x00,0x00,0x00,0xb6,0x15,
0xcf,0x2d,0x00,0x00,0x00,0x01,0x62,0x4b,0x47,0x44,0x0f,0x18,0xba,0x00,0xd9,
0x00,0x00,0x00,0x07,0x74,0x49,0x4d,0x45,0x07,0xe9,0x09,0x0f,0x15,0x1b,0x0a,
0xfb,0xe2,0xd1,0xd2,0x00,0x00,0x00,0x3b,0x49,0x44,0x41,0x54,0x08,0xd7,0x35,
0xc1,0xc1,0x00,0x00,0x21,0x00,0x00,0xc1,0x55,0x48,0x21,0x85,0x14,0x52,0x48,
0x21,0x85,0x14,0x52,0x48,0x21,0x85,0x53,0x38,0x85,0x14,0x52,0xa8,0xcf,0x36,
0x03,0x4f,0x10,0x51,0x24,0x91,0x45,0x11,0x55,0x34,0xd1,0xc5,0x10,0x53,0x7c,
0xe2,0x17,0x4b,0x6c,0x71,0x74,0x01,0x95,0x95,0x3f,0xc1,0x40,0x15,0x38,0x32,
0x00,0x00,0x00,0x25,0x74,0x45,0x58,0x74,0x64,0x61,0x74,0x65,0x3a,0x63,0x72,
0x65,0x61,0x74,0x65,0x00,0x32,0x30,0x32,0x35,0x2d,0x30,0x39,0x2d,0x31,0x35,
0x54,0x32,0x31,0x3a,0x30,0x36,0x3a,0x33,0x33,0x2b,0x30,0x30,0x3a,0x30,0x30,
0xea,0x28,0x6a,0xab,0x00,0x00,0x00,0x25,0x74,0x45,0x58,0x74,0x64,0x61,0x74,
0x65,0x3a,0x6d,0x6f,0x64,0x69,0x66,0x79,0x00,0x32,0x30,0x32,0x35,0x2d,0x30,
0x34,0x2d,0x31,0x35,0x54,0x32,0x31,0x3a,0x35,0x37,0x3a,0x31,0x39,0x2b,0x30,
0x30,0x3a,0x30,0x30,0xd4,0x9e,0xdd,0x67,0x00,0x00,0x00,0x28,0x74,0x45,0x58,
0x74,0x64,0x61,0x74,0x65,0x3a,0x74,0x69,0x6d,0x65,0x73,0x74,0x61,0x6d,0x70,
0x00,0x32,0x30,0x32,0x35,0x2d,0x30,0x39,0x2d,0x31,0x35,0x54,0x32,0x31,0x3a,
0x32,0x37,0x3a,0x31,0x30,0x2b,0x30,0x30,0x3a,0x30,0x30,0x08,0x03,0x3c,0xd7,
0x00,0x00,0x00,0x00,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
}

Look at icon_example/ directory for an example how a 16.x16 PNG file is converted to Go byte array to use as an icon for the systray.

Download

Pre-compiled binaries for Windows and Ubuntu are available from Releases page

Install

Linux Debian package

A pre-built Debian package is available. To install the package, type

sudo dpkg -i hod_1.8-ubuntu_amd64.deb

To remove the package, type:

sudo dpkg -r hod

Windows

Build from Source

Linux/Unix/MacOS

Go to the source directory and type:

$ sh ./configure
$ make clean
$ make
# make install

or

$ sudo make install

Microsoft Windows

MINGW64

This time I used MING64 (Sep-17-2025) to compile. To compile, just like Linux/Mac:

./configure
make

Visual Studio

A compiled binary for MS Windows is already supplied. However, if you need to modify something or want to compile it yourself, you will need MS Visual Studio (I used MS Visual Studio 10, freely available from Microsoft). To compile, open a command shell and type:

c:\> nmake -f Makefile.win clean
c:\> nmake -f Makefile.win

TOC is created by https://github.com/muquit/markdown-toc-go on Sep-17-2025

About

hexadecimal or octal data dumper

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Repository files navigation

Table Of Contents

Introduction

hod is a very simple, nice little hexadecimal and octal data dumper. It is very useful when dealing with binary data. I wrote it long long time ago, because I did not like the complexities and the output format of od and such programs. I hope you will find it useful.

Suggestions, bug reports are always welcome.

Synopsis

 hod v1.8
https://www.muquit.com/
usage: ./hod [options] <filename>
Where the options are:
-v : show version information
-h : show this help
-i : output C header file
-g : output golang byte array
-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

Version

The latest version is 1.8.

Please look at ChangeLog for details.

Examples

hexdump a binary file

$ 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 .=....

Octal dump

$ hod -o foo.bin
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 006 075 .=.....=
230: 206 020 056 000 ....

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 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

Create C header file

$ hod -i square.gif > square.h

The header file square.h will look like:

/*
** This file is created by hod 1.7 by running:
** hod -i square.gif
** on Sun May 13 14:44:25 2012
** hod is a free software available from: http://www.muquit.com/
*/
#ifndef square_gif_H
#define square_gif_H 1
const unsigned char square_gif[]=
{
0x47,0x49,0x46,0x38,0x39,0x61,0x10,0x00,0x10,0x00,0xf3,0x00,0x00,0x00,0x00,
0x00,0x10,0x0f,0x0e,0x20,0x1e,0x1b,0x30,0x2d,0x29,0x3f,0x3b,0x36,0x4f,0x4a,
0x44,0x5f,0x59,0x52,0x6f,0x68,0x5f,0x7f,0x77,0x6d,0x8f,0x86,0x7a,0x9f,0x95,
0x88,0xaf,0xa4,0x96,0xbe,0xb2,0xa3,0xce,0xc1,0xb1,0xde,0xd0,0xbe,0xee,0xdf,
0xcc,0x21,0xf9,0x04,0x00,0x00,0x00,0x00,0x00,0x2c,0x00,0x00,0x00,0x00,0x10,
0x00,0x10,0x00,0x00,0x04,0x4e,0xf0,0xc9,0x49,0xeb,0x73,0x38,0xeb,0xed,0x9a,
0xff,0x60,0xd8,0x30,0x64,0x69,0x9e,0xcc,0xa2,0xae,0x6c,0xbb,0x28,0x70,0x2c,
0xcf,0x4a,0x62,0xdf,0x78,0x9e,0x20,0x7c,0xef,0xff,0x88,0x83,0x70,0x48,0x2c,
0x1e,0x0c,0xc8,0xa4,0x72,0x69,0x28,0x38,0x9f,0xd0,0x68,0x81,0x40,0xad,0x5a,
0xaf,0x84,0x81,0x76,0xcb,0xed,0x0e,0x04,0xe0,0xb0,0x78,0x2c,0x08,0x98,0xcf,
0xe8,0x74,0x00,0xc0,0x6e,0xbb,0xdf,0x80,0x08,0x00,0x3b,
};
const unsigned int square_gif_len=161;
#endif /* square_gif_H */

Create Go byte array

$ hod -g icon.png > icon.go

The icon.go file will look like:

/
// This file is created by hod 1.8 by running:
// hod -g icon.png
// hod is a free software available from: https://www.muquit.com/
//
package Icon
var Data []byte = []byte {
0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,
0x52,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x04,0x03,0x00,0x00,0x00,0xed,
0xdd,0xe2,0x52,0x00,0x00,0x00,0x20,0x63,0x48,0x52,0x4d,0x00,0x00,0x7a,0x26,
0x00,0x00,0x80,0x84,0x00,0x00,0xfa,0x00,0x00,0x00,0x80,0xe8,0x00,0x00,0x75,
0x30,0x00,0x00,0xea,0x60,0x00,0x00,0x3a,0x98,0x00,0x00,0x17,0x70,0x9c,0xba,
0x51,0x3c,0x00,0x00,0x00,0x30,0x50,0x4c,0x54,0x45,0xee,0xdf,0xcc,0xde,0xd0,
0xbe,0xce,0xc1,0xb1,0xbe,0xb2,0xa3,0xaf,0xa4,0x96,0x9f,0x95,0x88,0x8f,0x86,
0x7a,0x7f,0x77,0x6d,0x6f,0x68,0x5f,0x5f,0x59,0x52,0x4f,0x4a,0x44,0x3f,0x3b,
0x36,0x30,0x2d,0x29,0x20,0x1e,0x1b,0x10,0x0f,0x0e,0x00,0x00,0x00,0xb6,0x15,
0xcf,0x2d,0x00,0x00,0x00,0x01,0x62,0x4b,0x47,0x44,0x0f,0x18,0xba,0x00,0xd9,
0x00,0x00,0x00,0x07,0x74,0x49,0x4d,0x45,0x07,0xe9,0x09,0x0f,0x15,0x1b,0x0a,
0xfb,0xe2,0xd1,0xd2,0x00,0x00,0x00,0x3b,0x49,0x44,0x41,0x54,0x08,0xd7,0x35,
0xc1,0xc1,0x00,0x00,0x21,0x00,0x00,0xc1,0x55,0x48,0x21,0x85,0x14,0x52,0x48,
0x21,0x85,0x14,0x52,0x48,0x21,0x85,0x53,0x38,0x85,0x14,0x52,0xa8,0xcf,0x36,
0x03,0x4f,0x10,0x51,0x24,0x91,0x45,0x11,0x55,0x34,0xd1,0xc5,0x10,0x53,0x7c,
0xe2,0x17,0x4b,0x6c,0x71,0x74,0x01,0x95,0x95,0x3f,0xc1,0x40,0x15,0x38,0x32,
0x00,0x00,0x00,0x25,0x74,0x45,0x58,0x74,0x64,0x61,0x74,0x65,0x3a,0x63,0x72,
0x65,0x61,0x74,0x65,0x00,0x32,0x30,0x32,0x35,0x2d,0x30,0x39,0x2d,0x31,0x35,
0x54,0x32,0x31,0x3a,0x30,0x36,0x3a,0x33,0x33,0x2b,0x30,0x30,0x3a,0x30,0x30,
0xea,0x28,0x6a,0xab,0x00,0x00,0x00,0x25,0x74,0x45,0x58,0x74,0x64,0x61,0x74,
0x65,0x3a,0x6d,0x6f,0x64,0x69,0x66,0x79,0x00,0x32,0x30,0x32,0x35,0x2d,0x30,
0x34,0x2d,0x31,0x35,0x54,0x32,0x31,0x3a,0x35,0x37,0x3a,0x31,0x39,0x2b,0x30,
0x30,0x3a,0x30,0x30,0xd4,0x9e,0xdd,0x67,0x00,0x00,0x00,0x28,0x74,0x45,0x58,
0x74,0x64,0x61,0x74,0x65,0x3a,0x74,0x69,0x6d,0x65,0x73,0x74,0x61,0x6d,0x70,
0x00,0x32,0x30,0x32,0x35,0x2d,0x30,0x39,0x2d,0x31,0x35,0x54,0x32,0x31,0x3a,
0x32,0x37,0x3a,0x31,0x30,0x2b,0x30,0x30,0x3a,0x30,0x30,0x08,0x03,0x3c,0xd7,
0x00,0x00,0x00,0x00,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
}

Look at icon_example/ directory for an example how a 16.x16 PNG file is converted to Go byte array to use as an icon for the systray.

Download

Pre-compiled binaries for Windows and Ubuntu are available from Releases page

Install

Linux Debian package

A pre-built Debian package is available. To install the package, type

sudo dpkg -i hod_1.8-ubuntu_amd64.deb

To remove the package, type:

sudo dpkg -r hod

Windows

Build from Source

Linux/Unix/MacOS

Go to the source directory and type:

$ sh ./configure
$ make clean
$ make
# make install

or

$ sudo make install

Microsoft Windows

MINGW64

This time I used MING64 (Sep-17-2025) to compile. To compile, just like Linux/Mac:

./configure
make

Visual Studio

A compiled binary for MS Windows is already supplied. However, if you need to modify something or want to compile it yourself, you will need MS Visual Studio (I used MS Visual Studio 10, freely available from Microsoft). To compile, open a command shell and type:

c:\> nmake -f Makefile.win clean
c:\> nmake -f Makefile.win

TOC is created by https://github.com/muquit/markdown-toc-go on Sep-17-2025

About

hexadecimal or octal data dumper

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Table Of Contents

Introduction

hod is a very simple, nice little hexadecimal and octal data dumper. It is very useful when dealing with binary data. I wrote it long long time ago, because I did not like the complexities and the output format of od and such programs. I hope you will find it useful.

Suggestions, bug reports are always welcome.

Synopsis

 hod v1.8
https://www.muquit.com/
usage: ./hod [options] <filename>
Where the options are:
-v : show version information
-h : show this help
-i : output C header file
-g : output golang byte array
-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

Version

The latest version is 1.8.

Please look at ChangeLog for details.

Examples

hexdump a binary file

$ 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 .=....

Octal dump

$ hod -o foo.bin
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 006 075 .=.....=
230: 206 020 056 000 ....

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 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

Create C header file

$ hod -i square.gif > square.h

The header file square.h will look like:

/*
** This file is created by hod 1.7 by running:
** hod -i square.gif
** on Sun May 13 14:44:25 2012
** hod is a free software available from: http://www.muquit.com/
*/
#ifndef square_gif_H
#define square_gif_H 1
const unsigned char square_gif[]=
{
0x47,0x49,0x46,0x38,0x39,0x61,0x10,0x00,0x10,0x00,0xf3,0x00,0x00,0x00,0x00,
0x00,0x10,0x0f,0x0e,0x20,0x1e,0x1b,0x30,0x2d,0x29,0x3f,0x3b,0x36,0x4f,0x4a,
0x44,0x5f,0x59,0x52,0x6f,0x68,0x5f,0x7f,0x77,0x6d,0x8f,0x86,0x7a,0x9f,0x95,
0x88,0xaf,0xa4,0x96,0xbe,0xb2,0xa3,0xce,0xc1,0xb1,0xde,0xd0,0xbe,0xee,0xdf,
0xcc,0x21,0xf9,0x04,0x00,0x00,0x00,0x00,0x00,0x2c,0x00,0x00,0x00,0x00,0x10,
0x00,0x10,0x00,0x00,0x04,0x4e,0xf0,0xc9,0x49,0xeb,0x73,0x38,0xeb,0xed,0x9a,
0xff,0x60,0xd8,0x30,0x64,0x69,0x9e,0xcc,0xa2,0xae,0x6c,0xbb,0x28,0x70,0x2c,
0xcf,0x4a,0x62,0xdf,0x78,0x9e,0x20,0x7c,0xef,0xff,0x88,0x83,0x70,0x48,0x2c,
0x1e,0x0c,0xc8,0xa4,0x72,0x69,0x28,0x38,0x9f,0xd0,0x68,0x81,0x40,0xad,0x5a,
0xaf,0x84,0x81,0x76,0xcb,0xed,0x0e,0x04,0xe0,0xb0,0x78,0x2c,0x08,0x98,0xcf,
0xe8,0x74,0x00,0xc0,0x6e,0xbb,0xdf,0x80,0x08,0x00,0x3b,
};
const unsigned int square_gif_len=161;
#endif /* square_gif_H */

Create Go byte array

$ hod -g icon.png > icon.go

The icon.go file will look like:

/
// This file is created by hod 1.8 by running:
// hod -g icon.png
// hod is a free software available from: https://www.muquit.com/
//
package Icon
var Data []byte = []byte {
0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,
0x52,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x04,0x03,0x00,0x00,0x00,0xed,
0xdd,0xe2,0x52,0x00,0x00,0x00,0x20,0x63,0x48,0x52,0x4d,0x00,0x00,0x7a,0x26,
0x00,0x00,0x80,0x84,0x00,0x00,0xfa,0x00,0x00,0x00,0x80,0xe8,0x00,0x00,0x75,
0x30,0x00,0x00,0xea,0x60,0x00,0x00,0x3a,0x98,0x00,0x00,0x17,0x70,0x9c,0xba,
0x51,0x3c,0x00,0x00,0x00,0x30,0x50,0x4c,0x54,0x45,0xee,0xdf,0xcc,0xde,0xd0,
0xbe,0xce,0xc1,0xb1,0xbe,0xb2,0xa3,0xaf,0xa4,0x96,0x9f,0x95,0x88,0x8f,0x86,
0x7a,0x7f,0x77,0x6d,0x6f,0x68,0x5f,0x5f,0x59,0x52,0x4f,0x4a,0x44,0x3f,0x3b,
0x36,0x30,0x2d,0x29,0x20,0x1e,0x1b,0x10,0x0f,0x0e,0x00,0x00,0x00,0xb6,0x15,
0xcf,0x2d,0x00,0x00,0x00,0x01,0x62,0x4b,0x47,0x44,0x0f,0x18,0xba,0x00,0xd9,
0x00,0x00,0x00,0x07,0x74,0x49,0x4d,0x45,0x07,0xe9,0x09,0x0f,0x15,0x1b,0x0a,
0xfb,0xe2,0xd1,0xd2,0x00,0x00,0x00,0x3b,0x49,0x44,0x41,0x54,0x08,0xd7,0x35,
0xc1,0xc1,0x00,0x00,0x21,0x00,0x00,0xc1,0x55,0x48,0x21,0x85,0x14,0x52,0x48,
0x21,0x85,0x14,0x52,0x48,0x21,0x85,0x53,0x38,0x85,0x14,0x52,0xa8,0xcf,0x36,
0x03,0x4f,0x10,0x51,0x24,0x91,0x45,0x11,0x55,0x34,0xd1,0xc5,0x10,0x53,0x7c,
0xe2,0x17,0x4b,0x6c,0x71,0x74,0x01,0x95,0x95,0x3f,0xc1,0x40,0x15,0x38,0x32,
0x00,0x00,0x00,0x25,0x74,0x45,0x58,0x74,0x64,0x61,0x74,0x65,0x3a,0x63,0x72,
0x65,0x61,0x74,0x65,0x00,0x32,0x30,0x32,0x35,0x2d,0x30,0x39,0x2d,0x31,0x35,
0x54,0x32,0x31,0x3a,0x30,0x36,0x3a,0x33,0x33,0x2b,0x30,0x30,0x3a,0x30,0x30,
0xea,0x28,0x6a,0xab,0x00,0x00,0x00,0x25,0x74,0x45,0x58,0x74,0x64,0x61,0x74,
0x65,0x3a,0x6d,0x6f,0x64,0x69,0x66,0x79,0x00,0x32,0x30,0x32,0x35,0x2d,0x30,
0x34,0x2d,0x31,0x35,0x54,0x32,0x31,0x3a,0x35,0x37,0x3a,0x31,0x39,0x2b,0x30,
0x30,0x3a,0x30,0x30,0xd4,0x9e,0xdd,0x67,0x00,0x00,0x00,0x28,0x74,0x45,0x58,
0x74,0x64,0x61,0x74,0x65,0x3a,0x74,0x69,0x6d,0x65,0x73,0x74,0x61,0x6d,0x70,
0x00,0x32,0x30,0x32,0x35,0x2d,0x30,0x39,0x2d,0x31,0x35,0x54,0x32,0x31,0x3a,
0x32,0x37,0x3a,0x31,0x30,0x2b,0x30,0x30,0x3a,0x30,0x30,0x08,0x03,0x3c,0xd7,
0x00,0x00,0x00,0x00,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
}

Look at icon_example/ directory for an example how a 16.x16 PNG file is converted to Go byte array to use as an icon for the systray.

Download

Pre-compiled binaries for Windows and Ubuntu are available from Releases page

Install

Linux Debian package

A pre-built Debian package is available. To install the package, type

sudo dpkg -i hod_1.8-ubuntu_amd64.deb

To remove the package, type:

sudo dpkg -r hod

Windows

Build from Source

Linux/Unix/MacOS

Go to the source directory and type:

$ sh ./configure
$ make clean
$ make
# make install

or

$ sudo make install

Microsoft Windows

MINGW64

This time I used MING64 (Sep-17-2025) to compile. To compile, just like Linux/Mac:

./configure
make

Visual Studio

A compiled binary for MS Windows is already supplied. However, if you need to modify something or want to compile it yourself, you will need MS Visual Studio (I used MS Visual Studio 10, freely available from Microsoft). To compile, open a command shell and type:

c:\> nmake -f Makefile.win clean
c:\> nmake -f Makefile.win

TOC is created by https://github.com/muquit/markdown-toc-go on Sep-17-2025

About

hexadecimal or octal data dumper

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Table Of Contents

Introduction

hod is a very simple, nice little hexadecimal and octal data dumper. It is very useful when dealing with binary data. I wrote it long long time ago, because I did not like the complexities and the output format of od and such programs. I hope you will find it useful.

Suggestions, bug reports are always welcome.

Synopsis

 hod v1.8
https://www.muquit.com/
usage: ./hod [options] <filename>
Where the options are:
-v : show version information
-h : show this help
-i : output C header file
-g : output golang byte array
-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

Version

The latest version is 1.8.

Please look at ChangeLog for details.

Examples

hexdump a binary file

$ 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 .=....

Octal dump

$ hod -o foo.bin
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 006 075 .=.....=
230: 206 020 056 000 ....

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 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

Create C header file

$ hod -i square.gif > square.h

The header file square.h will look like:

/*
** This file is created by hod 1.7 by running:
** hod -i square.gif
** on Sun May 13 14:44:25 2012
** hod is a free software available from: http://www.muquit.com/
*/
#ifndef square_gif_H
#define square_gif_H 1
const unsigned char square_gif[]=
{
0x47,0x49,0x46,0x38,0x39,0x61,0x10,0x00,0x10,0x00,0xf3,0x00,0x00,0x00,0x00,
0x00,0x10,0x0f,0x0e,0x20,0x1e,0x1b,0x30,0x2d,0x29,0x3f,0x3b,0x36,0x4f,0x4a,
0x44,0x5f,0x59,0x52,0x6f,0x68,0x5f,0x7f,0x77,0x6d,0x8f,0x86,0x7a,0x9f,0x95,
0x88,0xaf,0xa4,0x96,0xbe,0xb2,0xa3,0xce,0xc1,0xb1,0xde,0xd0,0xbe,0xee,0xdf,
0xcc,0x21,0xf9,0x04,0x00,0x00,0x00,0x00,0x00,0x2c,0x00,0x00,0x00,0x00,0x10,
0x00,0x10,0x00,0x00,0x04,0x4e,0xf0,0xc9,0x49,0xeb,0x73,0x38,0xeb,0xed,0x9a,
0xff,0x60,0xd8,0x30,0x64,0x69,0x9e,0xcc,0xa2,0xae,0x6c,0xbb,0x28,0x70,0x2c,
0xcf,0x4a,0x62,0xdf,0x78,0x9e,0x20,0x7c,0xef,0xff,0x88,0x83,0x70,0x48,0x2c,
0x1e,0x0c,0xc8,0xa4,0x72,0x69,0x28,0x38,0x9f,0xd0,0x68,0x81,0x40,0xad,0x5a,
0xaf,0x84,0x81,0x76,0xcb,0xed,0x0e,0x04,0xe0,0xb0,0x78,0x2c,0x08,0x98,0xcf,
0xe8,0x74,0x00,0xc0,0x6e,0xbb,0xdf,0x80,0x08,0x00,0x3b,
};
const unsigned int square_gif_len=161;
#endif /* square_gif_H */

Create Go byte array

$ hod -g icon.png > icon.go

The icon.go file will look like:

/
// This file is created by hod 1.8 by running:
// hod -g icon.png
// hod is a free software available from: https://www.muquit.com/
//
package Icon
var Data []byte = []byte {
0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,
0x52,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x04,0x03,0x00,0x00,0x00,0xed,
0xdd,0xe2,0x52,0x00,0x00,0x00,0x20,0x63,0x48,0x52,0x4d,0x00,0x00,0x7a,0x26,
0x00,0x00,0x80,0x84,0x00,0x00,0xfa,0x00,0x00,0x00,0x80,0xe8,0x00,0x00,0x75,
0x30,0x00,0x00,0xea,0x60,0x00,0x00,0x3a,0x98,0x00,0x00,0x17,0x70,0x9c,0xba,
0x51,0x3c,0x00,0x00,0x00,0x30,0x50,0x4c,0x54,0x45,0xee,0xdf,0xcc,0xde,0xd0,
0xbe,0xce,0xc1,0xb1,0xbe,0xb2,0xa3,0xaf,0xa4,0x96,0x9f,0x95,0x88,0x8f,0x86,
0x7a,0x7f,0x77,0x6d,0x6f,0x68,0x5f,0x5f,0x59,0x52,0x4f,0x4a,0x44,0x3f,0x3b,
0x36,0x30,0x2d,0x29,0x20,0x1e,0x1b,0x10,0x0f,0x0e,0x00,0x00,0x00,0xb6,0x15,
0xcf,0x2d,0x00,0x00,0x00,0x01,0x62,0x4b,0x47,0x44,0x0f,0x18,0xba,0x00,0xd9,
0x00,0x00,0x00,0x07,0x74,0x49,0x4d,0x45,0x07,0xe9,0x09,0x0f,0x15,0x1b,0x0a,
0xfb,0xe2,0xd1,0xd2,0x00,0x00,0x00,0x3b,0x49,0x44,0x41,0x54,0x08,0xd7,0x35,
0xc1,0xc1,0x00,0x00,0x21,0x00,0x00,0xc1,0x55,0x48,0x21,0x85,0x14,0x52,0x48,
0x21,0x85,0x14,0x52,0x48,0x21,0x85,0x53,0x38,0x85,0x14,0x52,0xa8,0xcf,0x36,
0x03,0x4f,0x10,0x51,0x24,0x91,0x45,0x11,0x55,0x34,0xd1,0xc5,0x10,0x53,0x7c,
0xe2,0x17,0x4b,0x6c,0x71,0x74,0x01,0x95,0x95,0x3f,0xc1,0x40,0x15,0x38,0x32,
0x00,0x00,0x00,0x25,0x74,0x45,0x58,0x74,0x64,0x61,0x74,0x65,0x3a,0x63,0x72,
0x65,0x61,0x74,0x65,0x00,0x32,0x30,0x32,0x35,0x2d,0x30,0x39,0x2d,0x31,0x35,
0x54,0x32,0x31,0x3a,0x30,0x36,0x3a,0x33,0x33,0x2b,0x30,0x30,0x3a,0x30,0x30,
0xea,0x28,0x6a,0xab,0x00,0x00,0x00,0x25,0x74,0x45,0x58,0x74,0x64,0x61,0x74,
0x65,0x3a,0x6d,0x6f,0x64,0x69,0x66,0x79,0x00,0x32,0x30,0x32,0x35,0x2d,0x30,
0x34,0x2d,0x31,0x35,0x54,0x32,0x31,0x3a,0x35,0x37,0x3a,0x31,0x39,0x2b,0x30,
0x30,0x3a,0x30,0x30,0xd4,0x9e,0xdd,0x67,0x00,0x00,0x00,0x28,0x74,0x45,0x58,
0x74,0x64,0x61,0x74,0x65,0x3a,0x74,0x69,0x6d,0x65,0x73,0x74,0x61,0x6d,0x70,
0x00,0x32,0x30,0x32,0x35,0x2d,0x30,0x39,0x2d,0x31,0x35,0x54,0x32,0x31,0x3a,
0x32,0x37,0x3a,0x31,0x30,0x2b,0x30,0x30,0x3a,0x30,0x30,0x08,0x03,0x3c,0xd7,
0x00,0x00,0x00,0x00,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
}

Look at icon_example/ directory for an example how a 16.x16 PNG file is converted to Go byte array to use as an icon for the systray.

Download

Pre-compiled binaries for Windows and Ubuntu are available from Releases page

Install

Linux Debian package

A pre-built Debian package is available. To install the package, type

sudo dpkg -i hod_1.8-ubuntu_amd64.deb

To remove the package, type:

sudo dpkg -r hod

Windows

Build from Source

Linux/Unix/MacOS

Go to the source directory and type:

$ sh ./configure
$ make clean
$ make
# make install

or

$ sudo make install

Microsoft Windows

MINGW64

This time I used MING64 (Sep-17-2025) to compile. To compile, just like Linux/Mac:

./configure
make

Visual Studio

A compiled binary for MS Windows is already supplied. However, if you need to modify something or want to compile it yourself, you will need MS Visual Studio (I used MS Visual Studio 10, freely available from Microsoft). To compile, open a command shell and type:

c:\> nmake -f Makefile.win clean
c:\> nmake -f Makefile.win

TOC is created by https://github.com/muquit/markdown-toc-go on Sep-17-2025

About

hexadecimal or octal data dumper

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Repository files navigation

Table Of Contents

Introduction

hod is a very simple, nice little hexadecimal and octal data dumper. It is very useful when dealing with binary data. I wrote it long long time ago, because I did not like the complexities and the output format of od and such programs. I hope you will find it useful.

Suggestions, bug reports are always welcome.

Synopsis

 hod v1.8
https://www.muquit.com/
usage: ./hod [options] <filename>
Where the options are:
-v : show version information
-h : show this help
-i : output C header file
-g : output golang byte array
-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

Version

The latest version is 1.8.

Please look at ChangeLog for details.

Examples

hexdump a binary file

$ 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 .=....

Octal dump

$ hod -o foo.bin
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 006 075 .=.....=
230: 206 020 056 000 ....

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 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

Create C header file

$ hod -i square.gif > square.h

The header file square.h will look like:

/*
** This file is created by hod 1.7 by running:
** hod -i square.gif
** on Sun May 13 14:44:25 2012
** hod is a free software available from: http://www.muquit.com/
*/
#ifndef square_gif_H
#define square_gif_H 1
const unsigned char square_gif[]=
{
0x47,0x49,0x46,0x38,0x39,0x61,0x10,0x00,0x10,0x00,0xf3,0x00,0x00,0x00,0x00,
0x00,0x10,0x0f,0x0e,0x20,0x1e,0x1b,0x30,0x2d,0x29,0x3f,0x3b,0x36,0x4f,0x4a,
0x44,0x5f,0x59,0x52,0x6f,0x68,0x5f,0x7f,0x77,0x6d,0x8f,0x86,0x7a,0x9f,0x95,
0x88,0xaf,0xa4,0x96,0xbe,0xb2,0xa3,0xce,0xc1,0xb1,0xde,0xd0,0xbe,0xee,0xdf,
0xcc,0x21,0xf9,0x04,0x00,0x00,0x00,0x00,0x00,0x2c,0x00,0x00,0x00,0x00,0x10,
0x00,0x10,0x00,0x00,0x04,0x4e,0xf0,0xc9,0x49,0xeb,0x73,0x38,0xeb,0xed,0x9a,
0xff,0x60,0xd8,0x30,0x64,0x69,0x9e,0xcc,0xa2,0xae,0x6c,0xbb,0x28,0x70,0x2c,
0xcf,0x4a,0x62,0xdf,0x78,0x9e,0x20,0x7c,0xef,0xff,0x88,0x83,0x70,0x48,0x2c,
0x1e,0x0c,0xc8,0xa4,0x72,0x69,0x28,0x38,0x9f,0xd0,0x68,0x81,0x40,0xad,0x5a,
0xaf,0x84,0x81,0x76,0xcb,0xed,0x0e,0x04,0xe0,0xb0,0x78,0x2c,0x08,0x98,0xcf,
0xe8,0x74,0x00,0xc0,0x6e,0xbb,0xdf,0x80,0x08,0x00,0x3b,
};
const unsigned int square_gif_len=161;
#endif /* square_gif_H */

Create Go byte array

$ hod -g icon.png > icon.go

The icon.go file will look like:

/
// This file is created by hod 1.8 by running:
// hod -g icon.png
// hod is a free software available from: https://www.muquit.com/
//
package Icon
var Data []byte = []byte {
0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,
0x52,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x04,0x03,0x00,0x00,0x00,0xed,
0xdd,0xe2,0x52,0x00,0x00,0x00,0x20,0x63,0x48,0x52,0x4d,0x00,0x00,0x7a,0x26,
0x00,0x00,0x80,0x84,0x00,0x00,0xfa,0x00,0x00,0x00,0x80,0xe8,0x00,0x00,0x75,
0x30,0x00,0x00,0xea,0x60,0x00,0x00,0x3a,0x98,0x00,0x00,0x17,0x70,0x9c,0xba,
0x51,0x3c,0x00,0x00,0x00,0x30,0x50,0x4c,0x54,0x45,0xee,0xdf,0xcc,0xde,0xd0,
0xbe,0xce,0xc1,0xb1,0xbe,0xb2,0xa3,0xaf,0xa4,0x96,0x9f,0x95,0x88,0x8f,0x86,
0x7a,0x7f,0x77,0x6d,0x6f,0x68,0x5f,0x5f,0x59,0x52,0x4f,0x4a,0x44,0x3f,0x3b,
0x36,0x30,0x2d,0x29,0x20,0x1e,0x1b,0x10,0x0f,0x0e,0x00,0x00,0x00,0xb6,0x15,
0xcf,0x2d,0x00,0x00,0x00,0x01,0x62,0x4b,0x47,0x44,0x0f,0x18,0xba,0x00,0xd9,
0x00,0x00,0x00,0x07,0x74,0x49,0x4d,0x45,0x07,0xe9,0x09,0x0f,0x15,0x1b,0x0a,
0xfb,0xe2,0xd1,0xd2,0x00,0x00,0x00,0x3b,0x49,0x44,0x41,0x54,0x08,0xd7,0x35,
0xc1,0xc1,0x00,0x00,0x21,0x00,0x00,0xc1,0x55,0x48,0x21,0x85,0x14,0x52,0x48,
0x21,0x85,0x14,0x52,0x48,0x21,0x85,0x53,0x38,0x85,0x14,0x52,0xa8,0xcf,0x36,
0x03,0x4f,0x10,0x51,0x24,0x91,0x45,0x11,0x55,0x34,0xd1,0xc5,0x10,0x53,0x7c,
0xe2,0x17,0x4b,0x6c,0x71,0x74,0x01,0x95,0x95,0x3f,0xc1,0x40,0x15,0x38,0x32,
0x00,0x00,0x00,0x25,0x74,0x45,0x58,0x74,0x64,0x61,0x74,0x65,0x3a,0x63,0x72,
0x65,0x61,0x74,0x65,0x00,0x32,0x30,0x32,0x35,0x2d,0x30,0x39,0x2d,0x31,0x35,
0x54,0x32,0x31,0x3a,0x30,0x36,0x3a,0x33,0x33,0x2b,0x30,0x30,0x3a,0x30,0x30,
0xea,0x28,0x6a,0xab,0x00,0x00,0x00,0x25,0x74,0x45,0x58,0x74,0x64,0x61,0x74,
0x65,0x3a,0x6d,0x6f,0x64,0x69,0x66,0x79,0x00,0x32,0x30,0x32,0x35,0x2d,0x30,
0x34,0x2d,0x31,0x35,0x54,0x32,0x31,0x3a,0x35,0x37,0x3a,0x31,0x39,0x2b,0x30,
0x30,0x3a,0x30,0x30,0xd4,0x9e,0xdd,0x67,0x00,0x00,0x00,0x28,0x74,0x45,0x58,
0x74,0x64,0x61,0x74,0x65,0x3a,0x74,0x69,0x6d,0x65,0x73,0x74,0x61,0x6d,0x70,
0x00,0x32,0x30,0x32,0x35,0x2d,0x30,0x39,0x2d,0x31,0x35,0x54,0x32,0x31,0x3a,
0x32,0x37,0x3a,0x31,0x30,0x2b,0x30,0x30,0x3a,0x30,0x30,0x08,0x03,0x3c,0xd7,
0x00,0x00,0x00,0x00,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
}

Look at icon_example/ directory for an example how a 16.x16 PNG file is converted to Go byte array to use as an icon for the systray.

Download

Pre-compiled binaries for Windows and Ubuntu are available from Releases page

Install

Linux Debian package

A pre-built Debian package is available. To install the package, type

sudo dpkg -i hod_1.8-ubuntu_amd64.deb

To remove the package, type:

sudo dpkg -r hod

Windows

Build from Source

Linux/Unix/MacOS

Go to the source directory and type:

$ sh ./configure
$ make clean
$ make
# make install

or

$ sudo make install

Microsoft Windows

MINGW64

This time I used MING64 (Sep-17-2025) to compile. To compile, just like Linux/Mac:

./configure
make

Visual Studio

A compiled binary for MS Windows is already supplied. However, if you need to modify something or want to compile it yourself, you will need MS Visual Studio (I used MS Visual Studio 10, freely available from Microsoft). To compile, open a command shell and type:

c:\> nmake -f Makefile.win clean
c:\> nmake -f Makefile.win

TOC is created by https://github.com/muquit/markdown-toc-go on Sep-17-2025

About

hexadecimal or octal data dumper

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages