volatility3.framework.layers.segmented module
- class NonLinearlySegmentedLayer(context, config_path, name, metadata=None)[source]
Bases:
TranslationLayerInterface
A class to handle a single run-based layer-to-layer mapping.
In the documentation “mapped address” or “mapped offset” refers to an offset once it has been mapped to the underlying layer
Basic initializer that allows configurables to access their own config settings.
- property address_mask: int
Returns a mask which encapsulates all the active bits of an address for this layer.
- build_configuration()
Constructs a HierarchicalDictionary of all the options required to build this component in the current context.
Ensures that if the class has been created, it can be recreated using the configuration built Inheriting classes must override this to ensure any dependent classes update their configurations too
- Return type:
- property config: HierarchicalDict
The Hierarchical configuration Dictionary for this Configurable object.
- property context: ContextInterface
The context object that this configurable belongs to/configuration is stored in.
- property dependencies: List[str]
Returns a list of the lower layers that this layer is dependent upon.
- destroy()
Causes a DataLayer to close any open handles, etc.
Systems that make use of Data Layers should call destroy when they are done with them. This will close all handles, and make the object unreadable (exceptions will be thrown using a DataLayer after destruction)
- Return type:
- classmethod get_requirements()[source]
Returns a list of Requirement objects for this type of layer.
- Return type:
- is_valid(offset, length=1)[source]
Returns whether the address offset can be translated to a valid address.
- Return type:
- classmethod make_subconfig(context, base_config_path, **kwargs)
Convenience function to allow constructing a new randomly generated sub-configuration path, containing each element from kwargs.
- Parameters:
context (
ContextInterface
) – The context in which to store the new configurationbase_config_path (
str
) – The base configuration path on which to build the new configurationkwargs – Keyword arguments that are used to populate the new configuration path
- Returns:
The newly generated full configuration path
- Return type:
- mapping(offset, length, ignore_errors=False)[source]
Returns a sorted iterable of (offset, length, mapped_offset, mapped_length, layer) mappings.
- read(offset, length, pad=False)
Reads an offset for length bytes and returns ‘bytes’ (not ‘str’) of length size.
- Return type:
- scan(context, scanner, progress_callback=None, sections=None)
Scans a Translation layer by chunk.
Note: this will skip missing/unmappable chunks of memory
- Parameters:
context (
ContextInterface
) – The context containing the data layerscanner (
ScannerInterface
) – The constructed Scanner object to be appliedprogress_callback (
Optional
[Callable
[[float
,str
],None
]]) – Method that is called periodically during scanning to update progresssections (
Iterable
[Tuple
[int
,int
]]) – A list of (start, size) tuples defining the portions of the layer to scan
- Return type:
- Returns:
The output iterable from the scanner object having been run against the layer
- classmethod unsatisfied(context, config_path)
Returns a list of the names of all unsatisfied requirements.
Since a satisfied set of requirements will return [], it can be used in tests as follows:
unmet = configurable.unsatisfied(context, config_path) if unmet: raise RuntimeError("Unsatisfied requirements: {}".format(unmet)
- Return type:
- class SegmentedLayer(context, config_path, name, metadata=None)[source]
Bases:
NonLinearlySegmentedLayer
,LinearlyMappedLayer
Basic initializer that allows configurables to access their own config settings.
- property address_mask: int
Returns a mask which encapsulates all the active bits of an address for this layer.
- build_configuration()
Constructs a HierarchicalDictionary of all the options required to build this component in the current context.
Ensures that if the class has been created, it can be recreated using the configuration built Inheriting classes must override this to ensure any dependent classes update their configurations too
- Return type:
- property config: HierarchicalDict
The Hierarchical configuration Dictionary for this Configurable object.
- property context: ContextInterface
The context object that this configurable belongs to/configuration is stored in.
- property dependencies: List[str]
Returns a list of the lower layers that this layer is dependent upon.
- destroy()
Causes a DataLayer to close any open handles, etc.
Systems that make use of Data Layers should call destroy when they are done with them. This will close all handles, and make the object unreadable (exceptions will be thrown using a DataLayer after destruction)
- Return type:
- classmethod get_requirements()
Returns a list of Requirement objects for this type of layer.
- Return type:
- is_valid(offset, length=1)
Returns whether the address offset can be translated to a valid address.
- Return type:
- classmethod make_subconfig(context, base_config_path, **kwargs)
Convenience function to allow constructing a new randomly generated sub-configuration path, containing each element from kwargs.
- Parameters:
context (
ContextInterface
) – The context in which to store the new configurationbase_config_path (
str
) – The base configuration path on which to build the new configurationkwargs – Keyword arguments that are used to populate the new configuration path
- Returns:
The newly generated full configuration path
- Return type:
- mapping(offset, length, ignore_errors=False)[source]
Returns a sorted iterable of (offset, length, mapped_offset, mapped_length, layer) mappings.
- read(offset, length, pad=False)
Reads an offset for length bytes and returns ‘bytes’ (not ‘str’) of length size.
- Return type:
- scan(context, scanner, progress_callback=None, sections=None)
Scans a Translation layer by chunk.
Note: this will skip missing/unmappable chunks of memory
- Parameters:
context (
ContextInterface
) – The context containing the data layerscanner (
ScannerInterface
) – The constructed Scanner object to be appliedprogress_callback (
Optional
[Callable
[[float
,str
],None
]]) – Method that is called periodically during scanning to update progresssections (
Iterable
[Tuple
[int
,int
]]) – A list of (start, size) tuples defining the portions of the layer to scan
- Return type:
- Returns:
The output iterable from the scanner object having been run against the layer
- classmethod unsatisfied(context, config_path)
Returns a list of the names of all unsatisfied requirements.
Since a satisfied set of requirements will return [], it can be used in tests as follows:
unmet = configurable.unsatisfied(context, config_path) if unmet: raise RuntimeError("Unsatisfied requirements: {}".format(unmet)
- Return type: