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

Public Member Functions

def additional_info (self)
 
def gen_modes (cls, subcls, name, bases, dct, fields)
 
def getmn (cls, name)
 
def getpc (cls, attrib=None)
 
def getsp (cls, attrib=None)
 
def getbits (cls, bitstream, attrib, start, n)
 
def endian_offset (cls, attrib, offset)
 
def value (self, mode)
 
- Public Member Functions inherited from miasm.core.cpu.cls_mn
def guess_mnemo (cls, bs, attrib, pre_dis_info, offset)
 
def reset_class (self)
 
def init_class (self)
 
def add_pre_dis_info (self, prefix=None)
 
def getbytes (cls, bs, offset, l)
 
def pre_dis (cls, v_o, attrib, offset)
 
def post_dis (self)
 
def check_mnemo (cls, fields)
 
def mod_fields (cls, fields)
 
def dis (cls, bs_o, mode_o=None, offset=0)
 
def fromstring (cls, text, loc_db, mode=None)
 
def dup_info (self, infos)
 
def get_cls_instance (cls, cc, mode, infos=None)
 
def asm (cls, instr, loc_db=None)
 
def filter_asm_candidates (cls, instr, candidates)
 
def encodefields (self, decoded)
 
def decoded2bytes (self, result)
 
def gen_args (self, args)
 
def args2str (self)
 
def __str__ (self)
 
def parse_prefix (self, v)
 
def set_dst_symbol (self, loc_db)
 
def getdstflow (self, loc_db)
 
- Public Member Functions inherited from miasm.core.cpu.metamn
def __new__ (mcs, name, bases, dct)
 

Static Public Attributes

int num = 0
 
 all_mn = list()
 
 all_mn_mode = defaultdict(list)
 
 all_mn_name = defaultdict(list)
 
 all_mn_inst = defaultdict(list)
 
 bintree = dict()
 
 instruction = instruction_mep
 
 regs = mep_regs_module
 
int delayslot = 0
 
string name = "mep"
 
dictionary pc = {'l': PC, 'b': PC}
 
- Static Public Attributes inherited from miasm.core.cpu.cls_mn
list args_symb = []
 
 instruction = instruction
 
int alignment = 1
 

Additional Inherited Members

- Public Attributes inherited from miasm.core.cpu.cls_mn
 args
 
 fields_order
 
 to_decode
 
 args_symb
 

Detailed Description

Toshiba MeP-c4 disassembler & assembler

Member Function Documentation

◆ additional_info()

def miasm.arch.mep.arch.mn_mep.additional_info (   self)
Define instruction side effects # GV: not fully understood yet

When used, it must return an object that implements specific
variables, such as except_on_instr.

Notes:
    - it must be implemented !
    - it could be moved to the cls_mn class

◆ endian_offset()

def miasm.arch.mep.arch.mn_mep.endian_offset (   cls,
  attrib,
  offset 
)
Adjust the byte offset according to the endianness
Here is the caller graph for this function:

◆ gen_modes()

def miasm.arch.mep.arch.mn_mep.gen_modes (   cls,
  subcls,
  name,
  bases,
  dct,
  fields 
)
Ease populating internal variables used to disassemble & assemble, such
as self.all_mn_mode, self.all_mn_name and self.all_mn_inst

Notes:
    - it must be implemented !
    - it could be moved to the cls_mn class. All miasm architectures
      use the same code

Args:
    cls: ?
    sublcs:
    name: mnemonic name
    bases: ?
    dct: ?
    fields: ?

Returns:
    a list of ?

◆ getbits()

def miasm.arch.mep.arch.mn_mep.getbits (   cls,
  bitstream,
  attrib,
  start,
  n 
)
Return an integer of n bits at the 'start' offset

   Note: code from miasm/arch/mips32/arch.py

Reimplemented from miasm.core.cpu.cls_mn.

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

◆ getmn()

def miasm.arch.mep.arch.mn_mep.getmn (   cls,
  name 
)
Get the mnemonic name

Notes:
    - it must be implemented !
    - it could be moved to the cls_mn class. Most miasm architectures
      use the same code

Args:
    cls:  the mnemonic class
    name: the mnemonic string

◆ getpc()

def miasm.arch.mep.arch.mn_mep.getpc (   cls,
  attrib = None 
)
"Return the ExprId that represents the Program Counter.

Notes:
    - mandatory for the symbolic execution
    - PC is defined in regs.py

Args:
   attrib: architecture dependent attributes (here, l or b)

◆ getsp()

def miasm.arch.mep.arch.mn_mep.getsp (   cls,
  attrib = None 
)
"Return the ExprId that represents the Stack Pointer.

Notes:
    - mandatory for the symbolic execution
    - SP is defined in regs.py

Args:
   attrib: architecture dependent attributes (here, l or b)

◆ value()

def miasm.arch.mep.arch.mn_mep.value (   self,
  mode 
)
Adjust the assembled instruction based on the endianness

   Note: code inspired by miasm/arch/mips32/arch.py

Reimplemented from miasm.core.cpu.cls_mn.

Here is the caller graph for this function:

Member Data Documentation

◆ all_mn

miasm.arch.mep.arch.mn_mep.all_mn = list()
static

◆ all_mn_inst

miasm.arch.mep.arch.mn_mep.all_mn_inst = defaultdict(list)
static

◆ all_mn_mode

miasm.arch.mep.arch.mn_mep.all_mn_mode = defaultdict(list)
static

◆ all_mn_name

miasm.arch.mep.arch.mn_mep.all_mn_name = defaultdict(list)
static

◆ bintree

miasm.arch.mep.arch.mn_mep.bintree = dict()
static

◆ delayslot

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

◆ instruction

miasm.arch.mep.arch.mn_mep.instruction = instruction_mep
static

◆ name

string miasm.arch.mep.arch.mn_mep.name = "mep"
static

◆ num

int miasm.arch.mep.arch.mn_mep.num = 0
static

◆ pc

dictionary miasm.arch.mep.arch.mn_mep.pc = {'l': PC, 'b': PC}
static

◆ regs

miasm.arch.mep.arch.mn_mep.regs = mep_regs_module
static

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