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

Public Member Functions

def fromstring
 
def flen
 
def encode
 
def decode
 

Public Attributes

 expr
 
 l
 
 value
 

Static Public Attributes

 parser = deref_mem
 

Detailed Description

Definition at line 2828 of file arch.py.

Member Function Documentation

def miasm2.arch.x86.arch.bs_movoff.decode (   self,
  v 
)

Definition at line 2876 of file arch.py.

2877  def decode(self, v):
2878  if self.parent.mode == 64:
2879  if self.parent.admode == 1:
2880  l = 32
2881  else:
2882  l = 64
2883  else:
2884  l = self.parent.v_admode()
2885  v = swap_uint(self.l, v)
2886  self.value = v
2887  v = sign_ext(v, self.l, l)
2888  v = ExprInt(v, l)
2889  size = self.parent.v_opmode()
2890  if self.parent.w8.value == 0:
2891  size = 8
2892  self.expr = ExprMem(v, size)
2893  return True
2894 
def swap_uint
Definition: cpu.py:1578
def sign_ext
Definition: cpu.py:1602

+ Here is the call graph for this function:

def miasm2.arch.x86.arch.bs_movoff.encode (   self)

Definition at line 2864 of file arch.py.

2865  def encode(self):
2866  p = self.parent
2867  if not isinstance(self.expr, ExprMem) or not isinstance(self.expr.arg, ExprInt):
2868  raise StopIteration
2869  self.l = p.v_admode()
2870  v = int(self.expr.arg.arg)
2871  mask = ((1 << self.l) - 1)
2872  if v != mask & v:
2873  raise StopIteration
2874  self.value = swap_uint(self.l, v & ((1 << self.l) - 1))
2875  yield True
def swap_uint
Definition: cpu.py:1578
def miasm2.arch.x86.arch.bs_movoff.flen (   cls,
  mode,
  v 
)

Definition at line 2855 of file arch.py.

2856  def flen(cls, mode, v):
2857  if mode == 64:
2858  if v['admode']:
2859  return 32
2860  else:
2861  return 64
2862  asize = v_admode_info(mode, v['admode'])
2863  return asize

+ Here is the call graph for this function:

def miasm2.arch.x86.arch.bs_movoff.fromstring (   self,
  s,
  parser_result = None 
)

Definition at line 2831 of file arch.py.

2832  def fromstring(self, s, parser_result=None):
2833  if parser_result:
2834  e, start, stop = parser_result[self.parser]
2835  if e is None:
2836  return None, None
2837  if not isinstance(e, ExprMem):
2838  return None, None
2839  self.expr = e
2840  if self.expr is None:
2841  return None, None
2842  return start, stop
2843  try:
2844  v, start, stop = self.parser.scanString(s).next()
2845  except StopIteration:
2846  return None, None
2847  if not isinstance(e, ExprMem):
2848  return None, None
2849  self.expr = v[0]
2850  if self.expr is None:
2851  log.debug('cannot fromstring int %r', s)
2852  return None, None
2853  return start, stop

Member Data Documentation

miasm2.arch.x86.arch.bs_movoff.expr

Definition at line 2838 of file arch.py.

miasm2.arch.x86.arch.bs_movoff.l

Definition at line 2868 of file arch.py.

miasm2.arch.x86.arch.bs_movoff.parser = deref_mem
static

Definition at line 2829 of file arch.py.

miasm2.arch.x86.arch.bs_movoff.value

Definition at line 2873 of file arch.py.


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