Repository navigation
bruiser Xobject Module
The xobjs module mostly provides convenience and/or lazy functions to access load.py from lua.
The module's source file is /bruiser/lua-scripts/xobj.lua.
The module's name that you would need to use in lua is xobj.
To prevent any confusions, in this wiki entry, objects are objects as defined in an ELF file, not the OO objects. In other words, they are variables.
SO is short for shared object library.
Here's a list of the functions currently available:
getSO() :
Read in the shared object library's full name(i.e directory and name).
getGlobalTable():
Returns a table of the objects in the shared object library file. The keys are the name and the values are the object size.
printObjNames():
Print the names of all the functions.
printObjSizes():
Print the size of the objects.
printFuncNames():
Print the function names.
printFuncCode():
Print the machine code of the functions.
findMain():
Returns a number representing the index of the function named "main" in the table returned by load.py for the functions.
codeTables():
Returns a table of tables. The tables contain the machine code of all the functions inside the SO. The table keys are all numbers. The values are tables, and those tables contain the machine code. Each table entry is one byte.
codeTableByName(name)
Returns a table containing the machine code of the function names "name". The table keys are numbers.
codeTableByName_number()
printFuncSizes:()
Prints the sizes of the functions found in the So.
getTextSection():
Return the .text section in the ELF file.
getRODataSection():
Return the .rodata section in the ELF file.
CSDump(code):
Prints the assembly for table "code" using libcapstone. Each table entry is a number representing a single byte.