From 6beeeebe3c43f0643e521139d3f8b1ff4a7f3059 Mon Sep 17 00:00:00 2001 From: Julien Voisin Date: Thu, 5 Mar 2015 15:36:22 +0100 Subject: Yara is cooler than Python --- modules/scanmodule.py | 56 --------------------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 modules/scanmodule.py (limited to 'modules/scanmodule.py') diff --git a/modules/scanmodule.py b/modules/scanmodule.py deleted file mode 100644 index 6ace387..0000000 --- a/modules/scanmodule.py +++ /dev/null @@ -1,56 +0,0 @@ -import ConfigParser -import pickle - - -class ScanModule(object): - def __init__(self): - self.config = ConfigParser.ConfigParser() - self.config.read('modules.conf') - - self.samples = dict() - - try: - self.populate(self.config.get(self.name, 'samples')) - except ConfigParser.NoOptionError: - pass - - try: - self.load(self.config.get(self.name, 'persistence')) - except ConfigParser.NoOptionError: - pass - - def is_disable(self): - try: - return self.config.getboolean(self.name, 'disable') - except ConfigParser.NoOptionError: - return False - - def evaluate(self, path): - ''' Return in percent, the probability that - the file is a malware - @param path File to evaluate - ''' - raise NotImplemented - - def populate(self, path): - ''' Populate the module's internal database - with data from the given path - @param path Path to the data - ''' - raise NotImplemented - - - def load(self, path): - ''' Unpickle the given path, and updates the samples dict with it. - @param path Path to the dict to unpickle - ''' - with open(path, 'r') as f: - self.samples.update(pickle.load(f)) - - def save(self, path): - ''' Save the database to the given file - @param path Path where to save the database - ''' - with open(path, 'w') as f: - pickle.dump(self.samples, f) - -- cgit v1.3