parameters: (self, event)
docstring: @type  event: L{Event}
          @param event: Event object for crash.
function: def __init__(self, event):
          """
          @type  event: L{Event}
          @param event: Event object for crash.
          """
  
          # First of all, take the timestamp.
          self.timeStamp          = time.time()
  
          # Notes are initially empty.
          self.notes              = list()
  
          # Get the process and thread, but dont't store them in the DB.
          process = event.get_process()
          thread  = event.get_thread()
  
          # Determine the architecture.
          self.os                 = System.os
          self.arch               = process.get_arch()
          self.bits               = process.get_bits()
  
          # The following properties are always retrieved for all events.
          self.eventCode          = event.get_event_code()
          self.eventName          = event.get_event_name()
          self.pid                = event.get_pid()
          self.tid                = event.get_tid()
          self.registers          = dict(thread.get_context())
          self.labelPC            = process.get_label_at_address(self.pc)
  
          # The following properties are only retrieved for some events.
          self.commandLine        = None
          self.environment        = None
          self.environmentData    = None
          self.registersPeek      = None
          self.debugString        = None
          self.modFileName        = None
          self.lpBaseOfDll        = None
          self.exceptionCode      = None
          self.exceptionName      = None
          self.exceptionDescription = None
          self.exceptionAddress   = None
          self.exceptionLabel     = None
          self.firstChance        = None
          self.faultType          = None
          self.faultAddress       = None
          self.faultLabel         = None
          self.isOurBreakpoint    = None
          self.isSystemBreakpoint = None
          self.stackTrace         = None
          self.stackTracePC       = None
          self.stackTraceLabels   = None
          self.stackTracePretty   = None
          self.stackRange         = None
          self.stackFrame         = None
          self.stackPeek          = None
          self.faultCode          = None
          self.faultMem           = None
          self.faultPeek          = None
          self.faultDisasm        = None
          self.memoryMap          = None
  
          # Get information for debug string events.
          if self.eventCode == win32.OUTPUT_DEBUG_STRING_EVENT:
              self.debugString = event.get_debug_string()
  
          # Get information for module load and unload events.
          # For create and exit process events, get the information
          # for the main module.
          elif self.eventCode in (win32.CREATE_PROCESS_DEBUG_EVENT,
                                  win32.EXIT_PROCESS_DEBUG_EVENT,
                                  win32.LOAD_DLL_DEBUG_EVENT,
                                  win32.UNLOAD_DLL_DEBUG_EVENT):
              aModule = event.get_module()
              self.modFileName = event.get_filename()
              if not self.modFileName:
                  self.modFileName = aModule.get_filename()
              self.lpBaseOfDll = event.get_module_base()
              if not self.lpBaseOfDll:
                  self.lpBaseOfDll = aModule.get_base()
  
          # Get some information for exception events.
          # To get the remaining information call fetch_extra_data().
          elif self.eventCode == win32.EXCEPTION_DEBUG_EVENT:
  
              # Exception information.
              self.exceptionCode          = event.get_exception_code()
              self.exceptionName          = event.get_exception_name()
              self.exceptionDescription   = event.get_exception_description()
              self.exceptionAddress       = event.get_exception_address()
              self.firstChance            = event.is_first_chance()
              self.exceptionLabel         = process.get_label_at_address(
                                                           self.exceptionAddress)
              if self.exceptionCode in (win32.EXCEPTION_ACCESS_VIOLATION,
                                        win32.EXCEPTION_GUARD_PAGE,
                                        win32.EXCEPTION_IN_PAGE_ERROR):
                  self.faultType    = event.get_fault_type()
                  self.faultAddress = event.get_fault_address()
                  self.faultLabel   = process.get_label_at_address(
                                                              self.faultAddress)
              elif self.exceptionCode in (win32.EXCEPTION_BREAKPOINT,
                                          win32.EXCEPTION_SINGLE_STEP):
                  self.isOurBreakpoint = hasattr(event, 'breakpoint') \
                                         and event.breakpoint
                  self.isSystemBreakpoint = \
                      process.is_system_defined_breakpoint(self.exceptionAddress)
  
              # Stack trace.
              try:
                  self.stackTracePretty = thread.get_stack_trace_with_labels()
              except Exception:
                  e = sys.exc_info()[1]
                  warnings.warn(
                      "Cannot get stack trace with labels, reason: %s" % str(e),
                      CrashWarning)
              try:
                  self.stackTrace     = thread.get_stack_trace()
                  stackTracePC        = [ ra for (_,ra,_) in self.stackTrace ]
                  self.stackTracePC   = tuple(stackTracePC)
                  stackTraceLabels    = [ process.get_label_at_address(ra) \
                                               for ra in self.stackTracePC ]
                  self.stackTraceLabels = tuple(stackTraceLabels)
              except Exception:
                  e = sys.exc_info()[1]
                  warnings.warn("Cannot get stack trace, reason: %s" % str(e),
                                CrashWarning)
function_tokens: def __init__ ( self , event ) : # First of all, take the timestamp. self . timeStamp = time . time ( ) # Notes are initially empty. self . notes = list ( ) # Get the process and thread, but dont't store them in the DB. process = event . get_process ( ) thread = event . get_thread ( ) # Determine the architecture. self . os = System . os self . arch = process . get_arch ( ) self . bits = process . get_bits ( ) # The following properties are always retrieved for all events. self . eventCode = event . get_event_code ( ) self . eventName = event . get_event_name ( ) self . pid = event . get_pid ( ) self . tid = event . get_tid ( ) self . registers = dict ( thread . get_context ( ) ) self . labelPC = process . get_label_at_address ( self . pc ) # The following properties are only retrieved for some events. self . commandLine = None self . environment = None self . environmentData = None self . registersPeek = None self . debugString = None self . modFileName = None self . lpBaseOfDll = None self . exceptionCode = None self . exceptionName = None self . exceptionDescription = None self . exceptionAddress = None self . exceptionLabel = None self . firstChance = None self . faultType = None self . faultAddress = None self . faultLabel = None self . isOurBreakpoint = None self . isSystemBreakpoint = None self . stackTrace = None self . stackTracePC = None self . stackTraceLabels = None self . stackTracePretty = None self . stackRange = None self . stackFrame = None self . stackPeek = None self . faultCode = None self . faultMem = None self . faultPeek = None self . faultDisasm = None self . memoryMap = None # Get information for debug string events. if self . eventCode == win32 . OUTPUT_DEBUG_STRING_EVENT : self . debugString = event . get_debug_string ( ) # Get information for module load and unload events. # For create and exit process events, get the information # for the main module. elif self . eventCode in ( win32 . CREATE_PROCESS_DEBUG_EVENT , win32 . EXIT_PROCESS_DEBUG_EVENT , win32 . LOAD_DLL_DEBUG_EVENT , win32 . UNLOAD_DLL_DEBUG_EVENT ) : aModule = event . get_module ( ) self . modFileName = event . get_filename ( ) if not self . modFileName : self . modFileName = aModule . get_filename ( ) self . lpBaseOfDll = event . get_module_base ( ) if not self . lpBaseOfDll : self . lpBaseOfDll = aModule . get_base ( ) # Get some information for exception events. # To get the remaining information call fetch_extra_data(). elif self . eventCode == win32 . EXCEPTION_DEBUG_EVENT : # Exception information. self . exceptionCode = event . get_exception_code ( ) self . exceptionName = event . get_exception_name ( ) self . exceptionDescription = event . get_exception_description ( ) self . exceptionAddress = event . get_exception_address ( ) self . firstChance = event . is_first_chance ( ) self . exceptionLabel = process . get_label_at_address ( self . exceptionAddress ) if self . exceptionCode in ( win32 . EXCEPTION_ACCESS_VIOLATION , win32 . EXCEPTION_GUARD_PAGE , win32 . EXCEPTION_IN_PAGE_ERROR ) : self . faultType = event . get_fault_type ( ) self . faultAddress = event . get_fault_address ( ) self . faultLabel = process . get_label_at_address ( self . faultAddress ) elif self . exceptionCode in ( win32 . EXCEPTION_BREAKPOINT , win32 . EXCEPTION_SINGLE_STEP ) : self . isOurBreakpoint = hasattr ( event , 'breakpoint' ) and event . breakpoint self . isSystemBreakpoint = process . is_system_defined_breakpoint ( self . exceptionAddress ) # Stack trace. try : self . stackTracePretty = thread . get_stack_trace_with_labels ( ) except Exception : e = sys . exc_info ( ) [ 1 ] warnings . warn ( "Cannot get stack trace with labels, reason: %s" % str ( e ) , CrashWarning ) try : self . stackTrace = thread . get_stack_trace ( ) stackTracePC = [ ra for ( _ , ra , _ ) in self . stackTrace ] self . stackTracePC = tuple ( stackTracePC ) stackTraceLabels = [ process . get_label_at_address ( ra ) for ra in self . stackTracePC ] self . stackTraceLabels = tuple ( stackTraceLabels ) except Exception : e = sys . exc_info ( ) [ 1 ] warnings . warn ( "Cannot get stack trace, reason: %s" % str ( e ) , CrashWarning )