miasm
Reverse engineering framework
miasm.arch.mep.arch.instruction_mep Class Reference
Inheritance diagram for miasm.arch.mep.arch.instruction_mep:
Collaboration diagram for miasm.arch.mep.arch.instruction_mep:

Public Member Functions

def __str__ (self)
 
def breakflow (self)
 
def splitflow (self)
 
def dstflow (self)
 
def dstflow2label (self, loc_db)
 
def get_dst_num (self)
 
def getdstflow (self, loc_db)
 
def is_subcall (self)
 
def fixDstOffset (self)
 
- Public Member Functions inherited from miasm.core.cpu.instruction
def __init__ (self, name, mode, args, additional_info=None)
 
def gen_args (self, args)
 
def to_string (self, loc_db=None)
 
def get_asm_offset (self, expr)
 
def get_asm_next_offset (self, expr)
 
def resolve_args_with_symbols (self, loc_db)
 
def get_info (self, c)
 

Static Public Member Functions

def arg2str (expr, pos=None, loc_db=None)
 

Public Attributes

 name
 
- Public Attributes inherited from miasm.core.cpu.instruction
 name
 
 mode
 
 args
 
 additional_info
 
 offset
 
 l
 
 b
 

Static Public Attributes

int delayslot = 0
 

Detailed Description

Generic MeP-c4 instruction

Notes:
    - this object is used to build internal miasm instructions based
      on mnemonics
    - it must be implemented !

Member Function Documentation

◆ __str__()

def miasm.arch.mep.arch.instruction_mep.__str__ (   self)
Return the mnemonic as a string.

Note:
    - it is not mandatory as the instruction class already implement
      it. It used to get rid of the padding between the opcode and the
      arguments.
    - most of this code is copied from miasm/core/cpu.py

Reimplemented from miasm.core.cpu.instruction.

◆ arg2str()

def miasm.arch.mep.arch.instruction_mep.arg2str (   expr,
  pos = None,
  loc_db = None 
)
static
Convert mnemonics arguments into readable strings according to the
MeP-c4 architecture manual and their internal types

Notes:
    - it must be implemented ! However, a simple 'return str(expr)'
      could do the trick.
    - it is used to mimic objdump output

Args:
    expr: argument as a miasm expression
    pos: position index in the arguments list
Here is the caller graph for this function:

◆ breakflow()

def miasm.arch.mep.arch.instruction_mep.breakflow (   self)
Instructions that stop a basic block.

◆ dstflow()

def miasm.arch.mep.arch.instruction_mep.dstflow (   self)
Instructions that explicitly provide the destination.

◆ dstflow2label()

def miasm.arch.mep.arch.instruction_mep.dstflow2label (   self,
  loc_db 
)
Set the label for the current destination.

   Note: it is used at disassembly
Here is the call graph for this function:

◆ fixDstOffset()

def miasm.arch.mep.arch.instruction_mep.fixDstOffset (   self)
Fix/correct the instruction immediate according to the current offset

   Note: - it is used at assembly
         - code inspired by miasm/arch/mips32/arch.py
Here is the call graph for this function:

◆ get_dst_num()

def miasm.arch.mep.arch.instruction_mep.get_dst_num (   self)
Get the index of the argument that points to the instruction destination.
Here is the caller graph for this function:

◆ getdstflow()

def miasm.arch.mep.arch.instruction_mep.getdstflow (   self,
  loc_db 
)
Get the argument that points to the instruction destination.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_subcall()

def miasm.arch.mep.arch.instruction_mep.is_subcall (   self)
Instructions used to call sub functions.
Here is the caller graph for this function:

◆ splitflow()

def miasm.arch.mep.arch.instruction_mep.splitflow (   self)
Instructions that splits a basic block, i.e. the CPU can go somewhere else.

Member Data Documentation

◆ delayslot

int miasm.arch.mep.arch.instruction_mep.delayslot = 0
static

◆ name

miasm.arch.mep.arch.instruction_mep.name

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