Package winappdbg :: Module sql :: Class CrashDAO
[hide private]
[frames] | no frames]

Class CrashDAO

source code


Data Access Object to read, write and search for Crash objects in a database.

Nested Classes [hide private]
class _new_session
Custom configured Session class used to create the _session instance variable. (Inherited from winappdbg.sql.BaseDAO)
Instance Methods [hide private]
 
add(self, crash, allow_duplicates=True)
Add a new crash dump to the database, optionally filtering them by signature to avoid duplicates.
source code
 
__add_crash(self, crash) source code
 
__add_memory(self, crash_id, memoryMap) source code
list(Crash)
find(self, signature=None, order=0, since=None, until=None, offset=None, limit=None)
Retrieve all crash dumps in the database, optionally filtering them by signature and timestamp, and/or sorting them by timestamp.
source code
list(Crash)
find_by_example(self, crash, offset=None, limit=None)
Find all crash dumps that have common properties with the crash dump provided.
source code
int
count(self, signature=None)
Counts how many crash dumps have been stored in this database.
source code
 
delete(self, crash)
Remove the given crash dump from the database.
source code
 
__init__(self, url, creator=None)
Connect to the database using the given connection URL. (Inherited from winappdbg.sql.BaseDAO)
source code
 
_transactional(self, method, *argv, **argd)
Begins a transaction and calls the given DAO method. (Inherited from winappdbg.sql.BaseDAO)
source code

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

Class Variables [hide private]
bool _echo = False
Set to True to print all SQL queries to standard output. (Inherited from winappdbg.sql.BaseDAO)
Instance Variables [hide private]
str _dialect
SQL dialect currently being used. (Inherited from winappdbg.sql.BaseDAO)
str _driver
Name of the database driver currently being used. (Inherited from winappdbg.sql.BaseDAO)
sqlalchemy.orm.Session _session
Database session object. (Inherited from winappdbg.sql.BaseDAO)
sqlalchemy.url.URL _url
Database connection URL. (Inherited from winappdbg.sql.BaseDAO)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

add(self, crash, allow_duplicates=True)

source code 

Add a new crash dump to the database, optionally filtering them by signature to avoid duplicates.

Parameters:
  • crash (Crash) - Crash object.
  • allow_duplicates (bool) - (Optional) True to always add the new crash dump. False to only add the crash dump if no other crash with the same signature is found in the database.

    Sometimes, your fuzzer turns out to be too good. Then you find youself browsing through gigabytes of crash dumps, only to find a handful of actual bugs in them. This simple heuristic filter saves you the trouble by discarding crashes that seem to be similar to another one you've already found.

Decorators:
  • @Transactional

find(self, signature=None, order=0, since=None, until=None, offset=None, limit=None)

source code 

Retrieve all crash dumps in the database, optionally filtering them by signature and timestamp, and/or sorting them by timestamp.

Results can be paged to avoid consuming too much memory if the database is large.

Parameters:
  • signature (object) - (Optional) Return only through crashes matching this signature. See Crash.signature for more details.
  • order (int) - (Optional) Sort by timestamp. If == 0, results are not sorted. If > 0, results are sorted from older to newer. If < 0, results are sorted from newer to older.
  • since (datetime) - (Optional) Return only the crashes after and including this date and time.
  • until (datetime) - (Optional) Return only the crashes before this date and time, not including it.
  • offset (int) - (Optional) Skip the first offset results.
  • limit (int) - (Optional) Return at most limit results.
Returns: list(Crash)
List of Crash objects.
Decorators:
  • @Transactional

See Also: find_by_example

find_by_example(self, crash, offset=None, limit=None)

source code 

Find all crash dumps that have common properties with the crash dump provided.

Results can be paged to avoid consuming too much memory if the database is large.

Parameters:
  • crash (Crash) - Crash object to compare with. Fields set to None are ignored, all other fields but the signature are used in the comparison.

    To search for signature instead use the find method.

  • offset (int) - (Optional) Skip the first offset results.
  • limit (int) - (Optional) Return at most limit results.
Returns: list(Crash)
List of similar crash dumps found.
Decorators:
  • @Transactional

See Also: find

count(self, signature=None)

source code 

Counts how many crash dumps have been stored in this database. Optionally filters the count by heuristic signature.

Parameters:
  • signature (object) - (Optional) Count only the crashes that match this signature. See Crash.signature for more details.
Returns: int
Count of crash dumps stored in this database.
Decorators:
  • @Transactional

delete(self, crash)

source code 

Remove the given crash dump from the database.

Parameters:
  • crash (Crash) - Crash dump to remove.
Decorators:
  • @Transactional