Rizin
unix-like reverse engineering framework and cli tools
elf_sections.c
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2021 08A <08A@riseup.net>
2 // SPDX-FileCopyrightText: 2008-2020 nibble <nibble.ds@gmail.com>
3 // SPDX-FileCopyrightText: 2008-2020 pancake <pancake@nopcode.org>
4 // SPDX-FileCopyrightText: 2008-2020 alvaro_fe <alvaro.felipe91@gmail.com>
5 // SPDX-License-Identifier: LGPL-3.0-only
6 
7 #include "elf.h"
8 
11  const char *name;
12 };
13 
16  char *name;
17 };
18 
19 static const struct type_translation type_translation_table[] = {
20  { SHT_NULL, "NULL" },
21  { SHT_PROGBITS, "PROGBITS" },
22  { SHT_SYMTAB, "SYMTAB" },
23  { SHT_STRTAB, "STRTAB" },
24  { SHT_RELA, "RELA" },
25  { SHT_HASH, "HASH" },
26  { SHT_DYNAMIC, "DYNAMIC" },
27  { SHT_NOTE, "NOTE" },
28  { SHT_NOBITS, "NOBITS" },
29  { SHT_REL, "REL" },
30  { SHT_SHLIB, "SHLIB" },
31  { SHT_DYNSYM, "DYNSYM" },
32  { SHT_INIT_ARRAY, "INIT_ARRAY" },
33  { SHT_FINI_ARRAY, "FINI_ARRAY" },
34  { SHT_PREINIT_ARRAY, "PREINIT_ARRAY" },
35  { SHT_GROUP, "GROUP" },
36  { SHT_SYMTAB_SHNDX, "SYMTAB_SHNDX" },
37  { SHT_NUM, "NUM" },
38  { SHT_LOOS, "LOOS" },
39  { SHT_GNU_ATTRIBUTES, "GNU_ATTRIBUTES" },
40  { SHT_GNU_HASH, "GNU_HASH" },
41  { SHT_GNU_LIBLIST, "GNU_LIBLIST" },
42  { SHT_CHECKSUM, "CHECKSUM" },
43  { SHT_SUNW_move, "MOVE" },
44  { SHT_SUNW_COMDAT, "COMDAT" },
45  { SHT_SUNW_syminfo, "SYMINFO" },
46  { SHT_GNU_verdef, "VERDEF" },
47  { SHT_GNU_verneed, "VERNEED" },
48  { SHT_GNU_versym, "VERSYM" }
49 };
50 
51 static const struct flag_translation flag_translation_table[] = {
52  { SHF_WRITE, "write" },
53  { SHF_ALLOC, "alloc" },
54  { SHF_EXECINSTR, "execute" },
55  { SHF_MERGE, "merge" },
56  { SHF_STRINGS, "strings" },
57  { SHF_INFO_LINK, "info" },
58  { SHF_LINK_ORDER, "link_order" },
59  { SHF_OS_NONCONFORMING, "extra_os_processing_reqd" },
60  { SHF_GROUP, "group" },
61  { SHF_TLS, "TLS" },
62  { SHF_EXCLUDE, "exclude" },
63  { SHF_COMPRESSED, "compressed" }
64 };
65 
66 static bool create_section_from_phdr(ELFOBJ *bin, RzVector *result, const char *name, ut64 addr, ut64 sz) {
67  RzBinElfSection section = { 0 };
68 
70  if (section.offset == UT64_MAX) {
71  RZ_LOG_WARN("Failed to convert section virtual address to physical address.\n")
72  return false;
73  }
74 
75  section.rva = addr;
76  section.size = sz;
77  section.name = strdup(name);
78  if (!section.name) {
79  return false;
80  }
81 
82  if (!rz_vector_push(result, &section)) {
83  return false;
84  }
85 
86  return true;
87 }
88 
89 static const char *get_plt_name(ELFOBJ *bin) {
90  ut64 dt_pltrel;
91 
92  if (!Elf_(rz_bin_elf_get_dt_info)(bin, DT_PLTREL, &dt_pltrel)) {
93  return NULL;
94  }
95 
96  if (dt_pltrel == DT_REL) {
97  return ".rel.plt";
98  }
99 
100  return ".rela.plt";
101 }
102 
103 static bool create_section_plt(ELFOBJ *bin, RzVector *result) {
104  ut64 addr;
105  ut64 size;
106 
107  const char *plt_name = get_plt_name(bin);
108  if (!plt_name) {
109  return true;
110  }
111 
113  return true;
114  }
115 
116  return create_section_from_phdr(bin, result, plt_name, addr, size);
117 }
118 
119 static void rz_bin_elf_section_free(void *e, RZ_UNUSED void *user) {
120  RzBinElfSection *ptr = e;
121  free(ptr->name);
122 }
123 
125  ut64 addr;
126  ut64 size;
127 
129  if (!result) {
130  return NULL;
131  }
132 
133  // There is no info about the got size
135  if (!create_section_from_phdr(bin, result, ".got.plt", addr, 0)) {
136  rz_vector_free(result);
137  return NULL;
138  }
139  }
140 
142  if (!create_section_from_phdr(bin, result, ".rel.dyn", addr, size)) {
143  rz_vector_free(result);
144  return NULL;
145  }
146  }
147 
149  if (!create_section_from_phdr(bin, result, ".rela.dyn", addr, size)) {
150  rz_vector_free(result);
151  return NULL;
152  }
153  }
154 
155  if (!create_section_plt(bin, result)) {
156  rz_vector_free(result);
157  return NULL;
158  }
159 
160  if (!rz_vector_len(result)) {
161  rz_vector_free(result);
162  return NULL;
163  }
164 
165  return result;
166 }
167 
169  return Elf_(rz_bin_elf_read_word)(bin, &offset, &section->sh_name) &&
170  Elf_(rz_bin_elf_read_word)(bin, &offset, &section->sh_type) &&
172  Elf_(rz_bin_elf_read_addr)(bin, &offset, &section->sh_addr) &&
173  Elf_(rz_bin_elf_read_off)(bin, &offset, &section->sh_offset) &&
175  Elf_(rz_bin_elf_read_word)(bin, &offset, &section->sh_link) &&
176  Elf_(rz_bin_elf_read_word)(bin, &offset, &section->sh_info) &&
177  Elf_(rz_bin_elf_read_word_xword)(bin, &offset, &section->sh_addralign) &&
179 }
180 
181 static bool get_shdr_entry(ELFOBJ *bin, Elf_(Shdr) * section, ut64 offset) {
183  RZ_LOG_WARN("Failed to read section entry at 0x%" PFMT64x ".\n", offset);
184  return false;
185  }
186 
187  return true;
188 }
189 
190 static bool set_elf_section_name(ELFOBJ *bin, RzBinElfSection *section, Elf_(Shdr) * shdr, size_t id) {
191  if (!bin->shstrtab || !Elf_(rz_bin_elf_strtab_has_index)(bin->shstrtab, shdr->sh_name)) {
192  section->name = rz_str_newf("invalid%zu", id);
193  return false;
194  }
195 
196  if (shdr->sh_type == SHT_NULL) {
197  section->name = NULL;
198  return true;
199  }
200 
201  section->name = Elf_(rz_bin_elf_strtab_get_dup)(bin->shstrtab, shdr->sh_name);
202  if (section->name) {
203  return true;
204  }
205 
206  section->name = NULL;
207  return false;
208 }
209 
210 static bool set_elf_section_aux(ELFOBJ *bin, RzBinElfSection *section, Elf_(Shdr) * shdr, size_t id) {
211  section->offset = shdr->sh_offset;
212  section->size = shdr->sh_size;
213  section->align = shdr->sh_addralign;
214  section->flags = shdr->sh_flags;
215  section->link = shdr->sh_link;
216  section->info = shdr->sh_info;
217  section->type = shdr->sh_type;
218 
220  section->rva = bin->baddr + shdr->sh_offset;
221  } else {
222  if (shdr->sh_flags & SHF_ALLOC) {
223  section->rva = shdr->sh_addr;
224  } else {
225  section->rva = UT64_MAX;
226  }
227  }
228  return set_elf_section_name(bin, section, shdr, id);
229 }
230 
231 static bool verify_shdr_entry(ELFOBJ *bin, Elf_(Shdr) * section) {
232  if (section->sh_link != SHT_SUNW_COMDAT && section->sh_link >= bin->ehdr.e_shnum) {
233  return false;
234  }
235 
236  Elf_(Off) end_off;
237  if (!Elf_(rz_bin_elf_add_off)(&end_off, section->sh_offset, section->sh_size)) {
238  return false;
239  }
240 
241  if (section->sh_type != SHT_NOBITS && end_off > bin->size) {
242  return false;
243  }
244 
245  if (!Elf_(rz_bin_elf_add_addr)(NULL, section->sh_addr, section->sh_size)) {
246  return false;
247  }
248 
249  return true;
250 }
251 
253  bool tmp = set_elf_section_aux(bin, section, shdr, id);
254 
255  if (!option->elf_checks_sections) {
256  section->is_valid = true;
257  return true;
258  }
259 
260  section->is_valid = tmp && verify_shdr_entry(bin, shdr);
261  return section->is_valid;
262 }
263 
266 
267  if (!bin->sections) {
268  return NULL;
269  }
270 
271  if (index < rz_vector_len(bin->sections)) {
272  return rz_vector_index_ptr(bin->sections, index);
273  }
274 
275  return NULL;
276 }
277 
280 
283  if (section->is_valid && section->name && !strcmp(section->name, name)) {
284  return section;
285  }
286  }
287 
288  return NULL;
289 }
290 
299  RzList *flag_list = rz_list_new();
300  if (!flag_list) {
301  return NULL;
302  }
303 
304  for (size_t i = 0; i < RZ_ARRAY_SIZE(flag_translation_table); i++) {
306  if (!rz_list_append(flag_list, flag_translation_table[i].name)) {
307  rz_list_free(flag_list);
308  return NULL;
309  }
310  }
311  }
312 
313  return flag_list;
314 }
315 
318 
319  if (!set_elf_section(bin, options, &section, shdr, pos)) {
320  RZ_LOG_WARN("The section %zu at 0x%" PFMT64x " seems to be invalid.\n", pos, section.offset);
321  }
322 
323  return section;
324 }
325 
327  if (!sections) {
328  return NULL;
329  }
330 
332  if (!result) {
333  return NULL;
334  }
335 
336  size_t i;
337  Elf_(Shdr) * section;
340  if (!rz_vector_push(result, &tmp)) {
341  rz_vector_free(result);
342  return NULL;
343  }
344  }
345 
346  return result;
347 }
348 
351  if (result) {
352  return result;
353  }
354 
357  }
358 
359  return result;
360 }
361 
364 
366  if (!result) {
367  return NULL;
368  }
369 
370  if (!rz_vector_len(result)) {
371  rz_vector_free(result);
372  return NULL;
373  }
374 
375  return result;
376 }
377 
380 
381  if (!bin->ehdr.e_shnum) {
382  return NULL;
383  }
384 
385  if (!Elf_(rz_bin_elf_check_array)(bin, bin->ehdr.e_shoff, bin->ehdr.e_shnum, sizeof(Elf_(Phdr)))) {
386  RZ_LOG_WARN("Invalid section header (check array failed).\n");
387  return NULL;
388  }
389 
390  RzVector *result = rz_vector_new(sizeof(Elf_(Shdr)), NULL, NULL);
391  if (!result) {
392  return NULL;
393  }
394 
395  ut64 offset = bin->ehdr.e_shoff;
396 
397  for (size_t i = 0; i < bin->ehdr.e_shnum; i++) {
398  Elf_(Shdr) *section = rz_vector_push(result, NULL);
399  if (!section) {
400  rz_vector_free(result);
401  return NULL;
402  }
403 
404  if (!get_shdr_entry(bin, section, offset)) {
405  rz_vector_free(result);
406  return NULL;
407  }
408 
409  offset += sizeof(Elf_(Shdr));
410  }
411 
412  return result;
413 }
414 
423  for (size_t i = 0; i < RZ_ARRAY_SIZE(type_translation_table); i++) {
424  if (type == type_translation_table[i].type) {
426  }
427  }
428 
429  if (type >= SHT_LOPROC && type <= SHT_HIPROC) {
430  return rz_str_newf("LOPROC+0x%08" PFMT64x, type - SHT_LOPROC);
431  }
432 
433  if (type >= SHT_LOUSER && type <= SHT_HIUSER) {
434  return rz_str_newf("LOUSER+0x%08" PFMT64x, type - SHT_LOUSER);
435  }
436 
437  return rz_str_newf("0x%" PFMT64x, type);
438 }
439 
441  rz_return_val_if_fail(bin, false);
442 
443  return bin->sections;
444 }
#define e(frag)
lzma_index ** i
Definition: index.h:629
RzList * sections(RzBinFile *bf)
Definition: bin_ne.c:110
#define NULL
Definition: cris-opc.c:27
ut64 Elf_() rz_bin_elf_v2p(RZ_NONNULL ELFOBJ *bin, ut64 vaddr)
Convert a virtual address to the physical address.
Definition: elf.c:429
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: elf_misc.c:117
bool Elf_() rz_bin_elf_strtab_has_index(RZ_NONNULL RzBinElfStrtab *strtab, ut64 index)
Definition: elf_strtab.c:67
#define rz_bin_elf_foreach_sections(bin, section)
Definition: elf.h:30
bool Elf_() rz_bin_elf_add_off(Elf_(Off) *result, Elf_(Off) addr, Elf_(Off) value)
Definition: elf_misc.c:146
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
#define ELFOBJ
Definition: elf.h:24
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
bool Elf_() rz_bin_elf_get_dt_info(RZ_NONNULL ELFOBJ *bin, ut64 key, RZ_OUT ut64 *info)
Definition: elf_dynamic.c:120
bool Elf_() rz_bin_elf_has_segments(RZ_NONNULL ELFOBJ *bin)
Definition: elf_segments.c:149
bool Elf_() rz_bin_elf_add_addr(Elf_(Addr) *result, Elf_(Addr) addr, Elf_(Addr) value)
Definition: elf_misc.c:138
bool Elf_() rz_bin_elf_is_relocatable(RZ_NONNULL ELFOBJ *bin)
Check if the elf binary is relocatable.
Definition: elf_info.c:1662
RZ_OWN char *Elf_() rz_bin_elf_strtab_get_dup(RZ_NONNULL RzBinElfStrtab *strtab, ut64 index)
Definition: elf_strtab.c:52
bool Elf_() rz_bin_elf_check_array(RZ_NONNULL ELFOBJ *bin, Elf_(Off) offset, Elf_(Off) length, Elf_(Off) entry_size)
Definition: elf_misc.c:32
static bool create_section_plt(ELFOBJ *bin, RzVector *result)
Definition: elf_sections.c:103
static bool get_shdr_entry_aux(ELFOBJ *bin, Elf_(Shdr) *section, ut64 offset)
Definition: elf_sections.c:168
static const struct flag_translation flag_translation_table[]
Definition: elf_sections.c:51
static bool get_shdr_entry(ELFOBJ *bin, Elf_(Shdr) *section, ut64 offset)
Definition: elf_sections.c:181
static RzVector * get_sections_from_dt_dynamic(ELFOBJ *bin)
Definition: elf_sections.c:124
static bool set_elf_section(ELFOBJ *bin, RzBinObjectLoadOptions *option, RzBinElfSection *section, Elf_(Shdr) *shdr, size_t id)
Definition: elf_sections.c:252
static void rz_bin_elf_section_free(void *e, RZ_UNUSED void *user)
Definition: elf_sections.c:119
static bool set_elf_section_aux(ELFOBJ *bin, RzBinElfSection *section, Elf_(Shdr) *shdr, size_t id)
Definition: elf_sections.c:210
RZ_BORROW RzBinElfSection *Elf_() rz_bin_elf_get_section(RZ_NONNULL ELFOBJ *bin, Elf_(Half) index)
Definition: elf_sections.c:264
static const char * get_plt_name(ELFOBJ *bin)
Definition: elf_sections.c:89
static RzBinElfSection convert_elf_section(ELFOBJ *bin, RzBinObjectLoadOptions *options, Elf_(Shdr) *shdr, size_t pos)
Definition: elf_sections.c:316
static const struct type_translation type_translation_table[]
Definition: elf_sections.c:19
RZ_BORROW RzBinElfSection *Elf_() rz_bin_elf_get_section_with_name(RZ_NONNULL ELFOBJ *bin, RZ_NONNULL const char *name)
Definition: elf_sections.c:278
RZ_OWN RzVector *Elf_() rz_bin_elf_sections_new(RZ_NONNULL ELFOBJ *bin)
Definition: elf_sections.c:378
static bool verify_shdr_entry(ELFOBJ *bin, Elf_(Shdr) *section)
Definition: elf_sections.c:231
static bool set_elf_section_name(ELFOBJ *bin, RzBinElfSection *section, Elf_(Shdr) *shdr, size_t id)
Definition: elf_sections.c:190
static RzVector * convert_sections_from_shdr(ELFOBJ *bin, RzBinObjectLoadOptions *options, RzVector *sections)
Definition: elf_sections.c:326
static bool create_section_from_phdr(ELFOBJ *bin, RzVector *result, const char *name, ut64 addr, ut64 sz)
Definition: elf_sections.c:66
RZ_OWN char *Elf_() rz_bin_elf_section_type_to_string(ut64 type)
Return a string representing the elf type.
Definition: elf_sections.c:422
RZ_OWN RzVector *Elf_() rz_bin_elf_convert_sections(RZ_NONNULL ELFOBJ *bin, RZ_NONNULL RzBinObjectLoadOptions *options, RzVector *sections)
Definition: elf_sections.c:362
bool Elf_() rz_bin_elf_has_sections(RZ_NONNULL ELFOBJ *bin)
Definition: elf_sections.c:440
static RzVector * convert_sections(ELFOBJ *bin, RzBinObjectLoadOptions *options, RzVector *sections)
Definition: elf_sections.c:349
RZ_OWN RzList *Elf_() rz_bin_elf_section_flag_to_rzlist(ut64 flag)
Return a list of string representing flag options.
Definition: elf_sections.c:298
#define Elf_(name)
Definition: elf_specs.h:32
#define SHT_SUNW_COMDAT
Definition: glibc_elf.h:456
#define SHT_CHECKSUM
Definition: glibc_elf.h:453
#define SHT_NUM
Definition: glibc_elf.h:448
#define SHT_SUNW_move
Definition: glibc_elf.h:455
#define SHF_COMPRESSED
Definition: glibc_elf.h:480
#define SHF_EXCLUDE
Definition: glibc_elf.h:484
#define SHT_SUNW_syminfo
Definition: glibc_elf.h:457
RZ_API void Ht_() free(HtName_(Ht) *ht)
Definition: ht_inc.c:130
voidpf void uLong size
Definition: ioapi.h:138
voidpf uLong offset
Definition: ioapi.h:144
#define SHF_WRITE
Definition: common.h:376
#define SHT_FINI_ARRAY
Definition: common.h:345
#define SHT_NULL
Definition: common.h:331
#define SHT_SYMTAB_SHNDX
Definition: common.h:348
#define DT_PLTGOT
Definition: common.h:540
#define SHF_TLS
Definition: common.h:385
#define SHT_GNU_LIBLIST
Definition: common.h:355
#define SHT_REL
Definition: common.h:340
#define SHT_LOOS
Definition: common.h:350
#define SHT_GNU_ATTRIBUTES
Definition: common.h:353
#define SHF_LINK_ORDER
Definition: common.h:382
#define SHF_ALLOC
Definition: common.h:377
#define SHT_DYNAMIC
Definition: common.h:337
#define SHF_MERGE
Definition: common.h:379
#define SHT_HASH
Definition: common.h:336
#define SHT_SYMTAB
Definition: common.h:333
#define SHT_PROGBITS
Definition: common.h:332
#define SHF_OS_NONCONFORMING
Definition: common.h:383
#define SHT_GNU_verdef
Definition: common.h:364
#define SHT_LOPROC
Definition: common.h:368
#define SHF_INFO_LINK
Definition: common.h:381
#define DT_RELSZ
Definition: common.h:555
#define SHT_LOUSER
Definition: common.h:370
#define SHT_NOTE
Definition: common.h:338
#define DT_RELASZ
Definition: common.h:545
#define SHT_NOBITS
Definition: common.h:339
#define DT_PLTREL
Definition: common.h:557
#define SHT_GNU_HASH
Definition: common.h:354
#define SHT_GNU_versym
Definition: common.h:366
#define SHF_STRINGS
Definition: common.h:380
#define DT_REL
Definition: common.h:554
#define SHT_GNU_verneed
Definition: common.h:365
#define SHT_HIPROC
Definition: common.h:369
#define DT_PLTRELSZ
Definition: common.h:539
#define SHT_INIT_ARRAY
Definition: common.h:344
#define SHT_PREINIT_ARRAY
Definition: common.h:346
#define SHT_DYNSYM
Definition: common.h:342
#define SHF_EXECINSTR
Definition: common.h:378
#define SHT_RELA
Definition: common.h:335
#define SHT_SHLIB
Definition: common.h:341
#define DT_JMPREL
Definition: common.h:560
#define SHT_GROUP
Definition: common.h:347
#define SHT_HIUSER
Definition: common.h:372
#define SHF_GROUP
Definition: common.h:384
#define DT_RELA
Definition: common.h:544
#define SHT_STRTAB
Definition: common.h:334
RZ_API RZ_OWN RzList * rz_list_new(void)
Returns a new initialized RzList pointer (free method is not initialized)
Definition: list.c:235
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
Definition: list.c:288
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
Definition: list.c:137
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
static const char struct stat static buf struct stat static buf static vhangup int options
Definition: sflib.h:145
int type
Definition: mipsasm.c:17
const char * name
Definition: op.c:541
#define rz_return_val_if_fail(expr, val)
Definition: rz_assert.h:108
#define RZ_LOG_WARN(fmtstr,...)
Definition: rz_log.h:56
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
RZ_API char * rz_str_new(const char *str)
Definition: str.c:865
#define RZ_OWN
Definition: rz_types.h:62
#define RZ_UNUSED
Definition: rz_types.h:73
#define RZ_NONNULL
Definition: rz_types.h:64
#define RZ_ARRAY_SIZE(x)
Definition: rz_types.h:300
#define PFMT64x
Definition: rz_types.h:393
#define RZ_BORROW
Definition: rz_types.h:63
#define UT64_MAX
Definition: rz_types_base.h:86
static void * rz_vector_index_ptr(RzVector *vec, size_t index)
Definition: rz_vector.h:88
RZ_API void * rz_vector_push(RzVector *vec, void *x)
Definition: vector.c:197
RZ_API void rz_vector_free(RzVector *vec)
Definition: vector.c:75
RZ_API RzVector * rz_vector_new(size_t elem_size, RzVectorFree free, void *free_user)
Definition: vector.c:42
static size_t rz_vector_len(const RzVector *vec)
Definition: rz_vector.h:82
#define rz_vector_enumerate(vec, it, i)
Definition: rz_vector.h:177
Definition: malloc.c:26
Definition: z80asm.h:102
Definition: getopt.h:84
uint32_t offset
uint32_t flags
uint32_t size
uint32_t align
const char * name
Definition: elf_sections.c:11
int pos
Definition: main.c:11
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static int addr
Definition: z80asm.c:58