Module pychrysalide.format.elf
Documentation
Python module for Chrysalide.format.elf
Classes
Class ElfFormat
PyChrysalide Elf format
Hierarchy
builtins.object ╰── gi._gi.GObject ╰── pychrysalide.format.KnownFormat ╰── pychrysalide.format.BinFormat ╰── pychrysalide.format.ExeFormat ╰── pychrysalide.format.elf.ElfFormat
Implements: pychrysalide.analysis.storage.SerializableObject
Methods
find_dynamic_item_by_index(self, index)
Find an item from the dynamic item using a given index.
The result is an instance of type StructObject
on success, None otherwise.
The provided information about a found dynamic item is composed of the following properties :
- d_tag;
- d_un.d_val;
- d_un.d_ptr.
find_dynamic_item_by_type(self, type)
Find an item from the dynamic item using a given type.
The result is an instance of type StructObject
on success, None otherwise.
The provided information about a found dynamic item is composed of the following properties :
- d_tag;
- d_un.d_val;
- d_un.d_ptr.
find_program_by_index(self, index)
Find a segment using a given index.
find_program_by_type(self, type)
Find a segment using a given type.
find_section_by_index(self, index)
Find a section using a given index.
find_section_by_name(self, name)
Find a section using a given name.
find_section_by_virtual_address(self, addr)
Find a section using a given virtual address.
find_sections_by_type(self, type)
Find sections using a given type.
get_header(self)
Get the Elf header.
Attributes
needed
Provide the list of requiered shared objects.
The result is a tuple of strings or an empty tuple if no external library is required by the binary.
sizeof_dyn
ide the size of Elf_Dyn structures for the loaded format.
sizeof_hdr
ide the size of Elf_Ehdr structures for the loaded format.
sizeof_phdr
ide the size of Elf_Phdr structures for the loaded format.
sizeof_rel
ide the size of Elf_Rel structures for the loaded format.
sizeof_shdr
ide the size of Elf_Shdr structures for the loaded format.
sizeof_sym
ide the size of Elf_Sym structures for the loaded format.
Constants
ElfAbiIdent
ABI of ELF file formats at position EI_OSABI
.
1 | = 0x1 |
2 | = 0x2 |
8 | = 0x8 |
64 | = 0x40 |
ElfClassIdent
Class of ELF file formats at position EI_CLASS
.
1 | = 1 |
2 | = 2 |
ElfEndiannessIdent
Endianness of ELF file formats at position EI_DATA
.
1 | = 1 |
2 | = 2 |
ElfHeaderIdent
Positions of information inside the e_ident
field of ELF headers.
1 | = 1 |
2 | = 2 |
4 | = 4 |
8 | = 8 |
16 | = 16 |
ElfHeaderMachine
Value inside the e_machine
field of ELF headers.
1 | = 1 |
2 | = 2 |
4 | = 4 |
8 | = 8 |
ElfHeaderType
Type available in the e_type
field of ELF headers.
1 | = 1 |
2 | = 2 |
4 | = 4 |
ElfProgramHeaderFlags
Value inside the p_flags
field of ELF program headers.
1 | = 0x1 |
2 | = 0x2 |
4 | = 0x4 |
ElfProgramHeaderType
Value inside the p_type
field of ELF program headers.
1 | = 1 |
2 | = 2 |
4 | = 4 |
8 | = 8 |
ElfRelocation386
Type of relocation for i386 ELF files.
ElfRelocationArm
Type of relocation for ARM ELF files.
ElfSectionHeaderFlags
Value for the d_tag
field of ELF file dynamic section entries.
1 | = 0x1 |
2 | = 0x2 |
4 | = 0x4 |
8 | = 0x8 |
16 | = 0x10 |
32 | = 0x20 |
ElfSectionHeaderType
Value inside the sh_type
field of ELF section headers.
1 | = 0x1 |
2 | = 0x2 |
4 | = 0x4 |
8 | = 0x8 |
16 | = 0x10 |
2147483648 | = 0x80000000 |
ElfSymbolInfo
Value inside the st_info
field of ELF symbols.
1 | = 1 |
2 | = 2 |
ElfVersionIdent
Version of ELF file formats at position EI_VERSION
.
1 | = 1 |