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

Public Member Functions

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

Public Attributes

 value
 
 expr
 

Static Public Attributes

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

Detailed Description

Definition at line 852 of file arch.py.

Member Function Documentation

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

Definition at line 872 of file arch.py.

873  def decode(self, v):
874  size = 64 if self.parent.sf.value else 32
875  if self.parent.shift.value == 0:
876  self.expr = m2_expr.ExprInt(v, size)
877  elif self.parent.shift.value == 1:
878  self.expr = m2_expr.ExprInt(v << 12, size)
879  else:
880  return False
881  return True
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_imm_sft.encode (   self)

Definition at line 854 of file arch.py.

855  def encode(self):
856  if not isinstance(self.expr, m2_expr.ExprInt):
857  return False
858  if not test_set_sf(self.parent, self.expr.size):
859  return False
860  value = int(self.expr.arg)
861  if value < 1 << self.l:
862  self.parent.shift.value = 0
863  else:
864  if value & 0xFFF:
865  return False
866  value >>= 12
867  if value >= 1 << self.l:
868  return False
869  self.parent.shift.value = 1
870  self.value = value
871  return True

+ 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.arch.aarch64.arch.aarch64_imm_sf.fromstring (   self,
  s,
  parser_result = None 
)
inherited

Definition at line 820 of file arch.py.

821  def fromstring(self, s, parser_result=None):
822  start, stop = super(aarch64_imm_sf, self).fromstring(s, parser_result)
823  if start is None:
824  return start, stop
825  size = self.parent.args[0].expr.size
826  if self.expr in gpregs64_info.expr + gpregs32_info.expr:
827  return None, None
828  if isinstance(self.expr, m2_expr.ExprOp):
829  return False
830  expr = set_imm_to_size(size, self.expr)
831  if expr is None:
832  return None, None
833  self.expr = expr
834  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_imm_sft.expr

Definition at line 875 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_imm_sf.parser = base_expr
staticinherited

Definition at line 818 of file arch.py.

miasm2.arch.aarch64.arch.aarch64_imm_sft.value

Definition at line 869 of file arch.py.


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