Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function SaveObjectList()
- local objlist = readInteger(0x1DDE268)
- local count = readInteger(objlist)
- objlist = readInteger(objlist + 0x04)
- local stage = readBytes(0x1934B70, 1, false)
- local file = io.open("objlist"..stage..".csv", "w+")
- file:write("name,flags,list,routine\n")
- for i=0,count-1 do
- local name = readString(readInteger(objlist + 0x0C), 64)
- local flags = readBytes(objlist, 1, false)
- local list = readBytes(objlist + 0x01, 1, false)
- local routine = readInteger(objlist + 0x08)
- if name == nil then name = "???" end
- file:write(name..","..num2hex(flags)..","..num2hex(list)..","..num2hex(routine).."\n")
- objlist = objlist + 0x10
- end
- file:close()
- end
- function num2hex(num)
- if num ~= nil then
- local hexstr = '0123456789ABCDEF'
- local s = ''
- while num > 0 do
- local mod = math.fmod(num, 16)
- s = string.sub(hexstr, mod+1, mod+1) .. s
- num = math.floor(num / 16)
- end
- if s == '' then s = '0' end
- return s
- else
- return ""
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement