Rizin
unix-like reverse engineering framework and cli tools
elf_ehdr.c File Reference
#include "elf.h"

Go to the source code of this file.

Functions

static Elf_ (Half)
 
static bool is_tiny_elf (ELFOBJ *bin)
 
static bool read_ehdr_other_aux (ELFOBJ *bin, ut64 *offset)
 
static bool read_ehdr_other (ELFOBJ *bin)
 
static bool is_valid_elf_ident (ut8 *e_ident)
 
static bool print_ehdr_aux (ELFOBJ *bin, PrintfCallback cb, ut64 offset, const char *name, char *(*get_value)(ELFOBJ *bin))
 
RZ_OWN char *Elf_() rz_bin_elf_get_e_ehsize_as_string (RZ_NONNULL 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_flags_as_string (RZ_NONNULL ELFOBJ *bin)
 
RZ_OWN char *Elf_() rz_bin_elf_get_e_indent_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_phentsize_as_string (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_phoff_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_shnum_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_shstrndx_as_string (RZ_NONNULL ELFOBJ *bin)
 
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_version_as_string (RZ_NONNULL ELFOBJ *bin)
 
bool Elf_() rz_bin_elf_get_ehdr (RZ_NONNULL ELFOBJ *bin)
 
bool Elf_() rz_bin_elf_print_ehdr (ELFOBJ *bin, RZ_NONNULL PrintfCallback cb)
 

Function Documentation

◆ Elf_()

static Elf_ ( Half  )
static

Definition at line 7 of file elf_ehdr.c.

7  {
8  ut64 offset = 44;
9 
10  ut8 tmp;
11  if (!Elf_(rz_bin_elf_read_char)(bin, &offset, &tmp)) {
12  RZ_LOG_WARN("Failed to read ELF header (e_phnum) in tiny elf mode.\n")
13  }
14 
15  return tmp;
16 }
bool Elf_() rz_bin_elf_read_char(RZ_NONNULL ELFOBJ *bin, RZ_NONNULL RZ_INOUT ut64 *offset, RZ_NONNULL RZ_OUT ut8 *result)
Definition: elf_misc.c:52
static Elf_(Half)
Definition: elf_ehdr.c:7
voidpf uLong offset
Definition: ioapi.h:144
uint8_t ut8
Definition: lh5801.h:11
#define RZ_LOG_WARN(fmtstr,...)
Definition: rz_log.h:56
Definition: malloc.c:26
ut64(WINAPI *w32_GetEnabledXStateFeatures)()

References rz_bin_elf_read_char(), RZ_LOG_WARN, autogen_x86imm::tmp, and ut64().

Referenced by read_ehdr_other(), read_ehdr_other_aux(), rz_bin_elf_get_ehdr(), and rz_bin_elf_print_ehdr().

◆ is_tiny_elf()

static bool is_tiny_elf ( ELFOBJ bin)
static

Definition at line 18 of file elf_ehdr.c.

18  {
19  return bin->size == 45;
20 }

Referenced by read_ehdr_other().

◆ is_valid_elf_ident()

static bool is_valid_elf_ident ( ut8 e_ident)
static

Definition at line 66 of file elf_ehdr.c.

66  {
67  return !memcmp(e_ident, ELFMAG, SELFMAG) || !memcmp(e_ident, CGCMAG, SCGCMAG);
68 }
#define CGCMAG
Definition: elf_specs.h:82
#define SCGCMAG
Definition: elf_specs.h:83
#define SELFMAG
Definition: glibc_elf.h:122
#define ELFMAG
Definition: glibc_elf.h:121

References CGCMAG, ELFMAG, SCGCMAG, and SELFMAG.

Referenced by rz_bin_elf_get_ehdr().

◆ print_ehdr_aux()

static bool print_ehdr_aux ( ELFOBJ bin,
PrintfCallback  cb,
ut64  offset,
const char *  name,
char *(*)(ELFOBJ *bin get_value 
)
static

Definition at line 70 of file elf_ehdr.c.

70  {
71  char *tmp = get_value(bin);
72  if (!tmp) {
73  return false;
74  }
75 
76  cb("0x%08" PFMT64x " %-10s %s\n", offset, name, tmp);
77 
78  free(tmp);
79  return true;
80 }
RZ_API void Ht_() free(HtName_(Ht) *ht)
Definition: ht_inc.c:130
#define PFMT64x
Definition: rz_types.h:393
Definition: z80asm.h:102
static const char * cb[]
Definition: z80_tab.h:176

References cb, free(), PFMT64x, and autogen_x86imm::tmp.

Referenced by rz_bin_elf_print_ehdr().

◆ read_ehdr_other()

static bool read_ehdr_other ( ELFOBJ bin)
static

Definition at line 34 of file elf_ehdr.c.

34  {
36 
37  if (!read_ehdr_other_aux(bin, &offset)) {
38  RZ_LOG_WARN("Failed to read beginning of the ELF header (until e_phnum).\n")
39  return false;
40  }
41 
42  if (!Elf_(rz_bin_elf_read_half)(bin, &offset, &bin->ehdr.e_phnum)) {
43  RZ_LOG_WARN("Failed to read ELF header (e_phnum).\n")
44  }
45 
46  if (!Elf_(rz_bin_elf_read_half)(bin, &offset, &bin->ehdr.e_shentsize)) {
47  RZ_LOG_WARN("Failed to read ELF header (e_shentsize).\n")
48  }
49 
50  if (!Elf_(rz_bin_elf_read_half)(bin, &offset, &bin->ehdr.e_shnum)) {
51  RZ_LOG_WARN("Failed to read ELF header (e_shnum).\n")
52  }
53 
54  if (!Elf_(rz_bin_elf_read_half)(bin, &offset, &bin->ehdr.e_shstrndx)) {
55  RZ_LOG_WARN("Failed to read ELF header (e_shstrndx).\n")
56  }
57 
58  if (is_tiny_elf(bin)) {
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);
61  }
62 
63  return true;
64 }
#define false
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: elf_misc.c:57
static bool read_ehdr_other_aux(ELFOBJ *bin, ut64 *offset)
Definition: elf_ehdr.c:22
static bool is_tiny_elf(ELFOBJ *bin)
Definition: elf_ehdr.c:18
#define EI_NIDENT
Definition: internal.h:43
if(dbg->bits==RZ_SYS_BITS_64)
Definition: windows-arm64.h:4

References EI_NIDENT, Elf_(), is_tiny_elf(), read_ehdr_other_aux(), rz_bin_elf_read_half(), RZ_LOG_WARN, and ut64().

Referenced by rz_bin_elf_get_ehdr().

◆ read_ehdr_other_aux()

static bool read_ehdr_other_aux ( ELFOBJ bin,
ut64 offset 
)
static

Definition at line 22 of file elf_ehdr.c.

22  {
23  return Elf_(rz_bin_elf_read_half)(bin, offset, &bin->ehdr.e_type) &&
24  Elf_(rz_bin_elf_read_half)(bin, offset, &bin->ehdr.e_machine) &&
25  Elf_(rz_bin_elf_read_word)(bin, offset, &bin->ehdr.e_version) &&
26  Elf_(rz_bin_elf_read_addr)(bin, offset, &bin->ehdr.e_entry) &&
27  Elf_(rz_bin_elf_read_off)(bin, offset, &bin->ehdr.e_phoff) &&
28  Elf_(rz_bin_elf_read_off)(bin, offset, &bin->ehdr.e_shoff) &&
29  Elf_(rz_bin_elf_read_word)(bin, offset, &bin->ehdr.e_flags) &&
30  Elf_(rz_bin_elf_read_half)(bin, offset, &bin->ehdr.e_ehsize) &&
31  Elf_(rz_bin_elf_read_half)(bin, offset, &bin->ehdr.e_phentsize);
32 }
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: elf_misc.c:82
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: elf_misc.c:91
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: elf_misc.c:62

References Elf_(), rz_bin_elf_read_addr(), rz_bin_elf_read_half(), rz_bin_elf_read_off(), and rz_bin_elf_read_word().

Referenced by read_ehdr_other().

◆ rz_bin_elf_get_e_ehsize_as_string()

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.

82  {
84 
85  return rz_str_newf("%d", bin->ehdr.e_ehsize);
86 }
#define NULL
Definition: cris-opc.c:27
#define rz_return_val_if_fail(expr, val)
Definition: rz_assert.h:108
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1

References NULL, rz_return_val_if_fail, and rz_str_newf().

Referenced by rz_bin_elf_print_ehdr().

◆ rz_bin_elf_get_e_entry_as_string()

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.

88  {
90 
91  return rz_str_newf("0x%08" PFMT64x, (ut64)bin->ehdr.e_entry);
92 }

References NULL, PFMT64x, rz_return_val_if_fail, rz_str_newf(), and ut64().

Referenced by rz_bin_elf_print_ehdr().

◆ rz_bin_elf_get_e_flags_as_string()

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.

94  {
96 
97  return rz_str_newf("0x%04x", bin->ehdr.e_flags);
98 }

References NULL, rz_return_val_if_fail, and rz_str_newf().

Referenced by rz_bin_elf_print_ehdr().

◆ rz_bin_elf_get_e_indent_as_string()

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.

100  {
102 
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]);
120 }

References NULL, rz_return_val_if_fail, and rz_str_newf().

Referenced by rz_bin_elf_print_ehdr().

◆ rz_bin_elf_get_e_machine_as_string()

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.

122  {
124 
125  return rz_str_newf("0x%04x", bin->ehdr.e_machine);
126 }

References NULL, rz_return_val_if_fail, and rz_str_newf().

Referenced by rz_bin_elf_print_ehdr().

◆ rz_bin_elf_get_e_phentsize_as_string()

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.

128  {
130 
131  return rz_str_newf("%d", bin->ehdr.e_phentsize);
132 }

References NULL, rz_return_val_if_fail, and rz_str_newf().

Referenced by rz_bin_elf_print_ehdr().

◆ rz_bin_elf_get_e_phnum_as_string()

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.

134  {
136 
137  return rz_str_newf("%d", bin->ehdr.e_phnum);
138 }

References NULL, rz_return_val_if_fail, and rz_str_newf().

Referenced by rz_bin_elf_print_ehdr().

◆ rz_bin_elf_get_e_phoff_as_string()

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.

140  {
142 
143  return rz_str_newf("0x%08" PFMT64x, (ut64)bin->ehdr.e_phoff);
144 }

References NULL, PFMT64x, rz_return_val_if_fail, rz_str_newf(), and ut64().

Referenced by rz_bin_elf_print_ehdr().

◆ rz_bin_elf_get_e_shentsize_as_string()

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.

146  {
148 
149  return rz_str_newf("%d", bin->ehdr.e_shentsize);
150 }

References NULL, rz_return_val_if_fail, and rz_str_newf().

Referenced by rz_bin_elf_print_ehdr().

◆ rz_bin_elf_get_e_shnum_as_string()

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.

152  {
154 
155  return rz_str_newf("%d", bin->ehdr.e_shnum);
156 }

References NULL, rz_return_val_if_fail, and rz_str_newf().

Referenced by rz_bin_elf_print_ehdr().

◆ rz_bin_elf_get_e_shoff_as_string()

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.

158  {
160 
161  return rz_str_newf("0x%08" PFMT64x, (ut64)bin->ehdr.e_shoff);
162 }

References NULL, PFMT64x, rz_return_val_if_fail, rz_str_newf(), and ut64().

Referenced by rz_bin_elf_print_ehdr().

◆ rz_bin_elf_get_e_shstrndx_as_string()

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.

164  {
166 
167  return rz_str_newf("%d", bin->ehdr.e_shstrndx);
168 }

References NULL, rz_return_val_if_fail, and rz_str_newf().

Referenced by rz_bin_elf_print_ehdr().

◆ rz_bin_elf_get_e_type_as_string()

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.

170  {
172 
173  return rz_str_newf("0x%04x", bin->ehdr.e_type);
174 }

References NULL, rz_return_val_if_fail, and rz_str_newf().

Referenced by rz_bin_elf_print_ehdr().

◆ rz_bin_elf_get_e_version_as_string()

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.

176  {
178 
179  return rz_str_newf("0x%08x", bin->ehdr.e_version);
180 }

References NULL, rz_return_val_if_fail, and rz_str_newf().

Referenced by rz_bin_elf_print_ehdr().

◆ rz_bin_elf_get_ehdr()

bool Elf_() rz_bin_elf_get_ehdr ( RZ_NONNULL ELFOBJ bin)

Definition at line 182 of file elf_ehdr.c.

182  {
183  rz_return_val_if_fail(bin, false);
184 
185  memset(&bin->ehdr, 0, sizeof(Elf_(Ehdr)));
186 
187  if (rz_buf_read_at(bin->b, 0, bin->ehdr.e_ident, EI_NIDENT) < EI_NIDENT) {
188  RZ_LOG_WARN("Failed to read ELF header e_ident.\n")
189  return false;
190  }
191 
192  if (!is_valid_elf_ident(bin->ehdr.e_ident)) {
193  RZ_LOG_WARN("Invalid ELF identification.\n");
194  return false;
195  }
196 
197  bin->big_endian = bin->ehdr.e_ident[EI_DATA] == ELFDATA2MSB;
198 
199  return read_ehdr_other(bin);
200 }
static bool read_ehdr_other(ELFOBJ *bin)
Definition: elf_ehdr.c:34
static bool is_valid_elf_ident(ut8 *e_ident)
Definition: elf_ehdr.c:66
return memset(p, 0, total)
#define ELFDATA2MSB
Definition: common.h:59
#define EI_DATA
Definition: common.h:56
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.
Definition: buf.c:1136

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_bin_elf_print_ehdr()

bool Elf_() rz_bin_elf_print_ehdr ( ELFOBJ bin,
RZ_NONNULL PrintfCallback  cb 
)

Definition at line 202 of file elf_ehdr.c.

202  {
203  rz_return_val_if_fail(bin && cb, false);
204 
219 }
RZ_OWN char *Elf_() rz_bin_elf_get_e_type_as_string(RZ_NONNULL ELFOBJ *bin)
Definition: elf_ehdr.c:170
RZ_OWN char *Elf_() rz_bin_elf_get_e_ehsize_as_string(RZ_NONNULL ELFOBJ *bin)
Definition: elf_ehdr.c:82
RZ_OWN char *Elf_() rz_bin_elf_get_e_phnum_as_string(RZ_NONNULL ELFOBJ *bin)
Definition: elf_ehdr.c:134
RZ_OWN char *Elf_() rz_bin_elf_get_e_shstrndx_as_string(RZ_NONNULL ELFOBJ *bin)
Definition: elf_ehdr.c:164
RZ_OWN char *Elf_() rz_bin_elf_get_e_entry_as_string(RZ_NONNULL ELFOBJ *bin)
Definition: elf_ehdr.c:88
RZ_OWN char *Elf_() rz_bin_elf_get_e_shoff_as_string(RZ_NONNULL ELFOBJ *bin)
Definition: elf_ehdr.c:158
RZ_OWN char *Elf_() rz_bin_elf_get_e_shentsize_as_string(RZ_NONNULL ELFOBJ *bin)
Definition: elf_ehdr.c:146
RZ_OWN char *Elf_() rz_bin_elf_get_e_machine_as_string(RZ_NONNULL ELFOBJ *bin)
Definition: elf_ehdr.c:122
RZ_OWN char *Elf_() rz_bin_elf_get_e_flags_as_string(RZ_NONNULL ELFOBJ *bin)
Definition: elf_ehdr.c:94
RZ_OWN char *Elf_() rz_bin_elf_get_e_version_as_string(RZ_NONNULL ELFOBJ *bin)
Definition: elf_ehdr.c:176
RZ_OWN char *Elf_() rz_bin_elf_get_e_phoff_as_string(RZ_NONNULL ELFOBJ *bin)
Definition: elf_ehdr.c:140
RZ_OWN char *Elf_() rz_bin_elf_get_e_indent_as_string(RZ_NONNULL ELFOBJ *bin)
Definition: elf_ehdr.c:100
RZ_OWN char *Elf_() rz_bin_elf_get_e_shnum_as_string(RZ_NONNULL ELFOBJ *bin)
Definition: elf_ehdr.c:152
static bool print_ehdr_aux(ELFOBJ *bin, PrintfCallback cb, ut64 offset, const char *name, char *(*get_value)(ELFOBJ *bin))
Definition: elf_ehdr.c:70
RZ_OWN char *Elf_() rz_bin_elf_get_e_phentsize_as_string(RZ_NONNULL ELFOBJ *bin)
Definition: elf_ehdr.c:128
#define E_PHENTSIZE_OFFSET
Definition: elf_specs.h:54
#define E_MACHINE_OFFSET
Definition: elf_specs.h:47
#define E_TYPE_OFFSET
Definition: elf_specs.h:46
#define E_SHNUM_OFFSET
Definition: elf_specs.h:57
#define E_VERSION_OFFSET
Definition: elf_specs.h:48
#define E_IDENT_OFFSET
Definition: elf_specs.h:45
#define E_FLAGS_OFFSET
Definition: elf_specs.h:52
#define E_SHENTSIZE_OFFSET
Definition: elf_specs.h:56
#define E_PHOFF_OFFSET
Definition: elf_specs.h:50
#define E_ENTRYPOINT_OFFSET
Definition: elf_specs.h:49
#define E_SHOFF_OFFSET
Definition: elf_specs.h:51
#define E_PHNUM_OFFSET
Definition: elf_specs.h:55
#define E_SHSTRNDX_OFFSET
Definition: elf_specs.h:58
#define E_EHSIZE_OFFSET
Definition: elf_specs.h:53

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.