Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
364 B

  1. -- hex dump
  2. -- usage: lua xd.lua < file
  3. local offset=0
  4. while true do
  5. local s=io.read(16)
  6. if s==nil then return end
  7. io.write(string.format("%08X ",offset))
  8. string.gsub(s,"(.)",
  9. function (c) io.write(string.format("%02X ",string.byte(c))) end)
  10. io.write(string.rep(" ",3*(16-string.len(s))))
  11. io.write(" ",string.gsub(s,"%c","."),"\n")
  12. offset=offset+16
  13. end