pelfy.elf_symbol#

class pelfy.elf_symbol(file, fields, index)#

Bases: object

A class for representing data of an ELF symbol

file#

Points to the parent ELF file object.

name#

Name of the symbol

section#

section where the symbol data is placed

index#

Absolut index in the symbol table

info#

Type of the symbol

description#

Description of the symbol type

stb#

visibility of the symbol (local, global, etc.)

stb_description#

Description of the symbol visibility

thumb_mode#

Indicate if symbol is a ARM thumb function

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

property data: bytes#

Returns the binary data the symbol is pointing to.

property data_hex: str#

Returns the binary data the symbol is pointing to as hex string.

property relocations: relocation_list#

Relocations that are pointing to this symbol. The symbol section must be of type SHT_PROGBITS (program code). Therefore this property returns typically all relocations that will be applied to the function represented by the symbol.