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_immhip_page Class Reference
+ Inheritance diagram for miasm2.arch.aarch64.arch.aarch64_immhip_page:
+ Collaboration diagram for miasm2.arch.aarch64.arch.aarch64_immhip_page:

Public Member Functions

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

Public Attributes

 expr
 
 value
 

Static Public Attributes

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

Detailed Description

Definition at line 1112 of file arch.py.

Member Function Documentation

def miasm2.arch.aarch64.arch.aarch64_immhip_page.decode (   self,
  v 
)

Definition at line 1115 of file arch.py.

1116  def decode(self, v):
1117  v = ((v << 2) | self.parent.immlo.value) << 12
1118  v = sign_ext(v, 33, 64)
1119  self.expr = m2_expr.ExprInt64(v)
1120  return True
def sign_ext
Definition: cpu.py:1602

+ 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.arch.aarch64.arch.aarch64_immhip_page.encode (   self)

Definition at line 1121 of file arch.py.

1122  def encode(self):
1123  v = int(self.expr.arg)
1124  if v & (1 << 63):
1125  v &= (1 << 33) - 1
1126  if v & 0xfff:
1127  return False
1128  v >>= 12
1129  self.parent.immlo.value = v & 3
1130  v >>= 2
1131  self.value = v
1132  return True
1133 
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.arch.aarch64.arch.aarch64_immhip_page.expr

Definition at line 1118 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.aarch64.arch.aarch64_immhip_page.parser = base_expr
static

Definition at line 1113 of file arch.py.

miasm2.arch.aarch64.arch.aarch64_immhip_page.value

Definition at line 1130 of file arch.py.


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