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

Public Member Functions

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

Public Attributes

 expr
 
 value
 
 expr
 

Static Public Attributes

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

Detailed Description

Definition at line 778 of file arch.py.

Member Function Documentation

def miasm2.core.cpu.imm_noarg.decode (   self,
  v 
)
inherited

Definition at line 1512 of file cpu.py.

1513  def decode(self, v):
1514  v = v & self.lmask
1515  v = self.decodeval(v)
1516  e = self.int2expr(v)
1517  if not e:
1518  return False
1519  self.expr = e
1520  return True

+ Here is the call graph for this function:

def miasm2.core.cpu.imm_noarg.decodeval (   self,
  v 
)
inherited

Definition at line 1504 of file cpu.py.

1505  def decodeval(self, v):
1506  return v

+ Here is the caller graph for this function:

def miasm2.core.cpu.imm_noarg.encode (   self)
inherited

Definition at line 1521 of file cpu.py.

1522  def encode(self):
1523  v = self.expr2int(self.expr)
1524  if v is None:
1525  return False
1526  v = self.encodeval(v)
1527  if v is False:
1528  return False
1529  self.value = v
1530  return True
1531 

+ Here is the call graph for this function:

def miasm2.core.cpu.imm_noarg.encodeval (   self,
  v 
)
inherited

Definition at line 1507 of file cpu.py.

1508  def encodeval(self, v):
1509  if v > self.lmask:
1510  return False
1511  return v

+ 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.core.cpu.imm_noarg.int2expr (   self,
  v 
)
inherited

Definition at line 1468 of file cpu.py.

1469  def int2expr(self, v):
1470  if (v & ~self.intmask) != 0:
1471  return None
1472  return m2_expr.ExprInt(v, self.intsize)

+ Here is the caller graph for this function:

Member Data Documentation

miasm2.core.cpu.m_arg.expr
inherited

Definition at line 607 of file cpu.py.

miasm2.core.cpu.imm_noarg.expr
inherited

Definition at line 1494 of file cpu.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.aarch64.arch.aarch64_imm_32.parser = base_expr
static

Definition at line 779 of file arch.py.

miasm2.core.cpu.imm_noarg.value
inherited

Definition at line 1528 of file cpu.py.


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