mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-10 11:47:38 +02:00
Fix up input validation and start the CLI code.
This commit is contained in:
@@ -1 +1,13 @@
|
||||
__author__ = 'mike'
|
||||
|
||||
import volatility.framework
|
||||
|
||||
class CommandLine():
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def run(self):
|
||||
sys.stdout.write("Volatility Framework 3 (version "+ "{0}.{1}.{2}".format(volatility.framework.version()) + ")")
|
||||
|
||||
def main():
|
||||
CommandLine().run()
|
||||
@@ -54,7 +54,7 @@ class TranslationLayerInput(GenericInput):
|
||||
"""Validate that the value is a valid layer name and that the layer adheres to the requirements"""
|
||||
if value not in context.memory:
|
||||
raise IndexError(value + " is not memory layer")
|
||||
|
||||
|
||||
|
||||
class ChoiceInput(GenericInput):
|
||||
"""Allows one from a choice of strings
|
||||
|
||||
@@ -33,8 +33,8 @@ class PluginInterface(validity.ValidityRoutines, metaclass = ABCMeta):
|
||||
def context(self):
|
||||
return self._context
|
||||
|
||||
@abstractmethod
|
||||
@classmethod
|
||||
@abstractmethod
|
||||
def inputs(cls):
|
||||
"""Returns a list of requirements options"""
|
||||
return []
|
||||
@@ -46,7 +46,7 @@ class PluginInterface(validity.ValidityRoutines, metaclass = ABCMeta):
|
||||
|
||||
def validate_inputs(self):
|
||||
for option in self.inputs():
|
||||
option.validate_input(option.value, self.context)
|
||||
option.validate_input(self.get_input(option.name).value, self.context)
|
||||
|
||||
@abstractmethod
|
||||
def __call__(self):
|
||||
|
||||
Reference in New Issue
Block a user