mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-08-27 00:22:23 +02:00
Refactor the get_schema call to make more sense.
This commit is contained in:
@@ -78,7 +78,7 @@ class DependencyResolver(validity.ValidityRoutines):
|
||||
|
||||
deptree = []
|
||||
|
||||
for subreq in configurable.get_schema():
|
||||
for subreq in configurable.get_requirements():
|
||||
# Find all the different ways to fulfill it (recursively)
|
||||
# TODO: Ensure no cycles or loops
|
||||
if not isinstance(subreq, interfaces.configuration.ConstraintInterface):
|
||||
|
||||
@@ -72,7 +72,7 @@ class ConfigurableInterface(validity.ValidityRoutines):
|
||||
return self._config_path
|
||||
|
||||
@classmethod
|
||||
def get_schema(cls):
|
||||
def get_requirements(cls):
|
||||
"""Returns a list of configuration schema nodes for this object"""
|
||||
return []
|
||||
|
||||
|
||||
@@ -116,8 +116,8 @@ class DataLayerInterface(configuration.ProviderInterface, validity.ValidityRouti
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
def get_schema(cls):
|
||||
"""Returns a list of requirements for this type of layer"""
|
||||
def get_requirements(cls):
|
||||
"""Returns a list of Requirement objects for this type of layer"""
|
||||
return []
|
||||
|
||||
@classmethod
|
||||
@@ -132,7 +132,7 @@ class DataLayerInterface(configuration.ProviderInterface, validity.ValidityRouti
|
||||
|
||||
# Construct the layer
|
||||
requirement_dict = {}
|
||||
for req in cls.get_schema():
|
||||
for req in cls.get_requirements():
|
||||
if req.name in node_config.data:
|
||||
requirement_dict[req.name] = node_config.data[req.name]
|
||||
# Fulfillment must happen, exceptions happening here mean the requirements aren't correct
|
||||
|
||||
@@ -37,8 +37,8 @@ class PluginInterface(configuration_interface.ConfigurableInterface, validity.Va
|
||||
return self._context
|
||||
|
||||
@classmethod
|
||||
def get_schema(cls):
|
||||
"""Returns a list of configuration schema items"""
|
||||
def get_requirements(cls):
|
||||
"""Returns a list of Requirement objects for this plugin"""
|
||||
return []
|
||||
|
||||
def validate_inputs(self):
|
||||
|
||||
@@ -140,7 +140,7 @@ class Intel(interfaces.layers.TranslationLayerInterface):
|
||||
return [self._base_layer]
|
||||
|
||||
@classmethod
|
||||
def get_schema(cls):
|
||||
def get_requirements(cls):
|
||||
return [volatility.framework.configuration.requirements.TranslationLayerRequirement(name = 'memory_layer',
|
||||
constraints = {
|
||||
"type": "physical"},
|
||||
|
||||
@@ -139,7 +139,7 @@ class LimeLayer(interfaces.layers.TranslationLayerInterface):
|
||||
return [self._base_layer]
|
||||
|
||||
@classmethod
|
||||
def get_schema(cls):
|
||||
def get_requirements(cls):
|
||||
return [requirements.TranslationLayerRequirement(name = 'base_layer',
|
||||
constraints = {"type": "physical"},
|
||||
optional = False)]
|
||||
|
||||
@@ -51,7 +51,7 @@ class BufferDataLayer(interfaces.layers.DataLayerInterface):
|
||||
self._buffer = self._buffer[:address] + data + self._buffer[address + len(data):]
|
||||
|
||||
@classmethod
|
||||
def get_schema(cls):
|
||||
def get_requirements(cls):
|
||||
# No real requirements (only the buffer). Need to figure out if there's a better way of representing this
|
||||
return [requirements.BytesRequirement(name = 'buffer', description = "The direct bytes to interact with",
|
||||
optional = False)]
|
||||
@@ -127,5 +127,5 @@ class FileLayer(interfaces.layers.DataLayerInterface):
|
||||
self._file.close()
|
||||
|
||||
@classmethod
|
||||
def get_schema(cls):
|
||||
def get_requirements(cls):
|
||||
return [requirements.StringRequirement(name = 'filename', optional = False)]
|
||||
|
||||
@@ -59,7 +59,7 @@ class XPSP2WindowsKernelSymbolProvider(WindowsKernelSymbolProvider):
|
||||
space_name = 'ntkrnlmp'
|
||||
|
||||
@classmethod
|
||||
def get_schema(cls):
|
||||
def get_requirements(cls):
|
||||
return [requirements.NativeSymbolRequirement("natives", description = "Native Symbols for x86",
|
||||
constraints = {"type": "natives",
|
||||
"architecture": "ia32"})]
|
||||
|
||||
@@ -5,7 +5,7 @@ from volatility.framework.renderers import TreeGrid
|
||||
|
||||
class PsList(plugins.PluginInterface):
|
||||
@classmethod
|
||||
def get_schema(cls):
|
||||
def get_requirements(cls):
|
||||
return [requirements.TranslationLayerRequirement(name = 'primary',
|
||||
description = 'Kernel Address Space',
|
||||
constraints = {"type": "memory",
|
||||
|
||||
Reference in New Issue
Block a user