Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.43 KB | None | 0 0
  1.         local f = assert(io.open(arg[1], "rb"))
  2.         local block = 10
  3.         while true do
  4.           local bytes = f:read(block)
  5.           if not bytes then break end
  6.           for b in string.gfind(bytes, ".") do
  7.             io.write(string.format("%02X ", string.byte(b)))
  8.           end
  9.           io.write(string.rep("   ", block - string.len(bytes) + 1))
  10.           io.write(string.gsub(bytes, "%c", "."), "\n")
  11.         end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement