Class <classname>elfio</classname> member functions Function Description elfio The constructor. ~elfio The destructor. void create unsigned char file_class unsigned char encoding Cleans and initializes empty elfio object. file_class is either ELFCLASS32 or ELFCLASS64. file_class is either ELFDATA2LSB or ELFDATA2MSB. bool load const std::string& file_name Initializes elfio object by loading data from ELF binary file. File name provided in file_name. Returns true if the file was processed successfully. bool save const std::string& file_name Creates a file in ELF binary format. File name provided in file_name. Returns true if the file was created successfully. unsigned char get_class Returns ELF file class. Possible values are ELFCLASS32 or ELFCLASS64. unsigned char get_elf_version Returns ELF file format version. unsigned char get_encoding Returns ELF file format encoding. Possible values are ELFDATA2LSB and ELFDATA2MSB. Elf_Word get_version Identifies the object file version. Elf_Half get_header_size Returns the ELF header's size in bytes. Elf_Half get_section_entry_size Returns a section's entry size in ELF file header section table. Elf_Half get_segment_entry_size Returns a segment's entry size in ELF file header program table. unsigned char get_os_abi Returns operating system ABI identification. void set_os_abi unsigned char value Sets operating system ABI identification. unsigned char get_abi_version Returns ABI version. void set_abi_version unsigned char value Sets ABI version. Elf_Half get_type Returns the object file type. void set_type Elf_Half value Sets the object file type. Elf_Half get_machine Returns the object file's architecture. void set_machine Elf_Half value Sets the object file's architecture. Elf_Word get_flags Returns processor-specific flags associated with the file. void set_flags Elf_Word value Sets processor-specific flags associated with the file.
Class <classname>elfio</classname> member functions (continue) Function Description Elf64_Addr get_entry Returns the virtual address to which the system first transfers control. void set_entry Elf64_Addr value Sets the virtual address to which the system first transfers control. Elf64_Off get_sections_offset Returns the section header table's file offset in bytes. void set_sections_offset Elf64_Off value Sets the section header table's file offset. Attention! The value can be overridden by the library, when it creates new ELF file layout. Elf64_Off get_segments_offset Returns the program header table's file offset. void set_segments_offset Elf64_Off value Sets the program header table's file offset. Attention! The value can be overridden by the library, when it creates new ELF file layout. Elf_Half get_section_name_str_index Returns the section header table index of the entry associated with the section name string table. void set_section_name_str_index Elf_Half value Sets the section header table index of the entry associated with the section name string table. endianess_convertor& get_convertor Returns endianess convertor reference for the specific elfio object instance. Elf_Xword get_default_entry_size Elf_Word section_type Returns default entry size for known section types having different values on 32 and 64 bit architectures. At the moment, only SHT_RELA, SHT_REL, SHT_SYMTAB and SHT_DYNAMIC are 'known' section types. The function returns 0 for other section types.