Xd.lua

It is designed to be run from the command line, for example: lua xd.lua < yourfile .

While the snippet provided is for Lua 5.1, it can be adapted for newer versions. xd.lua

-- Example Usage (as found on Stack Overflow) -- Usage: lua xd.lua < file local offset=0 -- Starts at offset 0 while true do local s=io.read(16) -- Reads 16 bytes if s==nil then return end -- Ends at end of file io.write(string.format("%08X ",offset)) -- Prints offset string.gsub(s,"(.)", function (c) io.write(string.format("%02X ",string.byte(c))) -- Prints hex end) io.write(string.rep(" ",3*(16-string.len(s)))) io.write(" ",string.gsub(s,"%c","."),"\n") -- Prints ASCII offset=offset+16 end Use code with caution. (Based on snippet in) To give you a better review, could you tell me: Are you trying to or inspect game data ? Are you using standard Lua , LuaJIT , or Luau (Roblox) ? It is designed to be run from the

The script reads a file and prints its contents in a structured 8-digit hexadecimal offset followed by 16 bytes per line. xd.lua

  Report Error: General English Questions and Answers for Competitive Exam

Please Enter Message
Error Reported Successfully