Ejemplo n.º 1
0
    def handler_access_violation(self, dbg):
        """
        If the shit hits the fan, we want to know about it.
        """

        # if the user wants to ignore first chance exceptions then do so.
        if self.ignore_first_chance and dbg.dbg.u.Exception.dwFirstChance:
            return DBG_EXCEPTION_NOT_HANDLED

        crash_bin = crash_binning.crash_binning()
        crash_bin.record_crash(dbg)

        self.log(crash_bin.crash_synopsis())
        dbg.terminate_process()
        self.export_mysql()
Ejemplo n.º 2
0
    def handler_access_violation(self, dbg):
        '''
        If the shit hits the fan, we want to know about it.
        '''

        # if the user wants to ignore first chance exceptions then do so.
        if self.ignore_first_chance and dbg.dbg.u.Exception.dwFirstChance:
            return DBG_EXCEPTION_NOT_HANDLED

        crash_bin = crash_binning.crash_binning()
        crash_bin.record_crash(dbg)

        self.log(crash_bin.crash_synopsis())
        dbg.terminate_process()
        self.export_mysql()
Ejemplo n.º 3
0
	def __init__ (self, host, port, crash_filename, start_commands=None, ignore_pid=None, log_level=1):
		'''
		@type  host:		   String
		@param host:		   Hostname or IP address
		@type  port:		   Integer
		@param port:		   Port to bind server to
		@type  crash_filename: String
		@param crash_filename: Name of file to (un)serialize crash bin to/from
		@type  proc_name:	  String
		@param proc_name:	  (Optional, def=None) Process name to search for and attach to
		@type  ignore_pid:	 Integer
		@param ignore_pid:	 (Optional, def=None) Ignore this PID when searching for the target process
		@type  log_level:	  Integer
		@param log_level:	  (Optional, def=1) Log output level, increase for more verbosity
		'''

		# initialize the PED-RPC server.
		pedrpc.server.__init__(self, host, port)

		self.crash_filename   = crash_filename
		#XXX:remove this:
		self.proc_name		= None
		self.ignore_pid	   = ignore_pid
		self.log_level		= log_level

		self.stop_commands	= []
		self.start_commands   = start_commands
		self.dbg_thread	= None
		self.crash_bin		= crash_binning.crash_binning()
			
		self.last_synopsis	= ""

		if not os.access(os.path.dirname(self.crash_filename), os.X_OK):
			self.log("invalid path specified for crash bin: %s" % self.crash_filename)
			raise Exception

		# restore any previously recorded crashes.
		try:
			self.crash_bin.import_file(self.crash_filename)
		except:
			pass

		self.log("Process Monitor PED-RPC server initialized:")
		self.log("\t crash file:  %s" % self.crash_filename)
		self.log("\t # records:   %d" % len(self.crash_bin.bins))
		#self.log("\t proc name:   %s" % self.proc_name)
		self.log("\t log level:   %d" % self.log_level)
		self.log("awaiting requests...")