Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Sep 21st, 2012  |  syntax: None  |  size: 0.19 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #
  2. # input txt style
  3. # 00 00 14 66 2a ...
  4. #
  5.  
  6. input = open("input.hex")
  7. output = open("output.bin", "w")
  8. while line = input.gets
  9.     a = line.split.collect{|c| c.hex}
  10.     output.write a.pack("C*")
  11. end