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

Public Member Functions

def flen
 
def encode
 
def decode
 
def clone
 
def __hash__
 

Public Attributes

 l
 
 value
 
 expr
 
 parent
 
 strbits
 
 cls
 
 fname
 
 order
 
 lmask
 
 fbits
 
 fmask
 
 flen
 
 kargs
 

Detailed Description

Definition at line 2787 of file arch.py.

Member Function Documentation

def miasm2.core.cpu.bsi.__hash__ (   self)
inherited

Definition at line 493 of file cpu.py.

494  def __hash__(self):
495  kargs = []
496  for k, v in self.kargs.items():
497  if isinstance(v, list):
498  v = tuple(v)
499  kargs.append((k, v))
500  l = [self.strbits, self.l, self.cls,
501  self.fname, self.order, self.lmask, self.fbits,
502  self.fmask, self.value] # + kargs
503 
504  return hash(tuple(l))
505 
def miasm2.core.cpu.bsi.clone (   self)
inherited

Definition at line 483 of file cpu.py.

484  def clone(self):
485  s = self.__class__(self.parent,
486  self.strbits, self.l, self.cls,
487  self.fname, self.order, self.lmask, self.fbits,
488  self.fmask, self.value, self.flen, **self.kargs)
489  s.__dict__.update(self.kargs)
490  if hasattr(self, 'expr'):
491  s.expr = self.expr
492  return s
def miasm2.arch.x86.arch.bs_moff.decode (   self,
  v 
)

Definition at line 2817 of file arch.py.

2818  def decode(self, v):
2819  opmode = self.parent.v_opmode()
2820  if opmode == 64:
2821  return False
2822  v = swap_uint(self.l, v)
2823  self.value = v
2824  v = sign_ext(v, self.l, opmode)
2825  self.expr = ExprInt(v, opmode)
2826  return True
2827 
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_moff.encode (   self)

Definition at line 2797 of file arch.py.

2798  def encode(self):
2799  if not hasattr(self.parent, "mseg"):
2800  raise StopIteration
2801  m = self.parent.mseg.expr
2802  if not (isinstance(m, ExprOp) and m.op == 'segm'):
2803  raise StopIteration
2804  if not isinstance(m.args[1], ExprInt):
2805  raise StopIteration
2806  l = self.parent.v_opmode()
2807  if l == 16:
2808  self.l = 16
2809  else:
2810  self.l = 32
2811  v = int(m.args[1].arg)
2812  mask = ((1 << self.l) - 1)
2813  if v != sign_ext(v & mask, self.l, l):
2814  raise StopIteration
2815  self.value = swap_uint(self.l, v & ((1 << self.l) - 1))
2816  yield True
def swap_uint
Definition: cpu.py:1578
def sign_ext
Definition: cpu.py:1602
def miasm2.arch.x86.arch.bs_moff.flen (   cls,
  mode,
  v 
)

Definition at line 2790 of file arch.py.

2791  def flen(cls, mode, v):
2792  osize = v_opmode_info(mode, v['opmode'], v['rex_w'], 0)
2793  if osize == 16:
2794  return 16
2795  else:
2796  return 32

+ Here is the call graph for this function:

Member Data Documentation

miasm2.core.cpu.bsi.cls
inherited

Definition at line 465 of file cpu.py.

miasm2.arch.x86.arch.bs_moff.expr

Definition at line 2824 of file arch.py.

miasm2.core.cpu.bsi.fbits
inherited

Definition at line 469 of file cpu.py.

miasm2.core.cpu.bsi.flen
inherited

Definition at line 471 of file cpu.py.

miasm2.core.cpu.bsi.fmask
inherited

Definition at line 470 of file cpu.py.

miasm2.core.cpu.bsi.fname
inherited

Definition at line 466 of file cpu.py.

miasm2.core.cpu.bsi.kargs
inherited

Definition at line 473 of file cpu.py.

miasm2.arch.x86.arch.bs_moff.l

Definition at line 2807 of file arch.py.

miasm2.core.cpu.bsi.lmask
inherited

Definition at line 468 of file cpu.py.

miasm2.core.cpu.bsi.order
inherited

Definition at line 467 of file cpu.py.

miasm2.core.cpu.bsi.parent
inherited

Definition at line 462 of file cpu.py.

miasm2.core.cpu.bsi.strbits
inherited

Definition at line 463 of file cpu.py.

miasm2.arch.x86.arch.bs_moff.value

Definition at line 2814 of file arch.py.


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