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

Public Member Functions

def get_size
 
def encode
 
def decode
 
def fromstring
 
def fromstring
 
def check_fbits
 

Public Attributes

 value
 
 expr
 
 fmask
 

Static Public Attributes

 parser = deref_ext2
 
 reg_info = None
 

Detailed Description

Definition at line 995 of file arch.py.

Member Function Documentation

def miasm2.core.cpu.reg_noarg.check_fbits (   self,
  v 
)
inherited

Definition at line 666 of file cpu.py.

667  def check_fbits(self, v):
668  return v & self.fmask == self.fbits
669 
def miasm2.arch.aarch64.arch.aarch64_gpreg_ext2.decode (   self,
  v 
)
inherited

Definition at line 972 of file arch.py.

973  def decode(self, v):
974  opt = self.parent.option.value
975  if opt in [0, 1, 4, 5]:
976  return False
977  elif opt in [2, 6]:
978  reg_expr = gpregsz32_info.expr
979  elif opt in [3, 7]:
980  reg_expr = gpregsz64_info.expr
981  arg = reg_expr[v]
982 
983  if opt in EXT2_OP:
984  if self.parent.shift.value == 1:
985  arg = m2_expr.ExprOp(EXT2_OP[opt], arg,
986  m2_expr.ExprInt_from(arg, self.get_size()))
987  else:
988  arg = m2_expr.ExprOp(EXT2_OP[opt], arg,
989  m2_expr.ExprInt_from(arg, 0))
990 
991  reg = self.parent.rn.reg_info.expr[self.parent.rn.value]
992  self.expr = m2_expr.ExprOp('segm', reg, arg)
993  return True
994 

+ Here is the call graph for this function:

def miasm2.arch.aarch64.arch.aarch64_gpreg_ext2.encode (   self)
inherited

Definition at line 931 of file arch.py.

932  def encode(self):
933  if not isinstance(self.expr, m2_expr.ExprOp):
934  return False
935  arg0, arg1 = self.expr.args
936  if not (isinstance(self.expr, m2_expr.ExprOp) and self.expr.op == 'segm'):
937  return False
938  if not arg0 in self.parent.rn.reg_info.expr:
939  return False
940  self.parent.rn.value = self.parent.rn.reg_info.expr.index(arg0)
941  is_reg = False
942  self.parent.shift.value = 0
943  if isinstance(arg1, m2_expr.ExprId):
944  reg = arg1
945  self.parent.option.value = 0b011
946  is_reg = True
947  elif isinstance(arg1, m2_expr.ExprOp) and arg1.op in EXT2_OP.values():
948  reg = arg1.args[0]
949  else:
950  return False
951  if not (reg.size in gpregs_info and
952  reg in gpregs_info[reg.size].expr):
953  return False
954  self.value = gpregs_info[reg.size].expr.index(reg)
955  if is_reg:
956  return True
957  if not (isinstance(arg1.args[1], m2_expr.ExprInt)):
958  return False
959  if arg1.op not in EXT2_OP_INV:
960  return False
961  self.parent.option.value = EXT2_OP_INV[arg1.op]
962  if arg1.args[1].arg == 0:
963  self.parent.shift.value = 0
964  return True
965 
966  if arg1.args[1].arg != self.get_size():
967  return False
968 
969  self.parent.shift.value = 1
970 
971  return True
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.reg_noarg.fromstring (   self,
  s,
  parser_result = None 
)
inherited

Definition at line 636 of file cpu.py.

637  def fromstring(self, s, parser_result=None):
638  if parser_result:
639  e, start, stop = parser_result[self.parser]
640  self.expr = e
641  return start, stop
642  try:
643  v, start, stop = self.parser.scanString(s).next()
644  except StopIteration:
645  return None, None
646  self.expr = v[0]
647  return start, stop
def miasm2.arch.aarch64.arch.aarch64_gpreg_ext2_128.get_size (   self)

Definition at line 997 of file arch.py.

998  def get_size(self):
999  return 4
1000 

Member Data Documentation

miasm2.arch.aarch64.arch.aarch64_gpreg_ext2.expr
inherited

Definition at line 991 of file arch.py.

miasm2.core.cpu.reg_noarg.fmask
inherited

Definition at line 667 of file cpu.py.

miasm2.arch.aarch64.arch.aarch64_gpreg_ext2.parser = deref_ext2
staticinherited

Definition at line 926 of file arch.py.

miasm2.core.cpu.reg_noarg.reg_info = None
staticinherited

Definition at line 633 of file cpu.py.

miasm2.arch.aarch64.arch.aarch64_gpreg_ext2.value
inherited

Definition at line 953 of file arch.py.


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