Package winappdbg :: Module crash :: Class CrashDictionary
[hide private]
[frames] | no frames]

Class CrashDictionary

source code


Dictionary-like persistence interface for Crash objects.

Currently the only implementation is through sql.CrashDAO.

Instance Methods [hide private]
 
__init__(self, url, creator=None, allowRepeatedKeys=True)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
add(self, crash)
Adds a new crash to the container.
source code
Crash object.
get(self, key)
Retrieves a crash from the container.
source code
iterator
__iter__(self)
Returns: Iterator of the contained Crash objects.
source code
iterator
itervalues(self)
Returns: Iterator of the contained Crash objects.
source code
iterator
iterkeys(self)
Returns: Iterator of the contained Crash heuristic signatures.
source code
bool
__contains__(self, crash)
Returns: True if the Crash object is in the container.
source code
bool
has_key(self, key)
Returns: True if a matching Crash object is in the container.
source code
int
__len__(self)
Returns: Count of Crash elements in the container.
source code
bool
__bool__(self)
Returns: False if the container is empty.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, url, creator=None, allowRepeatedKeys=True)
(Constructor)

source code 

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

Parameters:
  • url (str) - Connection URL of the crash database. See sql.CrashDAO.__init__ for more details.
  • creator (callable) - (Optional) Callback function that creates the SQL database connection.

    Normally it's not necessary to use this argument. However in some odd cases you may need to customize the database connection, for example when using the integrated authentication in MSSQL.

  • allowRepeatedKeys (bool) - If True all Crash objects are stored.

    If False any Crash object with the same signature as a previously existing object will be ignored.

Overrides: object.__init__

add(self, crash)

source code 

Adds a new crash to the container.

Parameters:
  • crash (Crash) - Crash object to add.

Note: When the allowRepeatedKeys parameter of the constructor is set to False, duplicated crashes are ignored.

See Also: Crash.key

get(self, key)

source code 

Retrieves a crash from the container.

Parameters:
  • key (Crash signature.) - Heuristic signature of the crash to get.
Returns: Crash object.
Crash matching the given signature. If more than one is found, retrieve the newest one.

See Also: iterkeys

Warning: A copy of each object is returned, so any changes made to them will be lost.

To preserve changes do the following:

  1. Keep a reference to the object.
  2. Delete the object from the set.
  3. Modify the object and add it again.

__iter__(self)

source code 
Returns: iterator
Iterator of the contained Crash objects.

itervalues(self)

source code 
Returns: iterator
Iterator of the contained Crash objects.

iterkeys(self)

source code 
Returns: iterator
Iterator of the contained Crash heuristic signatures.

__contains__(self, crash)
(In operator)

source code 
Parameters:
  • crash (Crash) - Crash object.
Returns: bool
True if the Crash object is in the container.

has_key(self, key)

source code 
Parameters:
  • key (Crash signature.) - Heuristic signature of the crash to get.
Returns: bool
True if a matching Crash object is in the container.

__len__(self)
(Length operator)

source code 
Returns: int
Count of Crash elements in the container.

__bool__(self)

source code 
Returns: bool
False if the container is empty.