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_msegoff Class Reference
+ Inheritance diagram for miasm2.arch.x86.arch.bs_msegoff:
+ Collaboration diagram for miasm2.arch.x86.arch.bs_msegoff:

Public Member Functions

def fromstring
 
def encode
 
def decode
 

Public Attributes

 expr
 
 value
 

Static Public Attributes

 parser = deref_ptr
 

Detailed Description

Definition at line 2895 of file arch.py.

Member Function Documentation

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

Definition at line 2932 of file arch.py.

2933  def decode(self, v):
2934  opmode = self.parent.v_opmode()
2935  v = swap_uint(self.l, v)
2936  self.value = v
2937  v = ExprInt16(v)
2938  self.expr = ExprOp('segm', v, self.parent.off.expr)
2939  return True
2940 
def swap_uint
Definition: cpu.py:1578

+ Here is the call graph for this function:

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

Definition at line 2917 of file arch.py.

2918  def encode(self):
2919  if not (isinstance(self.expr, ExprOp) and self.expr.op == 'segm'):
2920  raise StopIteration
2921  if not isinstance(self.expr.args[0], ExprInt):
2922  raise StopIteration
2923  if not isinstance(self.expr.args[1], ExprInt):
2924  raise StopIteration
2925  l = self.parent.v_opmode()
2926  v = int(self.expr.args[0].arg)
2927  mask = ((1 << self.l) - 1)
2928  if v != sign_ext(v & mask, self.l, l):
2929  raise StopIteration
2930  self.value = swap_uint(self.l, v & ((1 << self.l) - 1))
2931  yield True
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_msegoff.fromstring (   self,
  s,
  parser_result = None 
)

Definition at line 2898 of file arch.py.

2899  def fromstring(self, s, parser_result=None):
2900  if parser_result:
2901  e, start, stop = parser_result[self.parser]
2902  if e is None:
2903  return None, None
2904  self.expr = e
2905  if self.expr is None:
2906  return None, None
2907  return start, stop
2908  try:
2909  v, start, stop = self.parser.scanString(s).next()
2910  except StopIteration:
2911  return None, None
2912  self.expr = v[0]
2913  if self.expr is None:
2914  log.debug('cannot fromstring int %r', s)
2915  return None, None
2916  return start, stop

Member Data Documentation

miasm2.arch.x86.arch.bs_msegoff.expr

Definition at line 2903 of file arch.py.

miasm2.arch.x86.arch.bs_msegoff.parser = deref_ptr
static

Definition at line 2896 of file arch.py.

miasm2.arch.x86.arch.bs_msegoff.value

Definition at line 2929 of file arch.py.


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