Skip to content

Commit 9cc73b6

Browse files
author
Dave Lassalle
committed
issue #1017 - check for valid root node type
1 parent 93b2972 commit 9cc73b6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

volatility3/framework/layers/registry.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,12 @@ def get_key(
171171
node (default) or a list of nodes from root to the current node
172172
(if return_list is true).
173173
"""
174-
node_key = [self.get_node(self.root_cell_offset)]
174+
root_node = self.get_node(self.root_cell_offset)
175+
if not root_node.vol.type_name.endswith(constants.BANG + "_CM_KEY_NODE"):
176+
raise RegistryFormatException(
177+
self.name, "Encountered {} instead of _CM_KEY_NODE".format(root_node.vol.type_name)
178+
)
179+
node_key = [root_node]
175180
if key.endswith("\\"):
176181
key = key[:-1]
177182
key_array = key.split("\\")

0 commit comments

Comments
 (0)