aboutsummaryrefslogtreecommitdiffstats
path: root/bruiser/lua-scripts/df-demo.lua
blob: 916db0062bbafdc86c2f780fe08f07e853d3cc80 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
xobj = require("xobj")
asmrw = require("asmrw")
colors = require("ansicolors")

df_exe = "/home/bloodstalker/df/df_44_09_linux/df_linux/libs/Dwarf_Fortress"

function jmp_table_test()
  io.write(colors("%{cyan}".."lua:getting text section...\n"))
  local text_section = xobj.getTextSection(df_exe)
  local rodata = xobj.getRODataSection(df_exe)
  for k,v in pairs(rodata) do
    if v > 33 and v < 127 then 
      io.write(string.format("%c",v)) 
    else
      io.write(" ")
    end
  end
  io.write("\0\n")
end

asmrw.strings(df_exe)