Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local term = require("term")
- local component = require("component")
- local shell = require("shell")
- local fs = require("filesystem")
- local drive = component.drive
- local offset = 1
- local data = {}
- local filename = ""
- local length = 0
- local args = shell.parse(...)
- filename = args[1]
- length = drive.getCapacity()
- local function displayBytes()
- length = drive.getCapacity()
- repeat
- data = drive.readByte(offset)
- offset = offset + 1
- term.write(string.format("%02x", string.byte(data)))
- term.write(" ")
- -- term.write(offset)
- local cursorX, cursorY = term.getCursor()
- term.setCursor(cursorX + 2, cursorY)
- until string.byte(data) == 48
- end
- displayBytes()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement