Rizin
unix-like reverse engineering framework and cli tools
|
#include "elf.h"
Go to the source code of this file.
Variables | |
static const char * | sdb_elf_p_type_cparse |
static const char * | sdb_elf_p_flags_cparse |
static const char * | sdb_elf_type_cparse |
static const char * | sdb_elf_machine_cparse |
static const char * | sdb_elf_class_cparse = "enum elf_class {ELFCLASSNONE=0, ELFCLASS32=1, ELFCLASS64=2};" |
static const char * | sdb_elf_data_cparse = "enum elf_data {ELFDATANONE=0, ELFDATA2LSB=1, ELFDATA2MSB=2};" |
static const char * | sdb_elf_hdr_version_cparse = "enum elf_hdr_version {EV_NONE=0, EV_CURRENT=1};" |
static const char * | sdb_elf_obj_version_cparse = "enum elf_obj_version {EV_NONE=0, EV_CURRENT=1};" |
static const char * | sdb_elf_ident_format |
static const char * | sdb_elf_s_type_cparse |
static const char * | sdb_elf_phdr_format |
static const char * | sdb_elf_s_flags_32_cparse |
static const char * | sdb_elf_shdr_format |
static const char * | sdb_elf_header_format |
|
static |
|
static |
|
static |
Definition at line 296 of file elf.c.
References Elf_, ET_CORE, init_dt_dynamic(), init_dynstr(), init_ehdr(), init_phdr(), init_shdr(), init_shstrtab(), init_symbols_info(), NULL, options, rz_bin_elf_analyse_imports(), rz_bin_elf_get_baddr(), rz_bin_elf_get_bits(), rz_bin_elf_get_boffset(), rz_bin_elf_get_targets_map_base(), rz_bin_elf_is_relocatable(), rz_bin_elf_is_static(), rz_bin_elf_notes_new(), rz_bin_elf_relocs_new(), rz_bin_elf_sections_new(), rz_bin_elf_symbols_new(), rz_vector_free(), and sections().
Referenced by rz_bin_elf_new_buf().
|
static |
Definition at line 241 of file elf.c.
References init_dt_dynamic_aux(), and RZ_LOG_INFO.
Referenced by init().
Definition at line 232 of file elf.c.
References Elf_, init_dt_dynamic_sdb(), and rz_bin_elf_dt_dynamic_new().
Referenced by init_dt_dynamic().
Definition at line 219 of file elf.c.
References Elf_, RZ_BIN_ELF_FULL_RELRO, rz_bin_elf_has_relro(), RZ_BIN_ELF_PART_RELRO, and sdb_set().
Referenced by init_dt_dynamic_aux().
|
static |
Definition at line 275 of file elf.c.
References init_dynstr_aux(), and RZ_LOG_INFO.
Referenced by init().
Definition at line 252 of file elf.c.
References addr, DT_STRSZ, DT_STRTAB, Elf_, init_dynstr_sdb(), rz_bin_elf_get_dt_info(), rz_bin_elf_strtab_new(), rz_bin_elf_v2p(), RZ_LOG_INFO, ut64(), and UT64_MAX.
Referenced by init_dynstr().
Definition at line 154 of file elf.c.
References Elf_, init_ehdr_sdb(), and rz_bin_elf_get_ehdr().
Referenced by init().
Definition at line 141 of file elf.c.
References Elf_, sdb_elf_class_cparse, sdb_elf_data_cparse, sdb_elf_hdr_version_cparse, sdb_elf_header_format, sdb_elf_ident_format, sdb_elf_machine_cparse, sdb_elf_obj_version_cparse, sdb_elf_type_cparse, sdb_num_set(), and sdb_set().
Referenced by init_ehdr().
|
static |
Definition at line 130 of file elf.c.
References init_phdr_aux(), options, RZ_LOG_WARN, and sections().
Referenced by init().
|
static |
Definition at line 121 of file elf.c.
References Elf_, init_phdr_sdb(), options, rz_bin_elf_segments_new(), and sections().
Referenced by init_phdr().
Definition at line 113 of file elf.c.
References Elf_, sdb_elf_p_flags_cparse, sdb_elf_p_type_cparse, sdb_elf_phdr_format, sdb_num_set(), and sdb_set().
Referenced by init_phdr_aux().
|
static |
Definition at line 183 of file elf.c.
References init_shdr_aux(), options, RZ_LOG_WARN, and sections().
Referenced by init().
|
static |
Definition at line 174 of file elf.c.
References Elf_, init_shdr_sdb(), options, rz_bin_elf_convert_sections(), and sections().
Referenced by init_shdr().
Definition at line 162 of file elf.c.
References Elf_, sdb_elf_s_flags_32_cparse, sdb_elf_s_type_cparse, sdb_elf_shdr_format, sdb_num_set(), and sdb_set().
Referenced by init_shdr_aux().
Definition at line 213 of file elf.c.
References init_shstrtab_aux(), RZ_LOG_WARN, and sections().
Referenced by init().
Definition at line 194 of file elf.c.
References Elf_, init_shstrtab_sdb(), rz_bin_elf_strtab_new(), RZ_LOG_WARN, rz_vector_index_ptr(), and sections().
Referenced by init_shstrtab().
|
static |
Definition at line 290 of file elf.c.
References init_symbols_info_aux(), and RZ_LOG_INFO.
Referenced by init().
Definition at line 281 of file elf.c.
References Elf_, info(), rz_bin_elf_get_symbols_info(), and sdb_ns_set().
Referenced by init_symbols_info().
void Elf_() rz_bin_elf_free | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Free the elf binary.
elf | binary |
...
Definition at line 366 of file elf.c.
References Elf_, free(), rz_bin_elf_dt_dynamic_free(), rz_bin_elf_strtab_free(), rz_buf_free(), rz_return_if_fail, rz_vector_free(), and sdb_free().
Referenced by get_gnu_debugdata_elf_symbols(), and rz_bin_elf_new_buf().
RZ_OWN ELFOBJ* Elf_() rz_bin_elf_new_buf | ( | RZ_NONNULL RzBuffer * | buf, |
RZ_NONNULL RzBinObjectLoadOptions * | options | ||
) |
Definition at line 339 of file elf.c.
References Elf_, ELFOBJ, init(), NULL, options, rz_bin_elf_free(), rz_buf_ref(), rz_buf_size(), RZ_NEW0, rz_return_val_if_fail, and sdb_new0().
Referenced by get_gnu_debugdata_elf_symbols().
ut64 Elf_() rz_bin_elf_p2v | ( | RZ_NONNULL ELFOBJ * | bin, |
ut64 | paddr | ||
) |
Convert a physical address to the virtual address.
elf | binary |
Converts a physical address to the virtual address, looking at the program headers in the binary bin
Definition at line 400 of file elf.c.
References Elf_, in_physical_phdr(), PT_LOAD, rz_bin_elf_foreach_segments, rz_bin_elf_has_segments(), rz_bin_elf_is_relocatable(), rz_return_val_if_fail, RzBinElfSegment, and UT64_MAX.
Referenced by convert_elf_symbol_entry(), fix_rva_and_offset_relocable_file(), get_main_offset_arm64(), get_main_offset_linux_64_pie(), get_main_offset_x86_gcc(), and get_main_offset_x86_pie().
ut64 Elf_() rz_bin_elf_v2p | ( | RZ_NONNULL ELFOBJ * | bin, |
ut64 | vaddr | ||
) |
Convert a virtual address to the physical address.
elf | binary |
Converts a virtual address to the relative physical address, looking at the program headers in the binary bin
Definition at line 429 of file elf.c.
References Elf_, in_virtual_phdr(), PT_LOAD, rz_bin_elf_foreach_segments, rz_bin_elf_has_segments(), rz_bin_elf_is_relocatable(), rz_return_val_if_fail, RzBinElfSegment, and UT64_MAX.
Referenced by convert_elf_symbol_entry(), convert_elf_symbol_to_elf_import(), create_section_from_phdr(), Elf_(), fix_rva_and_offset_exec_file(), get_dynamic_elf_symbols(), get_gnu_verneed(), get_gnu_versym(), get_import_addr_mips(), get_import_addr_ppc(), get_import_addr_x86_manual(), get_main_offset_arm64(), get_main_offset_arm_glibc_non_thumb(), get_main_offset_arm_glibc_thumb(), get_main_offset_linux_64_pie(), get_main_offset_mips(), get_main_offset_x86_gcc(), get_main_offset_x86_non_pie(), get_relocs_entry_from_dt_dynamic_aux(), get_versym_entry_sdb_from_verdef(), get_versym_entry_sdb_from_verneed(), init_dt_dynamic(), init_dynstr_aux(), rz_bin_elf_get_entry_offset(), rz_bin_elf_get_fini_offset(), rz_bin_elf_get_gnu_hash_table(), rz_bin_elf_get_hash_table(), and rz_bin_elf_get_init_offset().
|
static |
Definition at line 59 of file elf.c.
Referenced by init_ehdr_sdb().
|
static |
Definition at line 61 of file elf.c.
Referenced by init_ehdr_sdb().
|
static |
Definition at line 63 of file elf.c.
Referenced by init_ehdr_sdb().
|
static |
Definition at line 100 of file elf.c.
Referenced by init_ehdr_sdb().
|
static |
Definition at line 67 of file elf.c.
Referenced by init_ehdr_sdb().
|
static |
Definition at line 21 of file elf.c.
Referenced by init_ehdr_sdb().
|
static |
Definition at line 65 of file elf.c.
Referenced by init_ehdr_sdb().
|
static |
Definition at line 13 of file elf.c.
Referenced by init_phdr_sdb().
|
static |
Definition at line 9 of file elf.c.
Referenced by init_phdr_sdb().
|
static |
Definition at line 90 of file elf.c.
Referenced by init_phdr_sdb().
|
static |
Definition at line 93 of file elf.c.
Referenced by init_shdr_sdb().
|
static |
Definition at line 70 of file elf.c.
Referenced by init_shdr_sdb().
|
static |
Definition at line 97 of file elf.c.
Referenced by init_shdr_sdb().
|
static |
Definition at line 17 of file elf.c.
Referenced by init_ehdr_sdb().