Rizin
unix-like reverse engineering framework and cli tools
|
#include "elf.h"
Go to the source code of this file.
Macros | |
#define | MIPS_PLT_OFFSET 0x20 |
#define | RISCV_PLT_ENTRY_SIZE 0x10 |
#define | RISCV_PLT_OFFSET 0x20 |
#define | SPARC_OFFSET_PLT_ENTRY_FROM_GOT_ADDR -0x6 |
#define | X86_OFFSET_PLT_ENTRY_FROM_GOT_ADDR -0x6 |
#define | X86_PLT_ENTRY_SIZE 0x10 |
#define | COMPUTE_PLTGOT_POSITION(rel, pltgot_addr, n_initial_unused_entries) ((rel->vaddr - pltgot_addr - n_initial_unused_entries * sizeof(Elf_(Addr))) / sizeof(Elf_(Addr))) |
#define COMPUTE_PLTGOT_POSITION | ( | rel, | |
pltgot_addr, | |||
n_initial_unused_entries | |||
) | ((rel->vaddr - pltgot_addr - n_initial_unused_entries * sizeof(Elf_(Addr))) / sizeof(Elf_(Addr))) |
Definition at line 16 of file elf_imports.c.
#define MIPS_PLT_OFFSET 0x20 |
Definition at line 9 of file elf_imports.c.
#define RISCV_PLT_ENTRY_SIZE 0x10 |
Definition at line 10 of file elf_imports.c.
#define RISCV_PLT_OFFSET 0x20 |
Definition at line 11 of file elf_imports.c.
#define SPARC_OFFSET_PLT_ENTRY_FROM_GOT_ADDR -0x6 |
Definition at line 12 of file elf_imports.c.
#define X86_OFFSET_PLT_ENTRY_FROM_GOT_ADDR -0x6 |
Definition at line 13 of file elf_imports.c.
#define X86_PLT_ENTRY_SIZE 0x10 |
Definition at line 14 of file elf_imports.c.
|
static |
Definition at line 292 of file elf_imports.c.
References Elf_, get_import_offset(), rz_bin_elf_symbol_t::paddr, rz_bin_elf_v2p(), rz_bin_elf_symbol_t::size, UT64_MAX, and rz_bin_elf_symbol_t::vaddr.
Referenced by convert_elf_symbols_to_elf_imports().
Definition at line 305 of file elf_imports.c.
References convert_elf_symbol_to_elf_import(), rz_vector_foreach, and symbols().
Referenced by rz_bin_elf_analyse_imports().
Definition at line 312 of file elf_imports.c.
References Elf_, rz_bin_elf_is_relocatable(), and SHT_NULL.
Referenced by rz_bin_elf_analyse_imports().
|
static |
Definition at line 19 of file elf_imports.c.
References addr, Elf_, rz_bin_elf_reloc_t::paddr, rz_bin_elf_read_addr(), ut64(), and UT64_MAX.
Referenced by get_import_addr_arm(), get_import_addr_riscv(), get_import_addr_sparc(), and get_import_addr_x86().
Definition at line 268 of file elf_imports.c.
References Elf_, get_import_addr_aux(), rz_bin_elf_foreach_relocs, rz_bin_elf_has_dt_dynamic(), rz_bin_elf_has_relocs(), rz_bin_elf_reloc_t::sym, autogen_x86imm::tmp, ut64(), and UT64_MAX.
Referenced by get_import_offset().
|
static |
Definition at line 203 of file elf_imports.c.
References rz_bin_elf_reloc_t::addend, COMPUTE_PLTGOT_POSITION, DT_PLTGOT, Elf_, get_got_entry(), pos, RZ_AARCH64_IRELATIVE, RZ_AARCH64_JUMP_SLOT, RZ_AARCH64_RELATIVE, RZ_ARM_JUMP_SLOT, rz_bin_elf_get_dt_info(), rz_bin_elf_is_thumb_addr(), RZ_LOG_WARN, rz_bin_elf_reloc_t::type, ut64(), and UT64_MAX.
Referenced by get_import_addr_aux().
|
static |
Definition at line 242 of file elf_imports.c.
References EM_386, EM_AARCH64, EM_ARM, EM_MIPS, EM_PPC, EM_PPC64, EM_RISCV, EM_SPARC, EM_SPARC32PLUS, EM_SPARCV9, EM_X86_64, get_import_addr_arm(), get_import_addr_mips(), get_import_addr_ppc(), get_import_addr_riscv(), get_import_addr_sparc(), get_import_addr_x86(), PFMT64u, RZ_LOG_WARN, rz_bin_elf_reloc_t::type, ut64(), and UT64_MAX.
Referenced by get_import_addr().
|
static |
Definition at line 34 of file elf_imports.c.
References COMPUTE_PLTGOT_POSITION, DT_JMPREL, DT_MIPS_PLTGOT, DT_PLTRELSZ, Elf_, int, MIPS_PLT_OFFSET, pos, rz_bin_elf_get_dt_info(), rz_bin_elf_v2p(), rz_buf_read_at(), rz_mem_mem_aligned(), ut64(), and UT64_MAX.
Referenced by get_import_addr_aux().
|
static |
Definition at line 86 of file elf_imports.c.
References COMPUTE_PLTGOT_POSITION, DT_PLTGOT, Elf_, pos, rz_bin_elf_get_dt_info(), rz_bin_elf_get_num_relocs_dynamic_plt(), rz_bin_elf_v2p(), autogen_x86imm::tmp, ut64(), and UT64_MAX.
Referenced by get_import_addr_aux().
|
static |
Definition at line 60 of file elf_imports.c.
References COMPUTE_PLTGOT_POSITION, DT_PLTGOT, Elf_, get_got_entry(), pos, RISCV_PLT_ENTRY_SIZE, RISCV_PLT_OFFSET, rz_bin_elf_get_dt_info(), ut64(), and UT64_MAX.
Referenced by get_import_addr_aux().
|
static |
Definition at line 76 of file elf_imports.c.
References get_got_entry(), RZ_LOG_WARN, RZ_SPARC_JMP_SLOT, SPARC_OFFSET_PLT_ENTRY_FROM_GOT_ADDR, autogen_x86imm::tmp, rz_bin_elf_reloc_t::type, ut64(), and UT64_MAX.
Referenced by get_import_addr_aux().
|
static |
Definition at line 181 of file elf_imports.c.
References COMPUTE_PLTGOT_POSITION, DT_PLTGOT, Elf_, get_got_entry(), get_import_addr_x86_manual(), pos, rz_bin_elf_section_t::rva, rz_bin_elf_get_dt_info(), rz_bin_elf_get_section_with_name(), autogen_x86imm::tmp, ut64(), UT64_MAX, X86_OFFSET_PLT_ENTRY_FROM_GOT_ADDR, and X86_PLT_ENTRY_SIZE.
Referenced by get_import_addr_aux().
|
static |
Definition at line 120 of file elf_imports.c.
References DT_PLTGOT, Elf_, pos, rz_bin_elf_get_dt_info(), rz_bin_elf_get_section_with_name(), rz_bin_elf_has_relro(), RZ_BIN_ELF_PART_RELRO, rz_bin_elf_read_word(), rz_bin_elf_v2p(), s, autogen_x86imm::tmp, ut64(), UT64_MAX, and rz_bin_elf_reloc_t::vaddr.
Referenced by get_import_addr_x86().
|
static |
Definition at line 288 of file elf_imports.c.
References get_import_addr(), and rz_bin_elf_symbol_t::ordinal.
Referenced by convert_elf_symbol_to_elf_import().
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().
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.
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.