Add in more information to the paged exceptions.

This commit is contained in:
Mike Auty
2018-01-28 16:25:16 +00:00
parent c203663f0b
commit 35be4c5a84
2 changed files with 4 additions and 2 deletions
+2
View File
@@ -37,9 +37,11 @@ class PagedInvalidAddressException(InvalidAddressException):
layer_name: str,
invalid_address: int,
invalid_bits: int,
entry: int,
*args) -> None:
super().__init__(layer_name, invalid_address, *args)
self.invalid_bits = invalid_bits
self.entry = entry
class InvalidDataException(VolatilityException):
+2 -2
View File
@@ -108,7 +108,7 @@ class Intel(interfaces.layers.TranslationLayerInterface):
for (name, size, large_page) in self._structure:
# Check we're valid
if not self._page_is_valid(entry):
raise exceptions.PagedInvalidAddressException(self.name, offset, position + 1,
raise exceptions.PagedInvalidAddressException(self.name, offset, position + 1, entry,
"Page Fault at entry " + hex(entry) + " in table " + name)
# Check if we're a large page
if large_page and (entry & (1 << 7)):
@@ -130,7 +130,7 @@ class Intel(interfaces.layers.TranslationLayerInterface):
# Now we're done
if not self._page_is_valid(entry):
raise exceptions.PagedInvalidAddressException(self.name, offset, position + 1,
raise exceptions.PagedInvalidAddressException(self.name, offset, position + 1, entry,
"Page Fault at entry {} in page entry".format(hex(entry)))
page = self._mask(entry, self._maxphyaddr - 1, position + 1) | self._mask(offset, position, 0)
return page, 1 << (position + 1), self._base_layer