ISOFT
  • access_timeПонедельник-Пятница: 9:00 до 18:00
compare_arrows0

Xd.lua -

The basic script requires a terminal or environment that can interpret the standard output properly. It does not provide an interactive "editor" interface, only a display.

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

It provides a simple, dependency-free way to examine binary files using only Lua's standard libraries. The basic script requires a terminal or environment

Based on the search results, xd.lua is a well-known sample script historically included in the Lua distribution (up to Lua 5.1) used to perform a on files. It is designed to display the hexadecimal representation of a file's content directly in the terminal, making it useful for inspecting binary data. Key Features and Review It provides a simple, dependency-free way to examine

-- 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) ?

Is it possible to perform a hexdump in Lua code - Stack Overflow

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