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

Class CrashTableMSSQL

source code

   object --+        
            |        
ContainerBase --+    
                |    
       CrashTable --+
                    |
                   CrashTableMSSQL

Manages a database of persistent Crash objects, trying to avoid duplicates only when requested.

Uses a Microsoft SQL database for persistency.


See Also: Crash.key

Instance Methods [hide private]
tuple( str, str, database, cursor )
_connect(self, connectionString)
Connect to a remote SQL database using the given connection string.
source code
bool
__bool__(self)
Returns: False if there are no known keys. (Inherited from winappdbg.crash.ContainerBase)
source code
bool
__contains__(self, crash)
Returns: True if a Crash object with the same key is in the container. (Inherited from winappdbg.crash.ContainerBase)
source code
 
__init__(self, location=None, allowRepeatedKeys=True)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature (Inherited from winappdbg.crash.CrashTable)
source code
iterator
__iter__(self)
Returns: Iterator of the contained Crash objects. (Inherited from winappdbg.crash.CrashTable)
source code
int
__len__(self)
Returns: Count of Crash elements in the container. (Inherited from winappdbg.crash.CrashTable)
source code
 
_get_row_values(self, crash)
Private method, do not use. (Inherited from winappdbg.crash.CrashTable)
source code
 
_memory_get_row_values(self, CrashID, mbi)
Private method, do not use. (Inherited from winappdbg.crash.CrashTable)
source code
 
add(self, crash)
Adds a new crash to the container. (Inherited from winappdbg.crash.CrashTable)
source code
bool
has_key(self, key)
Returns: True if the key is present in the set of known keys. (Inherited from winappdbg.crash.ContainerBase)
source code
iterator
iterkeys(self)
Returns: Iterator of known Crash keys. (Inherited from winappdbg.crash.ContainerBase)
source code
str or buffer
marshall_key(self, key)
Marshalls a Crash key to be used in the database. (Inherited from winappdbg.crash.ContainerBase)
source code
str
marshall_value(self, value, storeMemoryMap=False)
Marshalls a Crash object to be used in the database. (Inherited from winappdbg.crash.ContainerBase)
source code
 
remove_key(self, key)
Removes the given key from the set of known keys. (Inherited from winappdbg.crash.ContainerBase)
source code
Crash key.
unmarshall_key(self, key)
Unmarshalls a Crash key read from the database. (Inherited from winappdbg.crash.ContainerBase)
source code
Crash
unmarshall_value(self, value)
Unmarshalls a Crash object read from the database. (Inherited from winappdbg.crash.ContainerBase)
source code

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

Class Variables [hide private]
bool optimizeKeys = True
True to optimize the marshalling of keys, False otherwise.
bool optimizeValues = True
True to optimize the marshalling of keys, False otherwise.
bool compressKeys = True
True to compress keys when marshalling, False to leave them uncompressed.
bool compressValues = True
True to compress values when marshalling, False to leave them uncompressed.
bool escapeKeys = False
True to escape keys when marshalling, False to leave them uncompressed.
bool escapeValues = False
True to escape values when marshalling, False to leave them uncompressed.
bool binaryKeys = True
True to marshall keys to binary format (the Python buffer type), False to use text marshalled keys (str type).
bool binaryValues = True
True to marshall values to binary format (the Python buffer type), False to use text marshalled values (str type).
  _table_definition = 'CREATE TABLE Crashes (id INTEGER IDENTITY...
  _insert_row = 'INSERT INTO Crashes VALUES (?, ?, ?, ?, ?, ?, ?...
  _select_pickle = 'SELECT pickled_obj FROM Crashes'
  _select_key = 'SELECT pickled_key FROM Crashes'
  _select_count = "SELECT COUNT(*) FROM Crashes"
  _memory_table_definition = 'CREATE TABLE Memory (id INTEGER ID...
  _memory_insert_row = 'INSERT INTO Memory VALUES (?, ?, ?, ?, ?...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_connect(self, connectionString)

source code 

Connect to a remote SQL database using the given connection string.

Parameters:
  • connectionString (str) - (Optional) ODBC connection string.
Returns: tuple( str, str, database, cursor )
Tuple of location, database type, database object, cursor object.
Overrides: CrashTable._connect

Note: This is a private method and you shouldn't need to call it.


Class Variable Details [hide private]

_table_definition

Value:
'CREATE TABLE Crashes (id INTEGER IDENTITY(1,1) PRIMARY KEY CLUSTERED,\
timeStamp TEXT NOT NULL,pickled_key IMAGE NOT NULL,pickled_obj IMAGE N\
OT NULL,isExploitable TEXT,isExploitableRule TEXT,eventCode BIGINT,pid\
 BIGINT,tid BIGINT,pc BIGINT,sp BIGINT,fp BIGINT,labelPC TEXT,exceptio\
nCode BIGINT,exceptionAddress BIGINT,exceptionLabel TEXT,firstChance I\
NTEGER,faultType INTEGER,faultAddress BIGINT,faultLabel TEXT,faultDisa\
sm TEXT,stackTrace TEXT,notes TEXT)'

_insert_row

Value:
'INSERT INTO Crashes VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,\
 ?, ?, ?, ?, ?, ?, ?, ?)'

_memory_table_definition

Value:
'CREATE TABLE Memory (id INTEGER IDENTITY(1,1) PRIMARY KEY CLUSTERED,C\
rash INTEGER,Address BIGINT NOT NULL,Size BIGINT NOT NULL,State TEXT N\
OT NULL,Access TEXT NOT NULL,Type TEXT NOT NULL,Filename TEXT,Data IMA\
GE)'

_memory_insert_row

Value:
'INSERT INTO Memory VALUES (?, ?, ?, ?, ?, ?, ?, ?)'