aboutsummaryrefslogtreecommitdiffstats
path: root/bruiser/lua-scripts/df-demo.lua
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2018-04-30 20:11:29 +0000
committerbloodstalker <thabogre@gmail.com>2018-04-30 20:11:29 +0000
commitb6107d5bb6aeef6ab03909750f59196555c51081 (patch)
tree3240c1651c57d819c54a4441b1bb2c61fad6f842 /bruiser/lua-scripts/df-demo.lua
parentramdump is here (diff)
downloadmutator-b6107d5bb6aeef6ab03909750f59196555c51081.tar.gz
mutator-b6107d5bb6aeef6ab03909750f59196555c51081.zip
fixes #30. run make deepclean on bruiser. lua needs to be rebuilt. added a new commandline option, --keepalive. drops to cli if you were running in non-cli after script finishes running.
Diffstat (limited to '')
-rw-r--r--bruiser/lua-scripts/df-demo.lua28
1 files changed, 14 insertions, 14 deletions
diff --git a/bruiser/lua-scripts/df-demo.lua b/bruiser/lua-scripts/df-demo.lua
index 916db00..ac54c94 100644
--- a/bruiser/lua-scripts/df-demo.lua
+++ b/bruiser/lua-scripts/df-demo.lua
@@ -3,20 +3,20 @@ 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
+function df_demo()
+ df_exe = "/home/bloodstalker/df/df_44_09_linux/df_linux/libs/Dwarf_Fortress"
+ --asmrw.strings(df_exe)
+ pgrep_handle = io.popen("pgrep Dwarf_Fortress")
+ for pid in pgrep_handle:lines() do
+ df_pid = tonumber(pid)
end
- io.write("\0\n")
+ print("df pid is "..tostring(df_pid))
+ ramdump(df_pid, "/tmp/ramdump")
+ -- @DEVI-broken
+ --ramdump(11419, "/tmp/ramdump")
+ ram = io.open("/tmp/ramdump", "r")
+ io.input(ram)
+ print(io.read())
end
-asmrw.strings(df_exe)
+df_demo()