Miasm2
 All Classes Namespaces Files Functions Variables Typedefs Properties Macros
Classes | Functions | Variables
miasm2.arch.mips32.arch Namespace Reference

Classes

class  additional_info
 
class  bs_cond
 
class  bs_cond_mod
 
class  bs_cond_name
 
class  instruction_mips32
 
class  mips32_cpr
 
class  mips32_dreg_imm
 
class  mips32_eposh
 
class  mips32_esize
 
class  mips32_fccreg
 
class  mips32_fltpreg
 
class  mips32_gpreg
 
class  mips32_imm
 
class  mips32_instr_index
 
class  mips32_reg
 
class  mips32_s16imm
 
class  mips32_s16imm_noarg
 
class  mips32_soff
 
class  mips32_soff_noarg
 
class  mips32_u16imm
 
class  mn_mips32
 

Functions

def deref2expr
 
def deref2expr_nooff
 
def ast_id2expr
 
def ast_int2expr
 
def mips32op
 

Variables

tuple log = logging.getLogger("mips32dis")
 
tuple console_handler = logging.StreamHandler()
 
tuple gpregs = cpu.reg_info(regs.regs32_str, regs.regs32_expr)
 
tuple LPARENTHESIS = Literal("(")
 
tuple RPARENTHESIS = Literal(")")
 
 base_expr = cpu.base_expr
 
tuple deref_off
 
tuple deref_nooff
 
 deref = deref_off|deref_nooff
 
 int_or_expr = base_expr
 
tuple my_var_parser = cpu.parse_ast(ast_id2expr, ast_int2expr)
 
list br_0 = ['B', 'J', 'JR', 'BAL', 'JAL', 'JALR']
 
list br_1 = ['BGEZ', 'BLTZ', 'BGTZ', 'BLEZ', 'BC1T', 'BC1F']
 
list br_2 = ['BEQ', 'BEQL', 'BNE']
 
tuple rs = cpu.bs(l=5, cls=(mips32_gpreg,))
 
tuple rt = cpu.bs(l=5, cls=(mips32_gpreg,))
 
tuple rd = cpu.bs(l=5, cls=(mips32_gpreg,))
 
tuple ft = cpu.bs(l=5, cls=(mips32_fltpreg,))
 
tuple fs = cpu.bs(l=5, cls=(mips32_fltpreg,))
 
tuple fd = cpu.bs(l=5, cls=(mips32_fltpreg,))
 
tuple s16imm = cpu.bs(l=16, cls=(mips32_s16imm,))
 
tuple u16imm = cpu.bs(l=16, cls=(mips32_u16imm,))
 
tuple sa = cpu.bs(l=5, cls=(mips32_u16imm,))
 
tuple base = cpu.bs(l=5, cls=(mips32_dreg_imm,))
 
tuple soff = cpu.bs(l=16, cls=(mips32_soff,))
 
tuple cpr0 = cpu.bs(l=5, cls=(mips32_imm,), fname="cpr0")
 
tuple cpr = cpu.bs(l=3, cls=(mips32_cpr,))
 
tuple s16imm_noarg
 
tuple hint = cpu.bs(l=5, default_val="00000")
 
tuple fcc = cpu.bs(l=3, cls=(mips32_fccreg,))
 
tuple sel = cpu.bs(l=3, cls=(mips32_u16imm,))
 
tuple code = cpu.bs(l=20, cls=(mips32_u16imm,))
 
tuple esize = cpu.bs(l=5, cls=(mips32_esize,))
 
tuple epos
 
tuple eposh = cpu.bs(l=5, cls=(mips32_eposh,))
 
tuple instr_index = cpu.bs(l=26, cls=(mips32_instr_index,))
 
tuple bs_fmt
 
tuple bs_cond
 
tuple bs_arith
 
tuple bs_shift
 
tuple bs_shift1
 
tuple bs_arithfmt
 
tuple bs_s_l
 
tuple bs_oax
 
tuple bs_bcc
 
 alias = True)
 

Function Documentation

def miasm2.arch.mips32.arch.ast_id2expr (   t)

Definition at line 56 of file arch.py.

56 
57 def ast_id2expr(t):
58  if not t in mn_mips32.regs.all_regs_ids_byname:
59  r = ExprId(asm_label(t))
60  else:
61  r = mn_mips32.regs.all_regs_ids_byname[t]
62  return r
63 
def miasm2.arch.mips32.arch.ast_int2expr (   a)

Definition at line 64 of file arch.py.

64 
65 def ast_int2expr(a):
66  return ExprInt32(a)
67 

+ Here is the call graph for this function:

def miasm2.arch.mips32.arch.deref2expr (   s,
  l,
  t 
)

Definition at line 29 of file arch.py.

29 
30 def deref2expr(s, l, t):
31  t = t[0]
32  if len(t) != 4:
33  raise NotImplementedError("TODO")
34 
35  return ExprMem(t[2] + t[0])
def miasm2.arch.mips32.arch.deref2expr_nooff (   s,
  l,
  t 
)

Definition at line 36 of file arch.py.

36 
37 def deref2expr_nooff(s, l, t):
38  t = t[0]
39  if len(t) != 3:
40  raise NotImplementedError("TODO")
41  return ExprMem(t[1])
def miasm2.arch.mips32.arch.mips32op (   name,
  fields,
  args = None,
  alias = False 
)

Definition at line 274 of file arch.py.

275 def mips32op(name, fields, args=None, alias=False):
276  dct = {"fields": fields}
277  dct["alias"] = alias
278  if args is not None:
279  dct['args'] = args
280  type(name, (mn_mips32,), dct)
281  #type(name, (mn_mips32b,), dct)
282 

Variable Documentation

miasm2.arch.mips32.arch.alias = True)

Definition at line 665 of file arch.py.

tuple miasm2.arch.mips32.arch.base = cpu.bs(l=5, cls=(mips32_dreg_imm,))

Definition at line 472 of file arch.py.

miasm2.arch.mips32.arch.base_expr = cpu.base_expr

Definition at line 42 of file arch.py.

list miasm2.arch.mips32.arch.br_0 = ['B', 'J', 'JR', 'BAL', 'JAL', 'JALR']

Definition at line 75 of file arch.py.

list miasm2.arch.mips32.arch.br_1 = ['BGEZ', 'BLTZ', 'BGTZ', 'BLEZ', 'BC1T', 'BC1F']

Definition at line 76 of file arch.py.

list miasm2.arch.mips32.arch.br_2 = ['BEQ', 'BEQL', 'BNE']

Definition at line 77 of file arch.py.

tuple miasm2.arch.mips32.arch.bs_arith
Initial value:
1 = cpu.bs_name(l=6, name={'ADDU':0b100001,
2  'SUBU':0b100011,
3  'OR':0b100101,
4  'AND':0b100100,
5  'SLTU':0b101011,
6  'XOR':0b100110,
7  'SLT':0b101010,
8  'SUBU':0b100011,
9  'NOR':0b100111,
10  'MOVN':0b001011,
11  'MOVZ':0b001010,
12  })

Definition at line 551 of file arch.py.

tuple miasm2.arch.mips32.arch.bs_arithfmt
Initial value:
1 = cpu.bs_name(l=6, name={'ADD':0b000000,
2  'SUB':0b000001,
3  'MUL':0b000010,
4  'DIV':0b000011,
5  })

Definition at line 575 of file arch.py.

tuple miasm2.arch.mips32.arch.bs_bcc
Initial value:
1 = cpu.bs_name(l=5, name = {"BGEZ": 0b00001,
2  "BGEZL": 0b00011,
3  "BGEZAL": 0b10001,
4  "BGEZALL": 0b10011,
5  "BLTZ": 0b00000,
6  "BLTZL": 0b00010,
7  "BLTZAL": 0b10000,
8  "BLTZALL": 0b10010,
9  })

Definition at line 602 of file arch.py.

tuple miasm2.arch.mips32.arch.bs_cond
Initial value:
1 = bs_cond_mod(l=4,
2  mn_mod = ['.F', '.UN', '.EQ', '.UEQ',
3  '.OLT', '.ULT', '.OLE', '.ULE',
4  '.SF', '.NGLE', '.SEQ', '.NGL',
5  '.LT', '.NGE', '.LE', '.NGT'])

Definition at line 543 of file arch.py.

tuple miasm2.arch.mips32.arch.bs_fmt
Initial value:
1 = cpu.bs_mod_name(l=5, fname='fmt', mn_mod={0x10: '.S', 0x11: '.D',
2  0x14: '.W', 0x15: '.L',
3  0x16: '.PS'})

Definition at line 496 of file arch.py.

tuple miasm2.arch.mips32.arch.bs_oax
Initial value:
1 = cpu.bs_name(l=6, name = {"ORI": 0b001101,
2  "ANDI": 0b001100,
3  "XORI": 0b001110,
4  })

Definition at line 597 of file arch.py.

tuple miasm2.arch.mips32.arch.bs_s_l
Initial value:
1 = cpu.bs_name(l=6, name = {"SW": 0b101011,
2  "SH": 0b101001,
3  "SB": 0b101000,
4  "LW": 0b100011,
5  "LH": 0b100001,
6  "LB": 0b100000,
7  "LHU": 0b100101,
8  "LBU": 0b100100,
9  "LWL": 0b100010,
10  "LWR": 0b100110,
11 
12  "SWL": 0b101010,
13  "SWR": 0b101110,
14  })

Definition at line 581 of file arch.py.

tuple miasm2.arch.mips32.arch.bs_shift
Initial value:
1 = cpu.bs_name(l=6, name={'SLL':0b000000,
2  'SRL':0b000010,
3  'SRA':0b000011,
4  })

Definition at line 564 of file arch.py.

tuple miasm2.arch.mips32.arch.bs_shift1
Initial value:
1 = cpu.bs_name(l=6, name={'SLLV':0b000100,
2  'SRLV':0b000110,
3  'SRAV':0b000111,
4  })

Definition at line 569 of file arch.py.

tuple miasm2.arch.mips32.arch.code = cpu.bs(l=20, cls=(mips32_u16imm,))

Definition at line 487 of file arch.py.

tuple miasm2.arch.mips32.arch.console_handler = logging.StreamHandler()

Definition at line 16 of file arch.py.

tuple miasm2.arch.mips32.arch.cpr = cpu.bs(l=3, cls=(mips32_cpr,))

Definition at line 476 of file arch.py.

tuple miasm2.arch.mips32.arch.cpr0 = cpu.bs(l=5, cls=(mips32_imm,), fname="cpr0")

Definition at line 475 of file arch.py.

miasm2.arch.mips32.arch.deref = deref_off|deref_nooff

Definition at line 48 of file arch.py.

tuple miasm2.arch.mips32.arch.deref_nooff
Initial value:
1 = Group(LPARENTHESIS + gpregs.parser + \
2  RPARENTHESIS)

Definition at line 46 of file arch.py.

tuple miasm2.arch.mips32.arch.deref_off
Initial value:
1 = Group(Optional(cpu.base_expr) + LPARENTHESIS + gpregs.parser + \
2  RPARENTHESIS)

Definition at line 44 of file arch.py.

tuple miasm2.arch.mips32.arch.epos
Initial value:
1 = cpu.bs(l=5, cls=(mips32_u16imm,), fname="epos",
2  order=-1)

Definition at line 490 of file arch.py.

tuple miasm2.arch.mips32.arch.eposh = cpu.bs(l=5, cls=(mips32_eposh,))

Definition at line 493 of file arch.py.

tuple miasm2.arch.mips32.arch.esize = cpu.bs(l=5, cls=(mips32_esize,))

Definition at line 489 of file arch.py.

tuple miasm2.arch.mips32.arch.fcc = cpu.bs(l=3, cls=(mips32_fccreg,))

Definition at line 483 of file arch.py.

tuple miasm2.arch.mips32.arch.fd = cpu.bs(l=5, cls=(mips32_fltpreg,))

Definition at line 467 of file arch.py.

tuple miasm2.arch.mips32.arch.fs = cpu.bs(l=5, cls=(mips32_fltpreg,))

Definition at line 466 of file arch.py.

tuple miasm2.arch.mips32.arch.ft = cpu.bs(l=5, cls=(mips32_fltpreg,))

Definition at line 465 of file arch.py.

tuple miasm2.arch.mips32.arch.gpregs = cpu.reg_info(regs.regs32_str, regs.regs32_expr)

Definition at line 22 of file arch.py.

tuple miasm2.arch.mips32.arch.hint = cpu.bs(l=5, default_val="00000")

Definition at line 482 of file arch.py.

tuple miasm2.arch.mips32.arch.instr_index = cpu.bs(l=26, cls=(mips32_instr_index,))

Definition at line 495 of file arch.py.

miasm2.arch.mips32.arch.int_or_expr = base_expr

Definition at line 53 of file arch.py.

tuple miasm2.arch.mips32.arch.log = logging.getLogger("mips32dis")

Definition at line 15 of file arch.py.

tuple miasm2.arch.mips32.arch.LPARENTHESIS = Literal("(")

Definition at line 26 of file arch.py.

tuple miasm2.arch.mips32.arch.my_var_parser = cpu.parse_ast(ast_id2expr, ast_int2expr)

Definition at line 68 of file arch.py.

tuple miasm2.arch.mips32.arch.rd = cpu.bs(l=5, cls=(mips32_gpreg,))

Definition at line 464 of file arch.py.

tuple miasm2.arch.mips32.arch.RPARENTHESIS = Literal(")")

Definition at line 27 of file arch.py.

tuple miasm2.arch.mips32.arch.rs = cpu.bs(l=5, cls=(mips32_gpreg,))

Definition at line 462 of file arch.py.

tuple miasm2.arch.mips32.arch.rt = cpu.bs(l=5, cls=(mips32_gpreg,))

Definition at line 463 of file arch.py.

tuple miasm2.arch.mips32.arch.s16imm = cpu.bs(l=16, cls=(mips32_s16imm,))

Definition at line 469 of file arch.py.

tuple miasm2.arch.mips32.arch.s16imm_noarg
Initial value:
1 = cpu.bs(l=16, cls=(mips32_s16imm_noarg,), fname="imm",
2  order=-1)

Definition at line 479 of file arch.py.

tuple miasm2.arch.mips32.arch.sa = cpu.bs(l=5, cls=(mips32_u16imm,))

Definition at line 471 of file arch.py.

tuple miasm2.arch.mips32.arch.sel = cpu.bs(l=3, cls=(mips32_u16imm,))

Definition at line 485 of file arch.py.

tuple miasm2.arch.mips32.arch.soff = cpu.bs(l=16, cls=(mips32_soff,))

Definition at line 473 of file arch.py.

tuple miasm2.arch.mips32.arch.u16imm = cpu.bs(l=16, cls=(mips32_u16imm,))

Definition at line 470 of file arch.py.