Advertisement
Zanoab

regdump.lua

Sep 14th, 2014
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.56 KB | None | 0 0
  1. local address = 0x239b04E
  2. local length = 2
  3.  
  4. function openLog()
  5.     return io.open("dump.log", "a")
  6. end
  7.  
  8. function dumpRegisters(f)
  9.     f:write("Instruction Address:\t" .. bit.tohex(memory.getregister("main.r15")-8) .. "\n\t")
  10.     for r = 0, 15 do
  11.         f:write("r"..r..":"..bit.tohex(memory.getregister("main.r"..r)).."\t")
  12.     end
  13.     f:write("\n")
  14. end
  15.  
  16. function dump()
  17.     f = openLog()
  18.     dumpRegisters(f)
  19.     f:close()
  20. end
  21.  
  22. local f = openLog()
  23. f:write("------------------\n")
  24. f:close()
  25.  
  26. memory.registerread(address, length, dump)
  27. memory.registerwrite(address, length, dump)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement