diff options
Diffstat (limited to 'bruiser/lua-scripts')
-rw-r--r-- | bruiser/lua-scripts/demo1.lua | 10 | ||||
-rw-r--r-- | bruiser/lua-scripts/demo2.lua | 11 |
2 files changed, 13 insertions, 8 deletions
diff --git a/bruiser/lua-scripts/demo1.lua b/bruiser/lua-scripts/demo1.lua index 6f02860..964fd81 100644 --- a/bruiser/lua-scripts/demo1.lua +++ b/bruiser/lua-scripts/demo1.lua @@ -121,7 +121,7 @@ function printFuncSizes() end end -function main() +function demo1() pwd() printObjNames() printObjSizes() @@ -209,8 +209,14 @@ local C_main_code = codeTableByName("'main'") a = xobjlist() print("the offset of quad and add2 is : ", a["quad"] - a["add2"]) + mem_size = xmemusage() + print("memory used "..mem_size) + xclear() + mem_size = xmemusage() + print("memory used "..mem_size) + end -main() +demo1() -------------------------------------------------------------------------------------------------------------- diff --git a/bruiser/lua-scripts/demo2.lua b/bruiser/lua-scripts/demo2.lua index a5cf1af..73a177c 100644 --- a/bruiser/lua-scripts/demo2.lua +++ b/bruiser/lua-scripts/demo2.lua @@ -11,7 +11,7 @@ function get_jmp_type(val) return "U" end -function main() +function demo21() xobj.getSO(elf_file) local add2_code = xobj.codeTableByName_number("'add2'") local sub2_code = xobj.codeTableByName_number("'sub2'") @@ -21,8 +21,6 @@ function main() local quad_code = xobj.codeTableByName_number("'quad'") local passthrough_code = xobj.codeTableByName_number("'passthrough'") - --xobj.printFuncSizes() - xobjregister(add2_code, "add2") xobjregister(sub2_code, "sub2") xobjregister(adddouble_code, "adddouble") @@ -32,7 +30,7 @@ function main() xobjregister(passthrough_code, "passthrough") end -function pretty_dump() +function demo22() count = 0 local text_section = xobj.getTextSection(elf_exe) io.write(colors("%{blue}".." ".."\t".."00 ".."01 ".."02 ".."03 ".."04 ".."05 ".."06 ".."07 ".."08 ".."09 ".."0A ".."0B ".."0C ".."0D ".."0E ".."0F")) @@ -118,9 +116,10 @@ function get_jmp_table() end --main() -pretty_dump() --test() --jmp_t_test() --integ_test() ---asm_rewriter_pretty() +asm_rewriter_pretty() --dump_jmp_table() +demo21() +demo22() |