Beispiel #1
0
 def _registerPlugin(self, pluginModulePath, pluginClassName):
     pluginClass = module.getClass(pluginModulePath, pluginClassName)
     if not pluginClass:
         raise EHFError, "ERROR! can not resolve plugin class from:\n%s\n%s" % (pluginModulePath, pluginClassName)
     for _attr in pluginClass.requirements:
         if _attr not in self._attributes:
             raise EHFError, "ERROR! plugin\n%s\nrequires [%s] but can not find it from the application"%(pluginClass, _attr)
     for _attr in pluginClass.contributions:
         if _attr in self._attributes:
             raise EHFError, "ERROR! plugin\n%s\nwill override attribute [%s]"%(pluginClass, _attr)
         self.setAttribute(_attr, None)
     pluginInstance = pluginClass(self)
     self._pluginRegistry[pluginClass.uid].append(pluginInstance)
     logger.info(" + Successfully registered plugin: %s" % pluginClass)
Beispiel #2
0
 def __init__(self, hProcess, 
                    memoryStart=0x0, 
                    memorySize=0x0,
                    patternFinderRepoClass=""):
     self.hProcess = hProcess
     self.rawDump = create_string_buffer(memorySize)
     self.memoryStart = memoryStart
     self.memorySize = memorySize
     self.values = {}
     
     # get the pattern finder repository class
     className = patternFinderRepoClass.split('.')[-1]
     modulePath = '.'.join( patternFinderRepoClass.split('.')[:-1] )
     repoCls = ehfmodule.getClass(modulePath, className)
     if not repoCls:
         raise MemoryScannerError, "Can not resolve pattern finder repo class:\n%s" % patternFinderRepoClass
     self.patternFinders = repoCls().getRepo()
Beispiel #3
0
 def _registerPlugin(self, pluginModulePath, pluginClassName):
     pluginClass = module.getClass(pluginModulePath, pluginClassName)
     if not pluginClass:
         raise EHFError, "ERROR! can not resolve plugin class from:\n%s\n%s" % (pluginModulePath, pluginClassName)
     for _attr in pluginClass.requirements:
         if _attr not in self._attributes:
             raise EHFError, "ERROR! plugin\n%s\nrequires [%s] but can not find it from the application" % (
                 pluginClass,
                 _attr,
             )
     for _attr in pluginClass.contributions:
         if _attr in self._attributes:
             raise EHFError, "ERROR! plugin\n%s\nwill override attribute [%s]" % (pluginClass, _attr)
         self.setAttribute(_attr, None)
     pluginInstance = pluginClass(self)
     self._pluginRegistry[pluginClass.uid].append(pluginInstance)
     logger.info(" + Successfully registered plugin: %s" % pluginClass)