コード例 #1
0
    def analyze_file(self, _file):
        """ Creates a Virus object with metadata retrieved from the given
		data source of the analyzer. 
		
		Args:
			_file: The file to analyze.
			
		Returns:
			Virus object containing information retrieved from the data
			source.
			
		Raises:
			Exception if the provided file is null or empty.
		
		"""
        if (_file and len(_file) > 0):
            self.logger.print_info(MSG_INFO_ANALYZING.format(_file))

            #**********************************************************
            # Create a Virus object to manipulate the malware.
            #**********************************************************
            vx = Virus(_logger=self.logger)
            vx.add_file(_file)

            vx_dst_file = ""
            #******************************************************
            # Retrieve the information about the file from the
            # given data source.
            #******************************************************
            try:
                self.datasource.retrieve_metadata(vx)
            except:
                pass
            return vx
        else:
            raise NullOrEmptyArgumentException()
コード例 #2
0
ファイル: Analyzers.py プロジェクト: InfectedPacket/VxVault
	def analyze_file(self, _file):
		""" Creates a Virus object with metadata retrieved from the given
		data source of the analyzer. 
		
		Args:
			_file: The file to analyze.
			
		Returns:
			Virus object containing information retrieved from the data
			source.
			
		Raises:
			Exception if the provided file is null or empty.
		
		"""
		if (_file and len(_file) > 0):
			self.logger.print_info(MSG_INFO_ANALYZING.format(_file))
			
			#**********************************************************
			# Create a Virus object to manipulate the malware.
			#**********************************************************
			vx = Virus(_logger=self.logger)
			vx.add_file(_file)

			vx_dst_file = ""
			#******************************************************
			# Retrieve the information about the file from the
			# given data source.
			#******************************************************
			try:
				self.datasource.retrieve_metadata(vx)
			except:
				pass
			return vx
		else:
			raise NullOrEmptyArgumentException()