Miasm2
 All Classes Namespaces Files Functions Variables Typedefs Properties Macros
Public Member Functions | Static Public Attributes | List of all members
miasm2.arch.mips32.arch.mn_mips32 Class Reference
+ Inheritance diagram for miasm2.arch.mips32.arch.mn_mips32:
+ Collaboration diagram for miasm2.arch.mips32.arch.mn_mips32:

Public Member Functions

def getpc
 
def getsp
 
def additional_info
 
def getbits
 
def endian_offset
 
def check_mnemo
 
def getmn
 
def gen_modes
 
def value
 

Static Public Attributes

int delayslot = 0
 
string name = "mips32"
 
 regs = regs
 
dictionary bintree = {}
 
int num = 0
 
list all_mn = []
 
tuple all_mn_mode = defaultdict(list)
 
tuple all_mn_name = defaultdict(list)
 
tuple all_mn_inst = defaultdict(list)
 
dictionary pc = {'l':regs.PC, 'b':regs.PC}
 
dictionary sp = {'l':regs.SP, 'b':regs.SP}
 
 instruction = instruction_mips32
 
int max_instruction_len = 4
 

Detailed Description

Definition at line 191 of file arch.py.

Member Function Documentation

def miasm2.arch.mips32.arch.mn_mips32.additional_info (   self)

Definition at line 214 of file arch.py.

215  def additional_info(self):
216  info = additional_info()
217  return info
def miasm2.arch.mips32.arch.mn_mips32.check_mnemo (   cls,
  fields 
)

Definition at line 250 of file arch.py.

251  def check_mnemo(cls, fields):
252  l = sum([x.l for x in fields])
253  assert l == 32, "len %r" % l
def miasm2.arch.mips32.arch.mn_mips32.endian_offset (   cls,
  attrib,
  offset 
)

Definition at line 241 of file arch.py.

242  def endian_offset(cls, attrib, offset):
243  if attrib == "l":
244  return (offset & ~3) + 3 - offset % 4
245  elif attrib == "b":
246  return offset
247  else:
248  raise NotImplementedError('bad attrib')
def miasm2.arch.mips32.arch.mn_mips32.gen_modes (   cls,
  subcls,
  name,
  bases,
  dct,
  fields 
)

Definition at line 259 of file arch.py.

260  def gen_modes(cls, subcls, name, bases, dct, fields):
261  dct['mode'] = None
262  return [(subcls, name, bases, dct, fields)]
def miasm2.arch.mips32.arch.mn_mips32.getbits (   cls,
  bitstream,
  attrib,
  start,
  n 
)

Definition at line 219 of file arch.py.

220  def getbits(cls, bitstream, attrib, start, n):
221  if not n:
222  return 0
223  o = 0
224  while n:
225  offset = start / 8
226  n_offset = cls.endian_offset(attrib, offset)
227  c = cls.getbytes(bitstream, n_offset, 1)
228  if not c:
229  raise IOError
230  c = ord(c)
231  r = 8 - start % 8
232  c &= (1 << r) - 1
233  l = min(r, n)
234  c >>= (r - l)
235  o <<= l
236  o |= c
237  n -= l
238  start += l
239  return o
def miasm2.arch.mips32.arch.mn_mips32.getmn (   cls,
  name 
)

Definition at line 255 of file arch.py.

256  def getmn(cls, name):
257  return name.upper()
def miasm2.arch.mips32.arch.mn_mips32.getpc (   cls,
  attrib = None 
)

Definition at line 207 of file arch.py.

208  def getpc(cls, attrib = None):
209  return regs.PC
def miasm2.arch.mips32.arch.mn_mips32.getsp (   cls,
  attrib = None 
)

Definition at line 211 of file arch.py.

212  def getsp(cls, attrib = None):
213  return regs.SP
def miasm2.arch.mips32.arch.mn_mips32.value (   self,
  mode 
)

Definition at line 263 of file arch.py.

264  def value(self, mode):
265  v = super(mn_mips32, self).value(mode)
266  if mode == 'l':
267  return [x[::-1] for x in v]
268  elif mode == 'b':
269  return [x for x in v]
270  else:
271  raise NotImplementedError('bad attrib')
272 
273 

Member Data Documentation

list miasm2.arch.mips32.arch.mn_mips32.all_mn = []
static

Definition at line 197 of file arch.py.

tuple miasm2.arch.mips32.arch.mn_mips32.all_mn_inst = defaultdict(list)
static

Definition at line 200 of file arch.py.

tuple miasm2.arch.mips32.arch.mn_mips32.all_mn_mode = defaultdict(list)
static

Definition at line 198 of file arch.py.

tuple miasm2.arch.mips32.arch.mn_mips32.all_mn_name = defaultdict(list)
static

Definition at line 199 of file arch.py.

dictionary miasm2.arch.mips32.arch.mn_mips32.bintree = {}
static

Definition at line 195 of file arch.py.

int miasm2.arch.mips32.arch.mn_mips32.delayslot = 0
static

Definition at line 192 of file arch.py.

miasm2.arch.mips32.arch.mn_mips32.instruction = instruction_mips32
static

Definition at line 203 of file arch.py.

int miasm2.arch.mips32.arch.mn_mips32.max_instruction_len = 4
static

Definition at line 204 of file arch.py.

string miasm2.arch.mips32.arch.mn_mips32.name = "mips32"
static

Definition at line 193 of file arch.py.

int miasm2.arch.mips32.arch.mn_mips32.num = 0
static

Definition at line 196 of file arch.py.

dictionary miasm2.arch.mips32.arch.mn_mips32.pc = {'l':regs.PC, 'b':regs.PC}
static

Definition at line 201 of file arch.py.

miasm2.arch.mips32.arch.mn_mips32.regs = regs
static

Definition at line 194 of file arch.py.

dictionary miasm2.arch.mips32.arch.mn_mips32.sp = {'l':regs.SP, 'b':regs.SP}
static

Definition at line 202 of file arch.py.


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