Created
August 19, 2012 05:04
-
-
Save Santarh/3392201 to your computer and use it in GitHub Desktop.
ruby hex2bin
This file contains hidden or 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
# | |
# input txt style | |
# 00 00 14 66 2a ... | |
# | |
input = open("input.hex") | |
output = open("output.bin", "w") | |
while line = input.gets | |
a = line.split.collect{|c| c.hex} | |
output.write a.pack("C*") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment