Rizin
unix-like reverse engineering framework and cli tools
|
#include <rz_types.h>
#include <rz_util.h>
#include <rz_lib.h>
#include <rz_bin.h>
#include "elf_specs.h"
Go to the source code of this file.
Classes | |
struct | gnu_hash_table |
struct | rz_bin_elf_gnu_hash_table_t |
struct | elf_hash_table |
struct | rz_bin_elf_hash_table_ |
struct | prstatus_layout_t |
Information about the binary layout in a NT_PRSTATUS note for core files of a certain architecture and os. More... | |
struct | rz_bin_elf_section_t |
struct | rz_bin_elf_symbol_t |
struct | rz_bin_elf_reloc_t |
struct | rz_bin_elf_note_prstatus_t |
Parsed PT_NOTE of type NT_PRSTATUS. More... | |
Macros | |
#define | RZ_BIN_ELF_SCN_IS_EXECUTABLE(x) x &SHF_EXECINSTR |
#define | RZ_BIN_ELF_SCN_IS_READABLE(x) x &SHF_ALLOC |
#define | RZ_BIN_ELF_SCN_IS_WRITABLE(x) x &SHF_WRITE |
#define | RZ_BIN_ELF_NO_RELRO 0 |
#define | RZ_BIN_ELF_PART_RELRO 1 |
#define | RZ_BIN_ELF_FULL_RELRO 2 |
#define | ELFOBJ struct Elf_(rz_bin_elf_obj_t) |
#define | rz_bin_elf_foreach_segments(bin, segment) |
#define | rz_bin_elf_foreach_sections(bin, section) |
#define | rz_bin_elf_enumerate_sections(bin, section, i) |
#define | rz_bin_elf_foreach_relocs(bin, reloc) |
#define | rz_bin_elf_foreach_notes_segment(bin, notes) |
#define | rz_bin_elf_foreach_symbols(bin, symbol) |
#define | rz_bin_elf_foreach_imports(bin, import) |
#define | rz_bin_elf_fix_arm_thumb_object_dispatch(object) Elf_(rz_bin_elf_fix_arm_thumb_object)(&object->paddr, &object->vaddr, &object->bits) |
Typedefs | |
typedef struct rz_bin_elf_gnu_hash_table_t | RzBinElfGnuHashTable |
typedef struct rz_bin_elf_hash_table_ | RzBinElfHashTable |
typedef struct prstatus_layout_t | RzBinElfPrStatusLayout |
Information about the binary layout in a NT_PRSTATUS note for core files of a certain architecture and os. More... | |
typedef struct rz_bin_elf_section_t | RzBinElfSection |
typedef struct rz_bin_elf_symbol_t | RzBinElfSymbol |
typedef struct rz_bin_elf_reloc_t | RzBinElfReloc |
typedef struct rz_bin_elf_dt_dynamic_t | RzBinElfDtDynamic |
typedef struct rz_bin_elf_note_prstatus_t | RzBinElfNotePrStatus |
Parsed PT_NOTE of type NT_PRSTATUS. More... | |
typedef struct rz_bin_elf_strtab | RzBinElfStrtab |
typedef bool(* | RzBinElfSymbolFilter) (ELFOBJ *bin, Elf_(Sym) *entry, bool is_dynamic) |
Variables | |
RzBinElfSegment | |
RzBinElfNoteFile | |
RzBinElfNote | |
#define rz_bin_elf_fix_arm_thumb_object_dispatch | ( | object | ) | Elf_(rz_bin_elf_fix_arm_thumb_object)(&object->paddr, &object->vaddr, &object->bits) |
#define rz_bin_elf_foreach_imports | ( | bin, | |
import | |||
) |
#define rz_bin_elf_foreach_notes_segment | ( | bin, | |
notes | |||
) |
#define rz_bin_elf_foreach_relocs | ( | bin, | |
reloc | |||
) |
#define rz_bin_elf_foreach_segments | ( | bin, | |
segment | |||
) |
#define rz_bin_elf_foreach_symbols | ( | bin, | |
symbol | |||
) |
#define RZ_BIN_ELF_SCN_IS_EXECUTABLE | ( | x | ) | x &SHF_EXECINSTR |
typedef struct rz_bin_elf_dt_dynamic_t RzBinElfDtDynamic |
typedef struct rz_bin_elf_gnu_hash_table_t RzBinElfGnuHashTable |
typedef struct rz_bin_elf_hash_table_ RzBinElfHashTable |
typedef struct rz_bin_elf_note_prstatus_t RzBinElfNotePrStatus |
Parsed PT_NOTE of type NT_PRSTATUS.
typedef struct prstatus_layout_t RzBinElfPrStatusLayout |
Information about the binary layout in a NT_PRSTATUS note for core files of a certain architecture and os.
typedef struct rz_bin_elf_reloc_t RzBinElfReloc |
typedef struct rz_bin_elf_section_t RzBinElfSection |
typedef struct rz_bin_elf_strtab RzBinElfStrtab |
typedef struct rz_bin_elf_symbol_t RzBinElfSymbol |
struct Elf_ | ( | rz_bin_elf_note_file_t | ) |
struct Elf_ | ( | rz_bin_elf_note_t | ) |
struct Elf_ | ( | rz_bin_elf_obj_t | ) |
< overlay over the original file with relocs patched
Definition at line 182 of file elf.h.
struct Elf_ | ( | rz_bin_elf_segment_t | ) |
Elf_ | ( | Word | ) |
Definition at line 75 of file elf_symbols.c.
References DT_STRTAB, DT_SYMTAB, Elf_(), rz_bin_elf_get_dt_info(), rz_bin_elf_v2p(), ut64(), and UT64_MAX.
Definition at line 138 of file elf_misc.c.
References addr, UT32_ADD(), ut64(), UT64_ADD(), and value.
Referenced by verify_phdr_entry(), and verify_shdr_entry().
Definition at line 146 of file elf_misc.c.
References addr, UT32_ADD(), ut64(), UT64_ADD(), and value.
Referenced by rz_bin_elf_check_array(), verify_phdr_entry(), and verify_shdr_entry().
RZ_OWN RzVector* Elf_() rz_bin_elf_analyse_imports | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 329 of file elf_imports.c.
References convert_elf_symbols_to_elf_imports(), Elf_, filter_import(), NULL, rz_bin_elf_compute_symbols(), and rz_return_val_if_fail.
Referenced by init().
bool Elf_() rz_bin_elf_check_array | ( | RZ_NONNULL ELFOBJ * | bin, |
Elf_(Off) | offset, | ||
Elf_(Off) | length, | ||
Elf_(Off) | entry_size | ||
) |
Definition at line 32 of file elf_misc.c.
References Elf_, length, rz_bin_elf_add_off(), rz_bin_elf_mul_off(), and rz_return_val_if_fail.
Referenced by rz_bin_elf_sections_new(), rz_bin_elf_segments_new(), and rz_bin_elf_strtab_new().
RZ_OWN RzVector* Elf_() rz_bin_elf_compute_symbols | ( | ELFOBJ * | bin, |
RzBinElfSymbolFilter | filter | ||
) |
Definition at line 486 of file elf_symbols.c.
References elf_symbol_fini(), get_dynamic_elf_symbols(), get_gnu_debugdata_elf_symbols(), get_section_elf_symbols(), NULL, rz_vector_free(), rz_vector_len(), and rz_vector_new().
Referenced by get_gnu_debugdata_elf_symbols(), rz_bin_elf_analyse_imports(), and rz_bin_elf_symbols_new().
RZ_OWN RzVector* Elf_() rz_bin_elf_convert_sections | ( | RZ_NONNULL ELFOBJ * | bin, |
RZ_NONNULL RzBinObjectLoadOptions * | options, | ||
RzVector * | sections | ||
) |
Definition at line 362 of file elf_sections.c.
References convert_sections(), NULL, options, rz_return_val_if_fail, rz_vector_free(), rz_vector_len(), and sections().
Referenced by init_shdr_aux().
void Elf_() rz_bin_elf_dt_dynamic_free | ( | RzBinElfDtDynamic * | ptr | ) |
Definition at line 135 of file elf_dynamic.c.
References free(), and rz_vector_fini().
Referenced by rz_bin_elf_dt_dynamic_new(), and rz_bin_elf_free().
RZ_OWN RzBinElfDtDynamic* Elf_() rz_bin_elf_dt_dynamic_new | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 98 of file elf_dynamic.c.
References rz_bin_elf_dt_dynamic_t::dt_needed, Elf_, rz_bin_elf_dt_dynamic_t::info, init_dt_dynamic(), NULL, rz_bin_elf_dt_dynamic_free(), RZ_NEW0, rz_vector_init(), and ut64().
Referenced by init_dt_dynamic_aux().
Definition at line 28 of file elf_arm.c.
References addr, Elf_, rz_bin_elf_is_thumb_addr(), and rz_return_if_fail.
Referenced by rz_bin_elf_fix_arm_thumb_object().
void Elf_() rz_bin_elf_fix_arm_thumb_object | ( | RZ_NONNULL ut64 * | paddr, |
RZ_NONNULL ut64 * | vaddr, | ||
RZ_NONNULL int * | bits | ||
) |
Definition at line 33 of file elf_arm.c.
References bits(), Elf_, rz_bin_elf_fix_arm_thumb_addr(), rz_bin_elf_is_thumb_addr(), and rz_return_if_fail.
void Elf_() rz_bin_elf_fix_arm_thumb_symbol | ( | RZ_NONNULL RzBinSymbol * | symbol | ) |
Definition at line 49 of file elf_arm.c.
References rz_bin_elf_fix_arm_thumb_object_dispatch, rz_return_if_fail, start_a_sequence_of_data(), start_a_sequence_of_instruction(), and start_a_sequence_of_thumb_instruction().
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 char* Elf_() rz_bin_elf_get_abi | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Return a string representing the application binary interface.
elf | type |
Only work on mips right now. Use the elf header to deduce the application binary interface
Definition at line 1386 of file elf_info.c.
References EM_MIPS, get_abi_mips(), NULL, and rz_return_val_if_fail.
Referenced by add_abi_info().
RZ_OWN char* Elf_() rz_bin_elf_get_arch | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Get the elf binary architecture.
elf | binary |
With the elf header (e_machine) deduce the elf architecture
Definition at line 1403 of file elf_info.c.
References arch_translation_table, i, NULL, RZ_ARRAY_SIZE, rz_return_val_if_fail, and strdup().
ut64 Elf_() rz_bin_elf_get_baddr | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Compute the base address of the binary.
elf | binary |
To compute the base address, one determines the memory address associated with the lowest p_vaddr value for a PT_LOAD segment.
Definition at line 1772 of file elf_info.c.
References compute_baddr_from_phdr(), Elf_(), rz_bin_elf_has_segments(), rz_bin_elf_is_relocatable(), and rz_return_val_if_fail.
Referenced by get_main_offset_x86_pie(), and init().
int Elf_() rz_bin_elf_get_bits | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Return the elf bits.
elf | binary |
...
Definition at line 1697 of file elf_info.c.
References arch_is_arcompact(), arch_is_mips(), Elf_(), get_bits_common(), get_bits_mips(), has_thumb_symbol(), rz_bin_elf_get_entry_offset(), rz_bin_elf_is_arm_binary_supporting_thumb(), rz_bin_elf_is_static(), rz_bin_elf_is_thumb_addr(), rz_return_val_if_fail, and ut64().
Referenced by init().
ut64 Elf_() rz_bin_elf_get_boffset | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Compute the base offset of the binary.
elf | binary |
To compute the base address, one determines the memory address associated with the lowest p_offset value for a PT_LOAD segment.
Definition at line 1795 of file elf_info.c.
References compute_boffset_from_phdr(), Elf_(), rz_bin_elf_has_segments(), and rz_return_val_if_fail.
Referenced by init().
RZ_OWN char* Elf_() rz_bin_elf_get_compiler | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Get the compiler info from the .comment section.
elf | binary |
...
Definition at line 1339 of file elf_info.c.
References Elf_(), test_evm::end, free(), malloc(), NULL, section::offset, rz_bin_elf_get_section_with_name(), rz_buf_read_at(), RZ_MIN, rz_return_val_if_fail, rz_str_escape(), rz_str_trim(), section::size, and ut64().
RZ_OWN char* Elf_() rz_bin_elf_get_cpu | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Return a string representing the cpu.
elf | type |
Only work on mips right now. Use the elf header to deduce the cpu
Definition at line 1422 of file elf_info.c.
References Elf_(), EM_MIPS, get_cpu_mips(), NULL, rz_bin_elf_has_segments(), and rz_return_val_if_fail.
Referenced by add_cpu_info().
Definition at line 120 of file elf_dynamic.c.
References Elf_, get_dt_info(), info(), key, rz_bin_elf_has_dt_dynamic(), and rz_return_val_if_fail.
Referenced by create_section_plt(), Elf_(), elf_is_bind_now(), get_dynamic_elf_symbols(), get_gnu_verneed(), get_gnu_versym(), get_import_addr_arm(), get_import_addr_mips(), get_import_addr_ppc(), get_import_addr_riscv(), get_import_addr_x86(), get_import_addr_x86_manual(), get_main_offset_mips(), get_plt_name(), get_relocs_entry_from_dt_dynamic(), get_relocs_entry_from_dt_dynamic_aux(), get_sections_from_dt_dynamic(), get_versym_entry_sdb_from_verdef(), get_versym_entry_sdb_from_verneed(), has_dt_rpath_entry(), init_dynstr_aux(), rz_bin_elf_get_fini_offset(), rz_bin_elf_get_gnu_hash_table(), rz_bin_elf_get_hash_table(), rz_bin_elf_get_init_offset(), and rz_bin_elf_get_num_relocs_dynamic_plt().
RZ_BORROW RzVector* Elf_() rz_bin_elf_get_dt_needed | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 88 of file elf_dynamic.c.
References Elf_, NULL, rz_bin_elf_has_dt_dynamic(), and rz_return_val_if_fail.
Referenced by rz_bin_elf_get_libs().
RZ_OWN char* Elf_() rz_bin_elf_get_e_ehsize_as_string | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 82 of file elf_ehdr.c.
References NULL, rz_return_val_if_fail, and rz_str_newf().
Referenced by rz_bin_elf_print_ehdr().
RZ_OWN char* Elf_() rz_bin_elf_get_e_entry_as_string | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 88 of file elf_ehdr.c.
References NULL, PFMT64x, rz_return_val_if_fail, rz_str_newf(), and ut64().
Referenced by rz_bin_elf_print_ehdr().
RZ_OWN char* Elf_() rz_bin_elf_get_e_flags_as_string | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 94 of file elf_ehdr.c.
References NULL, rz_return_val_if_fail, and rz_str_newf().
Referenced by rz_bin_elf_print_ehdr().
RZ_OWN char* Elf_() rz_bin_elf_get_e_indent_as_string | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 100 of file elf_ehdr.c.
References NULL, rz_return_val_if_fail, and rz_str_newf().
Referenced by rz_bin_elf_print_ehdr().
RZ_OWN char* Elf_() rz_bin_elf_get_e_machine_as_string | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 122 of file elf_ehdr.c.
References NULL, rz_return_val_if_fail, and rz_str_newf().
Referenced by rz_bin_elf_print_ehdr().
RZ_OWN char* Elf_() rz_bin_elf_get_e_phentsize_as_string | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 128 of file elf_ehdr.c.
References NULL, rz_return_val_if_fail, and rz_str_newf().
Referenced by rz_bin_elf_print_ehdr().
RZ_OWN char* Elf_() rz_bin_elf_get_e_phnum_as_string | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 134 of file elf_ehdr.c.
References NULL, rz_return_val_if_fail, and rz_str_newf().
Referenced by rz_bin_elf_print_ehdr().
RZ_OWN char* Elf_() rz_bin_elf_get_e_phoff_as_string | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 140 of file elf_ehdr.c.
References NULL, PFMT64x, rz_return_val_if_fail, rz_str_newf(), and ut64().
Referenced by rz_bin_elf_print_ehdr().
RZ_OWN char* Elf_() rz_bin_elf_get_e_shentsize_as_string | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 146 of file elf_ehdr.c.
References NULL, rz_return_val_if_fail, and rz_str_newf().
Referenced by rz_bin_elf_print_ehdr().
RZ_OWN char* Elf_() rz_bin_elf_get_e_shnum_as_string | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 152 of file elf_ehdr.c.
References NULL, rz_return_val_if_fail, and rz_str_newf().
Referenced by rz_bin_elf_print_ehdr().
RZ_OWN char* Elf_() rz_bin_elf_get_e_shoff_as_string | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 158 of file elf_ehdr.c.
References NULL, PFMT64x, rz_return_val_if_fail, rz_str_newf(), and ut64().
Referenced by rz_bin_elf_print_ehdr().
RZ_OWN char* Elf_() rz_bin_elf_get_e_shstrndx_as_string | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 164 of file elf_ehdr.c.
References NULL, rz_return_val_if_fail, and rz_str_newf().
Referenced by rz_bin_elf_print_ehdr().
RZ_OWN char* Elf_() rz_bin_elf_get_e_type_as_string | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 170 of file elf_ehdr.c.
References NULL, rz_return_val_if_fail, and rz_str_newf().
Referenced by rz_bin_elf_print_ehdr().
RZ_OWN char* Elf_() rz_bin_elf_get_e_version_as_string | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 176 of file elf_ehdr.c.
References NULL, rz_return_val_if_fail, and rz_str_newf().
Referenced by rz_bin_elf_print_ehdr().
bool Elf_() rz_bin_elf_get_ehdr | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 182 of file elf_ehdr.c.
References EI_DATA, EI_NIDENT, Elf_(), ELFDATA2MSB, is_valid_elf_ident(), memset(), read_ehdr_other(), rz_buf_read_at(), RZ_LOG_WARN, and rz_return_val_if_fail.
Referenced by init_ehdr().
RZ_OWN char* Elf_() rz_bin_elf_get_elf_class | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Return a string representing the elf class.
elf | binary |
Check the elf header (e_ident) to deduce the elf class
Definition at line 1443 of file elf_info.c.
References class_translation::class, class_translation_table, EI_CLASS, i, NULL, RZ_ARRAY_SIZE, rz_return_val_if_fail, rz_str_newf(), and strdup().
ut64 Elf_() rz_bin_elf_get_entry_offset | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Get the entry offset.
elf | binary |
Get the entry offset from the elf header (e_entry), and if the information isn't defined section header will be used.
Definition at line 1813 of file elf_info.c.
References Elf_(), get_entry_offset_from_shdr(), rz_bin_elf_is_executable(), rz_bin_elf_v2p(), rz_return_val_if_fail, autogen_x86imm::tmp, ut64(), and UT64_MAX.
Referenced by rz_bin_elf_get_bits(), and rz_bin_elf_get_main_offset().
RZ_OWN char* Elf_() rz_bin_elf_get_file_type | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Return a string representing the file type.
elf | binary |
Use the elf header (e_type) to deduce the file type
Definition at line 1462 of file elf_info.c.
References file_type_is_os_specific(), file_type_is_processor_specific(), get_file_type_basic(), NULL, rz_return_val_if_fail, and rz_str_newf().
ut64 Elf_() rz_bin_elf_get_fini_offset | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Compute the fini offset of the binary.
elf | binary |
Get the offset from the vaddr store in the dynamic section (dt_fini)
Definition at line 1840 of file elf_info.c.
References addr, DT_FINI, Elf_(), rz_bin_elf_get_dt_info(), rz_bin_elf_has_dt_dynamic(), rz_bin_elf_v2p(), rz_return_val_if_fail, and ut64().
bool Elf_() rz_bin_elf_get_gnu_hash_table | ( | RZ_NONNULL ELFOBJ * | bin, |
RzBinElfGnuHashTable * | result | ||
) |
Definition at line 64 of file elf_hash.c.
References addr, DT_GNU_HASH, Elf_, PFMT64x, read_gnu_hash_table(), rz_bin_elf_get_dt_info(), rz_bin_elf_v2p(), RZ_LOG_WARN, rz_return_val_if_fail, ut64(), and UT64_MAX.
Referenced by rz_bin_elf_get_number_of_symbols_from_gnu_hash_table().
bool Elf_() rz_bin_elf_get_hash_table | ( | RZ_NONNULL ELFOBJ * | bin, |
RzBinElfHashTable * | result | ||
) |
Definition at line 85 of file elf_hash.c.
References addr, DT_HASH, Elf_, PFMT64x, read_hash_table(), rz_bin_elf_get_dt_info(), rz_bin_elf_v2p(), RZ_LOG_WARN, rz_return_val_if_fail, ut64(), and UT64_MAX.
Referenced by rz_bin_elf_get_number_of_symbols_from_hash_table().
RZ_OWN char* Elf_() rz_bin_elf_get_head_flag | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Return the head flag.
...
Definition at line 1487 of file elf_info.c.
References free(), get_head_flag(), NULL, rz_return_val_if_fail, RZ_STR_ISEMPTY, and strdup().
RZ_BORROW RzBinElfSymbol* Elf_() rz_bin_elf_get_import | ( | RZ_NONNULL ELFOBJ * | bin, |
ut32 | ordinal | ||
) |
Definition at line 316 of file elf_imports.c.
References NULL, rz_bin_elf_foreach_imports, and rz_return_val_if_fail.
ut64 Elf_() rz_bin_elf_get_init_offset | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Compute the init offset of the binary.
elf | binary |
Get the offset from the vaddr store in the dynamic section (dt_init)
Definition at line 1863 of file elf_info.c.
References addr, DT_INIT, Elf_(), rz_bin_elf_get_dt_info(), rz_bin_elf_has_dt_dynamic(), rz_bin_elf_v2p(), rz_return_val_if_fail, and ut64().
RZ_OWN char* Elf_() rz_bin_elf_get_intrp | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Get the program interpreter.
elf | binary |
Get the program interpreter from the phdr
Definition at line 1568 of file elf_info.c.
References Elf_(), get_elf_intrp(), NULL, PT_INTERP, rz_bin_elf_get_segment_with_type(), rz_bin_elf_has_segments(), rz_return_val_if_fail, and RzBinElfSegment.
RZ_OWN RzList* Elf_() rz_bin_elf_get_libs | ( | RZ_NONNULL ELFOBJ * | bin | ) |
List all imported lib.
elf | binary |
Use dynamic information (dt_needed) to generate a list of imported lib
Definition at line 877 of file elf_info.c.
References Elf_(), free(), NULL, rz_bin_elf_get_dt_needed(), rz_bin_elf_has_dt_dynamic(), rz_bin_elf_strtab_get_dup(), rz_list_append(), rz_list_free(), rz_list_newf(), rz_return_val_if_fail, rz_vector_foreach, autogen_x86imm::tmp, and ut64().
RZ_OWN char* Elf_() rz_bin_elf_get_machine_name | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Return a string representing the machine name.
elf | type |
Use http://www.sco.com/developers/gabi/latest/ch4.eheader.html and the elf header (e_machine)
Definition at line 1508 of file elf_info.c.
References i, machine_name_translation_table, NULL, RZ_ARRAY_SIZE, rz_return_val_if_fail, rz_str_newf(), and strdup().
ut64 Elf_() rz_bin_elf_get_main_offset | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Compute the main offset of the binary.
elf | binary |
...
Definition at line 1886 of file elf_info.c.
References Elf_(), get_main_offset_arm64(), get_main_offset_arm_glibc(), get_main_offset_from_symbol(), get_main_offset_linux_64_pie(), get_main_offset_mips(), get_main_offset_x86_gcc(), get_main_offset_x86_non_pie(), get_main_offset_x86_pie(), RZ_ARRAY_SIZE, rz_bin_elf_get_entry_offset(), rz_buf_read_at(), rz_return_val_if_fail, ut64(), and UT64_MAX.
ut64 Elf_() rz_bin_elf_get_num_relocs_dynamic_plt | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 255 of file elf_relocs.c.
References DT_PLTREL, DT_PLTRELSZ, Elf_, relocs_segment::entry_size, get_size_rel_mode(), rz_bin_elf_get_dt_info(), rz_return_val_if_fail, and ut64().
Referenced by get_import_addr_ppc().
size_t Elf_() rz_bin_elf_get_number_of_symbols_from_gnu_hash_table | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 106 of file elf_hash.c.
References rz_bin_elf_gnu_hash_table_t::data, Elf_, get_highest_chain_index_in_gnu_hash_table_buckets(), get_highest_symbol_index_in_gnu_hash_table_chains(), rz_bin_elf_gnu_hash_table_t::offset, rz_bin_elf_get_gnu_hash_table(), rz_return_val_if_fail, and ut64().
size_t Elf_() rz_bin_elf_get_number_of_symbols_from_hash_table | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 122 of file elf_hash.c.
References rz_bin_elf_hash_table_::data, Elf_, rz_bin_elf_get_hash_table(), and rz_return_val_if_fail.
RZ_OWN char* Elf_() rz_bin_elf_get_osabi_name | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Return the os application binary interface name.
elf | binary |
Check the ehdr or the shdr to get the os name
Definition at line 1527 of file elf_info.c.
References get_osabi_name_from_ehdr(), get_osabi_name_from_shdr(), name, NULL, rz_return_val_if_fail, and strdup().
RZ_BORROW RzBinElfPrStatusLayout* Elf_() rz_bin_elf_get_prstatus_layout | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 201 of file elf_notes.c.
References AARCH64, ARM, EM_386, EM_AARCH64, EM_ARM, EM_X86_64, NULL, prstatus_layouts, rz_return_val_if_fail, X86, and X86_64.
Referenced by parse_note_prstatus(), and rz_bin_elf_get_sp_val().
size_t Elf_() rz_bin_elf_get_relocs_count | ( | RZ_NONNULL ELFOBJ * | bin | ) |
RZ_OWN char* Elf_() rz_bin_elf_get_rpath | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Get the rpath.
elf | binary |
Use DT_RPATH or DT_RUNPATH to return the string
Definition at line 1550 of file elf_info.c.
References Elf_(), has_dt_rpath_entry(), NULL, rz_bin_elf_has_segments(), rz_bin_elf_strtab_get_dup(), rz_return_val_if_fail, and val.
RZ_BORROW RzBinElfSection* Elf_() rz_bin_elf_get_section | ( | RZ_NONNULL ELFOBJ * | bin, |
Elf_(Half) | index | ||
) |
Definition at line 264 of file elf_sections.c.
References NULL, rz_return_val_if_fail, rz_vector_index_ptr(), and rz_vector_len().
Referenced by convert_elf_symbol_entry(), fix_rva_and_offset_relocable_file(), and get_section_elf_symbols().
RZ_BORROW RzBinElfSection* Elf_() rz_bin_elf_get_section_with_name | ( | RZ_NONNULL ELFOBJ * | bin, |
RZ_NONNULL const char * | name | ||
) |
Definition at line 278 of file elf_sections.c.
References NULL, rz_bin_elf_foreach_sections, and rz_return_val_if_fail.
Referenced by get_entry_offset_from_shdr(), get_gnu_debugdata_elf_symbols(), get_import_addr_x86(), get_import_addr_x86_manual(), and rz_bin_elf_get_compiler().
RZ_BORROW RzBinElfSegment* Elf_() rz_bin_elf_get_segment_with_type | ( | RZ_NONNULL ELFOBJ * | bin, |
Elf_(Word) | type | ||
) |
Definition at line 120 of file elf_segments.c.
References NULL, rz_bin_elf_foreach_segments, rz_return_val_if_fail, RzBinElfSegment, and type.
Referenced by elf_has_gnu_relro(), init_dt_dynamic(), rz_bin_elf_get_intrp(), rz_bin_elf_has_nx(), and rz_bin_elf_is_static().
ut64 Elf_() rz_bin_elf_get_sp_val | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Get the stack pointer value.
elf | binary |
Get the value of the stack pointer register in a core file from NT_PRSTATUS
Definition at line 16 of file elf_corefile.c.
References Elf_, NT_PRSTATUS, rz_bin_elf_note_prstatus_t::regstate, rz_bin_elf_note_prstatus_t::regstate_size, rz_bin_elf_foreach_notes_segment, rz_bin_elf_get_prstatus_layout(), rz_read_ble(), rz_return_val_if_fail, rz_vector_foreach, RzBinElfNote, prstatus_layout_t::sp_offset, prstatus_layout_t::sp_size, autogen_x86imm::tmp, and UT64_MAX.
RZ_BORROW RzBinElfSymbol* Elf_() rz_bin_elf_get_symbol | ( | RZ_NONNULL ELFOBJ * | bin, |
ut32 | ordinal | ||
) |
Definition at line 473 of file elf_symbols.c.
References NULL, rz_bin_elf_symbol_t::ordinal, rz_bin_elf_foreach_symbols, and rz_return_val_if_fail.
RZ_OWN Sdb* Elf_() rz_bin_elf_get_symbols_info | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 1301 of file elf_info.c.
References Elf_(), get_gnu_verneed(), get_gnu_versym(), NULL, rz_bin_elf_is_executable(), rz_return_val_if_fail, sdb_free(), sdb_new0(), and sdb_ns_set().
Referenced by init_symbols_info_aux().
Definition at line 44 of file elf_map.c.
References Elf_, get_targets_map_base(), rz_num_align_delta(), and ut64().
Referenced by init().
bool Elf_() rz_bin_elf_has_dt_dynamic | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 130 of file elf_dynamic.c.
References rz_return_val_if_fail.
Referenced by get_import_addr(), get_relocs_entry_from_dt_dynamic(), rz_bin_elf_get_dt_info(), rz_bin_elf_get_dt_needed(), rz_bin_elf_get_fini_offset(), rz_bin_elf_get_init_offset(), and rz_bin_elf_get_libs().
bool Elf_() rz_bin_elf_has_imports | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 342 of file elf_imports.c.
References rz_return_val_if_fail.
bool Elf_() rz_bin_elf_has_notes | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 255 of file elf_notes.c.
References rz_return_val_if_fail.
bool Elf_() rz_bin_elf_has_nx | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Check if the stack is not executable.
elf | binary |
Check p_flags from the segment PT_GNU_STACK
Definition at line 1615 of file elf_info.c.
References Elf_(), PF_X, PT_GNU_STACK, rz_bin_elf_get_segment_with_type(), rz_bin_elf_has_segments(), rz_return_val_if_fail, and RzBinElfSegment.
bool Elf_() rz_bin_elf_has_relocs | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 239 of file elf_relocs.c.
References rz_return_val_if_fail.
Referenced by get_import_addr().
int Elf_() rz_bin_elf_has_relro | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Analyse if the elf binary has relro or partial relro.
elf | binary |
Check if the elf has bind now enable and with PT_GNU_RELRO can deduct the relro type
Definition at line 1733 of file elf_info.c.
References elf_has_gnu_relro(), elf_is_bind_now(), RZ_BIN_ELF_FULL_RELRO, RZ_BIN_ELF_NO_RELRO, RZ_BIN_ELF_PART_RELRO, and rz_return_val_if_fail.
Referenced by get_import_addr_x86_manual(), and init_dt_dynamic_sdb().
bool Elf_() rz_bin_elf_has_sections | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 440 of file elf_sections.c.
References rz_return_val_if_fail.
Referenced by rz_bin_elf_is_stripped().
bool Elf_() rz_bin_elf_has_segments | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 149 of file elf_segments.c.
References rz_return_val_if_fail.
Referenced by arch_is_mips(), convert_sections(), elf_has_gnu_relro(), get_main_offset_x86_pie(), get_targets_map_base(), rz_bin_elf_get_baddr(), rz_bin_elf_get_boffset(), rz_bin_elf_get_cpu(), rz_bin_elf_get_intrp(), rz_bin_elf_get_rpath(), rz_bin_elf_has_nx(), rz_bin_elf_p2v(), and rz_bin_elf_v2p().
bool Elf_() rz_bin_elf_has_symbols | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 534 of file elf_symbols.c.
References rz_return_val_if_fail.
Check if the elf use virtual address.
elf | binary |
Return always true
Definition at line 1637 of file elf_info.c.
bool Elf_() rz_bin_elf_is_arm_binary_supporting_thumb | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 19 of file elf_arm.c.
References EM_ARM, and rz_return_val_if_fail.
Referenced by rz_bin_elf_get_bits().
bool Elf_() rz_bin_elf_is_big_endian | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Check the binary endianness.
elf | type |
Use the elf header (e_ident[EI_DATA]) to check the binary endianness
Definition at line 1757 of file elf_info.c.
References EI_DATA, ELFDATA2MSB, and rz_return_val_if_fail.
bool Elf_() rz_bin_elf_is_executable | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Check if the elf binary is executable.
elf | binary |
Use the elf header entry e_type to deduct if the elf is executable.
Definition at line 1648 of file elf_info.c.
References Elf_(), ET_DYN, ET_EXEC, rz_return_val_if_fail, and type.
Referenced by get_dynamic_elf_symbols(), is_playstation_hack(), rz_bin_elf_get_entry_offset(), and rz_bin_elf_get_symbols_info().
bool Elf_() rz_bin_elf_is_relocatable | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Check if the elf binary is relocatable.
elf | binary |
Use the elf header entry e_type to deduct if the elf is relocatable.
Definition at line 1662 of file elf_info.c.
References ET_REL, and rz_return_val_if_fail.
Referenced by convert_elf_symbol_entry(), filter_import(), fix_rva_and_offset(), init(), rz_bin_elf_get_baddr(), rz_bin_elf_p2v(), rz_bin_elf_v2p(), and set_elf_section_aux().
bool Elf_() rz_bin_elf_is_static | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Check if the binary is statically-linked library.
elf | binary |
Check the presence of PT_INTERP or PT_DYNAMIC in the program header
Definition at line 1674 of file elf_info.c.
References Elf_(), PT_DYNAMIC, PT_INTERP, rz_bin_elf_get_segment_with_type(), rz_return_val_if_fail, and RzBinElfSegment.
Referenced by init(), is_playstation_hack(), and rz_bin_elf_get_bits().
bool Elf_() rz_bin_elf_is_stripped | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Check if the binary is stripped.
elf | binary |
is_stripped | ? |
Use the shdr to check if the binary is stripped
Definition at line 1591 of file elf_info.c.
References Elf_(), rz_bin_elf_foreach_sections, rz_bin_elf_has_sections(), rz_return_val_if_fail, and SHT_SYMTAB.
Definition at line 24 of file elf_arm.c.
References addr, and UT64_MAX.
Referenced by get_import_addr_arm(), get_main_offset_arm_glibc(), has_thumb_symbol(), rz_bin_elf_fix_arm_thumb_addr(), rz_bin_elf_fix_arm_thumb_object(), and rz_bin_elf_get_bits().
Definition at line 154 of file elf_misc.c.
References addr, UT32_MUL(), ut64(), UT64_MUL(), and value.
Referenced by parse_note_file().
Definition at line 162 of file elf_misc.c.
References addr, UT32_MUL(), ut64(), UT64_MUL(), and value.
Referenced by rz_bin_elf_check_array().
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().
RZ_OWN RzVector* Elf_() rz_bin_elf_notes_new | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 218 of file elf_notes.c.
References note_free(), note_segment_free(), NULL, PT_NOTE, rz_bin_elf_foreach_segments, rz_return_val_if_fail, rz_vector_fini(), rz_vector_free(), rz_vector_init(), rz_vector_len(), rz_vector_new(), rz_vector_push(), RzBinElfNote, RzBinElfSegment, and set_note_segment().
Referenced by init().
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().
bool Elf_() rz_bin_elf_print_ehdr | ( | ELFOBJ * | bin, |
RZ_NONNULL PrintfCallback | cb | ||
) |
Definition at line 202 of file elf_ehdr.c.
References cb, E_EHSIZE_OFFSET, E_ENTRYPOINT_OFFSET, E_FLAGS_OFFSET, E_IDENT_OFFSET, E_MACHINE_OFFSET, E_PHENTSIZE_OFFSET, E_PHNUM_OFFSET, E_PHOFF_OFFSET, E_SHENTSIZE_OFFSET, E_SHNUM_OFFSET, E_SHOFF_OFFSET, E_SHSTRNDX_OFFSET, E_TYPE_OFFSET, E_VERSION_OFFSET, Elf_(), print_ehdr_aux(), rz_bin_elf_get_e_ehsize_as_string(), rz_bin_elf_get_e_entry_as_string(), rz_bin_elf_get_e_flags_as_string(), rz_bin_elf_get_e_indent_as_string(), rz_bin_elf_get_e_machine_as_string(), rz_bin_elf_get_e_phentsize_as_string(), rz_bin_elf_get_e_phnum_as_string(), rz_bin_elf_get_e_phoff_as_string(), rz_bin_elf_get_e_shentsize_as_string(), rz_bin_elf_get_e_shnum_as_string(), rz_bin_elf_get_e_shoff_as_string(), rz_bin_elf_get_e_shstrndx_as_string(), rz_bin_elf_get_e_type_as_string(), rz_bin_elf_get_e_version_as_string(), and rz_return_val_if_fail.
bool Elf_() rz_bin_elf_read_addr | ( | RZ_NONNULL ELFOBJ * | bin, |
RZ_NONNULL RZ_INOUT ut64 * | offset, | ||
RZ_NONNULL RZ_OUT Elf_(Addr) * | result | ||
) |
Definition at line 82 of file elf_misc.c.
References rz_return_val_if_fail, and ut64().
Referenced by get_dynamic_entry_aux(), get_got_entry(), get_note_file_aux(), get_phdr_entry(), get_shdr_entry_aux(), get_symbol_entry_aux(), parse_note_file(), read_ehdr_other_aux(), and read_reloc_entry_aux().
bool Elf_() rz_bin_elf_read_char | ( | RZ_NONNULL ELFOBJ * | bin, |
RZ_NONNULL RZ_INOUT ut64 * | offset, | ||
RZ_NONNULL RZ_OUT ut8 * | result | ||
) |
Definition at line 52 of file elf_misc.c.
References rz_buf_read8_offset, and rz_return_val_if_fail.
Referenced by Elf_(), and get_symbol_entry_aux().
bool Elf_() rz_bin_elf_read_half | ( | RZ_NONNULL ELFOBJ * | bin, |
RZ_NONNULL RZ_INOUT ut64 * | offset, | ||
RZ_NONNULL RZ_OUT Elf_(Half) * | result | ||
) |
Definition at line 57 of file elf_misc.c.
References rz_return_val_if_fail.
Referenced by get_verdef_entry_aux(), get_vernaux_entry_aux(), get_verneed_entry_aux(), read_ehdr_other(), read_ehdr_other_aux(), and rz_bin_elf_read_versym().
bool Elf_() rz_bin_elf_read_off | ( | RZ_NONNULL ELFOBJ * | bin, |
RZ_NONNULL RZ_INOUT ut64 * | offset, | ||
RZ_NONNULL RZ_OUT Elf_(Off) * | result | ||
) |
Definition at line 91 of file elf_misc.c.
References rz_return_val_if_fail, and ut64().
Referenced by get_note_file_aux(), get_phdr_entry(), get_shdr_entry_aux(), and read_ehdr_other_aux().
bool Elf_() rz_bin_elf_read_section | ( | RZ_NONNULL ELFOBJ * | bin, |
RZ_NONNULL RZ_INOUT ut64 * | offset, | ||
RZ_NONNULL RZ_OUT Elf_(Section) * | result | ||
) |
Definition at line 100 of file elf_misc.c.
References rz_return_val_if_fail.
Referenced by get_symbol_entry_aux().
bool Elf_() rz_bin_elf_read_sword | ( | RZ_NONNULL ELFOBJ * | bin, |
RZ_NONNULL RZ_INOUT ut64 * | offset, | ||
RZ_NONNULL RZ_OUT Elf_(Sword) * | result | ||
) |
Definition at line 67 of file elf_misc.c.
References buffer_read_32_signed(), and rz_return_val_if_fail.
Referenced by rz_bin_elf_read_sword_sxword().
bool Elf_() rz_bin_elf_read_sword_sxword | ( | RZ_NONNULL ELFOBJ * | bin, |
RZ_NONNULL RZ_INOUT ut64 * | offset, | ||
RZ_NONNULL RZ_OUT Elf_(Sword) * | result | ||
) |
Definition at line 131 of file elf_misc.c.
References Elf_, rz_bin_elf_read_sword(), and rz_return_val_if_fail.
Referenced by get_dynamic_entry_aux(), and read_reloc_entry_aux().
bool Elf_() rz_bin_elf_read_sxword | ( | RZ_NONNULL ELFOBJ * | bin, |
RZ_NONNULL RZ_INOUT ut64 * | offset, | ||
RZ_NONNULL RZ_OUT Elf_(Sxword) * | result | ||
) |
Definition at line 77 of file elf_misc.c.
References buffer_read_64_signed(), rz_return_val_if_fail, and st64.
bool Elf_() rz_bin_elf_read_versym | ( | RZ_NONNULL ELFOBJ * | bin, |
RZ_NONNULL RZ_INOUT ut64 * | offset, | ||
RZ_NONNULL RZ_OUT Elf_(Versym) * | result | ||
) |
Definition at line 105 of file elf_misc.c.
References Elf_, rz_bin_elf_read_half(), and rz_return_val_if_fail.
Referenced by get_gnu_versym().
bool Elf_() rz_bin_elf_read_word | ( | RZ_NONNULL ELFOBJ * | bin, |
RZ_NONNULL RZ_INOUT ut64 * | offset, | ||
RZ_NONNULL RZ_OUT Elf_(Word) * | result | ||
) |
Definition at line 62 of file elf_misc.c.
References rz_return_val_if_fail.
Referenced by get_highest_chain_index_in_gnu_hash_table_buckets(), get_highest_symbol_index_in_gnu_hash_table_chains(), get_import_addr_x86_manual(), get_phdr_entry(), get_shdr_entry_aux(), get_symbol_entry_aux(), get_verdaux_entry_aux(), get_verdef_entry_aux(), get_vernaux_entry_aux(), get_verneed_entry_aux(), read_ehdr_other_aux(), read_gnu_hash_table(), read_hash_table(), read_note_segment_header(), and rz_bin_elf_read_word_xword().
bool Elf_() rz_bin_elf_read_word_xword | ( | RZ_NONNULL ELFOBJ * | bin, |
RZ_NONNULL RZ_INOUT ut64 * | offset, | ||
RZ_NONNULL RZ_OUT Elf_(Word) * | result | ||
) |
Definition at line 117 of file elf_misc.c.
References Elf_, rz_bin_elf_read_word(), and rz_return_val_if_fail.
Referenced by get_phdr_entry(), get_shdr_entry_aux(), and read_reloc_entry_aux().
bool Elf_() rz_bin_elf_read_xword | ( | RZ_NONNULL ELFOBJ * | bin, |
RZ_NONNULL RZ_INOUT ut64 * | offset, | ||
RZ_NONNULL RZ_OUT Elf_(Xword) * | result | ||
) |
Definition at line 72 of file elf_misc.c.
References rz_return_val_if_fail, and ut64().
Referenced by get_symbol_entry_aux().
RZ_OWN RzVector* Elf_() rz_bin_elf_relocs_new | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 202 of file elf_relocs.c.
References get_relocs_entry_from_dt_dynamic(), get_relocs_entry_from_sections(), NULL, rz_return_val_if_fail, rz_vector_free(), rz_vector_len(), and rz_vector_new().
Referenced by init().
Return a list of string representing flag options.
elf | flag |
Compare the flag to common option such as SHF_WRITE, SHF_ALLOC, ect
Definition at line 298 of file elf_sections.c.
References flag_translation::flag, flag_translation_table, i, NULL, RZ_ARRAY_SIZE, rz_list_append(), rz_list_free(), and rz_list_new().
Return a string representing the elf type.
elf | type |
Compare the type SHT_NULL, SHT_PROGBITS, etc and return the string representation
Definition at line 422 of file elf_sections.c.
References i, PFMT64x, RZ_ARRAY_SIZE, rz_str_new(), rz_str_newf(), SHT_HIPROC, SHT_HIUSER, SHT_LOPROC, SHT_LOUSER, type, and type_translation_table.
RZ_OWN RzVector* Elf_() rz_bin_elf_sections_new | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 378 of file elf_sections.c.
References Elf_, get_shdr_entry(), i, NULL, rz_bin_elf_check_array(), RZ_LOG_WARN, rz_return_val_if_fail, rz_vector_free(), rz_vector_new(), rz_vector_push(), and ut64().
Referenced by init().
RZ_OWN RzVector* Elf_() rz_bin_elf_segments_new | ( | RZ_NONNULL ELFOBJ * | bin, |
RzVector * | sections, | ||
RZ_NONNULL RzBinObjectLoadOptions * | options | ||
) |
Definition at line 133 of file elf_segments.c.
References count, Elf_, get_number_of_segments(), get_segments_from_phdr(), NULL, options, rz_bin_elf_check_array(), RZ_LOG_WARN, rz_return_val_if_fail, and sections().
Referenced by init_phdr_aux().
void Elf_() rz_bin_elf_strtab_free | ( | RzBinElfStrtab * | ptr | ) |
Definition at line 72 of file elf_strtab.c.
References free().
Referenced by get_section_elf_symbols(), rz_bin_elf_free(), and rz_bin_elf_strtab_new().
RZ_BORROW const char* Elf_() rz_bin_elf_strtab_get | ( | RZ_NONNULL RzBinElfStrtab * | strtab, |
ut64 | index | ||
) |
Definition at line 8 of file elf_strtab.c.
References Elf_, NULL, rz_bin_elf_strtab_has_index(), and rz_return_val_if_fail.
Referenced by get_vernaux_entry_sdb(), get_verneed_entry_sdb_aux(), get_versym_entry_sdb_from_verdef(), and get_versym_entry_sdb_from_verneed().
RZ_OWN char* Elf_() rz_bin_elf_strtab_get_dup | ( | RZ_NONNULL RzBinElfStrtab * | strtab, |
ut64 | index | ||
) |
Definition at line 52 of file elf_strtab.c.
References Elf_, NULL, rz_bin_elf_strtab_has_index(), rz_return_val_if_fail, and strdup().
Referenced by rz_bin_elf_get_libs(), rz_bin_elf_get_rpath(), set_elf_section_name(), and set_elf_symbol_name().
bool Elf_() rz_bin_elf_strtab_has_index | ( | RZ_NONNULL RzBinElfStrtab * | strtab, |
ut64 | index | ||
) |
Definition at line 67 of file elf_strtab.c.
References rz_return_val_if_fail.
Referenced by rz_bin_elf_strtab_get(), rz_bin_elf_strtab_get_dup(), and set_elf_section_name().
RZ_OWN RzBinElfStrtab* Elf_() rz_bin_elf_strtab_new | ( | RZ_NONNULL ELFOBJ * | bin, |
ut64 | offset, | ||
ut64 | size | ||
) |
Definition at line 18 of file elf_strtab.c.
References rz_bin_elf_strtab::data, Elf_, NULL, PFMT64x, rz_bin_elf_check_array(), rz_bin_elf_strtab_free(), rz_buf_read_at(), RZ_LOG_WARN, RZ_NEW, RZ_NEWS, rz_return_val_if_fail, and rz_bin_elf_strtab::size.
Referenced by get_section_elf_symbols(), init_dynstr_aux(), and init_shstrtab_aux().
RZ_OWN RzVector* Elf_() rz_bin_elf_symbols_new | ( | RZ_NONNULL ELFOBJ * | bin | ) |
Definition at line 523 of file elf_symbols.c.
References Elf_(), filter_symbol(), NULL, rz_bin_elf_compute_symbols(), and rz_return_val_if_fail.
Referenced by init().
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().
RzBinElfNote |
Definition at line 182 of file elf.h.
Referenced by note_free(), parse_note_file(), parse_note_prstatus(), rz_bin_elf_get_sp_val(), and rz_bin_elf_notes_new().
RzBinElfSegment |
Definition at line 131 of file elf.h.
Referenced by compute_baddr_from_phdr(), compute_boffset_from_phdr(), elf_has_gnu_relro(), get_segments_from_phdr(), get_targets_map_base_from_segments(), init_dt_dynamic(), rz_bin_elf_get_intrp(), rz_bin_elf_get_segment_with_type(), rz_bin_elf_has_nx(), rz_bin_elf_is_static(), rz_bin_elf_notes_new(), rz_bin_elf_p2v(), and rz_bin_elf_v2p().