Skip to content

Commit c8d90cf

Browse files
committed
adjust to the new NULL-terminated processing
1 parent a5cc616 commit c8d90cf

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
@@ -187,26 +187,31 @@ def _get_sect_count(self, grp: interfaces.objects.ObjectInterface) -> int:
187187
"""
188188

189189
if grp.has_member("bin_attrs"):
190-
arr_offset = grp.bin_attrs
190+
arr_offset_ptr = grp.bin_attrs
191+
arr_subtype = "bin_attribute"
191192
else:
192-
arr_offset = grp.attrs
193+
arr_offset_ptr = grp.attrs
194+
arr_subtype = "attribute"
193195

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

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

0 commit comments

Comments
 (0)