Skip to content

Commit

Permalink
Windows Registry: Catch RegistryInvalidIndex
Browse files Browse the repository at this point in the history
refs #1484

This catches uncaught exceptions when casting the cell to a string in
`get_node`.
  • Loading branch information
dgmcdona committed Dec 31, 2024
1 parent 3211fc1 commit fa67f10
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion volatility3/framework/layers/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,13 @@ def get_node(self, cell_offset: int) -> "objects.StructType":
"""Returns the appropriate Node, interpreted from the Cell based on its
Signature."""
cell = self.get_cell(cell_offset)
signature = cell.cast("string", max_length=2, encoding="latin-1")
try:
signature = cell.cast("string", max_length=2, encoding="latin-1")
except (RegistryInvalidIndex, exceptions.InvalidAddressException):
vollog.debug(
f"Failed to get cell signature for cell (0x{cell.vol.offset:x})"
)
return cell
if signature == "nk":
return cell.u.KeyNode
elif signature == "sk":
Expand Down

0 comments on commit fa67f10

Please sign in to comment.