Rizin
unix-like reverse engineering framework and cli tools
bin_pe.inc
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2009-2019 nibble <nibble.ds@gmail.com>
2 // SPDX-FileCopyrightText: 2009-2019 pancake <pancake@nopcode.org>
3 // SPDX-FileCopyrightText: 2009-2019 alvarofe <alvaro.felipe91@gmail.com>
4 // SPDX-License-Identifier: LGPL-3.0-only
5 
6 #include <rz_types.h>
7 #include <rz_util.h>
8 #include <rz_lib.h>
9 #include <rz_bin.h>
10 #include "../i/private.h"
11 #include "pe/pe.h"
12 
13 static Sdb *get_sdb(RzBinFile *bf) {
14  RzBinObject *o = bf->o;
15  struct PE_(rz_bin_pe_obj_t) * bin;
16  if (!o || !o->bin_obj) {
17  return NULL;
18  }
19  bin = (struct PE_(rz_bin_pe_obj_t) *)o->bin_obj;
20  return bin ? bin->kv : NULL;
21 }
22 
23 static bool load_buffer(RzBinFile *bf, RzBinObject *obj, RzBuffer *buf, Sdb *sdb) {
24  rz_return_val_if_fail(bf && obj && buf, false);
25  struct PE_(rz_bin_pe_obj_t) *res = PE_(rz_bin_pe_new_buf)(buf, bf->rbin->verbose);
26  if (res) {
27  sdb_ns_set(sdb, "info", res->kv);
28  obj->bin_obj = res;
29  return true;
30  }
31  return false;
32 }
33 
34 static void destroy(RzBinFile *bf) {
36  ((struct PE_(rz_bin_pe_obj_t) *)bf->o->bin_obj);
37 }
38 
39 static ut64 baddr(RzBinFile *bf) {
40  return PE_(rz_bin_pe_get_image_base)(bf->o->bin_obj);
41 }
42 
44  struct rz_bin_pe_addr_t *peaddr = NULL;
45  RzBinAddr *ret = NULL;
46  if (bf && bf->o && bf->o->bin_obj) {
47  switch (type) {
49  peaddr = PE_(rz_bin_pe_get_main_vaddr)(bf->o->bin_obj);
50  break;
51  default:
52  break;
53  }
54  }
55  if (peaddr && (ret = RZ_NEW0(RzBinAddr))) {
56  ret->paddr = peaddr->paddr;
57  ret->vaddr = peaddr->vaddr;
58  }
59  free(peaddr);
60  return ret;
61 }
62 
63 static void add_tls_callbacks(RzBinFile *bf, RzList *list) {
65  int count = 0;
66  RzBinAddr *ptr = NULL;
67  struct PE_(rz_bin_pe_obj_t) *bin = (struct PE_(rz_bin_pe_obj_t) *)(bf->o->bin_obj);
68  char *key;
69 
70  do {
71  key = sdb_fmt("pe.tls_callback%d_paddr", count);
72  paddr = sdb_num_get(bin->kv, key, 0);
73  if (!paddr) {
74  break;
75  }
76 
77  key = sdb_fmt("pe.tls_callback%d_vaddr", count);
78  vaddr = sdb_num_get(bin->kv, key, 0);
79  if (!vaddr) {
80  break;
81  }
82 
83  key = sdb_fmt("pe.tls_callback%d_haddr", count);
84  haddr = sdb_num_get(bin->kv, key, 0);
85  if (!haddr) {
86  break;
87  }
88  if ((ptr = RZ_NEW0(RzBinAddr))) {
89  ptr->paddr = paddr;
90  ptr->vaddr = vaddr;
91  ptr->hpaddr = haddr;
93  rz_list_append(list, ptr);
94  }
95  count++;
96  } while (vaddr);
97 }
98 
99 static RzList *entries(RzBinFile *bf) {
100  struct rz_bin_pe_addr_t *entry = NULL;
101  RzBinAddr *ptr = NULL;
102  RzList *ret;
103 
104  if (!(ret = rz_list_newf(free))) {
105  return NULL;
106  }
107  if (!(entry = PE_(rz_bin_pe_get_entrypoint)(bf->o->bin_obj))) {
108  return ret;
109  }
110  if ((ptr = RZ_NEW0(RzBinAddr))) {
111  ptr->paddr = entry->paddr;
112  ptr->vaddr = entry->vaddr;
113  ptr->hpaddr = entry->haddr;
115  rz_list_append(ret, ptr);
116  }
117  free(entry);
118  // get TLS callback addresses
119  add_tls_callbacks(bf, ret);
120 
121  return ret;
122 }
123 
124 static ut32 perm_of_section_perm(ut64 perm) {
125  ut32 r = 0;
126  if (RZ_BIN_PE_SCN_IS_EXECUTABLE(perm)) {
127  r |= RZ_PERM_X;
128  r |= RZ_PERM_R; // implicit
129  }
130  if (RZ_BIN_PE_SCN_IS_WRITABLE(perm)) {
131  r |= RZ_PERM_W;
132  }
133  if (RZ_BIN_PE_SCN_IS_READABLE(perm)) {
134  r |= RZ_PERM_R;
135  }
136  if (RZ_BIN_PE_SCN_IS_SHAREABLE(perm)) {
137  r |= RZ_PERM_SHAR;
138  }
139  return r;
140 }
141 
142 static RzList *maps(RzBinFile *bf) {
143  struct PE_(rz_bin_pe_obj_t) *bin = (struct PE_(rz_bin_pe_obj_t) *)bf->o->bin_obj;
145  if (!bin || !(sections = bin->sections)) {
146  return NULL;
147  }
149  if (!ret) {
150  return NULL;
151  }
152  ut64 ba = baddr(bf);
154  if (!map) {
155  return ret;
156  }
157  map->name = strdup("header");
158  map->paddr = 0;
159  ut32 aligned_hdr_size = UT32_MAX;
160  if (bin->nt_headers->optional_header.FileAlignment != 0) {
161  aligned_hdr_size = RZ_ROUND(bin->nt_headers->optional_header.SizeOfHeaders, bin->nt_headers->optional_header.FileAlignment);
162  }
163  map->psize = RZ_MIN(bin->size, aligned_hdr_size);
164  map->vaddr = ba;
165  map->vsize = RZ_ROUND(map->psize, 4096);
166  map->perm = RZ_PERM_R;
167  rz_list_append(ret, map);
169  (bin, &sections);
170  for (size_t i = 0; !sections[i].last; i++) {
172  if (!map) {
173  break;
174  }
175  map->paddr = sections[i].paddr;
176  map->name = strdup((char *)sections[i].name);
177  map->psize = sections[i].size;
178  if (map->psize > bin->size) {
179  if (sections[i].vsize < bin->size) {
180  map->psize = sections[i].vsize;
181  } else {
182  // hack give it page size
183  map->psize = 4096;
184  }
185  }
186  map->vsize = sections[i].vsize;
187  if (!map->vsize && map->psize) {
188  map->vsize = map->psize;
189  }
190  map->vaddr = sections[i].vaddr + ba;
191  map->perm = perm_of_section_perm(sections[i].perm);
192  rz_list_append(ret, map);
193  }
194  return ret;
195 }
196 
197 static RzList *sections(RzBinFile *bf) {
198  RzList *ret = NULL;
199  RzBinSection *ptr = NULL;
201  struct PE_(rz_bin_pe_obj_t) *bin = (struct PE_(rz_bin_pe_obj_t) *)bf->o->bin_obj;
202  ut64 ba = baddr(bf);
203  int i;
205  return NULL;
206  }
207  if (!bin || !(sections = bin->sections)) {
208  rz_list_free(ret);
209  return NULL;
210  }
212  (bin, &sections);
213  for (i = 0; !sections[i].last; i++) {
214  if (!(ptr = RZ_NEW0(RzBinSection))) {
215  break;
216  }
217  ptr->name = strdup((char *)sections[i].name);
218  ptr->size = sections[i].size;
219  ptr->vsize = sections[i].vsize;
220  ptr->flags = sections[i].flags;
221  ptr->paddr = sections[i].paddr;
222  ptr->vaddr = sections[i].vaddr + ba;
223  ptr->perm = perm_of_section_perm(sections[i].perm);
224  if ((ptr->perm & RZ_PERM_R) && !(ptr->perm & RZ_PERM_X) && ptr->size > 0) {
225  ptr->is_data = true;
226  }
227  rz_list_append(ret, ptr);
228  }
229  if (rz_list_length(ret) == 1 && ptr->perm & RZ_PERM_R) {
230  // if there is only one section, then we expect to have data in here also.
231  ptr->is_data = true;
232  }
233  return ret;
234 }
235 
236 static void find_pe_overlay(RzBinFile *bf) {
237  ut64 pe_overlay_size;
238  ut64 pe_overlay_offset = PE_(bin_pe_get_overlay)(bf->o->bin_obj, &pe_overlay_size);
239  if (pe_overlay_offset) {
240  sdb_num_set(bf->sdb, "pe_overlay.offset", pe_overlay_offset, 0);
241  sdb_num_set(bf->sdb, "pe_overlay.size", pe_overlay_size, 0);
242  }
243 }
244 
245 static inline bool is_thumb(struct PE_(rz_bin_pe_obj_t) * bin, ut64 address) {
246  switch (bin->nt_headers->file_header.Machine) {
249  return address & 1;
250  default:
251  return false;
252  }
253 }
254 
255 static bool is_go_pclntab(ut8 *magic) {
256 #define IS_GOPCLNTAB_1_2_LE(x) (x[0] == 0xfb && x[1] == 0xff && x[2] == 0xff && x[3] == 0xff && x[4] == 0x00 && x[5] == 0x00)
257 #define IS_GOPCLNTAB_1_2_BE(x) (x[3] == 0xfb && x[2] == 0xff && x[1] == 0xff && x[0] == 0xff && x[4] == 0x00 && x[5] == 0x00)
258 #define IS_GOPCLNTAB_1_16_LE(x) (x[0] == 0xfa && x[1] == 0xff && x[2] == 0xff && x[3] == 0xff && x[4] == 0x00 && x[5] == 0x00)
259 #define IS_GOPCLNTAB_1_16_BE(x) (x[3] == 0xfa && x[2] == 0xff && x[1] == 0xff && x[0] == 0xff && x[4] == 0x00 && x[5] == 0x00)
260 #define IS_GOPCLNTAB_1_18_LE(x) (x[0] == 0xf0 && x[1] == 0xff && x[2] == 0xff && x[3] == 0xff && x[4] == 0x00 && x[5] == 0x00)
261 #define IS_GOPCLNTAB_1_18_BE(x) (x[3] == 0xf0 && x[2] == 0xff && x[1] == 0xff && x[0] == 0xff && x[4] == 0x00 && x[5] == 0x00)
262  return IS_GOPCLNTAB_1_2_LE(magic) || IS_GOPCLNTAB_1_2_BE(magic) ||
263  IS_GOPCLNTAB_1_16_LE(magic) || IS_GOPCLNTAB_1_16_BE(magic) ||
265 #undef IS_GOPCLNTAB_1_2_LE
266 #undef IS_GOPCLNTAB_1_2_BE
267 #undef IS_GOPCLNTAB_1_16_LE
268 #undef IS_GOPCLNTAB_1_16_BE
269 #undef IS_GOPCLNTAB_1_18_LE
270 #undef IS_GOPCLNTAB_1_18_BE
271 }
272 
273 static ut64 find_go_pclntab(RzBinFile *bf, ut32 *size, ut64 *vaddr) {
274  ut8 magic[16];
275  struct PE_(rz_bin_pe_obj_t) *bin = (struct PE_(rz_bin_pe_obj_t) *)bf->o->bin_obj;
276  struct rz_bin_pe_section_t *sections = bin->sections;
277  if (!sections) {
278  return 0;
279  }
280  ut64 ba = baddr(bf);
281  for (int i = 0; !sections[i].last; i++) {
282  if (!strstr((char *)sections[i].name, "data")) {
283  continue;
284  }
285  ut64 offset = sections[i].paddr;
286  ut32 section_size = sections[i].size;
287  for (ut32 pos = 0; pos < section_size; pos += 8) {
288  if ((section_size - pos) < 16) {
289  break;
290  }
291  rz_buf_read_at(bf->buf, offset + pos, magic, sizeof(magic));
292  if ((magic[6] != 1 && magic[6] != 2 && magic[6] != 4) || // pc quantum
293  (magic[7] != 4 && magic[7] != 8)) { // pointer size
294  continue;
295  }
296  if (is_go_pclntab(magic)) {
297  if (size) {
298  *size = section_size - pos;
299  }
300  if (vaddr) {
301  *vaddr = ba + sections[i].vaddr + pos;
302  }
303  return offset + pos;
304  }
305  }
306  }
307  return 0;
308 }
309 
310 static RzList *symbols(RzBinFile *bf) {
311  RzList *ret = NULL;
312  ut64 go_pclntab_paddr = 0;
313  ut64 go_pclntab_vaddr = 0;
314  ut32 go_pclntab_size = 0;
315  RzBinSymbol *ptr = NULL;
316  struct rz_bin_pe_export_t *symbols = NULL;
317  struct rz_bin_pe_import_t *imports = NULL;
318  struct PE_(rz_bin_pe_obj_t) *bin = bf->o->bin_obj;
319  int i;
320 
321  if (!(ret = rz_list_newf((RzListFree)rz_bin_symbol_free))) {
322  return NULL;
323  }
324  int file_bits = PE_(rz_bin_pe_get_bits(bin));
325  if ((symbols = PE_(rz_bin_pe_get_exports)(bf->o->bin_obj))) {
326  for (i = 0; !symbols[i].last; i++) {
327  if (!(ptr = RZ_NEW0(RzBinSymbol))) {
328  break;
329  }
330  ptr->name = strdup((char *)symbols[i].name);
331  ptr->libname = *symbols[i].libname ? strdup((char *)symbols[i].libname) : NULL;
332  ptr->forwarder = rz_str_constpool_get(&bf->rbin->constpool, (char *)symbols[i].forwarder);
333  // strncpy (ptr->bind, "NONE", RZ_BIN_SIZEOF_STRINGS);
335  ptr->type = RZ_BIN_TYPE_FUNC_STR;
336  ptr->size = 0;
337  if (is_thumb(bin, symbols[i].vaddr)) {
338  ptr->bits = 16;
339  ptr->vaddr = symbols[i].vaddr - 1;
340  ptr->paddr = symbols[i].paddr - 1;
341  } else {
342  ptr->bits = file_bits;
343  ptr->vaddr = symbols[i].vaddr;
344  ptr->paddr = symbols[i].paddr;
345  }
346  ptr->ordinal = symbols[i].ordinal;
347  rz_list_append(ret, ptr);
348  }
349  free(symbols);
350  }
351 
352  if ((go_pclntab_paddr = find_go_pclntab(bf, &go_pclntab_size, &go_pclntab_vaddr))) {
353  if (!(ptr = RZ_NEW0(RzBinSymbol))) {
354  return ret;
355  }
356  ptr->name = strdup("gopclntab");
359  ptr->size = go_pclntab_size;
360  ptr->bits = file_bits;
361  ptr->vaddr = go_pclntab_vaddr;
362  ptr->paddr = go_pclntab_paddr;
363  rz_list_append(ret, ptr);
364  }
365 
366  if ((imports = PE_(rz_bin_pe_get_imports)(bf->o->bin_obj))) {
367  for (i = 0; !imports[i].last; i++) {
368  if (!(ptr = RZ_NEW0(RzBinSymbol))) {
369  break;
370  }
371  // strncpy (ptr->name, (char*)symbols[i].name, RZ_BIN_SIZEOF_STRINGS);
372  ptr->name = strdup((const char *)imports[i].name);
373  ptr->libname = strdup((const char *)imports[i].libname);
374  ptr->is_imported = true;
375  // strncpy (ptr->forwarder, (char*)imports[i].forwarder, RZ_BIN_SIZEOF_STRINGS);
376  ptr->bind = "NONE";
377  ptr->type = RZ_BIN_TYPE_FUNC_STR;
378  ptr->size = 0;
379  ptr->vaddr = imports[i].vaddr;
380  ptr->paddr = imports[i].paddr;
381  ptr->ordinal = imports[i].ordinal;
382  rz_list_append(ret, ptr);
383  }
384  free(imports);
385  }
386 
387  // CLR symbols
388  RzList *clr_symbols = PE_(rz_bin_pe_get_clr_symbols)(bf->o->bin_obj);
389  if (clr_symbols) {
390  rz_list_join(ret, clr_symbols);
391  free(clr_symbols);
392  }
393 
394  find_pe_overlay(bf);
395  return ret;
396 }
397 
398 static void filter_import(ut8 *n) {
399  int I;
400  for (I = 0; n[I]; I++) {
401  if (n[I] < 30 || n[I] >= 0x7f) {
402  n[I] = 0;
403  break;
404  }
405  }
406 }
407 
408 static RzList *imports(RzBinFile *bf) {
409  RzList *relocs = NULL;
410  RzBinImport *ptr = NULL;
411  RzBinReloc *rel = NULL;
412  struct rz_bin_pe_import_t *imports = NULL;
413  int i;
414 
415  if (!bf || !bf->o || !bf->o->bin_obj) {
416  return NULL;
417  }
419  if (!ret) {
420  return NULL;
421  }
422 
423  // XXX: has_canary is causing problems! thus we need to check and clean here until it is fixed!
424  if (((struct PE_(rz_bin_pe_obj_t) *)bf->o->bin_obj)->relocs) {
425  rz_list_free(((struct PE_(rz_bin_pe_obj_t) *)bf->o->bin_obj)->relocs);
426  }
427 
428  if (!(relocs = rz_list_newf(free))) {
429  free(ret);
430  return NULL;
431  }
432  ((struct PE_(rz_bin_pe_obj_t) *)bf->o->bin_obj)->relocs = relocs;
433 
434  if (!(imports = PE_(rz_bin_pe_get_imports)(bf->o->bin_obj))) {
435  return ret;
436  }
437  for (i = 0; !imports[i].last; i++) {
438  if (!(ptr = RZ_NEW0(RzBinImport))) {
439  break;
440  }
442  ptr->name = strdup((char *)imports[i].name);
443  ptr->libname = strdup((char *)imports[i].libname);
444  ptr->bind = "NONE";
445  ptr->type = "FUNC";
446  ptr->ordinal = imports[i].ordinal;
447  // NOTE(eddyb) a PE hint is just an optional possible DLL export table
448  // index for the import. There is no point in exposing it.
449  // ptr->hint = imports[i].hint;
450  rz_list_append(ret, ptr);
451 
452  if (!(rel = RZ_NEW0(RzBinReloc))) {
453  break;
454  }
455 #ifdef RZ_BIN_PE64
456  rel->type = RZ_BIN_RELOC_64;
457 #else
458  rel->type = RZ_BIN_RELOC_32;
459 #endif
460  rel->additive = 0;
461  rel->import = ptr;
462  rel->addend = 0;
463  {
464  ut8 addr[4];
465  rz_buf_read_at(bf->buf, imports[i].paddr, addr, 4);
466  ut64 newaddr = (ut64)rz_read_le32(&addr);
467  rel->vaddr = newaddr;
468  }
469  rel->paddr = imports[i].paddr;
470  rz_list_append(relocs, rel);
471  }
472  free(imports);
473  return ret;
474 }
475 
476 static RzList *relocs(RzBinFile *bf) {
477  struct PE_(rz_bin_pe_obj_t) *obj = bf->o->bin_obj;
478  if (obj) {
479  return obj->relocs;
480  }
481  return NULL;
482 }
483 
484 static RzList *libs(RzBinFile *bf) {
485  struct rz_bin_pe_lib_t *libs = NULL;
486  RzList *ret = NULL;
487  char *ptr = NULL;
488  int i;
489 
490  if (!(ret = rz_list_new())) {
491  return NULL;
492  }
493  ret->free = free;
494  if (!(libs = PE_(rz_bin_pe_get_libs)(bf->o->bin_obj))) {
495  return ret;
496  }
497  for (i = 0; !libs[i].last; i++) {
498  ptr = strdup(libs[i].name);
499  rz_list_append(ret, ptr);
500  }
501  free(libs);
502  return ret;
503 }
504 
505 static RzList *resources(RzBinFile *bf) {
506  struct PE_(rz_bin_pe_obj_t) *obj = bf->o->bin_obj;
507  if (!obj) {
508  return NULL;
509  }
510 
512  if (!res) {
513  return NULL;
514  }
516  RzListIter *it;
517  size_t index = 0;
518  rz_list_foreach (obj->resources, it, rs) {
520  if (!br) {
521  goto err;
522  }
523 
524  br->index = index++;
525  br->name = strdup(rs->name);
526  if (!br->name) {
528  goto err;
529  }
530  br->time = strdup(rs->timestr);
531  if (!br->time) {
533  goto err;
534  }
535  br->vaddr = PE_(rz_bin_pe_get_image_base)(obj) + rs->data->OffsetToData;
536  br->size = rs->data->Size;
537  br->type = strdup(rs->type);
538  if (!br->type) {
540  goto err;
541  }
542  br->language = strdup(rs->language);
543  if (!br->language) {
545  goto err;
546  }
547 
548  rz_list_append(res, br);
549  }
550  return res;
551 
552 err:
553  rz_list_free(res);
554  return NULL;
555 }
556 
557 static bool is_dot_net(RzBinFile *bf) {
558  struct rz_bin_pe_lib_t *libs = NULL;
559  int i;
560  if (!(libs = PE_(rz_bin_pe_get_libs)(bf->o->bin_obj))) {
561  return false;
562  }
563  for (i = 0; !libs[i].last; i++) {
564  if (!strcmp(libs[i].name, "mscoree.dll")) {
565  free(libs);
566  return true;
567  }
568  }
569  free(libs);
570  return false;
571 }
572 
573 static bool is_vb6(RzBinFile *bf) {
574  struct rz_bin_pe_lib_t *libs = NULL;
575  int i;
576  if (!(libs = PE_(rz_bin_pe_get_libs)(bf->o->bin_obj))) {
577  return false;
578  }
579  for (i = 0; !libs[i].last; i++) {
580  if (!strcmp(libs[i].name, "msvbvm60.dll")) {
581  free(libs);
582  return true;
583  }
584  }
585  free(libs);
586  return false;
587 }
588 
589 static int has_canary(RzBinFile *bf) {
590  // XXX: We only need imports here but this causes leaks, we need to wait for the below. This is a horrible solution!
591  // TODO: use O(1) when imports sdbized
592  RzListIter *iter;
593  struct PE_(rz_bin_pe_obj_t) *bin = bf->o->bin_obj;
594  if (bin) {
595  const RzList *relocs_list = bin->relocs;
596  RzBinReloc *rel;
597  if (relocs_list) {
598  rz_list_foreach (relocs_list, iter, rel) {
599  if (!strcmp(rel->import->name, "__security_init_cookie")) {
600  return true;
601  }
602  }
603  }
604  } else { // rz_bin needs this as it will not initialise bin
605  const RzList *imports_list = imports(bf);
606  RzBinImport *imp;
607  if (imports_list) {
608  rz_list_foreach (imports_list, iter, imp) {
609  if (!strcmp(imp->name, "__security_init_cookie")) {
610  return true;
611  }
612  }
613  }
614  }
615  return false;
616 }
617 
618 static inline bool haschr(const struct PE_(rz_bin_pe_obj_t) * bin, ut16 dllCharacteristic) {
619  return bin->nt_headers->optional_header.DllCharacteristics & dllCharacteristic;
620 }
621 
622 static RzBinInfo *info(RzBinFile *bf) {
623  struct PE_(rz_bin_pe_obj_t) * bin;
624  SDebugInfo di = { { 0 } };
625  RzBinInfo *ret = RZ_NEW0(RzBinInfo);
626  ut32 claimed_checksum, actual_checksum, pe_overlay;
627 
628  if (!ret) {
629  return NULL;
630  }
631  bin = bf->o->bin_obj;
632  ret->file = strdup(bf->file);
633  ret->bclass = PE_(rz_bin_pe_get_class)(bf->o->bin_obj);
634  ret->rclass = strdup("pe");
635  ret->os = PE_(rz_bin_pe_get_os)(bf->o->bin_obj);
636  ret->arch = PE_(rz_bin_pe_get_arch)(bf->o->bin_obj);
637  ret->machine = PE_(rz_bin_pe_get_machine)(bf->o->bin_obj);
639  ret->default_cc = PE_(rz_bin_pe_get_cc)(bf->o->bin_obj);
640  if (is_dot_net(bf)) {
641  ret->lang = "cil";
642  }
643  if (is_vb6(bf)) {
644  ret->lang = "vb";
645  }
646 
647  if (PE_(rz_bin_pe_is_dll)(bf->o->bin_obj)) {
648  ret->type = strdup("DLL (Dynamic Link Library)");
649  } else {
650  ret->type = strdup("EXEC (Executable file)");
651  }
652  claimed_checksum = PE_(bin_pe_get_claimed_checksum)(bf->o->bin_obj);
653  actual_checksum = PE_(bin_pe_get_actual_checksum)(bf->o->bin_obj);
654  pe_overlay = sdb_num_get(bf->sdb, "pe_overlay.size", 0);
655  ret->bits = PE_(rz_bin_pe_get_bits)(bf->o->bin_obj);
657  ret->dbg_info = 0;
658  ret->has_canary = has_canary(bf);
661  ret->claimed_checksum = strdup(sdb_fmt("0x%08x", claimed_checksum));
662  ret->actual_checksum = strdup(sdb_fmt("0x%08x", actual_checksum));
663  ret->pe_overlay = pe_overlay > 0;
664  ret->signature = bin ? bin->is_signed : false;
665  Sdb *db = sdb_ns(bf->sdb, "pe", true);
666  sdb_bool_set(db, "canary", has_canary(bf), 0);
667  sdb_bool_set(db, "highva", haschr(bin, IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA), 0);
669  sdb_bool_set(db, "forceintegrity", haschr(bin, IMAGE_DLL_CHARACTERISTICS_FORCE_INTEGRITY), 0);
671  sdb_bool_set(db, "isolation", !haschr(bin, IMAGE_DLLCHARACTERISTICS_NO_ISOLATION), 0);
672  sdb_bool_set(db, "seh", !haschr(bin, IMAGE_DLLCHARACTERISTICS_NO_SEH), 0);
673  sdb_bool_set(db, "bind", !haschr(bin, IMAGE_DLLCHARACTERISTICS_NO_BIND), 0);
674  sdb_bool_set(db, "appcontainer", haschr(bin, IMAGE_DLLCHARACTERISTICS_APPCONTAINER), 0);
675  sdb_bool_set(db, "wdmdriver", haschr(bin, IMAGE_DLLCHARACTERISTICS_WDM_DRIVER), 0);
676  sdb_bool_set(db, "guardcf", haschr(bin, IMAGE_DLLCHARACTERISTICS_GUARD_CF), 0);
677  sdb_bool_set(db, "terminalserveraware", haschr(bin, IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE), 0);
678  sdb_num_set(db, "bits", ret->bits, 0);
679  sdb_set(db, "claimed_checksum", ret->claimed_checksum, 0);
680  sdb_set(db, "actual_checksum", ret->actual_checksum, 0);
681  sdb_bool_set(db, "is_authhash_valid", PE_(bin_pe_is_authhash_valid)(bf->o->bin_obj), 0);
682 
683  ret->has_va = true;
684 
687  }
690  }
692  ret->dbg_info |= RZ_BIN_DBG_SYMS;
693  }
695  ret->dbg_info |= RZ_BIN_DBG_RELOCS;
696  }
697  if (PE_(rz_bin_pe_get_debug_data)(bf->o->bin_obj, &di)) {
698  ret->guid = rz_str_ndup(di.guidstr, GUIDSTR_LEN);
699  if (ret->guid) {
701  if (!ret->debug_file_name) {
702  RZ_FREE(ret->guid);
703  }
704  }
705  }
706 
707  return ret;
708 }
709 
710 static ut64 get_vaddr(RzBinFile *bf, ut64 baddr, ut64 paddr, ut64 vaddr) {
711  return baddr + vaddr;
712 }
713 
714 static RzList *compute_hashes(RzBinFile *bf) {
716  const char *authentihash = PE_(bin_pe_get_authentihash)(bf->o->bin_obj);
717  if (authentihash) {
718  RzBinFileHash *authhash = RZ_NEW0(RzBinFileHash);
719  if (authhash) {
720  authhash->type = strdup("authentihash");
721  authhash->hex = strdup(authentihash);
722  rz_list_push(file_hashes, authhash);
723  }
724  }
725 
726  return file_hashes;
727 }
728 
729 static RzList *strings(RzBinFile *bf) {
730  return rz_bin_file_strings(bf, 4, false);
731 }
732 
737 static ut64 get_offset(RzBinFile *bf, int type, int idx) {
738  struct PE_(rz_bin_pe_obj_t) * bin;
739  Pe_image_clr *clr;
740 
741  if (!bf || !bf->o ||
742  !(bin = bf->o->bin_obj) ||
743  !(clr = bin->clr)) {
744  return UT64_MAX;
745  }
746 
747  if (type == 'd') { // MethodDef index
749  return PE_(rz_bin_pe_get_clr_methoddef_offset)(bin, methoddef);
750  }
751 
752  return UT64_MAX;
753 }
#define rs()
lzma_index ** i
Definition: index.h:629
#define I(x)
Definition: arc.h:164
static bool err
Definition: armass.c:435
RZ_API RZ_OWN RzList * rz_bin_file_strings(RZ_NONNULL RzBinFile *bf, size_t min_length, bool raw_strings)
Generates a RzList struct containing RzBinString from a given RzBinFile.
Definition: bfile_string.c:325
RZ_API void rz_bin_file_hash_free(RzBinFileHash *fhash)
Definition: bin.c:89
RZ_API void rz_bin_symbol_free(RzBinSymbol *sym)
Definition: bin.c:175
RZ_API void rz_bin_map_free(RzBinMap *map)
Definition: bin.c:1023
RZ_API void rz_bin_import_free(RzBinImport *imp)
Definition: bin.c:137
RZ_API void rz_bin_resource_free(RzBinResource *res)
Definition: bin.c:147
RZ_API void rz_bin_section_free(RzBinSection *bs)
Definition: bin.c:1116
static bool load_buffer(RzBinFile *bf, RzBinObject *obj, RzBuffer *buf, Sdb *sdb)
Definition: bin_any.c:50
static void destroy(RzBinFile *bf)
Definition: bin_any.c:54
static ut64 baddr(RzBinFile *bf)
Definition: bin_any.c:58
static Sdb * get_sdb(RzBinFile *bf)
Definition: bin_art.c:60
static RzList * maps(RzBinFile *bf)
Definition: bin_bf.c:116
static RzBinAddr * binsym(RzBinFile *bf, RzBinSpecialSymbol sym)
Definition: bin_coff.c:47
static RzList * libs(RzBinFile *bf)
Definition: bin_coff.c:379
static ut64 get_offset(RzBinFile *bf, int type, int index)
Definition: bin_dex.c:206
RzList * entries(RzBinFile *bf)
Definition: bin_ne.c:98
RzBinInfo * info(RzBinFile *bf)
Definition: bin_ne.c:86
RzList * symbols(RzBinFile *bf)
Definition: bin_ne.c:102
RzList * imports(RzBinFile *bf)
Definition: bin_ne.c:106
RzList * sections(RzBinFile *bf)
Definition: bin_ne.c:110
RzList * relocs(RzBinFile *bf)
Definition: bin_ne.c:114
static ut64 get_vaddr(RzBinFile *bf, ut64 baddr, ut64 paddr, ut64 vaddr)
Definition: bin_omf.c:161
#define IS_GOPCLNTAB_1_2_LE(x)
Definition: golang.c:12
#define IS_GOPCLNTAB_1_16_BE(x)
Definition: golang.c:15
#define IS_GOPCLNTAB_1_18_BE(x)
Definition: golang.c:17
#define IS_GOPCLNTAB_1_2_BE(x)
Definition: golang.c:13
#define IS_GOPCLNTAB_1_18_LE(x)
Definition: golang.c:16
#define IS_GOPCLNTAB_1_16_LE(x)
Definition: golang.c:14
#define NULL
Definition: cris-opc.c:27
#define r
Definition: crypto_rc6.c:12
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
Definition: sflib.h:98
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len key
Definition: sflib.h:118
uint16_t ut16
uint32_t ut32
static bool filter_import(ELFOBJ *bin, Elf_(Sym) *symbol, bool is_dynamic)
Definition: elf_imports.c:312
size_t map(int syms, int left, int len)
Definition: enough.c:237
checking print the parsed form of the magic use in n conjunction with m to debug a new magic file n before installing it n output MIME type strings(--mime-type and\n" " --mime-encoding)\n") OPT('s'
RZ_API char * sdb_fmt(const char *fmt,...)
Definition: fmt.c:26
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
voidpf void * buf
Definition: ioapi.h:138
uint8_t ut8
Definition: lh5801.h:11
static void list(RzEgg *egg)
Definition: rz-gg.c:52
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
Definition: list.c:248
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 bool rz_list_join(RZ_NONNULL RzList *list1, RZ_NONNULL RzList *list2)
Joins 2 list into one (list2 pointer needs to be freed by the user)
Definition: list.c:209
RZ_API RZ_BORROW RzListIter * rz_list_push(RZ_NONNULL RzList *list, void *item)
Alias for rz_list_append.
Definition: list.c:60
RZ_API ut32 rz_list_length(RZ_NONNULL const RzList *list)
Returns the length of the list.
Definition: list.c:109
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 bool is_thumb(RzBinFile *bf)
static void PE_() add_tls_callbacks(struct PE_(rz_bin_pe_obj_t) *bin, RzList *list)
Definition: mdmp_pe.c:10
int n
Definition: mipsasm.c:19
int type
Definition: mipsasm.c:17
int idx
Definition: setup.py:197
RZ_API int sdb_ns_set(Sdb *s, const char *name, Sdb *r)
Definition: ns.c:156
RZ_API Sdb * sdb_ns(Sdb *s, const char *name, int create)
Definition: ns.c:186
RZ_API int sdb_num_set(Sdb *s, const char *key, ut64 v, ut32 cas)
Definition: num.c:25
RZ_API int sdb_bool_set(Sdb *db, const char *str, bool v, ut32 cas)
Definition: num.c:72
RZ_API ut64 sdb_num_get(Sdb *s, const char *key, ut32 *cas)
Definition: num.c:13
void *PE_() rz_bin_pe_free(RzBinPEObj *bin)
Definition: pe.c:88
RzBinPEObj *PE_() rz_bin_pe_new_buf(RzBuffer *buf, bool verbose)
Definition: pe.c:116
int PE_() rz_bin_pe_is_stripped_debug(RzBinPEObj *bin)
Definition: pe_info.c:377
int PE_() rz_bin_pe_get_debug_data(RzBinPEObj *bin, SDebugInfo *res)
Definition: pe_debug.c:158
struct rz_bin_pe_export_t *PE_() rz_bin_pe_get_exports(RzBinPEObj *bin)
Definition: pe_exports.c:162
ut64 PE_() rz_bin_pe_get_clr_methoddef_offset(RzBinPEObj *bin, Pe_image_metadata_methoddef *methoddef)
Definition: pe_clr.c:104
int PE_() rz_bin_pe_is_big_endian(RzBinPEObj *bin)
Definition: pe_info.c:343
struct rz_bin_pe_addr_t *PE_() rz_bin_pe_get_main_vaddr(RzBinPEObj *bin)
Definition: pe_info.c:917
#define RZ_BIN_PE_SCN_IS_WRITABLE(x)
Definition: pe.h:20
void PE_() rz_bin_pe_check_sections(RzBinPEObj *bin, struct rz_bin_pe_section_t **sects)
Definition: pe_section.c:10
#define RZ_BIN_PE_SCN_IS_SHAREABLE(x)
Definition: pe.h:17
struct rz_bin_pe_addr_t *PE_() rz_bin_pe_get_entrypoint(RzBinPEObj *bin)
Definition: pe_info.c:509
int PE_() rz_bin_pe_is_stripped_local_syms(RzBinPEObj *bin)
Definition: pe_info.c:370
#define RZ_BIN_PE_SCN_IS_EXECUTABLE(x)
Definition: pe.h:18
#define RZ_BIN_PE_SCN_IS_READABLE(x)
Definition: pe.h:19
char *PE_() rz_bin_pe_get_subsystem(RzBinPEObj *bin)
Definition: pe_info.c:159
char *PE_() rz_bin_pe_get_machine(RzBinPEObj *bin)
Definition: pe_info.c:24
char *PE_() rz_bin_pe_get_arch(RzBinPEObj *bin)
Definition: pe_info.c:114
#define DBG_FILE_NAME_LEN
Definition: pe.h:117
int PE_() bin_pe_get_claimed_checksum(RzBinPEObj *bin)
Definition: pe_info.c:221
struct rz_bin_pe_import_t *PE_() rz_bin_pe_get_imports(RzBinPEObj *bin)
Definition: pe_imports.c:198
struct rz_bin_pe_lib_t *PE_() rz_bin_pe_get_libs(RzBinPEObj *bin)
Definition: pe_info.c:384
int PE_() bin_pe_get_actual_checksum(RzBinPEObj *bin)
Definition: pe_info.c:249
RZ_OWN RzList *PE_() rz_bin_pe_get_clr_symbols(RzBinPEObj *bin)
Definition: pe_clr.c:8
ut64 PE_() rz_bin_pe_get_image_base(RzBinPEObj *bin)
Definition: pe_info.c:588
char *PE_() rz_bin_pe_get_cc(RzBinPEObj *bin)
Definition: pe_info.c:201
int PE_() rz_bin_pe_is_stripped_relocs(RzBinPEObj *bin)
Definition: pe_info.c:356
char *PE_() rz_bin_pe_get_os(RzBinPEObj *bin)
Definition: pe_info.c:69
char *PE_() rz_bin_pe_get_class(RzBinPEObj *bin)
Definition: pe_info.c:103
int PE_() rz_bin_pe_is_dll(RzBinPEObj *bin)
Definition: pe_info.c:324
int PE_() rz_bin_pe_get_bits(RzBinPEObj *bin)
Definition: pe_info.c:306
#define GUIDSTR_LEN
Definition: pe.h:116
int PE_() bin_pe_is_authhash_valid(RzBinPEObj *bin)
Definition: pe_security.c:67
int PE_() rz_bin_pe_is_stripped_line_nums(RzBinPEObj *bin)
Definition: pe_info.c:363
const char *PE_() bin_pe_get_authentihash(RzBinPEObj *bin)
Definition: pe_security.c:60
int PE_() bin_pe_get_overlay(RzBinPEObj *bin, ut64 *size)
Definition: pe_overlay.c:16
#define PE_(name)
Definition: pe_specs.h:23
#define IMAGE_DLLCHARACTERISTICS_GUARD_CF
Definition: pe_specs.h:126
#define IMAGE_DLLCHARACTERISTICS_WDM_DRIVER
Definition: pe_specs.h:125
#define PE_IMAGE_FILE_MACHINE_ARMNT
Definition: pe_specs.h:70
#define IMAGE_DLL_CHARACTERISTICS_FORCE_INTEGRITY
Definition: pe_specs.h:119
#define PE_IMAGE_FILE_MACHINE_ARM
Definition: pe_specs.h:69
#define IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE
Definition: pe_specs.h:118
#define IMAGE_DLLCHARACTERISTICS_NO_BIND
Definition: pe_specs.h:123
#define IMAGE_DLLCHARACTERISTICS_APPCONTAINER
Definition: pe_specs.h:124
#define IMAGE_DLL_CHARACTERISTICS_NX_COMPAT
Definition: pe_specs.h:120
#define IMAGE_DLLCHARACTERISTICS_NO_ISOLATION
Definition: pe_specs.h:121
#define IMAGE_DLLCHARACTERISTICS_NO_SEH
Definition: pe_specs.h:122
#define IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE
Definition: pe_specs.h:127
#define PE_DWord
Definition: pe_specs.h:27
#define IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA
Definition: pe_specs.h:117
#define rz_return_val_if_fail(expr, val)
Definition: rz_assert.h:108
#define RZ_BIN_DBG_RELOCS
Definition: rz_bin.h:31
#define RZ_BIN_DBG_STRIPPED
Definition: rz_bin.h:27
@ RZ_BIN_RELOC_32
Definition: rz_bin.h:176
@ RZ_BIN_RELOC_64
Definition: rz_bin.h:177
#define RZ_BIN_ENTRY_TYPE_TLS
Definition: rz_bin.h:37
#define RZ_BIN_TYPE_NOTYPE_STR
Definition: rz_bin.h:117
RzBinSpecialSymbol
Definition: rz_bin.h:136
@ RZ_BIN_SPECIAL_SYMBOL_MAIN
Definition: rz_bin.h:139
#define RZ_BIN_DBG_SYMS
Definition: rz_bin.h:30
#define RZ_BIN_ENTRY_TYPE_PROGRAM
Definition: rz_bin.h:33
#define RZ_BIN_BIND_GLOBAL_STR
Definition: rz_bin.h:107
#define RZ_BIN_TYPE_FUNC_STR
Definition: rz_bin.h:119
#define RZ_BIN_DBG_LINENUMS
Definition: rz_bin.h:29
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
static ut32 rz_read_le32(const void *src)
Definition: rz_endian.h:239
void(* RzListFree)(void *ptr)
Definition: rz_list.h:11
RZ_API char * rz_str_ndup(RZ_NULLABLE const char *ptr, int len)
Create new copy of string ptr limited to size len.
Definition: str.c:1006
RZ_API const char * rz_str_constpool_get(RzStrConstPool *pool, const char *str)
Definition: str_constpool.c:19
#define RZ_PERM_R
Definition: rz_types.h:93
#define RZ_NEW0(x)
Definition: rz_types.h:284
#define RZ_PERM_W
Definition: rz_types.h:94
#define RZ_PERM_X
Definition: rz_types.h:95
#define RZ_PERM_SHAR
Definition: rz_types.h:100
#define RZ_FREE(x)
Definition: rz_types.h:369
#define RZ_ROUND(x, y)
#define RZ_MIN(x, y)
#define UT32_MAX
Definition: rz_types_base.h:99
#define UT64_MAX
Definition: rz_types_base.h:86
static void * rz_pvector_at(const RzPVector *vec, size_t index)
Definition: rz_vector.h:236
RZ_API int sdb_set(Sdb *s, const char *key, const char *val, ut32 cas)
Definition: sdb.c:611
#define br(opcode, mask, lose, flags)
RzPVector * methoddefs
Definition: dotnet.h:163
Definition: pe.h:119
char file_name[DBG_FILE_NAME_LEN]
Definition: pe.h:121
char guidstr[GUIDSTR_LEN]
Definition: pe.h:120
Definition: malloc.c:26
Definition: zipcmp.c:77
Definition: z80asm.h:102
ut64 vaddr
Definition: rz_bin.h:186
ut64 paddr
Definition: rz_bin.h:187
ut64 hpaddr
Definition: rz_bin.h:189
const char * type
Definition: rz_bin.h:205
const char * hex
Definition: rz_bin.h:206
XX curplugin == o->plugin.
Definition: rz_bin.h:298
RzBinObject * o
Definition: rz_bin.h:305
RZ_DEPRECATE Sdb * sdb
deprecated, put info in C structures instead of this
Definition: rz_bin.h:315
struct rz_bin_t * rbin
Definition: rz_bin.h:316
char * file
Definition: rz_bin.h:299
RzBuffer * buf
Definition: rz_bin.h:303
char * libname
Definition: rz_bin.h:702
const char * type
Definition: rz_bin.h:704
const char * bind
Definition: rz_bin.h:703
ut32 ordinal
Definition: rz_bin.h:707
char * name
Definition: rz_bin.h:701
int has_va
Definition: rz_bin.h:228
char * claimed_checksum
Definition: rz_bin.h:237
char * type
Definition: rz_bin.h:211
int has_canary
Definition: rz_bin.h:230
char * default_cc
Definition: rz_bin.h:225
char * os
Definition: rz_bin.h:219
char * subsystem
Definition: rz_bin.h:220
int has_pi
Definition: rz_bin.h:229
int has_nx
Definition: rz_bin.h:234
char * machine
Definition: rz_bin.h:216
const char * lang
Definition: rz_bin.h:224
char * bclass
Definition: rz_bin.h:212
char * guid
Definition: rz_bin.h:222
char * file
Definition: rz_bin.h:210
char * debug_file_name
Definition: rz_bin.h:223
ut64 dbg_info
Definition: rz_bin.h:240
bool signature
Definition: rz_bin.h:239
int pe_overlay
Definition: rz_bin.h:238
char * actual_checksum
Definition: rz_bin.h:236
char * rclass
Definition: rz_bin.h:213
char * arch
Definition: rz_bin.h:214
int big_endian
Definition: rz_bin.h:235
Description of a single memory mapping into virtual memory from a binary.
Definition: rz_bin.h:602
void * bin_obj
Definition: rz_bin.h:293
ut64 vaddr
Definition: pe.h:58
ut64 paddr
Definition: pe.h:59
ut64 haddr
Definition: pe.h:60
ut64 paddr
the paddr where the value should be patched into
Definition: rz_bin.h:717
RzBinRelocType type
Definition: rz_bin.h:712
ut64 vaddr
the vaddr where the value should be patched into
Definition: rz_bin.h:716
RzBinImport * import
Definition: rz_bin.h:714
bool additive
Definition: rz_bin.h:720
st64 addend
Definition: rz_bin.h:715
char * name
Definition: rz_bin.h:619
const char * bind
Definition: rz_bin.h:681
bool is_imported
Definition: rz_bin.h:684
const char * type
Definition: rz_bin.h:682
char * name
Definition: rz_bin.h:675
ut32 ordinal
Definition: rz_bin.h:692
const char * forwarder
Definition: rz_bin.h:680
char * libname
Definition: rz_bin.h:677
bool verbose
Definition: rz_bin.h:359
RzStrConstPool constpool
Definition: rz_bin.h:362
RzListFree free
Definition: rz_list.h:21
Definition: sdb.h:63
int pos
Definition: main.c:11
if(dbg->bits==RZ_SYS_BITS_64)
Definition: windows-arm64.h:4
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static int addr
Definition: z80asm.c:58