Skip to content

Instantly share code, notes, and snippets.

@vgmoose
Created January 23, 2015 20:04
Show Gist options
  • Save vgmoose/3f880418b1879dbcc447 to your computer and use it in GitHub Desktop.
Save vgmoose/3f880418b1879dbcc447 to your computer and use it in GitHub Desktop.
import sys
a = open(sys.argv[1]).read()
for x in range(0, len(a), 16):
line = a[x:x+16]
hexl = ' '.join(y.encode('hex') for y in line)
hexl += ' '*(47-len(hexl))
hexl = hexl[:24] + " " + hexl[24:]
line = line.replace("\n", ".")
print "%08x" % x, " "+hexl, " |"+line+"|"
print "%08x" % len(a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment