.data_hex properties fixed

This commit is contained in:
Nicolas Kruse 2025-04-02 21:46:18 +02:00
parent da74692664
commit 27e48f8d5b
1 changed files with 2 additions and 3 deletions

View File

@ -82,7 +82,7 @@ class elf_symbol():
def data_hex(self) -> str:
"""Returns the binary data the symbol is pointing to as hex string.
"""
return ' '.join(f'{d:02X}' for d in self.read_data())
return ' '.join(f'{d:02X}' for d in self.data)
@property
def relocations(self) -> 'relocation_list':
@ -170,8 +170,7 @@ class elf_section():
def data_hex(self) -> str:
"""Returns the binary data from the section as hex string.
"""
data = self.file.read_bytes(self['sh_offset'], self['sh_size'])
return ' '.join(f'{d:02X}' for d in data)
return ' '.join(f'{d:02X}' for d in self.data)
def __getitem__(self, key: str | int) -> int:
if isinstance(key, str):