Files
volatility3/volatility/framework/interfaces/plugins.py
T
Mike Auty ca61cf10b9 Refactor the context back into the ConfigurableInterface.
This also adds support for manually constructed configurables to
populate the config tree in the current context.

I'm still toying around with this though, I need to figure out
what to do with optional values and think the whole thing through
to make sure it's worthwhile.
2016-08-14 21:28:43 +01:00

56 lines
2.0 KiB
Python

"""
Created on 6 May 2013
@author: mike
"""
from abc import ABCMeta, abstractmethod
from volatility.framework import validity
from volatility.framework.interfaces import configuration as configuration_interface, context as context_interface
#
# Plugins
# - Take in relevant number of TranslationLayers (of specified type)
# - Outputs TreeGrid
#
# Should the plugin handle constructing the translation layers from the filenames or should the library have routines for it?
# Outwardly, the user specifies an OS, version, architecture triple and images.
# The UI checks the plugin against the OS/Version/Arch triple
# The UI constructs the TranslationLayers and names them according to the plugin's input layer names
# The UI constructs the appropriate default symbol spaces
# The plugin accepts the context and modifies as necessary
# The plugin runs and produces a TreeGrid output
class PluginInterface(configuration_interface.ConfigurableInterface, validity.ValidityRoutines, metaclass = ABCMeta):
"""Class that defines the interface all Plugins must maintain"""
def __init__(self, context, config_path):
super().__init__(context, config_path)
# self.validate()
@classmethod
def get_requirements(cls):
"""Returns a list of Requirement objects for this plugin"""
return []
@classmethod
def validate(self, context, config_path):
result_set = [(config_path + "." + requirement.name, requirement.validate(context, config_path)) for requirement
in self.get_requirements() if not requirement.optional]
return all([r for _, r in result_set])
@abstractmethod
def run(self):
"""Executes the functionality of the code
@:param
:return: a TreeGrid object that can then be passed to a Renderer.
:rtype: TreeGrid
"""
# TODO: Needs to say what it can/can't handle (validate context)
# TODO: Needs to offer available options'
# TODO: Figure out how to handle global config options