Skip to content

Instantly share code, notes, and snippets.

@nst
Created March 13, 2014 09:00
Show Gist options
  • Save nst/9524736 to your computer and use it in GitHub Desktop.
Save nst/9524736 to your computer and use it in GitHub Desktop.
# http://corkami.googlecode.com/svn/trunk/src/HexII/
$ ./hello
Hello world
$ hexdump hello
0000000 ce fa ed fe 07 00 00 00 03 00 00 00 02 00 00 00
0000010 02 00 00 00 88 00 00 00 01 00 00 00 01 00 00 00
0000020 38 00 00 00 5f 5f 54 45 58 54 00 00 00 00 00 00
0000030 00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00
0000040 40 00 00 00 07 00 00 00 05 00 00 00 00 00 00 00
0000050 00 00 00 00 05 00 00 00 50 00 00 00 01 00 00 00
0000060 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000080 00 00 00 00 00 00 00 00 00 00 00 00 a4 00 00 00
0000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000a0 00 00 00 00 6a 0c 68 c0 00 00 00 6a 01 b0 04 83
00000b0 ec 04 cd 80 83 c4 10 6a 00 b0 01 83 ec 04 cd 80
00000c0 48 65 6c 6c 6f 20 77 6f 72 6c 64 0a
00000cc
$ python hexii.py hello > hello.txt
$ cat hello.txt
00: CE FA ED FE 07 03 02 |
10: 02 88 01 01 |
20: .8 ._ ._ .T .E .X .T |
30: 10 |
40: .@ 07 05 |
50: 05 .P 01 |
60: 10 |
80: A4 |
A0: .j 0C .h C0 .j 01 B0 04 83|
B0: EC 04 CD 80 83 C4 10 .j B0 01 83 EC 04 CD 80|
C0: .H .e .l .l .o 20 .w .o .r .l .d 0A ]
$ python hexII2bin.py hello.txt hello2
$ chmod +x hello2
$ ./hello2
Hello world
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment