Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- local io = require("io")
- local file = io.open(args[1],"r")
- local fo = io.open("/home/obj", "wb")
- if not file then
- error("No file")
- end
- local str = file:read(2)
- while str do
- print(str)
- if file:read(1)== "\r" then file:read(1) end
- fo:write(string.char(tonumber(str, 16)))
- str = file:read(2)
- -- os.sleep(1)
- end
- --fo:write(string.char(0x00))
- --fo:write(string.char(0x00))
- --fo:write(string.char(0xf0))
- --fo:write(string.char(0xff))
- fo:close()
- file:close()
Add Comment
Please, Sign In to add comment