Rizin
unix-like reverse engineering framework and cli tools
cmd_flag.c
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2009-2021 pancake <pancake@nopcode.org>
2 // SPDX-License-Identifier: LGPL-3.0-only
3 
4 #include <stddef.h>
5 #include <rz_cons.h>
6 #include <rz_core.h>
7 #include "../core_private.h"
8 
9 static bool listFlag(RzFlagItem *flag, void *user) {
10  rz_list_append(user, flag);
11  return true;
12 }
13 
14 static size_t countMatching(const char *a, const char *b) {
15  size_t matches = 0;
16  for (; *a && *b; a++, b++) {
17  if (*a != *b) {
18  break;
19  }
20  matches++;
21  }
22  return matches;
23 }
24 
25 static const char *__isOnlySon(RzCore *core, RzList *flags, const char *kw) {
27  RzFlagItem *f;
28 
29  size_t count = 0;
30  char *fname = NULL;
31  rz_list_foreach (flags, iter, f) {
32  if (!strncmp(f->name, kw, strlen(kw))) {
33  count++;
34  if (count > 1) {
35  return NULL;
36  }
37  fname = f->name;
38  }
39  }
40  return fname;
41 }
42 
43 static RzList *__childrenFlagsOf(RzCore *core, RzList *flags, const char *prefix) {
45  RzListIter *iter, *iter2;
46  RzFlagItem *f, *f2;
47  char *fn;
48 
49  const size_t prefix_len = strlen(prefix);
50  rz_list_foreach (flags, iter, f) {
51  if (prefix_len > 0 && strncmp(f->name, prefix, prefix_len)) {
52  continue;
53  }
54  if (prefix_len > strlen(f->name)) {
55  continue;
56  }
57  if (rz_cons_is_breaked()) {
58  break;
59  }
60  const char *name = f->name;
61  int name_len = strlen(name);
62  rz_list_foreach (flags, iter2, f2) {
63  if (prefix_len > strlen(f2->name)) {
64  continue;
65  }
66  if (prefix_len > 0 && strncmp(f2->name, prefix, prefix_len)) {
67  continue;
68  }
69  int matching = countMatching(name, f2->name);
70  if (matching < prefix_len || matching == name_len) {
71  continue;
72  }
73  if (matching > name_len) {
74  break;
75  }
76  if (matching < name_len) {
77  name_len = matching;
78  }
79  }
80  char *kw = rz_str_ndup(name, name_len + 1);
81  const int kw_len = strlen(kw);
82  const char *only = __isOnlySon(core, flags, kw);
83  if (only) {
84  free(kw);
85  kw = strdup(only);
86  } else {
87  const char *fname = NULL;
88  size_t fname_len = 0;
89  rz_list_foreach (flags, iter2, f2) {
90  if (strncmp(f2->name, kw, kw_len)) {
91  continue;
92  }
93  if (fname) {
94  int matching = countMatching(fname, f2->name);
95  if (fname_len) {
96  if (matching < fname_len) {
97  fname_len = matching;
98  }
99  } else {
100  fname_len = matching;
101  }
102  } else {
103  fname = f2->name;
104  }
105  }
106  if (fname_len > 0) {
107  free(kw);
108  kw = rz_str_ndup(fname, fname_len);
109  }
110  }
111 
112  bool found = false;
113  rz_list_foreach (list, iter2, fn) {
114  if (!strcmp(fn, kw)) {
115  found = true;
116  break;
117  }
118  }
119  if (found) {
120  free(kw);
121  } else {
122  if (strcmp(prefix, kw)) {
123  rz_list_append(list, kw);
124  } else {
125  free(kw);
126  }
127  }
128  }
129  return list;
130 }
131 
132 static void __printRecursive(RzCore *core, RzList *list, const char *name, RzOutputMode mode, int depth);
133 
134 static void __printRecursive(RzCore *core, RzList *flags, const char *name, RzOutputMode mode, int depth) {
135  char *fn;
136  RzListIter *iter;
138  rz_cons_printf("agn root\n");
139  }
140  if (rz_flag_get(core->flags, name)) {
141  return;
142  }
143  RzList *children = __childrenFlagsOf(core, flags, name);
144  const int name_len = strlen(name);
145  rz_list_foreach (children, iter, fn) {
146  if (!strcmp(fn, name)) {
147  continue;
148  }
149  if (mode == RZ_OUTPUT_MODE_RIZIN) {
150  rz_cons_printf("agn %s %s\n", fn, fn + name_len);
151  rz_cons_printf("age %s %s\n", RZ_STR_ISNOTEMPTY(name) ? name : "root", fn);
152  } else {
153  rz_cons_printf("%s %s\n", rz_str_pad(' ', name_len), fn + name_len);
154  }
155  // rz_cons_printf (".fg %s\n", fn);
156  __printRecursive(core, flags, fn, mode, depth + 1);
157  }
158  rz_list_free(children);
159 }
160 
161 typedef struct {
165 
166 static bool print_function_labels_cb(void *user, const ut64 addr, const void *v) {
167  const PrintFcnLabelsCtx *ctx = user;
168  const char *name = v;
169  switch (ctx->state->mode) {
170  case RZ_OUTPUT_MODE_JSON:
171  pj_o(ctx->state->d.pj);
172  pj_kn(ctx->state->d.pj, name, addr);
173  pj_end(ctx->state->d.pj);
174  break;
176  rz_cons_printf("%s\n", name);
177  break;
179  rz_cons_printf("0x%08" PFMT64x " %s [%s + %" PFMT64d "]\n",
180  addr,
181  name, ctx->fcn->name,
182  addr - ctx->fcn->addr);
183  break;
184  default:
186  break;
187  }
188  return true;
189 }
190 
191 static bool flag_set_comment(RzFlagItem *item, const char *comment) {
192  if (!strncmp(comment, "base64:", 7)) {
193  const char *b64str = comment + 7;
194  char *dec = (char *)rz_base64_decode_dyn(b64str, -1);
195  if (!dec) {
196  RZ_LOG_ERROR("Failed to decode base64-encoded string: \"%s\"\n", b64str);
197  return false;
198  }
199  rz_flag_item_set_comment(item, dec);
200  free(dec);
201  } else {
202  rz_flag_item_set_comment(item, comment);
203  }
204  return true;
205 }
206 
207 RZ_IPI RzCmdStatus rz_flag_add_handler(RzCore *core, int argc, const char **argv) {
208  RzFlagItem *item;
209  bool addFlag = true;
210  ut64 size = argc > 2 ? rz_num_math(core->num, argv[2]) : 1;
211  if ((item = rz_flag_get_at(core->flags, core->offset, false))) {
212  RZ_LOG_ERROR("Cannot create flag \"%s\" at 0x%" PFMT64x
213  " because there is already \"%s\" flag\n",
214  argv[1],
215  core->offset, item->name);
216  addFlag = false;
217  }
218  if (addFlag) {
219  item = rz_flag_set(core->flags, argv[1], core->offset, size);
220  }
221  if (!item) {
222  RZ_LOG_ERROR("Cannot create flag \"%s\" at 0x%" PFMT64x "\n", argv[1], core->offset);
223  return RZ_CMD_STATUS_ERROR;
224  }
225  if (argc > 3) {
226  return bool2status(flag_set_comment(item, argv[3]));
227  }
228  return RZ_CMD_STATUS_OK;
229 }
230 
231 RZ_IPI RzCmdStatus rz_flag_append_handler(RzCore *core, int argc, const char **argv) {
232  ut64 size = argc > 2 ? rz_num_math(core->num, argv[2]) : 1;
233  RzFlagItem *item = rz_flag_set(core->flags, argv[1], core->offset, size);
234  if (!item) {
235  RZ_LOG_ERROR("Cannot create flag \"%s\" at 0x%" PFMT64x "\n", argv[1], core->offset);
236  return RZ_CMD_STATUS_ERROR;
237  }
238  if (argc > 3) {
239  return bool2status(flag_set_comment(item, argv[3]));
240  }
241  return RZ_CMD_STATUS_OK;
242 }
243 
244 RZ_IPI RzCmdStatus rz_flag_local_add_handler(RzCore *core, int argc, const char **argv) {
246  if (!fcn) {
247  RZ_LOG_ERROR("Cannot find function at 0x%" PFMT64x " offset\n", core->offset);
248  return RZ_CMD_STATUS_ERROR;
249  }
251  return RZ_CMD_STATUS_OK;
252 }
253 
256  if (!fcn) {
257  RZ_LOG_ERROR("Cannot find function at 0x%" PFMT64x " offset\n", core->offset);
258  return RZ_CMD_STATUS_ERROR;
259  }
261  return RZ_CMD_STATUS_OK;
262 }
263 
266  if (!fcn) {
267  RZ_LOG_ERROR("Cannot find function at 0x%" PFMT64x " offset\n", core->offset);
268  return RZ_CMD_STATUS_ERROR;
269  }
271  PrintFcnLabelsCtx ctx = { fcn, state };
272  ht_up_foreach(fcn->labels, print_function_labels_cb, &ctx);
274  return RZ_CMD_STATUS_OK;
275 }
276 
278  RzAnalysisFunction *fcn;
279  RzListIter *it;
281  rz_list_foreach (core->analysis->fcns, it, fcn) {
282  if (!fcn->labels->count) {
283  continue;
284  }
285  if (state->mode == RZ_OUTPUT_MODE_JSON) {
286  pj_k(state->d.pj, fcn->name);
287  }
288  PrintFcnLabelsCtx ctx = { fcn, state };
289  ht_up_foreach(fcn->labels, print_function_labels_cb, &ctx);
290  if (state->mode == RZ_OUTPUT_MODE_JSON) {
291  pj_end(state->d.pj);
292  }
293  }
295  return RZ_CMD_STATUS_OK;
296 }
297 
300  rz_flag_foreach_space(core->flags, rz_flag_space_cur(core->flags), listFlag, flags);
301  if (!argv[1]) {
302  __printRecursive(core, flags, "", state->mode, 0);
303  } else {
304  __printRecursive(core, flags, argv[1], state->mode, 0);
305  }
307  return RZ_CMD_STATUS_OK;
308 }
309 
310 RZ_IPI RzCmdStatus rz_flag_relocate_handler(RzCore *core, int argc, const char **argv) {
311  ut64 mask = 0xffff;
312  if (argc > 3) {
313  mask = rz_num_math(core->num, argv[3]);
314  }
315  ut64 from = rz_num_math(core->num, argv[1]);
316  ut64 to = rz_num_math(core->num, argv[2]);
317  int ret = rz_flag_relocate(core->flags, from, mask, to);
318  RZ_LOG_INFO("Relocated %d flags\n", ret);
319  return RZ_CMD_STATUS_OK;
320 }
321 
322 static int cmpflag(const void *_a, const void *_b) {
323  const RzFlagItem *flag1 = _a, *flag2 = _b;
324  return (flag1->offset - flag2->offset);
325 }
326 
327 RZ_IPI void rz_core_flag_describe(RzCore *core, ut64 addr, bool strict_offset, RzCmdStateOutput *state) {
328  RzFlagItem *f = rz_flag_get_at(core->flags, addr, !strict_offset);
329  if (!f) {
330  return;
331  }
332  PJ *pj = state->d.pj;
333  switch (state->mode) {
334  case RZ_OUTPUT_MODE_JSON:
335  pj_o(pj);
336  pj_kn(pj, "offset", f->offset);
337  pj_ks(pj, "name", f->name);
338  // Print flag's real name if defined
339  if (f->realname) {
340  pj_ks(pj, "realname", f->realname);
341  }
342  pj_end(pj);
343  break;
345  // Print realname if exists and asm.flags.real is enabled
346  const char *name = core->flags->realnames && f->realname ? f->realname : f->name;
347  if (f->offset != addr) {
348  rz_cons_printf("%s + %d\n", name, (int)(addr - f->offset));
349  } else {
351  }
352  break;
353  }
354  default:
356  break;
357  }
358 }
359 
361  rz_core_flag_describe(core, core->offset, false, state);
362  return RZ_CMD_STATUS_OK;
363 }
364 
366  const RzList *flags = rz_flag_get_list(core->flags, core->offset);
367  if (!flags) {
368  return RZ_CMD_STATUS_OK;
369  }
370  PJ *pj = state->d.pj;
372  RzFlagItem *flag;
373  RzListIter *iter;
374  // Sometimes an address has multiple flags assigned to, show them all
375  rz_list_foreach (flags, iter, flag) {
376  if (!flag) {
377  continue;
378  }
379  switch (state->mode) {
380  case RZ_OUTPUT_MODE_JSON:
381  pj_o(pj);
382  pj_ks(pj, "name", flag->name);
383  if (flag->realname) {
384  pj_ks(pj, "realname", flag->realname);
385  }
386  pj_end(pj);
387  break;
389  // Print realname if exists and asm.flags.real is enabled
390  if (core->flags->realnames && flag->realname) {
391  rz_cons_println(flag->realname);
392  } else {
393  rz_cons_println(flag->name);
394  }
395  break;
396  default:
398  break;
399  }
400  }
402  return RZ_CMD_STATUS_OK;
403 }
404 
406  RzList *temp = rz_flag_all_list(core->flags, true);
407  if (!temp) {
408  return RZ_CMD_STATUS_OK;
409  }
410  ut64 loff = 0;
411  ut64 uoff = 0;
412  ut64 curseek = core->offset;
413  char *lmatch = NULL, *umatch = NULL;
414  RzFlagItem *flag;
415  RzListIter *iter;
416  rz_list_sort(temp, &cmpflag);
417  rz_list_foreach (temp, iter, flag) {
418  if (strstr(flag->name, argv[1]) != NULL) {
419  if (flag->offset < core->offset) {
420  loff = flag->offset;
421  lmatch = flag->name;
422  continue;
423  }
424  uoff = flag->offset;
425  umatch = flag->name;
426  break;
427  }
428  }
429  char *match = (curseek - loff) < (uoff - curseek) ? lmatch : umatch;
430  if (match) {
431  if (*match) {
433  }
434  }
435  rz_list_free(temp);
436  return RZ_CMD_STATUS_OK;
437 }
438 
440  if (!f->zones) {
441  return;
442  }
443  RzListIter *iter;
444  RzFlagZoneItem *zi;
445  PJ *pj = state->d.pj;
447  rz_list_foreach (f->zones, iter, zi) {
448  switch (state->mode) {
449  case RZ_OUTPUT_MODE_JSON:
450  pj_o(pj);
451  pj_ks(pj, "name", zi->name);
452  pj_ki(pj, "from", zi->from);
453  pj_ki(pj, "to", zi->to);
454  pj_end(pj);
455  break;
457  rz_cons_printf("0x08%" PFMT64x " 0x%08" PFMT64x " %s\n",
458  zi->from, zi->to, zi->name);
459  break;
460  default:
462  break;
463  }
464  }
466 }
467 
468 RZ_IPI RzCmdStatus rz_flag_zone_add_handler(RzCore *core, int argc, const char **argv) {
469  rz_flag_zone_add(core->flags, argv[1], core->offset);
470  return RZ_CMD_STATUS_OK;
471 }
472 
473 RZ_IPI RzCmdStatus rz_flag_zone_remove_handler(RzCore *core, int argc, const char **argv) {
474  rz_flag_zone_del(core->flags, argv[1]);
475  return RZ_CMD_STATUS_OK;
476 }
477 
479  rz_flag_zone_reset(core->flags);
480  return RZ_CMD_STATUS_OK;
481 }
482 
483 RZ_IPI RzCmdStatus rz_flag_zone_around_handler(RzCore *core, int argc, const char **argv) {
484  const char *a = NULL, *b = NULL;
485  rz_flag_zone_around(core->flags, core->offset, &a, &b);
486  rz_cons_printf("%s %s\n", a ? a : "~", b ? b : "~");
487  return RZ_CMD_STATUS_OK;
488 }
489 
491  flag_zone_list(core->flags, state);
492  return RZ_CMD_STATUS_OK;
493 }
494 
495 struct flagbar_t {
497  int cols;
498 };
499 
500 static bool flagbar_foreach(RzFlagItem *fi, void *user) {
501  struct flagbar_t *u = (struct flagbar_t *)user;
502  ut64 min = 0, max = rz_io_size(u->core->io);
503  RzIOMap *m = rz_io_map_get(u->core->io, fi->offset);
504  if (m) {
505  min = m->itv.addr;
506  max = m->itv.addr + m->itv.size;
507  }
508  rz_cons_printf("0x%08" PFMT64x " ", fi->offset);
509  rz_print_rangebar(u->core->print, fi->offset, fi->offset + fi->size, min, max, u->cols);
510  rz_cons_printf(" %s\n", fi->name);
511  return true;
512 }
513 
514 static void flagbars(RzCore *core, const char *glob) {
515  int cols = rz_cons_get_size(NULL);
516  cols -= 80;
517  if (cols < 0) {
518  cols += 80;
519  }
520 
521  struct flagbar_t u = { .core = core, .cols = cols };
522  rz_flag_foreach_space_glob(core->flags, glob, rz_flag_space_cur(core->flags), flagbar_foreach, &u);
523 }
524 
528 };
529 
530 static bool flag_to_flag_foreach(RzFlagItem *fi, void *user) {
531  struct flag_to_flag_t *u = (struct flag_to_flag_t *)user;
532  if (fi->offset < u->next && fi->offset > u->offset) {
533  u->next = fi->offset;
534  }
535  return true;
536 }
537 
538 static int flag_to_flag(RzCore *core, const char *glob) {
539  rz_return_val_if_fail(glob, 0);
540  glob = rz_str_trim_head_ro(glob);
541  struct flag_to_flag_t u = { .next = UT64_MAX, .offset = core->offset };
543  if (u.next != UT64_MAX && u.next > core->offset) {
544  return u.next - core->offset;
545  }
546  return 0;
547 }
548 
549 RZ_IPI RzCmdStatus rz_flag_tag_add_handler(RzCore *core, int argc, const char **argv) {
550  rz_flag_tags_set(core->flags, argv[1], argv[2]);
551  return RZ_CMD_STATUS_OK;
552 }
553 
554 static void flag_tag_print(RzCore *core, const char *tag, RzCmdStateOutput *state) {
555  PJ *pj = state->d.pj;
556  switch (state->mode) {
557  case RZ_OUTPUT_MODE_JSON: {
558  pj_k(pj, tag);
559  pj_a(pj);
561  if (!flags) {
562  pj_end(pj);
563  break;
564  }
565  RzListIter *iter;
566  RzFlagItem *flag;
567  rz_list_foreach (flags, iter, flag) {
568  pj_s(pj, flag->name);
569  }
570  pj_end(pj);
572  break;
573  }
574  case RZ_OUTPUT_MODE_LONG: {
575  rz_cons_printf("%s:\n", tag);
577  if (!flags) {
578  break;
579  }
580  RzListIter *iter;
581  RzFlagItem *flag;
582  rz_list_foreach (flags, iter, flag) {
583  rz_cons_printf("0x%08" PFMT64x " %s\n", flag->offset, flag->name);
584  }
586  break;
587  }
589  rz_cons_printf("%s\n", tag);
590  break;
591  default:
593  break;
594  }
595 }
596 
599  if (!list) {
600  return RZ_CMD_STATUS_ERROR;
601  }
602  RzListIter *iter;
603  const char *tag;
605  rz_list_foreach (list, iter, tag) {
606  flag_tag_print(core, tag, state);
607  }
610  return RZ_CMD_STATUS_OK;
611 }
612 
613 RZ_IPI RzCmdStatus rz_flag_tag_search_handler(RzCore *core, int argc, const char **argv) {
614  RzList *flags = rz_flag_tags_get(core->flags, argv[1]);
615  if (!flags) {
616  return RZ_CMD_STATUS_ERROR;
617  }
618  RzListIter *iter;
619  RzFlagItem *flag;
620  rz_list_foreach (flags, iter, flag) {
621  rz_cons_printf("0x%08" PFMT64x " %s\n", flag->offset, flag->name);
622  }
623  return RZ_CMD_STATUS_OK;
624 }
625 
628  const char *pfx;
629  int count;
630 };
631 
632 static bool rename_flag_ordinal(RzFlagItem *fi, void *user) {
633  struct rename_flag_t *u = (struct rename_flag_t *)user;
634  char *newName = rz_str_newf("%s%d", u->pfx, u->count++);
635  if (!newName) {
636  return false;
637  }
638  rz_flag_rename(u->core->flags, fi, newName);
639  free(newName);
640  return true;
641 }
642 
643 static void flag_ordinals(RzCore *core, const char *glob) {
644  char *pfx = strdup(glob);
645  char *p = strchr(pfx, '*');
646  if (p) {
647  *p = 0;
648  }
649  struct rename_flag_t u = { .core = core, .pfx = pfx, .count = 0 };
651  free(pfx);
652 }
653 
654 static bool adjust_offset(RzFlagItem *flag, void *user) {
655  st64 base = *(st64 *)user;
656  flag->offset += base;
657  return true;
658 }
659 
660 static void print_space_stack(RzFlag *f, int ordinal, const char *name, bool selected, RzCmdStateOutput *state) {
661  switch (state->mode) {
662  case RZ_OUTPUT_MODE_JSON: {
663  char *ename = rz_str_escape(name);
664  if (!ename) {
665  return;
666  }
667  pj_o(state->d.pj);
668  pj_ki(state->d.pj, "ordinal", ordinal);
669  pj_ks(state->d.pj, "name", ename);
670  pj_kb(state->d.pj, "selected", selected);
671  pj_end(state->d.pj);
672  free(ename);
673  break;
674  }
675  default:
676  rz_cons_printf("%-2d %s%s\n", ordinal, name, selected ? " (selected)" : "");
677  break;
678  }
679 }
680 
682  return bool2status(rz_flag_space_set(core->flags, argv[1]));
683 }
684 
687  return RZ_CMD_STATUS_OK;
688 }
689 
692  if (!f) {
693  RZ_LOG_ERROR("Cannot find any flag at 0x%" PFMT64x ".\n", core->offset);
694  return RZ_CMD_STATUS_ERROR;
695  }
696  f->space = rz_flag_space_cur(core->flags);
697  return RZ_CMD_STATUS_OK;
698 }
699 
701  const RzSpace *sp = rz_flag_space_cur(core->flags);
702  if (!sp) {
703  RZ_LOG_ERROR("No flag space currently selected.\n");
704  return RZ_CMD_STATUS_ERROR;
705  }
706  return bool2status(rz_flag_space_unset(core->flags, sp->name));
707 }
708 
710  return bool2status(rz_flag_space_unset(core->flags, NULL));
711 }
712 
714  return bool2status(rz_flag_space_rename(core->flags, NULL, argv[1]));
715 }
716 
718  return bool2status(rz_flag_space_push(core->flags, argv[1]));
719 }
720 
722  return bool2status(rz_flag_space_pop(core->flags));
723 }
724 
726  RzListIter *iter;
727  char *space;
728  int i = 0;
729  rz_list_foreach (core->flags->spaces.spacestack, iter, space) {
730  print_space_stack(core->flags, i++, space, false, state);
731  }
732  const char *cur_name = rz_flag_space_cur_name(core->flags);
733  print_space_stack(core->flags, i++, cur_name, true, state);
734  return RZ_CMD_STATUS_OK;
735 }
736 
738  if (argc < 2) {
740  }
741  if (rz_flag_unset_glob(core->flags, argv[1]) < 0) {
742  return RZ_CMD_STATUS_ERROR;
743  }
744  return RZ_CMD_STATUS_OK;
745 }
746 
749  return RZ_CMD_STATUS_OK;
750 }
751 
753  RzFlagItem *fi = rz_flag_get(core->flags, argv[1]);
754  if (!fi) {
755  fi = rz_flag_set(core->flags, argv[1], core->offset, 1);
756  }
757  if (!fi) {
758  RZ_LOG_ERROR("Cannot find flag '%s'\n", argv[1]);
759  return RZ_CMD_STATUS_ERROR;
760  }
762  return RZ_CMD_STATUS_OK;
763 }
764 
766  if (argc > 2) {
767  RzFlag *f = core->flags;
768  ut64 base = rz_num_math(core->num, argv[1]);
770  } else {
771  core->flags->base = rz_num_math(core->num, argv[1]);
772  }
773  return RZ_CMD_STATUS_OK;
774 }
775 
777  RzFlagItem *item = rz_flag_get(core->flags, argv[1]);
778  if (!item) {
779  RZ_LOG_ERROR("Cannot find flag '%s'\n", argv[1]);
780  return RZ_CMD_STATUS_ERROR;
781  }
782  RZ_LOG_DEBUG("Find flag '%s' at 0x%" PFMT64x "\n", argv[1], item->offset);
783  return RZ_CMD_STATUS_OK;
784 }
785 
787  rz_cons_printf("%d\n", flag_to_flag(core, argv[1]));
788  return RZ_CMD_STATUS_OK;
789 }
790 
792  ut64 address = rz_num_math(core->num, argv[1]);
793  return bool2status(rz_flag_move(core->flags, core->offset, address));
794 }
795 
798  if (!item) {
799  RZ_LOG_ERROR("Cannot find flag at 0x%" PFMT64x " offset\n", core->offset);
800  return RZ_CMD_STATUS_ERROR;
801  }
802  if (argc < 2) {
803  rz_cons_printf("0x%08" PFMT64x "\n", item->size);
804  } else {
805  item->size = rz_num_math(core->num, argv[1]);
806  }
807  return RZ_CMD_STATUS_OK;
808 }
809 
811  RzFlagItem *item = argc > 1 ? rz_flag_get(core->flags, argv[1])
813  if (!item) {
814  RZ_LOG_ERROR("Cannot find flag\n");
815  return RZ_CMD_STATUS_ERROR;
816  }
817  if (argc < 3) {
818  rz_cons_printf("%s\n", item->realname);
819  } else {
821  }
822  return RZ_CMD_STATUS_OK;
823 }
824 
826  if (argc > 1) {
827  flagbars(core, argv[1]);
828  } else {
829  flagbars(core, NULL);
830  }
831  return RZ_CMD_STATUS_OK;
832 }
833 
835  RzFlagItem *fi = rz_flag_get(core->flags, argv[1]);
836  if (!fi) {
837  RZ_LOG_ERROR("Cannot find the flag '%s'\n", argv[1]);
838  return RZ_CMD_STATUS_ERROR;
839  }
840  const char *ret = rz_flag_item_set_color(fi, argv[2]);
841  if (ret) {
842  rz_cons_println(ret);
843  }
844  return RZ_CMD_STATUS_OK;
845 }
846 
848  RzFlagItem *item;
849  if (argc > 2) {
850  item = rz_flag_get(core->flags, argv[1]);
851  if (!item) {
852  RZ_LOG_ERROR("Cannot find flag with name '%s'\n", argv[1]);
853  return RZ_CMD_STATUS_ERROR;
854  }
855  return bool2status(flag_set_comment(item, argv[2]));
856  } else {
857  item = rz_flag_get_i(core->flags, rz_num_math(core->num, argv[1]));
858  if (item && item->comment) {
859  rz_cons_println(item->comment);
860  } else {
861  RZ_LOG_ERROR("Cannot find the flag\n");
862  return RZ_CMD_STATUS_ERROR;
863  }
864  }
865  return RZ_CMD_STATUS_OK;
866 }
867 
869  flag_ordinals(core, argv[1]);
870  return RZ_CMD_STATUS_OK;
871 }
872 
874  RzFlagItem *item = rz_flag_get(core->flags, argv[1]);
875  if (!item && !strncmp(argv[1], "fcn.", 4)) {
876  item = rz_flag_get(core->flags, argv[1] + 4);
877  }
878  if (!item) {
879  RZ_LOG_ERROR("Cannot find matching flag\n");
880  return RZ_CMD_STATUS_ERROR;
881  }
882  if (!rz_flag_rename(core->flags, item, argv[2])) {
883  RZ_LOG_ERROR("Invalid new flag name\n");
884  return RZ_CMD_STATUS_ERROR;
885  }
886  return RZ_CMD_STATUS_OK;
887 }
888 
890  char cmd[128];
891  ut64 address = rz_num_math(core->num, argv[1]);
892  RzFlagItem *item = rz_flag_get_i(core->flags, address);
893  if (!item) {
894  RZ_LOG_ERROR("Cannot find flag '%s'\n", argv[1]);
895  return RZ_CMD_STATUS_ERROR;
896  }
897  rz_cons_printf("0x%08" PFMT64x "\n", item->offset);
898  // FIXME: Use the API directly instead of calling the command
899  snprintf(cmd, sizeof(cmd), "px@%" PFMT64d ":%" PFMT64d, item->offset, item->size);
901  return RZ_CMD_STATUS_OK;
902 }
903 
905  if (argc > 1) {
906  ut64 size = rz_num_math(core->num, argv[1]);
908  } else {
910  }
911  return RZ_CMD_STATUS_OK;
912 }
913 
916  return RZ_CMD_STATUS_OK;
917 }
918 
921  return RZ_CMD_STATUS_OK;
922 }
#define mask()
#define RZ_IPI
Definition: analysis_wasm.c:11
lzma_index ** i
Definition: index.h:629
RZ_IPI void rz_core_flag_range_print(RzFlag *f, RzCmdStateOutput *state, ut64 range_from, ut64 range_to)
Definition: cflag.c:184
RZ_IPI void rz_core_flag_print(RzFlag *f, RzCmdStateOutput *state)
Definition: cflag.c:169
RZ_API int rz_core_cmd0(RzCore *core, const char *cmd)
Definition: cmd.c:5428
RZ_API void rz_cmd_state_output_array_start(RzCmdStateOutput *state)
Mark the start of an array of elements in the output.
Definition: cmd_api.c:2558
RZ_API void rz_cmd_state_output_array_end(RzCmdStateOutput *state)
Mark the end of an array of elements in the output.
Definition: cmd_api.c:2572
RZ_IPI RzCmdStatus rz_flag_space_stack_pop_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:721
RZ_IPI RzCmdStatus rz_flag_local_list_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
Definition: cmd_flag.c:264
static int flag_to_flag(RzCore *core, const char *glob)
Definition: cmd_flag.c:538
RZ_IPI RzCmdStatus rz_flag_graph_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
Definition: cmd_flag.c:298
RZ_IPI RzCmdStatus rz_flag_range_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
Definition: cmd_flag.c:904
RZ_IPI RzCmdStatus rz_flag_zone_remove_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:473
RZ_IPI RzCmdStatus rz_flag_local_list_all_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
Definition: cmd_flag.c:277
static void flag_zone_list(RzFlag *f, RzCmdStateOutput *state)
Definition: cmd_flag.c:439
RZ_IPI RzCmdStatus rz_flag_relocate_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:310
static bool flag_set_comment(RzFlagItem *item, const char *comment)
Definition: cmd_flag.c:191
RZ_IPI RzCmdStatus rz_flag_ordinals_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:868
RZ_IPI RzCmdStatus rz_flag_list_at_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
Definition: cmd_flag.c:914
RZ_IPI RzCmdStatus rz_flag_zone_add_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:468
static int cmpflag(const void *_a, const void *_b)
Definition: cmd_flag.c:322
RZ_IPI RzCmdStatus rz_flag_base_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:765
RZ_IPI RzCmdStatus rz_flag_append_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:231
RZ_IPI RzCmdStatus rz_flag_alias_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:752
RZ_IPI RzCmdStatus rz_flag_hexdump_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:889
static bool flag_to_flag_foreach(RzFlagItem *fi, void *user)
Definition: cmd_flag.c:530
RZ_IPI RzCmdStatus rz_flag_list_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
Definition: cmd_flag.c:919
RZ_IPI RzCmdStatus rz_flag_local_add_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:244
RZ_IPI RzCmdStatus rz_flag_exists_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:776
static const char * __isOnlySon(RzCore *core, RzList *flags, const char *kw)
Definition: cmd_flag.c:25
RZ_IPI RzCmdStatus rz_flag_comment_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:847
RZ_IPI RzCmdStatus rz_flag_space_list_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
Definition: cmd_flag.c:685
RZ_IPI RzCmdStatus rz_flag_space_move_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:690
RZ_IPI RzCmdStatus rz_flag_remove_all_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:747
RZ_IPI RzCmdStatus rz_flag_color_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:834
RZ_IPI RzCmdStatus rz_flag_tag_search_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:613
RZ_IPI RzCmdStatus rz_flag_remove_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:737
RZ_IPI RzCmdStatus rz_flag_space_rename_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:713
RZ_IPI RzCmdStatus rz_flag_rename_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:873
static bool flagbar_foreach(RzFlagItem *fi, void *user)
Definition: cmd_flag.c:500
RZ_IPI RzCmdStatus rz_flag_zone_list_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
Definition: cmd_flag.c:490
RZ_IPI RzCmdStatus rz_flag_tag_add_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:549
static void print_space_stack(RzFlag *f, int ordinal, const char *name, bool selected, RzCmdStateOutput *state)
Definition: cmd_flag.c:660
RZ_IPI RzCmdStatus rz_flag_describe_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
Definition: cmd_flag.c:360
static bool listFlag(RzFlagItem *flag, void *user)
Definition: cmd_flag.c:9
static bool adjust_offset(RzFlagItem *flag, void *user)
Definition: cmd_flag.c:654
static bool print_function_labels_cb(void *user, const ut64 addr, const void *v)
Definition: cmd_flag.c:166
RZ_IPI RzCmdStatus rz_flag_realname_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:810
RZ_IPI RzCmdStatus rz_flag_move_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:791
RZ_IPI RzCmdStatus rz_flag_add_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:207
static void flag_ordinals(RzCore *core, const char *glob)
Definition: cmd_flag.c:643
RZ_IPI RzCmdStatus rz_flag_space_stack_list_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
Definition: cmd_flag.c:725
RZ_IPI void rz_core_flag_describe(RzCore *core, ut64 addr, bool strict_offset, RzCmdStateOutput *state)
Definition: cmd_flag.c:327
RZ_IPI RzCmdStatus rz_flag_space_remove_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:700
RZ_IPI RzCmdStatus rz_flag_zone_around_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:483
RZ_IPI RzCmdStatus rz_flag_distance_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:786
RZ_IPI RzCmdStatus rz_flag_zone_remove_all_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:478
static void flagbars(RzCore *core, const char *glob)
Definition: cmd_flag.c:514
RZ_IPI RzCmdStatus rz_flag_length_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:796
static void flag_tag_print(RzCore *core, const char *tag, RzCmdStateOutput *state)
Definition: cmd_flag.c:554
RZ_IPI RzCmdStatus rz_flag_describe_closest_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:405
static void __printRecursive(RzCore *core, RzList *list, const char *name, RzOutputMode mode, int depth)
Definition: cmd_flag.c:134
static RzList * __childrenFlagsOf(RzCore *core, RzList *flags, const char *prefix)
Definition: cmd_flag.c:43
RZ_IPI RzCmdStatus rz_flag_space_stack_push_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:717
RZ_IPI RzCmdStatus rz_flag_space_add_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:681
RZ_IPI RzCmdStatus rz_flag_space_remove_all_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:709
RZ_IPI RzCmdStatus rz_flag_list_ascii_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:825
RZ_IPI RzCmdStatus rz_flag_tag_list_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
Definition: cmd_flag.c:597
RZ_IPI RzCmdStatus rz_flag_local_remove_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_flag.c:254
static size_t countMatching(const char *a, const char *b)
Definition: cmd_flag.c:14
RZ_IPI RzCmdStatus rz_flag_describe_at_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
Definition: cmd_flag.c:365
static bool rename_flag_ordinal(RzFlagItem *fi, void *user)
Definition: cmd_flag.c:632
RZ_IPI void rz_core_spaces_print(RzCore *core, RzSpaces *spaces, RzCmdStateOutput *state)
Definition: cmeta.c:9
RZ_API int rz_cons_get_size(int *rows)
Definition: cons.c:1446
RZ_API int rz_cons_printf(const char *format,...)
Definition: cons.c:1202
RZ_API bool rz_cons_is_breaked(void)
Definition: cons.c:373
RZ_API void rz_cons_println(const char *str)
Definition: cons.c:233
static RzCmdStatus bool2status(bool val)
Definition: core_private.h:208
#define NULL
Definition: cris-opc.c:27
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 cmd
Definition: sflib.h:79
const char * v
Definition: dsignal.c:12
int max
Definition: enough.c:225
RZ_DEPRECATE RZ_API RzAnalysisFunction * rz_analysis_get_fcn_in(RzAnalysis *analysis, ut64 addr, int type)
Definition: fcn.c:1687
RZ_API int rz_flag_rename(RzFlag *f, RzFlagItem *item, const char *name)
Definition: flag.c:587
RZ_API RzFlagItem * rz_flag_get_i(RzFlag *f, ut64 off)
Definition: flag.c:317
RZ_API void rz_flag_foreach_space_glob(RzFlag *f, const char *glob, const RzSpace *space, RzFlagItemCb cb, void *user)
Definition: flag.c:822
RZ_API const char * rz_flag_item_set_color(RzFlagItem *item, const char *color)
Definition: flag.c:578
RZ_API void rz_flag_item_set_comment(RzFlagItem *item, const char *comment)
Definition: flag.c:564
RZ_API const RzList * rz_flag_get_list(RzFlag *f, ut64 off)
Definition: flag.c:475
RZ_API bool rz_flag_unset_all_off(RzFlag *f, ut64 off)
Definition: flag.c:635
RZ_API RzList * rz_flag_all_list(RzFlag *f, bool by_space)
Definition: flag.c:463
RZ_API void rz_flag_item_set_alias(RzFlagItem *item, const char *alias)
Definition: flag.c:557
RZ_API RzFlagItem * rz_flag_get_at(RzFlag *f, ut64 off, bool closest)
Definition: flag.c:404
RZ_API RzFlagItem * rz_flag_get(RzFlag *f, const char *name)
Definition: flag.c:310
RZ_API RzFlagItem * rz_flag_set(RzFlag *f, const char *name, ut64 off, ut32 size)
Definition: flag.c:521
RZ_API void rz_flag_unset_all(RzFlag *f)
Definition: flag.c:677
RZ_API bool rz_flag_move(RzFlag *f, ut64 at, ut64 to)
Definition: flag.c:741
RZ_API int rz_flag_unset_glob(RzFlag *f, const char *glob)
Definition: flag.c:660
RZ_API void rz_flag_foreach_space(RzFlag *f, const RzSpace *space, RzFlagItemCb cb, void *user)
Definition: flag.c:826
RZ_API int rz_flag_relocate(RzFlag *f, ut64 off, ut64 off_mask, ut64 to)
Definition: flag.c:726
RZ_API void rz_flag_item_set_realname(RzFlagItem *item, const char *realname)
Definition: flag.c:571
RZ_API void rz_flag_foreach_glob(RzFlag *f, const char *glob, RzFlagItemCb cb, void *user)
Definition: flag.c:818
unsigned short prefix[65536]
Definition: gun.c:163
RZ_API void Ht_() free(HtName_(Ht) *ht)
Definition: ht_inc.c:130
RZ_API const KEY_TYPE bool * found
Definition: ht_inc.h:130
voidpf void uLong size
Definition: ioapi.h:138
const char int mode
Definition: ioapi.h:137
snprintf
Definition: kernel.h:364
RZ_API bool rz_analysis_function_delete_label(RzAnalysisFunction *fcn, const char *name)
Definition: labels.c:34
RZ_API bool rz_analysis_function_set_label(RzAnalysisFunction *fcn, const char *name, ut64 addr)
Definition: labels.c:20
void * p
Definition: libc.cpp:67
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 void rz_list_sort(RZ_NONNULL RzList *list, RZ_NONNULL RzListComparator cmp)
Sorts via merge sort or via insertion sort a list.
Definition: list.c:743
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
static static fork const void static count static fd const char const char static newpath char char argv
Definition: sflib.h:40
static const char struct stat static buf struct stat static buf static idle const char static path static fd const char static len const void static prot const char struct module static image struct kernel_sym static table unsigned char static buf static fsuid unsigned struct dirent unsigned static count const struct iovec static count static pid const void static len static flags const struct sched_param static p static pid static policy struct timespec static tp static suid unsigned fn
Definition: sflib.h:186
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")
RZ_API void rz_print_rangebar(RzPrint *p, ut64 startA, ut64 endA, ut64 min, ut64 max, int cols)
Definition: print.c:1283
#define min(a, b)
Definition: qsort.h:83
#define rz_warn_if_reached()
Definition: rz_assert.h:29
#define rz_return_val_if_fail(expr, val)
Definition: rz_assert.h:108
RZ_API ut8 * rz_base64_decode_dyn(const char *in, int len)
Definition: ubase64.c:65
enum rz_cmd_status_t RzCmdStatus
@ RZ_CMD_STATUS_OK
command handler exited in the right way
Definition: rz_cmd.h:24
@ RZ_CMD_STATUS_ERROR
command handler had issues while running (e.g. allocation error, etc.)
Definition: rz_cmd.h:26
RZ_API ut64 rz_io_size(RzIO *io)
Definition: io.c:399
RZ_API RzIOMap * rz_io_map_get(RzIO *io, ut64 addr)
Definition: io_map.c:176
#define RZ_LOG_INFO(fmtstr,...)
Definition: rz_log.h:54
#define RZ_LOG_DEBUG(fmtstr,...)
Definition: rz_log.h:49
#define RZ_LOG_ERROR(fmtstr,...)
Definition: rz_log.h:58
RZ_API ut64 rz_num_math(RzNum *num, const char *str)
Definition: unum.c:456
RZ_API PJ * pj_kb(PJ *j, const char *k, bool v)
Definition: pj.c:177
RZ_API PJ * pj_ki(PJ *j, const char *k, int d)
Definition: pj.c:149
RZ_API PJ * pj_k(PJ *j, const char *k)
Definition: pj.c:104
RZ_API PJ * pj_end(PJ *j)
Definition: pj.c:87
RZ_API PJ * pj_o(PJ *j)
Definition: pj.c:75
RZ_API PJ * pj_s(PJ *j, const char *k)
Definition: pj.c:197
RZ_API PJ * pj_ks(PJ *j, const char *k, const char *v)
Definition: pj.c:170
RZ_API PJ * pj_kn(PJ *j, const char *k, ut64 n)
Definition: pj.c:121
RZ_API PJ * pj_a(PJ *j)
Definition: pj.c:81
#define RZ_STR_ISNOTEMPTY(x)
Definition: rz_str.h:68
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
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 RZ_OWN char * rz_str_escape(RZ_NONNULL const char *buf)
Definition: str.c:1550
#define RZ_STR_ISEMPTY(x)
Definition: rz_str.h:67
RZ_API const char * rz_str_trim_head_ro(const char *str)
Definition: str_trim.c:86
RZ_API const char * rz_str_pad(const char ch, int len)
Definition: str.c:3236
#define PFMT64d
Definition: rz_types.h:394
RzOutputMode
Enum to describe the way data are printed.
Definition: rz_types.h:38
@ RZ_OUTPUT_MODE_LONG
Definition: rz_types.h:44
@ RZ_OUTPUT_MODE_JSON
Definition: rz_types.h:40
@ RZ_OUTPUT_MODE_QUIET
Definition: rz_types.h:42
@ RZ_OUTPUT_MODE_RIZIN
Definition: rz_types.h:41
@ RZ_OUTPUT_MODE_STANDARD
Definition: rz_types.h:39
#define PFMT64x
Definition: rz_types.h:393
#define st64
Definition: rz_types_base.h:10
#define UT64_MAX
Definition: rz_types_base.h:86
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr from
Definition: sfsocketcall.h:123
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr socklen_t static fromlen const void const struct sockaddr to
Definition: sfsocketcall.h:125
static struct sockaddr static addrlen static backlog const void static flags void flags
Definition: sfsocketcall.h:123
#define b(i)
Definition: sha256.c:42
#define f(i)
Definition: sha256.c:46
#define a(i)
Definition: sha256.c:41
RzAnalysisFunction * fcn
Definition: cmd_flag.c:162
RzCmdStateOutput * state
Definition: cmd_flag.c:163
RzCore * core
Definition: cmd_flag.c:496
int cols
Definition: cmd_flag.c:497
Definition: engine.c:71
Definition: z80asm.h:102
Definition: rz_pj.h:12
RzCore * core
Definition: cmd_flag.c:627
const char * pfx
Definition: cmd_flag.c:628
RzList * fcns
Definition: rz_analysis.h:565
Represent the output state of a command handler.
Definition: rz_cmd.h:91
ut64 offset
Definition: rz_core.h:301
RzAnalysis * analysis
Definition: rz_core.h:322
RzIO * io
Definition: rz_core.h:313
RzNum * num
Definition: rz_core.h:316
RzFlag * flags
Definition: rz_core.h:330
RzPrint * print
Definition: rz_core.h:327
ut32 blocksize
Definition: rz_core.h:303
ut64 offset
Definition: rz_flag.h:38
char * comment
Definition: rz_flag.h:42
char * realname
Definition: rz_flag.h:36
char * name
Definition: rz_flag.h:35
bool realnames
Definition: rz_flag.h:49
RzSpaces spaces
Definition: rz_flag.h:47
st64 base
Definition: rz_flag.h:48
RzList * spacestack
Definition: rz_spaces.h:60
Definition: dis.h:43
RZ_API void rz_flag_tags_set(RzFlag *f, const char *name, const char *words)
Definition: tags.c:6
RZ_API RzList * rz_flag_tags_get(RzFlag *f, const char *name)
Definition: tags.c:53
RZ_API RZ_OWN RzList * rz_flag_tags_list(RzFlag *f)
Definition: tags.c:12
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static int sp
Definition: z80asm.c:91
static int addr
Definition: z80asm.c:58
RZ_API bool rz_flag_zone_reset(RzFlag *f)
Definition: zones.c:51
RZ_API bool rz_flag_zone_around(RzFlag *f, ut64 addr, const char **prev, const char **next)
Definition: zones.c:75
RZ_API bool rz_flag_zone_del(RzFlag *f, const char *name)
Definition: zones.c:57
RZ_API bool rz_flag_zone_add(RzFlag *f, const char *name, ut64 addr)
Definition: zones.c:29