size attribute added to symbol class

This commit is contained in:
Nicolas 2026-01-27 13:52:33 +01:00
parent 700813ff31
commit 024f86d4bc
1 changed files with 2 additions and 0 deletions

View File

@ -42,6 +42,7 @@ class elf_symbol():
offset_in_section: Position of first symbol byte
relative to section start
offset_in_file: Position of first symbol byte in object file
size: size of symbol in bytes
fields: All symbol header fields as dict
"""
@ -71,6 +72,7 @@ class elf_symbol():
self.thumb_mode = bool((file.architecture == 'EM_ARM') & fields['st_value'] & 1)
self.offset_in_section = fields['st_value'] & ~int(self.thumb_mode)
self.offset_in_file = self.section['sh_offset'] + self.offset_in_section if self.section else 0
self.size = self.fields['st_size']
@property
def data(self) -> bytes: