Add in an appropriate requirement for BufferLayers.

This commit is contained in:
Mike Auty
2016-01-16 22:20:10 +00:00
parent f197b43346
commit 139a6b610e
3 changed files with 10 additions and 5 deletions
@@ -63,7 +63,7 @@ class DependencyResolver(validity.ValidityRoutines):
break
else:
logging.debug(
"Unable to fulfill requirement " + repr(node.requirement) + " - no fulfillable candidates")
"Unable to fulfill requirement " + repr(node.requirement) + " - no fulfillable candidates")
return False
try:
value = context.config[node_path]
@@ -18,6 +18,10 @@ class StringRequirement(InstanceRequirement):
instance_type = str
class BytesRequirement(InstanceRequirement):
instance_type = bytes
class TranslationLayerRequirement(config_interface.ConstraintInterface):
"""Class maintaining the limitations on what sort of address spaces are acceptable"""
+5 -4
View File
@@ -6,8 +6,8 @@ Created on 6 May 2013
import os.path
import volatility.framework.configuration.requirements
from volatility.framework import interfaces, exceptions, configuration
from volatility.framework import interfaces, exceptions
from volatility.framework.configuration import requirements
class BufferDataLayer(interfaces.layers.DataLayerInterface):
@@ -48,7 +48,8 @@ class BufferDataLayer(interfaces.layers.DataLayerInterface):
@classmethod
def get_schema(cls):
# No real requirements (only the buffer). Need to figure out if there's a better way of representing this
return []
return [requirements.BytesRequirement(name = 'buffer', description = "The direct bytes to interact with",
optional = False)]
class FileLayer(interfaces.layers.DataLayerInterface):
@@ -110,4 +111,4 @@ class FileLayer(interfaces.layers.DataLayerInterface):
@classmethod
def get_schema(cls):
return [volatility.framework.configuration.requirements.StringRequirement(name = 'filename', optional = False)]
return [requirements.StringRequirement(name = 'filename', optional = False)]