miasm
Reverse engineering framework
miasm.ir.ir.IntermediateRepresentation Class Reference
Inheritance diagram for miasm.ir.ir.IntermediateRepresentation:
Collaboration diagram for miasm.ir.ir.IntermediateRepresentation:

Public Member Functions

def __init__ (self, arch, attrib, loc_db)
 
def get_ir (self, instr)
 
def new_ircfg (self, *args, **kwargs)
 
def new_ircfg_from_asmcfg (self, asmcfg, *args, **kwargs)
 
def instr2ir (self, instr)
 
def add_instr_to_ircfg (self, instr, ircfg, loc_key=None, gen_pc_updt=False)
 
def gen_pc_update (self, assignments, instr)
 
def add_instr_to_current_state (self, instr, block, assignments, ir_blocks_all, gen_pc_updt)
 
def add_asmblock_to_ircfg (self, block, ircfg, gen_pc_updt=False)
 
def add_block (self, block, gen_pc_updt=False)
 
def add_bloc (self, block, gen_pc_updt=False)
 
def get_next_loc_key (self, instr)
 
def get_loc_key_for_instr (self, instr)
 
def gen_loc_key_and_expr (self, size)
 
def expr_fix_regs_for_mode (self, expr, *args, **kwargs)
 
def expraff_fix_regs_for_mode (self, expr, *args, **kwargs)
 
def irbloc_fix_regs_for_mode (self, irblock, *args, **kwargs)
 
def is_pc_written (self, block)
 
def set_empty_dst_to_next (self, block, ir_blocks)
 
def post_add_asmblock_to_ircfg (self, block, ircfg, ir_blocks)
 

Public Attributes

 pc
 
 sp
 
 arch
 
 attrib
 
 loc_db
 
 IRDst
 

Detailed Description

Intermediate representation object

Allow native assembly to intermediate representation traduction

Constructor & Destructor Documentation

◆ __init__()

def miasm.ir.ir.IntermediateRepresentation.__init__ (   self,
  arch,
  attrib,
  loc_db 
)

Reimplemented in miasm.ir.ir.ir.

Member Function Documentation

◆ add_asmblock_to_ircfg()

def miasm.ir.ir.IntermediateRepresentation.add_asmblock_to_ircfg (   self,
  block,
  ircfg,
  gen_pc_updt = False 
)
Add a native block to the current IR
@block: native assembly block
@ircfg: IRCFG instance
@gen_pc_updt: insert PC update effects between instructions

Reimplemented in miasm.arch.mips32.ira.ir_a_mips32l, and miasm.arch.arm.sem.ir_arml.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_bloc()

def miasm.ir.ir.IntermediateRepresentation.add_bloc (   self,
  block,
  gen_pc_updt = False 
)
DEPRECATED function
Use add_asmblock_to_ircfg instead of add_bloc
Here is the call graph for this function:

◆ add_block()

def miasm.ir.ir.IntermediateRepresentation.add_block (   self,
  block,
  gen_pc_updt = False 
)
DEPRECATED function
Use add_asmblock_to_ircfg instead of add_block
Here is the caller graph for this function:

◆ add_instr_to_current_state()

def miasm.ir.ir.IntermediateRepresentation.add_instr_to_current_state (   self,
  instr,
  block,
  assignments,
  ir_blocks_all,
  gen_pc_updt 
)
Add the IR effects of an instruction to the current state.

Returns a bool:
* True if the current assignments list must be split
* False in other cases.

@instr: native instruction
@block: native block source
@assignments: list of current AssignBlocks
@ir_blocks_all: list of additional effects
@gen_pc_updt: insert PC update effects between instructions

Reimplemented in miasm.ir.analysis.ira, and miasm.arch.ppc.ira.ir_a_ppc32b.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_instr_to_ircfg()

def miasm.ir.ir.IntermediateRepresentation.add_instr_to_ircfg (   self,
  instr,
  ircfg,
  loc_key = None,
  gen_pc_updt = False 
)
Add the native instruction @instr to the @ircfg
@instr: instruction instance
@ircfg: IRCFG instance
@loc_key: loc_key instance of the instruction destination
@gen_pc_updt: insert PC update effects between instructions
Here is the call graph for this function:

◆ expr_fix_regs_for_mode()

def miasm.ir.ir.IntermediateRepresentation.expr_fix_regs_for_mode (   self,
  expr,
args,
**  kwargs 
)

◆ expraff_fix_regs_for_mode()

def miasm.ir.ir.IntermediateRepresentation.expraff_fix_regs_for_mode (   self,
  expr,
args,
**  kwargs 
)

◆ gen_loc_key_and_expr()

def miasm.ir.ir.IntermediateRepresentation.gen_loc_key_and_expr (   self,
  size 
)
Return a loc_key and it's corresponding ExprLoc
@size: size of expression
Here is the caller graph for this function:

◆ gen_pc_update()

def miasm.ir.ir.IntermediateRepresentation.gen_pc_update (   self,
  assignments,
  instr 
)
Here is the caller graph for this function:

◆ get_ir()

def miasm.ir.ir.IntermediateRepresentation.get_ir (   self,
  instr 
)

◆ get_loc_key_for_instr()

def miasm.ir.ir.IntermediateRepresentation.get_loc_key_for_instr (   self,
  instr 
)
Returns the loc_key associated to an instruction
@instr: current instruction
Here is the caller graph for this function:

◆ get_next_loc_key()

def miasm.ir.ir.IntermediateRepresentation.get_next_loc_key (   self,
  instr 
)
Here is the caller graph for this function:

◆ instr2ir()

def miasm.ir.ir.IntermediateRepresentation.instr2ir (   self,
  instr 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ irbloc_fix_regs_for_mode()

def miasm.ir.ir.IntermediateRepresentation.irbloc_fix_regs_for_mode (   self,
  irblock,
args,
**  kwargs 
)
Here is the caller graph for this function:

◆ is_pc_written()

def miasm.ir.ir.IntermediateRepresentation.is_pc_written (   self,
  block 
)
Return the first Assignblk of the @block in which PC is written
@block: IRBlock instance

◆ new_ircfg()

def miasm.ir.ir.IntermediateRepresentation.new_ircfg (   self,
args,
**  kwargs 
)
Return a new instance of IRCFG

◆ new_ircfg_from_asmcfg()

def miasm.ir.ir.IntermediateRepresentation.new_ircfg_from_asmcfg (   self,
  asmcfg,
args,
**  kwargs 
)
Return a new instance of IRCFG from an @asmcfg
@asmcfg: AsmCFG instance
Here is the call graph for this function:

◆ post_add_asmblock_to_ircfg()

def miasm.ir.ir.IntermediateRepresentation.post_add_asmblock_to_ircfg (   self,
  block,
  ircfg,
  ir_blocks 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_empty_dst_to_next()

def miasm.ir.ir.IntermediateRepresentation.set_empty_dst_to_next (   self,
  block,
  ir_blocks 
)
Here is the caller graph for this function:

Member Data Documentation

◆ arch

miasm.ir.ir.IntermediateRepresentation.arch

◆ attrib

miasm.ir.ir.IntermediateRepresentation.attrib

◆ IRDst

miasm.ir.ir.IntermediateRepresentation.IRDst

◆ loc_db

miasm.ir.ir.IntermediateRepresentation.loc_db

◆ pc

miasm.ir.ir.IntermediateRepresentation.pc

◆ sp

miasm.ir.ir.IntermediateRepresentation.sp

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