From f57bfa5738c802a635adcb25563c5362f529eecd Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Sun, 9 Dec 2018 13:28:44 +0000 Subject: [PATCH] Prepare core plugins for moving into the framework namespace. --- vol.spec | 6 +++++- volatility/framework/plugins/__init__.py | 5 +++++ volatility/framework/plugins/linux/__init__.py | 4 ++++ volatility/framework/plugins/windows/__init__.py | 4 ++++ volatility/framework/plugins/windows/registry/__init__.py | 4 ++++ volatility/plugins/linux/__init__.py | 8 ++++++++ volatility/plugins/windows/__init__.py | 8 ++++++++ volatility/plugins/windows/registry/__init__.py | 8 ++++++++ 8 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 volatility/framework/plugins/linux/__init__.py create mode 100644 volatility/framework/plugins/windows/__init__.py create mode 100644 volatility/framework/plugins/windows/registry/__init__.py diff --git a/vol.spec b/vol.spec index 58547c01b..e2ab4f40b 100644 --- a/vol.spec +++ b/vol.spec @@ -3,6 +3,8 @@ import os import sys +from PyInstaller.building.api import PYZ, EXE +from PyInstaller.building.build_main import Analysis from PyInstaller.utils.hooks import collect_submodules, collect_data_files block_cipher = None @@ -15,9 +17,11 @@ a = Analysis(['vol.py'], pathex = [], binaries = [], datas = collect_data_files('volatility.framework') + \ + collect_data_files('volatility.framework.plugins', include_py_files = True) + \ collect_data_files('volatility.schemas') + \ collect_data_files('volatility.plugins', include_py_files = True), - hiddenimports = collect_submodules('volatility.plugins'), + hiddenimports = collect_submodules('volatility.framework.plugins') + \ + collect_submodules('volatility.plugins'), hookspath = [], runtime_hooks = [], excludes = [], diff --git a/volatility/framework/plugins/__init__.py b/volatility/framework/plugins/__init__.py index 6e95389ad..b4e47e208 100644 --- a/volatility/framework/plugins/__init__.py +++ b/volatility/framework/plugins/__init__.py @@ -1,3 +1,8 @@ +"""All core generic plugins + +These modules should only be imported from volatility.plugins NOT volatility.framework.plugins +""" + import logging import typing diff --git a/volatility/framework/plugins/linux/__init__.py b/volatility/framework/plugins/linux/__init__.py new file mode 100644 index 000000000..5e262c19b --- /dev/null +++ b/volatility/framework/plugins/linux/__init__.py @@ -0,0 +1,4 @@ +"""All core linux plugins + +These modules should only be imported from volatility.plugins NOT volatility.framework.plugins +""" diff --git a/volatility/framework/plugins/windows/__init__.py b/volatility/framework/plugins/windows/__init__.py new file mode 100644 index 000000000..235250603 --- /dev/null +++ b/volatility/framework/plugins/windows/__init__.py @@ -0,0 +1,4 @@ +"""All core windows plugins + +These modules should only be imported from volatility.plugins NOT volatility.framework.plugins +""" diff --git a/volatility/framework/plugins/windows/registry/__init__.py b/volatility/framework/plugins/windows/registry/__init__.py new file mode 100644 index 000000000..5ea94d39c --- /dev/null +++ b/volatility/framework/plugins/windows/registry/__init__.py @@ -0,0 +1,4 @@ +"""All core windows registry plugins + +These modules should only be imported from volatility.plugins NOT volatility.framework.plugins +""" diff --git a/volatility/plugins/linux/__init__.py b/volatility/plugins/linux/__init__.py index dfeaf4832..1fb955e1d 100644 --- a/volatility/plugins/linux/__init__.py +++ b/volatility/plugins/linux/__init__.py @@ -1 +1,9 @@ """All Linux-related plugins""" + +import os + +from volatility.framework import constants + +# This is necessary to ensure the core plugins are available, whilst still be overridable +plugin_path_components = __name__.split('.')[2:] +__path__ = [os.path.join(x, *plugin_path_components) for x in constants.PLUGINS_PATH] diff --git a/volatility/plugins/windows/__init__.py b/volatility/plugins/windows/__init__.py index cdb4236d6..9e183090c 100644 --- a/volatility/plugins/windows/__init__.py +++ b/volatility/plugins/windows/__init__.py @@ -1 +1,9 @@ """All Windows OS plugins""" + +import os + +from volatility.framework import constants + +# This is necessary to ensure the core plugins are available, whilst still be overridable +plugin_path_components = __name__.split('.')[2:] +__path__ = [os.path.join(x, *plugin_path_components) for x in constants.PLUGINS_PATH] diff --git a/volatility/plugins/windows/registry/__init__.py b/volatility/plugins/windows/registry/__init__.py index 62f67f25c..2a10ee7d9 100644 --- a/volatility/plugins/windows/registry/__init__.py +++ b/volatility/plugins/windows/registry/__init__.py @@ -1 +1,9 @@ """Windows registry plugins""" + +import os + +from volatility.framework import constants + +# This is necessary to ensure the core plugins are available, whilst still be overridable +plugin_path_components = __name__.split('.')[2:] +__path__ = [os.path.join(x, *plugin_path_components) for x in constants.PLUGINS_PATH]