Skip to content

Instantly share code, notes, and snippets.

@spiiin
Created May 31, 2014 17:48
Show Gist options
  • Select an option

  • Save spiiin/88f80daaac6ab6bf5822 to your computer and use it in GitHub Desktop.

Select an option

Save spiiin/88f80daaac6ab6bf5822 to your computer and use it in GitHub Desktop.
Логгирование архивов
require "binio"
local time, cnt
time = 0
cnt = 1
memory.registerexec(0xCFC2, function()
log = io.open ("data1.log", "a");
local pr = string.format("addr: %02X:%02X%02X to:%02X%02X\n", memory.readbyte(0x69), memory.readbyte(0x68),memory.readbyte(0x67), memory.readbyte(0x6B), memory.readbyte(0x6A))
log:write(pr)
log:close()
print(pr)
if os.clock() - time > 4 then
cnt = cnt + 1
log = io.open ("data1.log", "a");
log:write(string.format("\n(%03d)----\n", cnt))
print("----")
log:close()
end
time = os.clock()
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment