aboutsummaryrefslogtreecommitdiffstats
path: root/bruiser/lua-scripts
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2018-09-08 22:44:20 +0000
committerbloodstalker <thabogre@gmail.com>2018-09-08 22:44:20 +0000
commit2cd674dac75855c35373d3e6b89359f3e89b1178 (patch)
tree6fd311b001c475c0a5ccdab4488c31f36be93248 /bruiser/lua-scripts
parentsome cosmetic changes and makefile fixes (diff)
downloadmutator-2cd674dac75855c35373d3e6b89359f3e89b1178.tar.gz
mutator-2cd674dac75855c35373d3e6b89359f3e89b1178.zip
jmp_t_s now uses the new way of registering tables, the 5.3 way. bruiser is supposed to be luarocks-friendly so i wont remove the compatibility build.
Diffstat (limited to '')
-rw-r--r--bruiser/lua-scripts/asmrw.lua24
-rw-r--r--bruiser/lua-scripts/asmtest.lua6
-rw-r--r--bruiser/lua-scripts/demo2.lua4
3 files changed, 19 insertions, 15 deletions
diff --git a/bruiser/lua-scripts/asmrw.lua b/bruiser/lua-scripts/asmrw.lua
index b8de4c5..07844ca 100644
--- a/bruiser/lua-scripts/asmrw.lua
+++ b/bruiser/lua-scripts/asmrw.lua
@@ -22,14 +22,14 @@ xobj = require("xobj")
-- this will hold a copy of the original text section
local text_buffer = {}
-setmetatable(jmp_s_t, {__call =
- function(self, arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12)
- local t = self.new(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12)
- print("created", t)
- return t
- end
- }
-)
+--setmetatable(jmp_s_t, {__call =
+ --function(self, arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12)
+ --local t = self.new(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12)
+ --print("created", t)
+ --return t
+ --end
+ --}
+--)
function asmrw.strings(exe)
io.write(colors("%{cyan}".."lua:getting text section...\n"))
@@ -48,10 +48,10 @@ end
function asmrw.strings_deep(exe)
end
-function jmp_s_t:dump(msg)
- print(msg, self:custom())
- return self
-end
+--function jmp_s_t:dump(msg)
+ --print(msg, self:custom())
+ --return self
+--end
function asmrw.get_head(elf_exe)
local text_section = xobj.getTextSection(elf_exe)
diff --git a/bruiser/lua-scripts/asmtest.lua b/bruiser/lua-scripts/asmtest.lua
index d7c0583..f5809d8 100644
--- a/bruiser/lua-scripts/asmtest.lua
+++ b/bruiser/lua-scripts/asmtest.lua
@@ -5,13 +5,13 @@ asmrw = require("asmrw")
function test()
local elf_exe = "../bfd/test/test"
local text_section = xobj.getTextSection(elf_exe)
- local head = jmp_s_t()
+ -- local head = jmp_s_t()
-- messes up the stack. I could fix it but not sure why i would want to keep this in
--local head2 = jmp_s_t:new()
- head = getjmptable(#text_section, text_section)
+ local head = getjmptable(#text_section, text_section)
while head:inext() ~= nil do
- head:dump("entry")
+ --head:dump("entry")
io.write("type:", head:type(), "\tlocation:", "0x"..string.format("%x", head:location()))
print()
head = head:inext()
diff --git a/bruiser/lua-scripts/demo2.lua b/bruiser/lua-scripts/demo2.lua
index 73a177c..4a1730e 100644
--- a/bruiser/lua-scripts/demo2.lua
+++ b/bruiser/lua-scripts/demo2.lua
@@ -52,16 +52,20 @@ function test()
print(dummy)
end
+--[[
setmetatable(jmp_s_t, {__call = function(self, arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12)
local t = self.new(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12)
print("created", t)
return t
end})
+]]--
+--[[
function jmp_s_t:show(msg)
print(msg, self, self:custom())
return self
end
+]]--
function jmp_t_test()
local t = jmp_s_t.new(1,2,3,nil,nil,nil,7,8,9,0,0,1)