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

Public Member Functions

def decodeval
 
def encodeval
 
def int2expr
 
def decode
 
def encode
 
def expr2int
 
def fromstring
 
def fromstring
 

Public Attributes

 expr
 
 value
 

Static Public Attributes

 parser = base_expr
 
int intsize = 32
 
tuple intmask = (1 << intsize)
 

Detailed Description

Definition at line 1643 of file arch.py.

Member Function Documentation

def miasm2.arch.arm.arch.arm_offs.decode (   self,
  v 
)
inherited

Definition at line 801 of file arch.py.

802  def decode(self, v):
803  v = v & self.lmask
804  if (1 << (self.l - 1)) & v:
805  v |= ~0 ^ self.lmask
806  v = self.decodeval(v)
807  self.expr = ExprInt32(v)
808  return True

+ Here is the call graph for this function:

def miasm2.arch.arm.arch.arm_offspc.decodeval (   self,
  v 
)

Definition at line 1645 of file arch.py.

1646  def decodeval(self, v):
1647  v = v << 1
1648  # Add pipeline offset
1649  v += 2 + 2
1650  return v

+ Here is the caller graph for this function:

def miasm2.arch.arm.arch.arm_offs.encode (   self)
inherited

Definition at line 809 of file arch.py.

810  def encode(self):
811  if not isinstance(self.expr, ExprInt):
812  return False
813  v = int(self.expr.arg)
814  if (1 << (self.l - 1)) & v:
815  v = -((0xffffffff ^ v) + 1)
816  v = self.encodeval(v)
817  self.value = (v & 0xffffffff) & self.lmask
818  return True
819 

+ Here is the call graph for this function:

def miasm2.arch.arm.arch.arm_offspc.encodeval (   self,
  v 
)

Definition at line 1651 of file arch.py.

1652  def encodeval(self, v):
1653  # Remove pipeline offset
1654  v -= 2 + 2
1655  if v % 2 == 0:
1656  return v >> 1
1657  return False
1658 

+ Here is the caller graph for this function:

def miasm2.core.cpu.imm_noarg.expr2int (   self,
  e 
)
inherited

Definition at line 1473 of file cpu.py.

1474  def expr2int(self, e):
1475  if not isinstance(e, m2_expr.ExprInt):
1476  return None
1477  v = int(e.arg)
1478  if v & ~self.intmask != 0:
1479  return None
1480  return v

+ Here is the caller graph for this function:

def miasm2.core.cpu.m_arg.fromstring (   self,
  s,
  parser_result = None 
)
inherited

Definition at line 604 of file cpu.py.

605  def fromstring(self, s, parser_result=None):
606  if parser_result:
607  e, start, stop = parser_result[self.parser]
608  self.expr = e
609  return start, stop
610  try:
611  v, start, stop = self.parser.scanString(s).next()
612  except StopIteration:
613  return None, None
614  self.expr = v[0]
615  return start, stop
616 

+ Here is the call graph for this function:

def miasm2.core.cpu.imm_noarg.fromstring (   self,
  s,
  parser_result = None 
)
inherited

Definition at line 1481 of file cpu.py.

1482  def fromstring(self, s, parser_result=None):
1483  if parser_result:
1484  e, start, stop = parser_result[self.parser]
1485  else:
1486  try:
1487  e, start, stop = self.parser.scanString(s).next()
1488  except StopIteration:
1489  return None, None
1490  if e is None:
1491  return None, None
1492 
1493  assert(isinstance(e, m2_expr.Expr))
1494  if isinstance(e, tuple):
1495  self.expr = self.int2expr(e[1])
1496  elif isinstance(e, m2_expr.Expr):
1497  self.expr = e
1498  else:
1499  raise TypeError('zarb expr')
1500  if self.expr is None:
1501  log.debug('cannot fromstring int %r', s)
1502  return None, None
1503  return start, stop

+ Here is the call graph for this function:

def miasm2.arch.arm.arch.arm_offs.int2expr (   self,
  v 
)
inherited

Definition at line 783 of file arch.py.

784  def int2expr(self, v):
785  if v & ~self.intmask != 0:
786  return None
787  return ExprInt(v, self.intsize)

+ Here is the caller graph for this function:

Member Data Documentation

miasm2.arch.arm.arch.arm_offs.expr
inherited

Definition at line 806 of file arch.py.

tuple miasm2.core.cpu.imm_noarg.intmask = (1 << intsize)
staticinherited

Definition at line 1466 of file cpu.py.

int miasm2.core.cpu.imm_noarg.intsize = 32
staticinherited

Definition at line 1465 of file cpu.py.

miasm2.arch.arm.arch.arm_offs.parser = base_expr
staticinherited

Definition at line 781 of file arch.py.

miasm2.arch.arm.arch.arm_offs.value
inherited

Definition at line 816 of file arch.py.


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