Rizin
unix-like reverse engineering framework and cli tools
|
#include "elf.h"
Go to the source code of this file.
Classes | |
struct | mips_bits_translation |
struct | section_note_osabi_translation |
struct | machine_name_translation |
struct | class_translation |
struct | cpu_mips_translation |
struct | arch_translation |
struct | ver_flags_translation |
Macros | |
#define | EF_MIPS_ABI_O32 0x00001000 /* O32 ABI. */ |
#define | EF_MIPS_ABI_O64 0x00002000 /* O32 extended for 64 bit. */ |
#define | EF_MIPS_ABI 0x0000f000 |
#define | VERSYM_VERSION 0x7fff |
Variables | |
static const struct mips_bits_translation | mips_bits_translation_table [] |
static const struct section_note_osabi_translation | section_note_osabi_translation_table [] |
static const struct machine_name_translation | machine_name_translation_table [] |
static const struct class_translation | class_translation_table [] |
static const struct cpu_mips_translation | cpu_mips_translation_table [] |
static const struct arch_translation | arch_translation_table [] |
static const struct ver_flags_translation | ver_flags_translation_table [] |
#define EF_MIPS_ABI 0x0000f000 |
Definition at line 11 of file elf_info.c.
#define EF_MIPS_ABI_O32 0x00001000 /* O32 ABI. */ |
Definition at line 9 of file elf_info.c.
#define EF_MIPS_ABI_O64 0x00002000 /* O32 extended for 64 bit. */ |
Definition at line 10 of file elf_info.c.
#define VERSYM_VERSION 0x7fff |
Definition at line 13 of file elf_info.c.
|
static |
Definition at line 755 of file elf_info.c.
References Elf_(), free(), rz_bin_elf_get_abi(), rz_str_appendf(), and cmd_descs_generate::str.
Referenced by get_head_flag().
|
static |
Definition at line 766 of file elf_info.c.
References Elf_(), rz_bin_elf_get_cpu(), rz_str_append_owned(), and cmd_descs_generate::str.
Referenced by get_head_flag().
Definition at line 626 of file elf_info.c.
References EM_ARC_A5.
Referenced by rz_bin_elf_get_bits().
Definition at line 622 of file elf_info.c.
References Elf_(), EM_MIPS, and rz_bin_elf_has_segments().
Referenced by rz_bin_elf_get_bits().
Definition at line 539 of file elf_info.c.
References PT_LOAD, rz_bin_elf_foreach_segments, RZ_MIN, RzBinElfSegment, ut64(), and UT64_MAX.
Referenced by rz_bin_elf_get_baddr().
Definition at line 526 of file elf_info.c.
References PT_LOAD, rz_bin_elf_foreach_segments, RZ_MIN, RzBinElfSegment, ut64(), and UT64_MAX.
Referenced by rz_bin_elf_get_boffset().
|
static |
Definition at line 672 of file elf_info.c.
References DT_RPATH, DT_RUNPATH, path, rz_bin_elf_get_dt_info(), and ut64().
Referenced by add_abi_info(), add_cpu_info(), arch_is_mips(), elf_has_gnu_relro(), elf_is_bind_now(), get_bits_mips(), get_cpu_mips(), get_entry_offset_from_shdr(), get_gnu_verneed(), get_gnu_versym(), get_main_offset_arm64(), get_main_offset_arm_glibc(), 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_main_offset_x86_pie(), get_verdaux_entry_aux(), get_verdef_entry_aux(), get_vernaux_entry_aux(), get_vernaux_entry_sdb(), get_verneed_entry_aux(), get_verneed_entry_sdb(), get_verneed_entry_sdb_aux(), get_versym_entry_sdb_from_verdef(), get_versym_entry_sdb_from_verneed(), has_dt_rpath_entry(), has_thumb_symbol(), is_playstation_hack(), rz_bin_elf_get_baddr(), rz_bin_elf_get_bits(), rz_bin_elf_get_boffset(), rz_bin_elf_get_compiler(), rz_bin_elf_get_cpu(), rz_bin_elf_get_entry_offset(), rz_bin_elf_get_fini_offset(), rz_bin_elf_get_init_offset(), rz_bin_elf_get_intrp(), rz_bin_elf_get_libs(), rz_bin_elf_get_main_offset(), rz_bin_elf_get_rpath(), rz_bin_elf_get_symbols_info(), rz_bin_elf_has_nx(), rz_bin_elf_is_executable(), rz_bin_elf_is_static(), and rz_bin_elf_is_stripped().
Definition at line 566 of file elf_info.c.
References Elf_(), PT_GNU_RELRO, rz_bin_elf_get_segment_with_type(), rz_bin_elf_has_segments(), and RzBinElfSegment.
Referenced by rz_bin_elf_has_relro().
Definition at line 552 of file elf_info.c.
References DF_1_NOW, DT_BIND_NOW, DT_FLAGS_1, Elf_(), NULL, rz_bin_elf_get_dt_info(), and ut64().
Referenced by rz_bin_elf_has_relro().
Definition at line 789 of file elf_info.c.
References ET_HIOS, and ET_LOOS.
Referenced by rz_bin_elf_get_file_type().
Definition at line 785 of file elf_info.c.
References ET_HIPROC, and ET_LOPROC.
Referenced by rz_bin_elf_get_file_type().
|
static |
Definition at line 854 of file elf_info.c.
References is_elf_class64(), is_mips_n32(), is_mips_o32(), NULL, and strdup().
Referenced by rz_bin_elf_get_abi().
Definition at line 575 of file elf_info.c.
References EI_CLASS, ELFCLASS32, ELFCLASS64, and ELFCLASSNONE.
Referenced by rz_bin_elf_get_bits().
Definition at line 612 of file elf_info.c.
References EF_MIPS_ARCH, Elf_(), get_bits_mips_common(), and is_playstation_hack().
Referenced by rz_bin_elf_get_bits().
Definition at line 598 of file elf_info.c.
References i, mips_bits_translation_table, RZ_ARRAY_SIZE, and type.
Referenced by get_bits_mips().
|
static |
Definition at line 810 of file elf_info.c.
References arch, cpu_mips_translation_table, EF_MIPS_ARCH, Elf_(), i, RZ_ARRAY_SIZE, and strdup().
Referenced by rz_bin_elf_get_cpu().
|
static |
Definition at line 646 of file elf_info.c.
References addr, free(), NULL, read_elf_intrp(), rz_buf_size(), sdb_num_set(), sdb_set(), cmd_descs_generate::str, and ut64().
Referenced by rz_bin_elf_get_intrp().
Definition at line 507 of file elf_info.c.
References Elf_(), section::offset, rz_bin_elf_get_section_with_name(), and UT64_MAX.
Referenced by rz_bin_elf_get_entry_offset().
|
static |
Definition at line 793 of file elf_info.c.
References ET_CORE, ET_DYN, ET_EXEC, ET_NONE, ET_REL, NULL, and strdup().
Referenced by rz_bin_elf_get_file_type().
Definition at line 1247 of file elf_info.c.
References DT_VERNEED, DT_VERNEEDNUM, Elf_(), get_verneed_entry(), get_verneed_entry_sdb(), i, key, NULL, rz_bin_elf_get_dt_info(), rz_bin_elf_v2p(), RZ_LOG_WARN, rz_strf, sdb_free(), sdb_new0(), sdb_ns_set(), sdb_num_set(), ut64(), and UT64_MAX.
Referenced by rz_bin_elf_get_symbols_info().
Definition at line 1089 of file elf_info.c.
References DT_VERSYM, Elf_(), get_versym_entry_sdb_from_verdef(), get_versym_entry_sdb_from_verneed(), i, key, NULL, rz_bin_elf_get_dt_info(), rz_bin_elf_read_versym(), rz_bin_elf_v2p(), rz_strf, sdb_free(), sdb_new0(), sdb_num_set(), sdb_set(), ut64(), UT64_MAX, VER_NDX_GLOBAL, and VER_NDX_LOCAL.
Referenced by rz_bin_elf_get_symbols_info().
|
static |
Definition at line 776 of file elf_info.c.
References add_abi_info(), add_cpu_info(), and NULL.
Referenced by rz_bin_elf_get_head_flag().
Definition at line 488 of file elf_info.c.
References Elf_(), rz_bin_elf_p2v(), rz_bin_elf_v2p(), rz_read_le32(), ut64(), and UT64_MAX.
Referenced by rz_bin_elf_get_main_offset().
Definition at line 477 of file elf_info.c.
References Elf_(), get_main_offset_arm_glibc_non_thumb(), get_main_offset_arm_glibc_thumb(), rz_bin_elf_is_thumb_addr(), and UT64_MAX.
Referenced by rz_bin_elf_get_main_offset().
Definition at line 465 of file elf_info.c.
References Elf_(), rz_bin_elf_v2p(), rz_read_le32(), and UT64_MAX.
Referenced by get_main_offset_arm_glibc().
Definition at line 443 of file elf_info.c.
References delta, Elf_(), rz_bin_elf_v2p(), rz_buf_size(), rz_read_le32(), autogen_x86imm::tmp, ut64(), and UT64_MAX.
Referenced by get_main_offset_arm_glibc().
Definition at line 296 of file elf_info.c.
References rz_bin_elf_symbol_t::name, rz_bin_elf_symbol_t::paddr, rz_bin_elf_foreach_symbols, UT64_MAX, and rz_bin_elf_symbol_t::vaddr.
Referenced by rz_bin_elf_get_main_offset().
Definition at line 311 of file elf_info.c.
References addr, Elf_(), p, rz_bin_elf_p2v(), rz_bin_elf_v2p(), rz_read_le32(), st32, ut64(), and UT64_MAX.
Referenced by rz_bin_elf_get_main_offset().
Definition at line 408 of file elf_info.c.
References delta, DT_PLTGOT, Elf_(), i, rz_bin_elf_get_dt_info(), rz_bin_elf_v2p(), rz_buf_read_at(), rz_read_le32(), ut64(), and UT64_MAX.
Referenced by rz_bin_elf_get_main_offset().
Definition at line 396 of file elf_info.c.
References addr, Elf_(), rz_bin_elf_p2v(), rz_bin_elf_v2p(), ut64(), and UT64_MAX.
Referenced by rz_bin_elf_get_main_offset().
Definition at line 344 of file elf_info.c.
References addr, Elf_(), rz_bin_elf_v2p(), rz_read_le32(), ut64(), and UT64_MAX.
Referenced by rz_bin_elf_get_main_offset().
Definition at line 364 of file elf_info.c.
References baddr(), Elf_(), rz_bin_elf_get_baddr(), rz_bin_elf_has_segments(), rz_bin_elf_p2v(), rz_buf_read_at(), rz_read_le32(), ut64(), and UT64_MAX.
Referenced by rz_bin_elf_get_main_offset().
|
static |
Definition at line 740 of file elf_info.c.
References EI_OSABI, ELFOSABI_FREEBSD, ELFOSABI_HPUX, ELFOSABI_LINUX, ELFOSABI_SOLARIS, NULL, and strdup().
Referenced by rz_bin_elf_get_osabi_name().
|
static |
Definition at line 706 of file elf_info.c.
References i, section_note_osabi_translation::note_name, NULL, RZ_ARRAY_SIZE, section_note_osabi_translation_table, SHT_NOTE, and strdup().
Referenced by get_osabi_name_from_shdr().
|
static |
Definition at line 720 of file elf_info.c.
References get_osabi_name_from_section_note(), NULL, rz_bin_elf_foreach_sections, and autogen_x86imm::tmp.
Referenced by rz_bin_elf_get_osabi_name().
|
static |
Definition at line 686 of file elf_info.c.
References ver_flags_translation::flag, flags, i, NULL, RZ_ARRAY_SIZE, rz_str_append(), strdup(), and ver_flags_translation_table.
Referenced by get_vernaux_entry_sdb().
Definition at line 916 of file elf_info.c.
References get_verdaux_entry_aux(), PFMT64x, and RZ_LOG_WARN.
Referenced by get_versym_entry_sdb_from_verdef().
Definition at line 911 of file elf_info.c.
References Elf_(), and rz_bin_elf_read_word().
Referenced by get_verdaux_entry().
Definition at line 935 of file elf_info.c.
References get_verdef_entry_aux(), PFMT64x, and RZ_LOG_WARN.
Referenced by get_versym_entry_sdb_from_verdef().
Definition at line 925 of file elf_info.c.
References Elf_(), rz_bin_elf_read_half(), and rz_bin_elf_read_word().
Referenced by get_verdef_entry().
Definition at line 952 of file elf_info.c.
References get_vernaux_entry_aux(), PFMT64x, and RZ_LOG_WARN.
Referenced by get_verneed_entry_sdb(), and get_versym_entry_sdb_from_verneed().
Definition at line 944 of file elf_info.c.
References Elf_(), rz_bin_elf_read_half(), and rz_bin_elf_read_word().
Referenced by get_vernaux_entry().
|
static |
Definition at line 1162 of file elf_info.c.
References Elf_(), flags, get_ver_flags(), NULL, rz_bin_elf_strtab_get(), sdb_free(), sdb_new0(), sdb_num_set(), sdb_set(), sdb_set_owned(), and autogen_x86imm::tmp.
Referenced by get_verneed_entry_sdb().
Definition at line 968 of file elf_info.c.
References get_verneed_entry_aux(), PFMT64x, and RZ_LOG_WARN.
Referenced by get_gnu_verneed(), and get_versym_entry_sdb_from_verneed().
Definition at line 960 of file elf_info.c.
References Elf_(), rz_bin_elf_read_half(), and rz_bin_elf_read_word().
Referenced by get_verneed_entry().
|
static |
Definition at line 1211 of file elf_info.c.
References Elf_(), get_vernaux_entry(), get_vernaux_entry_sdb(), get_verneed_entry_sdb_aux(), i, key, NULL, rz_strf, sdb_free(), sdb_ns_set(), and ut64().
Referenced by get_gnu_verneed().
|
static |
Definition at line 1189 of file elf_info.c.
References Elf_(), NULL, rz_bin_elf_strtab_get(), sdb_free(), sdb_new0(), sdb_num_set(), sdb_set(), and autogen_x86imm::tmp.
Referenced by get_verneed_entry_sdb().
|
static |
Definition at line 1035 of file elf_info.c.
References DT_VERDEF, DT_VERDEFNUM, Elf_(), get_verdaux_entry(), get_verdef_entry(), i, key, rz_bin_elf_get_dt_info(), rz_bin_elf_strtab_get(), rz_bin_elf_v2p(), rz_str_newf(), sdb_set_owned(), autogen_x86imm::tmp, ut64(), UT64_MAX, value, and VERSYM_VERSION.
Referenced by get_gnu_versym().
|
static |
Definition at line 977 of file elf_info.c.
References DT_VERNEED, DT_VERNEEDNUM, Elf_(), get_vernaux_entry(), get_verneed_entry(), i, key, rz_bin_elf_get_dt_info(), rz_bin_elf_strtab_get(), rz_bin_elf_v2p(), rz_str_newf(), sdb_set_owned(), autogen_x86imm::tmp, ut64(), UT64_MAX, value, and VERSYM_VERSION.
Referenced by get_gnu_versym().
Definition at line 702 of file elf_info.c.
References DT_RPATH, DT_RUNPATH, Elf_(), NULL, and rz_bin_elf_get_dt_info().
Referenced by rz_bin_elf_get_rpath().
Definition at line 587 of file elf_info.c.
References Elf_(), rz_bin_elf_symbol_t::paddr, rz_bin_elf_foreach_symbols, rz_bin_elf_is_thumb_addr(), and rz_bin_elf_symbol_t::vaddr.
Referenced by rz_bin_elf_get_bits().
Definition at line 822 of file elf_info.c.
References EI_CLASS, and ELFCLASS64.
Referenced by get_abi_mips().
Definition at line 842 of file elf_info.c.
References EF_MIPS_ABI, EF_MIPS_ABI2, EI_CLASS, and ELFCLASS32.
Referenced by get_abi_mips().
Definition at line 826 of file elf_info.c.
References EF_MIPS_ABI, EF_MIPS_ABI2, EF_MIPS_ABI_O32, EI_CLASS, and ELFCLASS32.
Referenced by get_abi_mips().
Definition at line 608 of file elf_info.c.
References EF_MIPS_ARCH_3, Elf_(), rz_bin_elf_is_executable(), and rz_bin_elf_is_static().
Referenced by get_bits_mips().
Definition at line 630 of file elf_info.c.
References addr, free(), malloc(), NULL, rz_buf_read_at(), and cmd_descs_generate::str.
Referenced by get_elf_intrp().
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().
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().
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().
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.
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_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.
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().
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.
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().
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_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.
|
static |
Definition at line 1 of file elf_info.c.
Referenced by rz_bin_elf_get_arch().
|
static |
Definition at line 1 of file elf_info.c.
Referenced by rz_bin_elf_get_elf_class().
|
static |
Definition at line 1 of file elf_info.c.
Referenced by get_cpu_mips().
|
static |
Definition at line 1 of file elf_info.c.
Referenced by rz_bin_elf_get_machine_name().
|
static |
Definition at line 1 of file elf_info.c.
Referenced by get_bits_mips_common().
|
static |
Definition at line 1 of file elf_info.c.
Referenced by get_osabi_name_from_section_note().
|
static |
Definition at line 1 of file elf_info.c.
Referenced by get_ver_flags().