miasm
Reverse engineering framework
miasm.arch.sh4.arch Namespace Reference

Classes

class  additional_info
 
class  bs_dgpreg
 
class  bs_dr0gbr
 
class  bs_dr0gp
 
class  instruction_sh4
 
class  mn_sh4
 
class  sh4_arg
 
class  sh4_bgpreg
 
class  sh4_dgbrimm8
 
class  sh4_dgpreg
 
class  sh4_dgpreg_imm
 
class  sh4_dgpregpdec
 
class  sh4_dgpregpinc
 
class  sh4_dpc16imm
 
class  sh4_dpc32imm
 
class  sh4_dr
 
class  sh4_freg
 
class  sh4_gpreg
 
class  sh4_gpreg_noarg
 
class  sh4_imm
 
class  sh4_pc32imm
 
class  sh4_reg
 
class  sh4_simm
 

Functions

def cb_deref_pcimm (tokens)
 
def cb_pcandimmimm (tokens)
 
def cb_deref_mem (tokens)
 
def cb_predec (tokens)
 
def cb_postinc (tokens)
 
def cb_regdisp (tokens)
 
def cb_regreg (tokens)
 
def addop (name, fields, args=None, alias=False)
 

Variables

 jra = ExprId('jra', 32)
 
 jrb = ExprId('jrb', 32)
 
 jrc = ExprId('jrc', 32)
 
 PLUS = Suppress("+")
 
 MULT = Suppress("*")
 
 MINUS = Suppress("-")
 
 AND = Suppress("&")
 
 LBRACK = Suppress("[")
 
 RBRACK = Suppress("]")
 
 DEREF = Suppress("@")
 
 COMMA = Suppress(",")
 
 LPARENT = Suppress("(")
 
 RPARENT = Suppress(")")
 
tuple ref_pc = (LPARENT + reg_info_pc.parser + COMMA + base_expr + RPARENT).setParseAction(cb_deref_pcimm)
 
tuple ref_pcandimm = (LPARENT + reg_info_pc.parser + AND + base_expr + COMMA + base_expr + RPARENT).setParseAction(cb_pcandimmimm)
 
tuple pcdisp = (reg_info_pc.parser + AND + base_expr + PLUS + base_expr).setParseAction(cb_pcandimmimm)
 
 PTR = Suppress('PTR')
 
tuple deref_pc = (DEREF + ref_pc).setParseAction(cb_deref_mem)
 
tuple deref_pcimm = (DEREF + ref_pcandimm).setParseAction(cb_deref_mem)
 
tuple dgpregs_base = (DEREF + gpregs.parser).setParseAction(cb_deref_mem)
 
tuple dgpregs_predec = (DEREF + MINUS + gpregs.parser).setParseAction(cb_predec)
 
tuple dgpregs_postinc = (DEREF + gpregs.parser + PLUS).setParseAction(cb_postinc)
 
tuple dgpregs = dgpregs_base | dgpregs_predec | dgpregs_postinc
 
tuple d_gpreg_gpreg = (DEREF + LPARENT + gpregs.parser + COMMA + gpregs.parser + RPARENT).setParseAction(cb_regdisp)
 
tuple dgpregs_p = dgpregs_predec | dgpregs_postinc
 
tuple dgpregs_ir = (DEREF + LPARENT + gpregs.parser + COMMA + base_expr + RPARENT).setParseAction(cb_regdisp)
 
tuple dgbr_imm = (DEREF + LPARENT + reg_info_gbr.parser + COMMA + base_expr + RPARENT).setParseAction(cb_regdisp)
 
tuple dgbr_reg = (DEREF + LPARENT + reg_info_gbr.parser + COMMA + gpregs.parser + RPARENT).setParseAction(cb_regreg)
 
 rn = bs(l=4, cls=(sh4_gpreg,), fname="rn")
 
 rm = bs(l=4, cls=(sh4_gpreg,), fname="rm")
 
 d08_rn = bs(l=4, cls=(sh4_dgpreg,), fname="rn", sz = 8)
 
 d16_rn = bs(l=4, cls=(sh4_dgpreg,), fname="rn", sz = 16)
 
 d32_rn = bs(l=4, cls=(sh4_dgpreg,), fname="rn", sz = 32)
 
 d08_rm = bs(l=4, cls=(sh4_dgpreg,), fname="rm", sz = 8)
 
 d16_rm = bs(l=4, cls=(sh4_dgpreg,), fname="rm", sz = 16)
 
 d32_rm = bs(l=4, cls=(sh4_dgpreg,), fname="rm", sz = 32)
 
 brm = bs(l=3, cls=(sh4_bgpreg,), fname="brm")
 
 brn = bs(l=3, cls=(sh4_bgpreg,), fname="brn")
 
 d08rnimm = bs(l=4, fname="rn", cls=(sh4_dgpreg_imm,), sz = 8)
 
 d16rnimm = bs(l=4, fname="rn", cls=(sh4_dgpreg_imm,), sz = 16)
 
 d32rnimm = bs(l=4, fname="rn", cls=(sh4_dgpreg_imm,), sz = 32)
 
 d08rmimm = bs(l=4, fname="rm", cls=(sh4_dgpreg_imm,), sz = 8)
 
 d16rmimm = bs(l=4, fname="rm", cls=(sh4_dgpreg_imm,), sz = 16)
 
 d32rmimm = bs(l=4, fname="rm", cls=(sh4_dgpreg_imm,), sz = 32)
 
 btype = bs(l=4, fname="btype", order=-1)
 
 s08imm = bs(l=8, cls=(sh4_simm,), fname="imm")
 
 s12imm = bs(l=12, cls=(sh4_simm,), fname="imm")
 
 dpc16imm = bs(l=8, cls=(sh4_dpc16imm,), fname="pcimm", sz=16)
 
 dpc32imm = bs(l=8, cls=(sh4_dpc32imm,), fname="pcimm", sz=32)
 
 dimm4 = bs(l=4, fname='disp', order=-1)
 
 d08gbrimm8 = bs(l=8, cls=(sh4_dgbrimm8,), fname='disp', sz=8)
 
 d16gbrimm8 = bs(l=8, cls=(sh4_dgbrimm8,), fname='disp', sz=16)
 
 d32gbrimm8 = bs(l=8, cls=(sh4_dgbrimm8,), fname='disp', sz=32)
 
 pc32imm = bs(l=8, cls=(sh4_pc32imm,), fname="pcimm")
 
 d08rnpinc = bs(l=4, cls=(sh4_dgpregpinc,), op='postinc', sz=8, fname="rn")
 
 d08rmpinc = bs(l=4, cls=(sh4_dgpregpinc,), op='postinc', sz=8, fname="rm")
 
 d16rnpinc = bs(l=4, cls=(sh4_dgpregpinc,), op='postinc', sz=16, fname="rn")
 
 d16rmpinc = bs(l=4, cls=(sh4_dgpregpinc,), op='postinc', sz=16, fname="rm")
 
 d32rnpinc = bs(l=4, cls=(sh4_dgpregpinc,), op='postinc', sz=32, fname="rn")
 
 d32rmpinc = bs(l=4, cls=(sh4_dgpregpinc,), op='postinc', sz=32, fname="rm")
 
 d08rnpdec = bs(l=4, cls=(sh4_dgpregpinc,), op='predec', sz=8, fname="rn")
 
 d08rmpdec = bs(l=4, cls=(sh4_dgpregpinc,), op='predec', sz=8, fname="rm")
 
 d16rnpdec = bs(l=4, cls=(sh4_dgpregpinc,), op='predec', sz=16, fname="rn")
 
 d16rmpdec = bs(l=4, cls=(sh4_dgpregpinc,), op='predec', sz=16, fname="rm")
 
 d32rnpdec = bs(l=4, cls=(sh4_dgpregpinc,), op='predec', sz=32, fname="rn")
 
 d32rmpdec = bs(l=4, cls=(sh4_dgpregpinc,), op='predec', sz=32, fname="rm")
 
 u08imm = bs(l=8, cls=(sh4_imm,), fname="imm")
 
 dr0gbr = bs(l=0, cls=(bs_dr0gbr,), sz=8)
 
 d08gpreg = bs(l=4, cls=(bs_dgpreg,), sz=8)
 
 d32gpreg = bs(l=4, cls=(bs_dgpreg,), sz=32)
 
 frn = bs(l=4, cls=(sh4_freg,), fname="frn")
 
 frm = bs(l=4, cls=(sh4_freg,), fname="frm")
 
 bd08r0gp = bs(l=4, cls=(bs_dr0gp,), sz=8)
 
 bd16r0gp = bs(l=4, cls=(bs_dr0gp,), sz=16)
 
 bd32r0gp = bs(l=4, cls=(bs_dr0gp,), sz=32)
 
 drn = bs(l=3, cls=(sh4_dr,), fname="drn")
 
 drm = bs(l=3, cls=(sh4_dr,), fname="drm")
 

Function Documentation

◆ addop()

def miasm.arch.sh4.arch.addop (   name,
  fields,
  args = None,
  alias = False 
)

◆ cb_deref_mem()

def miasm.arch.sh4.arch.cb_deref_mem (   tokens)

◆ cb_deref_pcimm()

def miasm.arch.sh4.arch.cb_deref_pcimm (   tokens)

◆ cb_pcandimmimm()

def miasm.arch.sh4.arch.cb_pcandimmimm (   tokens)

◆ cb_postinc()

def miasm.arch.sh4.arch.cb_postinc (   tokens)

◆ cb_predec()

def miasm.arch.sh4.arch.cb_predec (   tokens)

◆ cb_regdisp()

def miasm.arch.sh4.arch.cb_regdisp (   tokens)

◆ cb_regreg()

def miasm.arch.sh4.arch.cb_regreg (   tokens)

Variable Documentation

◆ AND

miasm.arch.sh4.arch.AND = Suppress("&")

◆ bd08r0gp

miasm.arch.sh4.arch.bd08r0gp = bs(l=4, cls=(bs_dr0gp,), sz=8)

◆ bd16r0gp

miasm.arch.sh4.arch.bd16r0gp = bs(l=4, cls=(bs_dr0gp,), sz=16)

◆ bd32r0gp

miasm.arch.sh4.arch.bd32r0gp = bs(l=4, cls=(bs_dr0gp,), sz=32)

◆ brm

miasm.arch.sh4.arch.brm = bs(l=3, cls=(sh4_bgpreg,), fname="brm")

◆ brn

miasm.arch.sh4.arch.brn = bs(l=3, cls=(sh4_bgpreg,), fname="brn")

◆ btype

miasm.arch.sh4.arch.btype = bs(l=4, fname="btype", order=-1)

◆ COMMA

miasm.arch.sh4.arch.COMMA = Suppress(",")

◆ d08_rm

miasm.arch.sh4.arch.d08_rm = bs(l=4, cls=(sh4_dgpreg,), fname="rm", sz = 8)

◆ d08_rn

miasm.arch.sh4.arch.d08_rn = bs(l=4, cls=(sh4_dgpreg,), fname="rn", sz = 8)

◆ d08gbrimm8

miasm.arch.sh4.arch.d08gbrimm8 = bs(l=8, cls=(sh4_dgbrimm8,), fname='disp', sz=8)

◆ d08gpreg

miasm.arch.sh4.arch.d08gpreg = bs(l=4, cls=(bs_dgpreg,), sz=8)

◆ d08rmimm

miasm.arch.sh4.arch.d08rmimm = bs(l=4, fname="rm", cls=(sh4_dgpreg_imm,), sz = 8)

◆ d08rmpdec

miasm.arch.sh4.arch.d08rmpdec = bs(l=4, cls=(sh4_dgpregpinc,), op='predec', sz=8, fname="rm")

◆ d08rmpinc

miasm.arch.sh4.arch.d08rmpinc = bs(l=4, cls=(sh4_dgpregpinc,), op='postinc', sz=8, fname="rm")

◆ d08rnimm

miasm.arch.sh4.arch.d08rnimm = bs(l=4, fname="rn", cls=(sh4_dgpreg_imm,), sz = 8)

◆ d08rnpdec

miasm.arch.sh4.arch.d08rnpdec = bs(l=4, cls=(sh4_dgpregpinc,), op='predec', sz=8, fname="rn")

◆ d08rnpinc

miasm.arch.sh4.arch.d08rnpinc = bs(l=4, cls=(sh4_dgpregpinc,), op='postinc', sz=8, fname="rn")

◆ d16_rm

miasm.arch.sh4.arch.d16_rm = bs(l=4, cls=(sh4_dgpreg,), fname="rm", sz = 16)

◆ d16_rn

miasm.arch.sh4.arch.d16_rn = bs(l=4, cls=(sh4_dgpreg,), fname="rn", sz = 16)

◆ d16gbrimm8

miasm.arch.sh4.arch.d16gbrimm8 = bs(l=8, cls=(sh4_dgbrimm8,), fname='disp', sz=16)

◆ d16rmimm

miasm.arch.sh4.arch.d16rmimm = bs(l=4, fname="rm", cls=(sh4_dgpreg_imm,), sz = 16)

◆ d16rmpdec

miasm.arch.sh4.arch.d16rmpdec = bs(l=4, cls=(sh4_dgpregpinc,), op='predec', sz=16, fname="rm")

◆ d16rmpinc

miasm.arch.sh4.arch.d16rmpinc = bs(l=4, cls=(sh4_dgpregpinc,), op='postinc', sz=16, fname="rm")

◆ d16rnimm

miasm.arch.sh4.arch.d16rnimm = bs(l=4, fname="rn", cls=(sh4_dgpreg_imm,), sz = 16)

◆ d16rnpdec

miasm.arch.sh4.arch.d16rnpdec = bs(l=4, cls=(sh4_dgpregpinc,), op='predec', sz=16, fname="rn")

◆ d16rnpinc

miasm.arch.sh4.arch.d16rnpinc = bs(l=4, cls=(sh4_dgpregpinc,), op='postinc', sz=16, fname="rn")

◆ d32_rm

miasm.arch.sh4.arch.d32_rm = bs(l=4, cls=(sh4_dgpreg,), fname="rm", sz = 32)

◆ d32_rn

miasm.arch.sh4.arch.d32_rn = bs(l=4, cls=(sh4_dgpreg,), fname="rn", sz = 32)

◆ d32gbrimm8

miasm.arch.sh4.arch.d32gbrimm8 = bs(l=8, cls=(sh4_dgbrimm8,), fname='disp', sz=32)

◆ d32gpreg

miasm.arch.sh4.arch.d32gpreg = bs(l=4, cls=(bs_dgpreg,), sz=32)

◆ d32rmimm

miasm.arch.sh4.arch.d32rmimm = bs(l=4, fname="rm", cls=(sh4_dgpreg_imm,), sz = 32)

◆ d32rmpdec

miasm.arch.sh4.arch.d32rmpdec = bs(l=4, cls=(sh4_dgpregpinc,), op='predec', sz=32, fname="rm")

◆ d32rmpinc

miasm.arch.sh4.arch.d32rmpinc = bs(l=4, cls=(sh4_dgpregpinc,), op='postinc', sz=32, fname="rm")

◆ d32rnimm

miasm.arch.sh4.arch.d32rnimm = bs(l=4, fname="rn", cls=(sh4_dgpreg_imm,), sz = 32)

◆ d32rnpdec

miasm.arch.sh4.arch.d32rnpdec = bs(l=4, cls=(sh4_dgpregpinc,), op='predec', sz=32, fname="rn")

◆ d32rnpinc

miasm.arch.sh4.arch.d32rnpinc = bs(l=4, cls=(sh4_dgpregpinc,), op='postinc', sz=32, fname="rn")

◆ d_gpreg_gpreg

tuple miasm.arch.sh4.arch.d_gpreg_gpreg = (DEREF + LPARENT + gpregs.parser + COMMA + gpregs.parser + RPARENT).setParseAction(cb_regdisp)

◆ DEREF

miasm.arch.sh4.arch.DEREF = Suppress("@")

◆ deref_pc

tuple miasm.arch.sh4.arch.deref_pc = (DEREF + ref_pc).setParseAction(cb_deref_mem)

◆ deref_pcimm

tuple miasm.arch.sh4.arch.deref_pcimm = (DEREF + ref_pcandimm).setParseAction(cb_deref_mem)

◆ dgbr_imm

tuple miasm.arch.sh4.arch.dgbr_imm = (DEREF + LPARENT + reg_info_gbr.parser + COMMA + base_expr + RPARENT).setParseAction(cb_regdisp)

◆ dgbr_reg

tuple miasm.arch.sh4.arch.dgbr_reg = (DEREF + LPARENT + reg_info_gbr.parser + COMMA + gpregs.parser + RPARENT).setParseAction(cb_regreg)

◆ dgpregs

tuple miasm.arch.sh4.arch.dgpregs = dgpregs_base | dgpregs_predec | dgpregs_postinc

◆ dgpregs_base

tuple miasm.arch.sh4.arch.dgpregs_base = (DEREF + gpregs.parser).setParseAction(cb_deref_mem)

◆ dgpregs_ir

tuple miasm.arch.sh4.arch.dgpregs_ir = (DEREF + LPARENT + gpregs.parser + COMMA + base_expr + RPARENT).setParseAction(cb_regdisp)

◆ dgpregs_p

tuple miasm.arch.sh4.arch.dgpregs_p = dgpregs_predec | dgpregs_postinc

◆ dgpregs_postinc

tuple miasm.arch.sh4.arch.dgpregs_postinc = (DEREF + gpregs.parser + PLUS).setParseAction(cb_postinc)

◆ dgpregs_predec

tuple miasm.arch.sh4.arch.dgpregs_predec = (DEREF + MINUS + gpregs.parser).setParseAction(cb_predec)

◆ dimm4

miasm.arch.sh4.arch.dimm4 = bs(l=4, fname='disp', order=-1)

◆ dpc16imm

miasm.arch.sh4.arch.dpc16imm = bs(l=8, cls=(sh4_dpc16imm,), fname="pcimm", sz=16)

◆ dpc32imm

miasm.arch.sh4.arch.dpc32imm = bs(l=8, cls=(sh4_dpc32imm,), fname="pcimm", sz=32)

◆ dr0gbr

miasm.arch.sh4.arch.dr0gbr = bs(l=0, cls=(bs_dr0gbr,), sz=8)

◆ drm

miasm.arch.sh4.arch.drm = bs(l=3, cls=(sh4_dr,), fname="drm")

◆ drn

miasm.arch.sh4.arch.drn = bs(l=3, cls=(sh4_dr,), fname="drn")

◆ frm

miasm.arch.sh4.arch.frm = bs(l=4, cls=(sh4_freg,), fname="frm")

◆ frn

miasm.arch.sh4.arch.frn = bs(l=4, cls=(sh4_freg,), fname="frn")

◆ jra

miasm.arch.sh4.arch.jra = ExprId('jra', 32)

◆ jrb

miasm.arch.sh4.arch.jrb = ExprId('jrb', 32)

◆ jrc

miasm.arch.sh4.arch.jrc = ExprId('jrc', 32)

◆ LBRACK

miasm.arch.sh4.arch.LBRACK = Suppress("[")

◆ LPARENT

miasm.arch.sh4.arch.LPARENT = Suppress("(")

◆ MINUS

miasm.arch.sh4.arch.MINUS = Suppress("-")

◆ MULT

miasm.arch.sh4.arch.MULT = Suppress("*")

◆ pc32imm

miasm.arch.sh4.arch.pc32imm = bs(l=8, cls=(sh4_pc32imm,), fname="pcimm")

◆ pcdisp

tuple miasm.arch.sh4.arch.pcdisp = (reg_info_pc.parser + AND + base_expr + PLUS + base_expr).setParseAction(cb_pcandimmimm)

◆ PLUS

miasm.arch.sh4.arch.PLUS = Suppress("+")

◆ PTR

miasm.arch.sh4.arch.PTR = Suppress('PTR')

◆ RBRACK

miasm.arch.sh4.arch.RBRACK = Suppress("]")

◆ ref_pc

tuple miasm.arch.sh4.arch.ref_pc = (LPARENT + reg_info_pc.parser + COMMA + base_expr + RPARENT).setParseAction(cb_deref_pcimm)

◆ ref_pcandimm

tuple miasm.arch.sh4.arch.ref_pcandimm = (LPARENT + reg_info_pc.parser + AND + base_expr + COMMA + base_expr + RPARENT).setParseAction(cb_pcandimmimm)

◆ rm

miasm.arch.sh4.arch.rm = bs(l=4, cls=(sh4_gpreg,), fname="rm")

◆ rn

miasm.arch.sh4.arch.rn = bs(l=4, cls=(sh4_gpreg,), fname="rn")

◆ RPARENT

miasm.arch.sh4.arch.RPARENT = Suppress(")")

◆ s08imm

miasm.arch.sh4.arch.s08imm = bs(l=8, cls=(sh4_simm,), fname="imm")

◆ s12imm

miasm.arch.sh4.arch.s12imm = bs(l=12, cls=(sh4_simm,), fname="imm")

◆ u08imm

miasm.arch.sh4.arch.u08imm = bs(l=8, cls=(sh4_imm,), fname="imm")