|
|
|
@ -4,6 +4,8 @@ from mythril.plugin.interface import MythrilCLIPlugin, MythrilPlugin |
|
|
|
|
from mythril.plugin.discovery import PluginDiscovery |
|
|
|
|
from mythril.support.support_utils import Singleton |
|
|
|
|
|
|
|
|
|
from mythril.analysis.module.loader import ModuleLoader |
|
|
|
|
|
|
|
|
|
import logging |
|
|
|
|
|
|
|
|
|
log = logging.getLogger(__name__) |
|
|
|
@ -38,13 +40,14 @@ class MythrilPluginLoader(object, metaclass=Singleton): |
|
|
|
|
raise UnsupportedPluginType("Passed plugin type is not yet supported") |
|
|
|
|
|
|
|
|
|
self.loaded_plugins.append(plugin) |
|
|
|
|
logging.info(f"Finished loading plugin: {plugin.name}") |
|
|
|
|
log.info(f"Finished loading plugin: {plugin.name}") |
|
|
|
|
|
|
|
|
|
def _load_detection_module(self, plugin: DetectionModule): |
|
|
|
|
pass |
|
|
|
|
log.info(f"Loading detection module: {plugin.name}") |
|
|
|
|
ModuleLoader().register_module(plugin) |
|
|
|
|
|
|
|
|
|
def _load_default_enabled(self): |
|
|
|
|
logging.info("Loading installed analysis modules that are enabled by default") |
|
|
|
|
log.info("Loading installed analysis modules that are enabled by default") |
|
|
|
|
for plugin_name in PluginDiscovery().get_plugins(default_enabled=True): |
|
|
|
|
plugin = PluginDiscovery().build_plugin(plugin_name) |
|
|
|
|
self.load(plugin) |
|
|
|
|