Package rekall :: Module obj :: Class Pointer
[frames] | no frames]

Class Pointer

source code


A pointer reads an 'address' object from the address space.

Nested Classes
  __metaclass__
Give each object a unique ID. (Inherited from rekall.obj.BaseObject)
Instance Methods
 
__init__(self, target=None, target_args=None, value=None, **kwargs)
Constructor.
source code
 
v(self, vm=None)
Do the actual reading and decoding of this member
source code
 
m(self, attr) source code
 
write(self, data)
Writes the data back into the address space
source code
 
__eq__(self, other) source code
 
is_valid(self)
Returns if what we are pointing to is valid
source code
 
__getitem__(self, item)
Indexing a pointer indexes its target.
source code
 
dereference(self, vm=None) source code
 
__dir__(self)
Hide any members with _.
source code
 
cdecl(self) source code
 
__nonzero__(self)
This method is used in comparison operations.
source code
 
__add__(self, other)
Return a new pointer advanced by this many positions.
source code
 
__sub__(self, other) source code
 
__iadd__(self, other) source code
 
__repr__(self)
repr(x)
source code
 
__unicode__(self) source code
 
__getattr__(self, attr) source code
 
__iter__(self)
Delegate the iterator to the target.
source code
 
dereference_as(self, target=None, target_args=None, vm=None, profile=None, parent=None)
Dereference ourselves into another type, or address space.
source code
 
GetData(self)
Returns the raw data of this object. (Inherited from rekall.obj.BaseObject)
source code
 
__abs__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__and__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__div__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__divmod__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__float__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__floordiv__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__format__(self, formatspec)
default object formatter (Inherited from rekall.obj.BaseObject)
source code
 
__ge__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__gt__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__hash__(self)
hash(x) (Inherited from rekall.obj.BaseObject)
source code
 
__hex__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__index__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__int__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__invert__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__le__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__long__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__lshift__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__lt__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__mod__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__mul__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__ne__(self, other) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__neg__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__oct__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__or__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__pos__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__pow__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__radd__(self, other) (Inherited from rekall.obj.NativeType) source code
 
__rand__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__rdiv__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__rdivmod__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__rfloordiv__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__rlshift__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__rmod__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__rmul__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__ror__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__rpow__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__rrshift__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__rshift__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__rsub__(self, other) (Inherited from rekall.obj.NativeType) source code
 
__rtruediv__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__rxor__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__str__(self)
str(x) (Inherited from rekall.obj.BaseObject)
source code
 
__truediv__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
__xor__(self, *args, **kw) (Inherited from rekall.obj.NumericProxyMixIn) source code
 
cast(self, type_name=None, vm=None, **kwargs) (Inherited from rekall.obj.BaseObject) source code
 
deref(self, vm=None)
An alias for dereference - less to type. (Inherited from rekall.obj.BaseObject)
source code
 
proxied(self) (Inherited from rekall.obj.NativeType) source code
 
reference(self)
Produces a pointer to this object. (Inherited from rekall.obj.BaseObject)
source code

Inherited from object: __delattr__, __getattribute__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Class Methods
 
getproperties(cls)
Return all members that are intended to represent some data. (Inherited from rekall.obj.BaseObject)
source code
Static Methods
 
integer_to_address(value)
Addresses only use 48 bits.
source code
Class Variables
  obj_name = <No name> (Inherited from rekall.obj.BaseObject)
  obj_parent = <No parent> (Inherited from rekall.obj.BaseObject)
  obj_producers = None
hash(x) (Inherited from rekall.obj.BaseObject)
Properties
  obj_size
  indices
Returns (usually 1) representation(s) of self usable as dict keys.
  obj_end (Inherited from rekall.obj.BaseObject)
  parents
Returns all the parents of this object. (Inherited from rekall.obj.BaseObject)

Inherited from object: __class__

Method Details

__init__(self, target=None, target_args=None, value=None, **kwargs)
(Constructor)

source code 
Constructor.

Args:
   target: The name of the target object (A string). We use the profile
     to instantiate it.
   target_args: The target will receive these as kwargs.

Overrides: object.__init__

v(self, vm=None)

source code 

Do the actual reading and decoding of this member

When vm is specified, we are asked to evaluate this object is another address space than the one it was created on. Derived classes should allow for this.

Overrides: BaseObject.v
(inherited documentation)

m(self, attr)

source code 
Overrides: BaseObject.m

write(self, data)

source code 

Writes the data back into the address space

Overrides: BaseObject.write
(inherited documentation)

__eq__(self, other)
(Equality operator)

source code 
Overrides: BaseObject.__eq__

is_valid(self)

source code 

Returns if what we are pointing to is valid

Overrides: BaseObject.is_valid

__getitem__(self, item)
(Indexing operator)

source code 

Indexing a pointer indexes its target.

Note this is different than C which treats pointers as arrays:

struct foobar *p1; struct foobar *p2[];

In C: p[1] -> struct foobar p[2] -> struct foobar *

In Rekall: p[1] -> Not allowed since structs do not have []. p[2] -> struct foobar.

dereference(self, vm=None)

source code 
Overrides: BaseObject.dereference

__dir__(self)

source code 

Hide any members with _.

Overrides: BaseObject.__dir__
(inherited documentation)

cdecl(self)

source code 
Overrides: NativeType.cdecl

__nonzero__(self)
(Boolean test operator)

source code 
This method is used in comparison operations.

This ideas here is to make it possible to easily write a condition such
as:

while ptr:
   ...
   ptr += 1

Pointers are considered non-zero if they are invalid (i.e. what they
point to is not mapped in. This is very subtle and might be the wrong
choice. Note that if the kernel actually maps the zero page in (which
can happen in some situations), then a null pointer is actually valid.

Overrides: BaseObject.__nonzero__

__add__(self, other)
(Addition operator)

source code 

Return a new pointer advanced by this many positions.

Note that as usual for pointer arithmetic, the pointer moves by steps of the size of the target.

Overrides: NumericProxyMixIn.__add__

__sub__(self, other)
(Subtraction operator)

source code 
Overrides: NumericProxyMixIn.__sub__

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__unicode__(self)

source code 
Overrides: BaseObject.__unicode__

dereference_as(self, target=None, target_args=None, vm=None, profile=None, parent=None)

source code 
Dereference ourselves into another type, or address space.

This method allows callers to explicitly override the setting in the
profile for this pointer.

Args:
  target: The target to override.
  target_args: The args to instantiate this target with.
  vm: The address space to dereference the pointer in.
  profile: If a new profile should be used to instantiate the target.


Property Details

obj_size

Get Method:
unreachable.obj_size(self)

indices

Returns (usually 1) representation(s) of self usable as dict keys.

Using full base objects for indexing can be slow, especially with Structs. This method returns a representation of the object that is a suitable key - either the value of a primitive type, or the memory address of the more complex ones.

Get Method:
unreachable.indices(self)