determine sect_attrs.attrs subtype dynamically

This commit is contained in:
Abyss Watcher
2025-11-20 13:19:34 +01:00
parent 735f5933ba
commit ac4326f478
@@ -211,9 +211,7 @@ class module(generic.GenericIntelProcess):
symbol_table_name + constants.BANG + "array",
layer_name=self.vol.layer_name,
offset=self.sect_attrs.attrs.vol.offset,
subtype=self._context.symbol_space.get_type(
symbol_table_name + constants.BANG + "module_sect_attr"
),
subtype=self.sect_attrs.attrs.vol.subtype,
count=self.number_of_sections,
)
@@ -3189,3 +3187,17 @@ class module_sect_attr(objects.StructType):
)
return None
class bin_attribute(objects.StructType):
def get_name(self) -> Optional[str]:
"""
Performs extraction of the bin_attribute name
"""
if hasattr(self, "attr"):
try:
return utility.pointer_to_string(self.attr.name, count=32)
except exceptions.InvalidAddressException:
vollog.debug(f"Invalid attr name for bin_attribute at {self.vol.offset:#x}")
return None
return None