mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-06 09:47:38 +02:00
Improve checks for invalid values
We determine address_masks using log/ln2, which cannot accept 0. Therefore we don't support address spaces with a maximum_address of 0. This can affect registry hives, so we've added a check in registry hives to prevent creating layers with invalid maximum_addresses.
This commit is contained in:
@@ -52,3 +52,7 @@ class SymbolSpaceError(VolatilityException):
|
||||
|
||||
class LayerException(VolatilityException):
|
||||
"""Thrown when an error occurs dealing with memory and layers"""
|
||||
|
||||
|
||||
class StructureException(VolatilityException):
|
||||
"""Thrown when an error occurs dealing with an expected structure type"""
|
||||
|
||||
@@ -46,7 +46,9 @@ class RegistryHive(interfaces.layers.TranslationLayerInterface):
|
||||
self._minaddr = 0
|
||||
self._maxaddr = self._base_block.Length
|
||||
|
||||
# print("MAPPING", self.mapping(self._base_block.RootCell, length = 2))
|
||||
if self._base_block.Length <= 0:
|
||||
raise exceptions.StructureException(
|
||||
"Invalid registry base_block length: {}".format(self._base_block.Length))
|
||||
|
||||
@property
|
||||
def address_mask(self):
|
||||
|
||||
Reference in New Issue
Block a user