Package rekall :: Module session :: Class Configuration
[frames] | no frames]

Class Configuration

source code


The session's configuration is managed through this object.

The session can be configured using the SetParameter() method. However,
sometimes when a certain parameter is modified, some code needs to run in
response. For example, if the filename is modified, the profile must be
recalculated.

It is not sufficient to attach setter methods to every such parameter
though, because there is no guarantee which order these parameters are
configured. For example, suppose we want to set both the filename and the
profile:

session.SetParameter("filename", filename)
session.SetParameter("profile", "nt/...")

Since the profile is explicitly set we should not guess it, but if a simple
set hook is used, there is no way for the _set_filename() hook to determine
that the profile is explicitly given. So what will happen now is that the
filename will be changed, then a profile will be autodetected, then it will
be immediately overwritten with the user set profile.

To avoid this issue we use a context manager to essentially group
SetParameter() calls into an indivisible unit. The hooks are all run _after_
all the parameters are set:

with session:
    session.SetParameter("filename", filename)
    session.SetParameter("profile", "nt/...")

Now the _set_filename() hook can see that the profile is explicitly set so
it should not be auto-detected.

Upon entering the context manager, we create a new temporary place to store
configuration parameters. Then, when exiting the context manager we ensure
that those parameters with hooks are called. The hooks are passed the newly
set parameters. Each hook returns the value that will actually be set in the
session (so the hook may actually modify the value).

Nested Classes

Inherited from rekall_lib.utils.AttributeDict: __metaclass__

Instance Methods
new empty dictionary

__init__(self, session=None, **kwargs)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__repr__(self)
repr(x)
source code
 
Set(self, attr, value) source code
 
__delitem__(self, item)
del x[y]
source code
 
__enter__(self) source code
 
__exit__(self, exc_type, exc_value, trace) source code
 
__str__(self)
Print the contents somewhat concisely.
source code

Inherited from rekall_lib.utils.AttributeDict: Get, __dir__, __getattr__, __setattr__

Inherited from dict: __cmp__, __contains__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __setitem__, __sizeof__, clear, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values, viewitems, viewkeys, viewvalues

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __subclasshook__

Class Variables
  session = None
hash(x)

Inherited from rekall_lib.utils.AttributeDict: dirty

Inherited from dict: __hash__

Properties

Inherited from object: __class__

Method Details

__init__(self, session=None, **kwargs)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Returns:
new empty dictionary

Overrides: object.__init__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

Set(self, attr, value)

source code 
Overrides: rekall_lib.utils.AttributeDict.Set

__delitem__(self, item)
(Index deletion operator)

source code 

del x[y]

Overrides: dict.__delitem__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

Print the contents somewhat concisely.

Overrides: object.__str__