mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-08-31 20:29:46 +02:00
manually iterate over the pointers to detect OOB locally
This commit is contained in:
@@ -279,14 +279,27 @@ def dynamically_sized_array_of_pointers(
|
||||
An array of pointer objects
|
||||
"""
|
||||
new_count = 0
|
||||
for entry in array_of_pointers(
|
||||
array=array, count=iterator_guard_value, subtype=subtype, context=context
|
||||
):
|
||||
# "entry" is naturally represented by the address that the pointer refers to
|
||||
if (entry == stop_value) or (
|
||||
not entry.is_readable() and stop_on_invalid_pointers
|
||||
):
|
||||
sym_table_name = array.get_symbol_table_name()
|
||||
sym_table = context.symbol_space[sym_table_name]
|
||||
ptr_size = sym_table.get_type("pointer").size
|
||||
layer_name = array.vol.layer_name
|
||||
|
||||
offset = array.vol.offset
|
||||
entry = None
|
||||
while entry != stop_value and new_count < iterator_guard_value:
|
||||
try:
|
||||
entry = context.object(
|
||||
sym_table_name + constants.BANG + "pointer",
|
||||
offset=offset,
|
||||
layer_name=layer_name,
|
||||
)
|
||||
except exceptions.InvalidAddressException:
|
||||
break
|
||||
|
||||
if not entry.is_readable() and stop_on_invalid_pointers:
|
||||
break
|
||||
|
||||
offset += ptr_size
|
||||
new_count += 1
|
||||
else:
|
||||
vollog.log(
|
||||
|
||||
Reference in New Issue
Block a user