12 RZ_LOG_WARN(
"Failed to read ELF header (e_phnum) in tiny elf mode.\n")
19 return bin->size == 45;
38 RZ_LOG_WARN(
"Failed to read beginning of the ELF header (until e_phnum).\n")
43 RZ_LOG_WARN(
"Failed to read ELF header (e_phnum).\n")
47 RZ_LOG_WARN(
"Failed to read ELF header (e_shentsize).\n")
51 RZ_LOG_WARN(
"Failed to read ELF header (e_shnum).\n")
55 RZ_LOG_WARN(
"Failed to read ELF header (e_shstrndx).\n")
59 RZ_LOG_WARN(
"The binary seems to be a tiny elf (45 bytes). Reload e_phnum value.\n");
60 bin->ehdr.e_phnum = get_tiny_elf_phnum(
bin);
71 char *
tmp = get_value(
bin);
103 return rz_str_newf(
"%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x",
104 bin->ehdr.e_ident[0],
105 bin->ehdr.e_ident[1],
106 bin->ehdr.e_ident[2],
107 bin->ehdr.e_ident[3],
108 bin->ehdr.e_ident[4],
109 bin->ehdr.e_ident[5],
110 bin->ehdr.e_ident[6],
111 bin->ehdr.e_ident[7],
112 bin->ehdr.e_ident[8],
113 bin->ehdr.e_ident[9],
114 bin->ehdr.e_ident[10],
115 bin->ehdr.e_ident[11],
116 bin->ehdr.e_ident[12],
117 bin->ehdr.e_ident[13],
118 bin->ehdr.e_ident[14],
119 bin->ehdr.e_ident[15]);
188 RZ_LOG_WARN(
"Failed to read ELF header e_ident.\n")
bool Elf_() rz_bin_elf_read_addr(RZ_NONNULL ELFOBJ *bin, RZ_NONNULL RZ_INOUT ut64 *offset, RZ_NONNULL RZ_OUT Elf_(Addr) *result)
bool Elf_() rz_bin_elf_read_char(RZ_NONNULL ELFOBJ *bin, RZ_NONNULL RZ_INOUT ut64 *offset, RZ_NONNULL RZ_OUT ut8 *result)
bool Elf_() rz_bin_elf_read_off(RZ_NONNULL ELFOBJ *bin, RZ_NONNULL RZ_INOUT ut64 *offset, RZ_NONNULL RZ_OUT Elf_(Off) *result)
bool Elf_() rz_bin_elf_read_word(RZ_NONNULL ELFOBJ *bin, RZ_NONNULL RZ_INOUT ut64 *offset, RZ_NONNULL RZ_OUT Elf_(Word) *result)
bool Elf_() rz_bin_elf_read_half(RZ_NONNULL ELFOBJ *bin, RZ_NONNULL RZ_INOUT ut64 *offset, RZ_NONNULL RZ_OUT Elf_(Half) *result)
RZ_OWN char *Elf_() rz_bin_elf_get_e_type_as_string(RZ_NONNULL ELFOBJ *bin)
RZ_OWN char *Elf_() rz_bin_elf_get_e_ehsize_as_string(RZ_NONNULL ELFOBJ *bin)
bool Elf_() rz_bin_elf_get_ehdr(RZ_NONNULL ELFOBJ *bin)
RZ_OWN char *Elf_() rz_bin_elf_get_e_phnum_as_string(RZ_NONNULL ELFOBJ *bin)
RZ_OWN char *Elf_() rz_bin_elf_get_e_shstrndx_as_string(RZ_NONNULL ELFOBJ *bin)
static bool read_ehdr_other_aux(ELFOBJ *bin, ut64 *offset)
static bool read_ehdr_other(ELFOBJ *bin)
RZ_OWN char *Elf_() rz_bin_elf_get_e_entry_as_string(RZ_NONNULL ELFOBJ *bin)
RZ_OWN char *Elf_() rz_bin_elf_get_e_shoff_as_string(RZ_NONNULL ELFOBJ *bin)
RZ_OWN char *Elf_() rz_bin_elf_get_e_shentsize_as_string(RZ_NONNULL ELFOBJ *bin)
RZ_OWN char *Elf_() rz_bin_elf_get_e_machine_as_string(RZ_NONNULL ELFOBJ *bin)
RZ_OWN char *Elf_() rz_bin_elf_get_e_flags_as_string(RZ_NONNULL ELFOBJ *bin)
RZ_OWN char *Elf_() rz_bin_elf_get_e_version_as_string(RZ_NONNULL ELFOBJ *bin)
RZ_OWN char *Elf_() rz_bin_elf_get_e_phoff_as_string(RZ_NONNULL ELFOBJ *bin)
RZ_OWN char *Elf_() rz_bin_elf_get_e_indent_as_string(RZ_NONNULL ELFOBJ *bin)
static bool is_tiny_elf(ELFOBJ *bin)
RZ_OWN char *Elf_() rz_bin_elf_get_e_shnum_as_string(RZ_NONNULL ELFOBJ *bin)
static bool print_ehdr_aux(ELFOBJ *bin, PrintfCallback cb, ut64 offset, const char *name, char *(*get_value)(ELFOBJ *bin))
static bool is_valid_elf_ident(ut8 *e_ident)
bool Elf_() rz_bin_elf_print_ehdr(ELFOBJ *bin, RZ_NONNULL PrintfCallback cb)
RZ_OWN char *Elf_() rz_bin_elf_get_e_phentsize_as_string(RZ_NONNULL ELFOBJ *bin)
#define E_PHENTSIZE_OFFSET
#define E_SHENTSIZE_OFFSET
#define E_ENTRYPOINT_OFFSET
#define E_SHSTRNDX_OFFSET
RZ_API void Ht_() free(HtName_(Ht) *ht)
return memset(p, 0, total)
#define rz_return_val_if_fail(expr, val)
RZ_API st64 rz_buf_read_at(RZ_NONNULL RzBuffer *b, ut64 addr, RZ_NONNULL RZ_OUT ut8 *buf, ut64 len)
Read len bytes of the buffer at the specified address.
#define RZ_LOG_WARN(fmtstr,...)
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
int(* PrintfCallback)(const char *str,...) RZ_PRINTF_CHECK(1
ut64(WINAPI *w32_GetEnabledXStateFeatures)()