mirror of https://github.com/Nonannet/pelfy.git
size attribute added to symbol class
This commit is contained in:
parent
700813ff31
commit
024f86d4bc
|
|
@ -42,6 +42,7 @@ class elf_symbol():
|
||||||
offset_in_section: Position of first symbol byte
|
offset_in_section: Position of first symbol byte
|
||||||
relative to section start
|
relative to section start
|
||||||
offset_in_file: Position of first symbol byte in object file
|
offset_in_file: Position of first symbol byte in object file
|
||||||
|
size: size of symbol in bytes
|
||||||
fields: All symbol header fields as dict
|
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.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_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.offset_in_file = self.section['sh_offset'] + self.offset_in_section if self.section else 0
|
||||||
|
self.size = self.fields['st_size']
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def data(self) -> bytes:
|
def data(self) -> bytes:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue