Created
May 4, 2012 07:19
-
-
Save Bobbias/2592829 to your computer and use it in GitHub Desktop.
For converting hex text to bin data for 0x10c ARG
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
import string | |
from bitstring import BitStream, BitArray | |
in_file = open("dump.log", "r") | |
out_file = open("dump.bin", "w") | |
text = in_file.read() | |
in_file.close() | |
split_text = text.splitlines() | |
for line in split_text: | |
blocks = line.split(' ') | |
for block in blocks: | |
b = BitArray(hex=block) | |
out_file.write(b.tobytes()) | |
raw_input() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment