miasm
Reverse engineering framework
miasm.core.asmblock.disasmEngine Class Reference
Inheritance diagram for miasm.core.asmblock.disasmEngine:
Collaboration diagram for miasm.core.asmblock.disasmEngine:

Public Member Functions

def __init__ (self, arch, attrib, bin_stream, loc_db, **kwargs)
 
def dis_block (self, offset)
 
def dis_multiblock (self, offset, blocks=None, job_done=None)
 
def apply_splitting (self, blocks)
 
def dis_instr (self, offset)
 

Public Attributes

 arch
 
 attrib
 
 bin_stream
 
 loc_db
 
 dont_dis
 
 split_dis
 
 follow_call
 
 dontdis_retcall
 
 lines_wd
 
 blocs_wd
 
 dis_block_callback
 
 dont_dis_nulstart_bloc
 
 dont_dis_retcall_funcs
 

Detailed Description

Disassembly engine, taking care of disassembler options and mutli-block
strategy.

Engine options:

+ Object supporting membership test (offset in ..)
 - dont_dis: stop the current disassembly branch if reached
 - split_dis: force a basic block end if reached,
              with a next constraint on its successor
 - dont_dis_retcall_funcs: stop disassembly after a call to one
                           of the given functions

+ On/Off
 - follow_call: recursively disassemble CALL destinations
 - dontdis_retcall: stop on CALL return addresses
 - dont_dis_nulstart_bloc: stop if a block begin with a few \x00

+ Number
 - lines_wd: maximum block's size (in number of instruction)
 - blocs_wd: maximum number of distinct disassembled block

+ callback(mdis, cur_block, offsets_to_dis)
 - dis_block_callback: callback after each new disassembled block

Constructor & Destructor Documentation

◆ __init__()

def miasm.core.asmblock.disasmEngine.__init__ (   self,
  arch,
  attrib,
  bin_stream,
  loc_db,
**  kwargs 
)
Instantiate a new disassembly engine
@arch: targeted architecture
@attrib: architecture attribute
@bin_stream: bytes source
@kwargs: (optional) custom options

Member Function Documentation

◆ apply_splitting()

def miasm.core.asmblock.disasmEngine.apply_splitting (   self,
  blocks 
)
Consider @blocks' bto destinations and split block in @blocks if one
of these destinations jumps in the middle of this block.  In order to
work, they must be only one block in @self per loc_key in

@blocks: Asmcfg
Here is the caller graph for this function:

◆ dis_block()

def miasm.core.asmblock.disasmEngine.dis_block (   self,
  offset 
)
Disassemble the block at offset @offset and return the created
AsmBlock
@offset: targeted offset to disassemble
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dis_instr()

def miasm.core.asmblock.disasmEngine.dis_instr (   self,
  offset 
)
Disassemble one instruction at offset @offset and return the
corresponding instruction instance
@offset: targeted offset to disassemble
Here is the call graph for this function:

◆ dis_multiblock()

def miasm.core.asmblock.disasmEngine.dis_multiblock (   self,
  offset,
  blocks = None,
  job_done = None 
)
Disassemble every block reachable from @offset regarding
specific disasmEngine conditions
Return an AsmCFG instance containing disassembled blocks
@offset: starting offset
@blocks: (optional) AsmCFG instance of already disassembled blocks to
        merge with
Here is the call graph for this function:

Member Data Documentation

◆ arch

miasm.core.asmblock.disasmEngine.arch

◆ attrib

miasm.core.asmblock.disasmEngine.attrib

◆ bin_stream

miasm.core.asmblock.disasmEngine.bin_stream

◆ blocs_wd

miasm.core.asmblock.disasmEngine.blocs_wd

◆ dis_block_callback

miasm.core.asmblock.disasmEngine.dis_block_callback

◆ dont_dis

miasm.core.asmblock.disasmEngine.dont_dis

◆ dont_dis_nulstart_bloc

miasm.core.asmblock.disasmEngine.dont_dis_nulstart_bloc

◆ dont_dis_retcall_funcs

miasm.core.asmblock.disasmEngine.dont_dis_retcall_funcs

◆ dontdis_retcall

miasm.core.asmblock.disasmEngine.dontdis_retcall

◆ follow_call

miasm.core.asmblock.disasmEngine.follow_call

◆ lines_wd

miasm.core.asmblock.disasmEngine.lines_wd

◆ loc_db

miasm.core.asmblock.disasmEngine.loc_db

◆ split_dis

miasm.core.asmblock.disasmEngine.split_dis

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