Created
November 2, 2014 11:45
-
-
Save bjoern-r/d5ff578eb024c458f737 to your computer and use it in GitHub Desktop.
convert hex to binary in python.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#copied from http://ctfcrew.org/writeup/90 | |
f = open('openwrt-wrtsl54gs-squashfs.hex', 'r') | |
w = open('openwrt-wrtsl54gs-squashfs.bin', 'wb') | |
lines = f.readlines() | |
for l in lines: | |
w.write(l.strip('\n').decode('hex')) | |
w.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment