Skip to content

Commit 3dc5569

Browse files
committed
adjust to the new NULL-terminated processing
1 parent 13bf505 commit 3dc5569

File tree

1 file changed

+14
-9
lines changed
  • volatility3/framework/symbols/linux/extensions

1 file changed

+14
-9
lines changed

volatility3/framework/symbols/linux/extensions/__init__.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -188,26 +188,31 @@ def _get_sect_count(self, grp: interfaces.objects.ObjectInterface) -> int:
188188
"""
189189

190190
if grp.has_member("bin_attrs"):
191-
arr_offset = grp.bin_attrs
191+
arr_offset_ptr = grp.bin_attrs
192+
arr_subtype = "bin_attribute"
192193
else:
193-
arr_offset = grp.attrs
194+
arr_offset_ptr = grp.attrs
195+
arr_subtype = "attribute"
194196

195-
if not arr_offset.is_readable():
197+
if not arr_offset_ptr.is_readable():
196198
vollog.log(
197199
constants.LOGLEVEL_V,
198200
f"Cannot dereference the pointer to the NULL-terminated list of binary attributes for module at offset {self.vol.offset:#x}",
199201
)
200202
return 0
201203

202-
# We chose 1000 as an arbitrary guard value against
203-
# extreme cases of smearing.
204+
# We chose 100 as an arbitrary guard value to prevent
205+
# looping forever in extreme cases, and because 100 is not expected
206+
# to be a valid number of sections. If that still happens,
207+
# Vol3 module processing will indicate that it is missing information
208+
# with the following message:
209+
# "Unable to reconstruct the ELF for module struct at"
204210
# See PR #1773 for more information.
205211
bin_attrs_list = utility.dynamically_sized_array_of_pointers(
206212
context=self._context,
207-
layer_name=self.vol.layer_name,
208-
symbol_table_name=self.get_symbol_table_name(),
209-
array_offset=arr_offset.dereference().vol.offset,
210-
iterator_guard_value=1000,
213+
array=arr_offset_ptr.dereference(),
214+
iterator_guard_value=100,
215+
subtype=self.get_symbol_table_name() + constants.BANG + arr_subtype,
211216
)
212217
return len(bin_attrs_list)
213218

0 commit comments

Comments
 (0)