Skip to content

Instantly share code, notes, and snippets.

@bvanheu
Created September 29, 2013 18:07
Show Gist options
  • Save bvanheu/6754986 to your computer and use it in GitHub Desktop.
Save bvanheu/6754986 to your computer and use it in GitHub Desktop.
import sys
import re
f_in = open(sys.argv[1], "r")
f_out = open(sys.argv[1] + ".bin", "w")
for line in f_in:
m = re.match("^[0-9A-F]{6}: ", line)
if (m):
line = line.split(" ")
line = line[1:17]
for b in line:
f_out.write(b.decode("hex"))
f_in.close()
f_out.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment