miasm
Reverse engineering framework
miasm.jitter.jitload.Jitter Class Reference
Inheritance diagram for miasm.jitter.jitload.Jitter:
Collaboration diagram for miasm.jitter.jitload.Jitter:

Public Member Functions

def __init__ (self, ir_arch, jit_type="gcc")
 
def init_exceptions_handler (self)
 
def add_breakpoint (self, addr, callback)
 
def set_breakpoint (self, addr, *args)
 
def get_breakpoint (self, addr)
 
def remove_breakpoints_by_callback (self, callback)
 
def remove_breakpoints_by_address (self, address)
 
def add_exception_handler (self, flag, callback)
 
def run_at (self, pc)
 
def runiter_once (self, pc)
 
def init_run (self, pc)
 
def continue_run (self, step=False, trace=False)
 
def run (self, addr)
 
def run_until (self, addr, trace=False)
 
def init_stack (self)
 
def get_exception (self)
 
def get_c_str (self, addr, max_char=None)
 
def set_c_str (self, addr, value)
 
def get_str_ansi (self, addr, max_char=None)
 
def get_str_unic (self, addr, max_char=None)
 
def handle_function (self, f_addr)
 
def add_lib_handler (self, libs, user_globals=None)
 
def eval_expr (self, expr)
 
def set_trace_log (self, trace_instr=True, trace_regs=True, trace_new_blocks=False)
 

Static Public Member Functions

def handle_lib (jitter)
 

Public Attributes

 arch
 
 attrib
 
 vm
 
 cpu
 
 ir_arch
 
 bs
 
 ircfg
 
 symbexec
 
 jit
 
 stack_size
 
 stack_base
 
 breakpoints_handler
 
 exceptions_handler
 
 exec_cb
 
 pc
 
 run_iterator
 
 run
 
 libs
 
 user_globals
 

Static Public Attributes

 C_Gen = CGen
 

Constructor & Destructor Documentation

◆ __init__()

def miasm.jitter.jitload.Jitter.__init__ (   self,
  ir_arch,
  jit_type = "gcc" 
)
Init an instance of jitter.
@ir_arch: ir instance for this architecture
@jit_type: JiT backend to use. Available options are:
    - "gcc"
    - "llvm"
    - "python"

Member Function Documentation

◆ add_breakpoint()

def miasm.jitter.jitload.Jitter.add_breakpoint (   self,
  addr,
  callback 
)
Add a callback associated with addr.
@addr: breakpoint address
@callback: function with definition (jitter instance)
Here is the caller graph for this function:

◆ add_exception_handler()

def miasm.jitter.jitload.Jitter.add_exception_handler (   self,
  flag,
  callback 
)
Add a callback associated with an exception flag.
@flag: bitflag
@callback: function with definition (jitter instance)
Here is the caller graph for this function:

◆ add_lib_handler()

def miasm.jitter.jitload.Jitter.add_lib_handler (   self,
  libs,
  user_globals = None 
)
Add a function to handle libs call with breakpoints
@libs: libimp instance
@user_globals: dictionary for defined user function

◆ continue_run()

def miasm.jitter.jitload.Jitter.continue_run (   self,
  step = False,
  trace = False 
)
PRE: init_run.
Continue the run of the current session until iterator returns or run is
set to False.
If step is True, run only one time.
If trace is True, activate trace log option until execution stops
Return the iterator value
Here is the call graph for this function:
Here is the caller graph for this function:

◆ eval_expr()

def miasm.jitter.jitload.Jitter.eval_expr (   self,
  expr 
)
Eval expression @expr in the context of the current instance. Side
effects are passed on it

◆ get_breakpoint()

def miasm.jitter.jitload.Jitter.get_breakpoint (   self,
  addr 
)
Return breakpoints handlers for address @addr
@addr: integer

◆ get_c_str()

def miasm.jitter.jitload.Jitter.get_c_str (   self,
  addr,
  max_char = None 
)
Get C str from vm.
@addr: address in memory
@max_char: maximum len
Here is the call graph for this function:

◆ get_exception()

def miasm.jitter.jitload.Jitter.get_exception (   self)

◆ get_str_ansi()

def miasm.jitter.jitload.Jitter.get_str_ansi (   self,
  addr,
  max_char = None 
)

◆ get_str_unic()

def miasm.jitter.jitload.Jitter.get_str_unic (   self,
  addr,
  max_char = None 
)

◆ handle_function()

def miasm.jitter.jitload.Jitter.handle_function (   self,
  f_addr 
)
Add a breakpoint which will trigger the function handler
Here is the call graph for this function:

◆ handle_lib()

def miasm.jitter.jitload.Jitter.handle_lib (   jitter)
static
Resolve the name of the function which cause the handler call. Then
call the corresponding handler from users callback.
Here is the caller graph for this function:

◆ init_exceptions_handler()

def miasm.jitter.jitload.Jitter.init_exceptions_handler (   self)
Here is the call graph for this function:

◆ init_run()

def miasm.jitter.jitload.Jitter.init_run (   self,
  pc 
)
Create an iterator on pc with runiter.
@pc: address of code to run
Here is the caller graph for this function:

◆ init_stack()

def miasm.jitter.jitload.Jitter.init_stack (   self)
Here is the call graph for this function:

◆ remove_breakpoints_by_address()

def miasm.jitter.jitload.Jitter.remove_breakpoints_by_address (   self,
  address 
)
Remove all breakpoints associated with @address.
@address: address of breakpoints to remove

◆ remove_breakpoints_by_callback()

def miasm.jitter.jitload.Jitter.remove_breakpoints_by_callback (   self,
  callback 
)
Remove callbacks associated with breakpoint.
@callback: callback to remove

◆ run()

def miasm.jitter.jitload.Jitter.run (   self,
  addr 
)
Launch emulation
@addr: (int) start address
Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_at()

def miasm.jitter.jitload.Jitter.run_at (   self,
  pc 
)
Wrapper on JiT backend. Run the code at PC and return the next PC.
@pc: address of code to run

◆ run_until()

def miasm.jitter.jitload.Jitter.run_until (   self,
  addr,
  trace = False 
)
PRE: init_run.
Continue the run of the current session until iterator returns, run is
set to False or addr is reached.
If trace is True, activate trace log option until execution stops
Return the iterator value
Here is the call graph for this function:

◆ runiter_once()

def miasm.jitter.jitload.Jitter.runiter_once (   self,
  pc 
)
Iterator on callbacks results on code running from PC.
Check exceptions before breakpoints.
Here is the caller graph for this function:

◆ set_breakpoint()

def miasm.jitter.jitload.Jitter.set_breakpoint (   self,
  addr,
args 
)
Set callbacks associated with addr.
@addr: breakpoint address
@args: functions with definition (jitter instance)

◆ set_c_str()

def miasm.jitter.jitload.Jitter.set_c_str (   self,
  addr,
  value 
)
Set C str str from vm.
@addr: address in memory
@value: str
Here is the call graph for this function:

◆ set_trace_log()

def miasm.jitter.jitload.Jitter.set_trace_log (   self,
  trace_instr = True,
  trace_regs = True,
  trace_new_blocks = False 
)
Activate/Deactivate trace log options

@trace_instr: activate instructions tracing log
@trace_regs: activate registers tracing log
@trace_new_blocks: dump new code blocks log
Here is the caller graph for this function:

Member Data Documentation

◆ arch

miasm.jitter.jitload.Jitter.arch

◆ attrib

miasm.jitter.jitload.Jitter.attrib

◆ breakpoints_handler

miasm.jitter.jitload.Jitter.breakpoints_handler

◆ bs

miasm.jitter.jitload.Jitter.bs

◆ C_Gen

miasm.jitter.jitload.Jitter.C_Gen = CGen
static

◆ cpu

miasm.jitter.jitload.Jitter.cpu

◆ exceptions_handler

miasm.jitter.jitload.Jitter.exceptions_handler

◆ exec_cb

miasm.jitter.jitload.Jitter.exec_cb

◆ ir_arch

miasm.jitter.jitload.Jitter.ir_arch

◆ ircfg

miasm.jitter.jitload.Jitter.ircfg

◆ jit

miasm.jitter.jitload.Jitter.jit

◆ libs

miasm.jitter.jitload.Jitter.libs

◆ pc

miasm.jitter.jitload.Jitter.pc

◆ run

miasm.jitter.jitload.Jitter.run

◆ run_iterator

miasm.jitter.jitload.Jitter.run_iterator

◆ stack_base

miasm.jitter.jitload.Jitter.stack_base

◆ stack_size

miasm.jitter.jitload.Jitter.stack_size

◆ symbexec

miasm.jitter.jitload.Jitter.symbexec

◆ user_globals

miasm.jitter.jitload.Jitter.user_globals

◆ vm

miasm.jitter.jitload.Jitter.vm

The documentation for this class was generated from the following file: