Rizin
unix-like reverse engineering framework and cli tools
cmd_eval.c
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2009-2020 pancake <pancake@nopcode.org>
2 // SPDX-License-Identifier: LGPL-3.0-only
3 
4 #include <stddef.h>
5 #include <stdbool.h>
6 #include <rz_core.h>
7 #include "../core_private.h"
8 
9 static bool load_theme(RzCore *core, const char *path) {
10  if (!rz_file_exists(path)) {
11  return false;
12  }
13  core->cmdfilter = "ec ";
14  bool res = rz_core_cmd_file(core, path);
15  if (res) {
17  }
18  core->cmdfilter = NULL;
19  return res;
20 }
21 
22 static bool pal_seek(RzCore *core, RzConsPalSeekMode mode, const char *file, RzListIter *iter) {
23  const char *fn = rz_str_lchr(file, '/');
24  if (!fn) {
25  fn = file;
26  }
27  switch (mode) {
29  const char *next_fn = iter->n ? iter->n->data : NULL;
30  if (!core->curtheme) {
31  return true;
32  }
33  if (next_fn && !strcmp(next_fn, core->curtheme)) {
34  free(core->curtheme);
35  core->curtheme = strdup(fn);
36  return false;
37  }
38  break;
39  }
40  case RZ_CONS_PAL_SEEK_NEXT: {
41  const char *prev_fn = iter->p ? iter->p->data : NULL;
42  if (!core->curtheme) {
43  return true;
44  }
45  if (prev_fn && !strcmp(prev_fn, core->curtheme)) {
46  free(core->curtheme);
47  core->curtheme = strdup(fn);
48  return false;
49  }
50  break;
51  }
52  }
53  return true;
54 }
55 
56 RZ_API bool rz_core_theme_load(RzCore *core, const char *name) {
57  bool failed = false;
58  if (!name || !*name) {
59  return false;
60  }
61  if (!rz_str_cmp(name, "default", strlen(name))) {
62  core->curtheme = rz_str_dup(core->curtheme, name);
64  return true;
65  }
66 
67  char *home_themes = rz_path_home_prefix(RZ_THEMES);
68  char *system_themes = rz_path_system(RZ_THEMES);
69  char *home_file = rz_file_path_join(home_themes, name);
70  char *system_file = rz_file_path_join(system_themes, name);
71  free(system_themes);
72  free(home_themes);
73 
74  if (!load_theme(core, home_file)) {
75  if (load_theme(core, system_file)) {
76  core->curtheme = rz_str_dup(core->curtheme, name);
77  } else {
78  if (load_theme(core, name)) {
79  core->curtheme = rz_str_dup(core->curtheme, name);
80  } else {
81  eprintf("eco: cannot open colorscheme profile (%s)\n", name);
82  failed = true;
83  }
84  }
85  }
86  free(home_file);
87  free(system_file);
88  return !failed;
89 }
90 
91 static void list_themes_in_path(HtPU *themes, const char *path) {
93  const char *fn;
95  rz_list_foreach (files, iter, fn) {
96  if (*fn && *fn != '.') {
97  ht_pu_insert(themes, fn, 1);
98  }
99  }
101 }
102 
104  return core->curtheme;
105 }
106 
107 static bool dict2keylist(void *user, const void *key, const ut64 value) {
108  RzList *list = (RzList *)user;
110  return true;
111 }
112 
121 
122  HtPU *themes = ht_pu_new0();
123  if (!themes) {
124  return NULL;
125  }
126 
128  if (path) {
129  list_themes_in_path(themes, path);
130  RZ_FREE(path);
131  }
132 
134  if (path) {
135  list_themes_in_path(themes, path);
136  RZ_FREE(path);
137  }
138 
140  rz_list_append(list, strdup("default"));
141  ht_pu_foreach(themes, dict2keylist, list);
142 
144  ht_pu_free(themes);
145  return list;
146 }
147 
149  RzListIter *iter;
150  const char *fn;
152 
153  rz_list_foreach (files, iter, fn) {
154  if (*fn && *fn != '.') {
155  if (!pal_seek(core, mode, fn, iter)) {
156  goto done;
157  }
158  }
159  }
161  files = NULL;
162 done:
163  rz_core_theme_load(core, core->curtheme);
165 }
166 
168  if (argc == 3) {
169  if (!rz_cons_pal_set(argv[1], argv[2])) {
170  return RZ_CMD_STATUS_ERROR;
171  }
173  return RZ_CMD_STATUS_OK;
174  } else if (argc == 2) {
175  char color[32];
177  rz_cons_rgb_str(color, sizeof(color), &rcolor);
178  eprintf("(%s)(%sCOLOR" Color_RESET ")\n", argv[1], color);
179  return RZ_CMD_STATUS_OK;
180  }
181  switch (mode) {
184  break;
185  case RZ_OUTPUT_MODE_JSON:
186  rz_cons_pal_list('j', NULL);
187  break;
190  break;
191  default:
192  return RZ_CMD_STATUS_ERROR;
193  };
194  return RZ_CMD_STATUS_OK;
195 }
196 
198  rz_cons_pal_list('c', argv[1]);
199  return RZ_CMD_STATUS_OK;
200 }
201 
203  rz_cons_pal_init(core->cons->context);
204  return RZ_CMD_STATUS_OK;
205 }
206 
209  return RZ_CMD_STATUS_OK;
210 }
211 
214  return RZ_CMD_STATUS_OK;
215 }
216 
219  return RZ_CMD_STATUS_OK;
220 }
221 
224  return RZ_CMD_STATUS_OK;
225 }
226 
228  RzCmdStateOutput state = { 0 };
233  return RZ_CMD_STATUS_OK;
234 }
235 
237  RzList *themes_list = NULL;
238  RzListIter *th_iter;
239  PJ *pj = state->d.pj;
240  const char *th;
241  if (argc == 2) {
242  return bool2status(rz_core_theme_load(core, argv[1]));
243  }
244  themes_list = rz_core_theme_list(core);
245  if (!themes_list) {
246  return RZ_CMD_STATUS_ERROR;
247  }
248  if (state->mode == RZ_OUTPUT_MODE_JSON) {
249  pj_a(pj);
250  }
251  rz_list_foreach (themes_list, th_iter, th) {
252  switch (state->mode) {
253  case RZ_OUTPUT_MODE_JSON: {
254  pj_s(pj, th);
255  break;
256  }
258  rz_cons_printf("%s\n", th);
259  break;
260  default:
261  if (core->curtheme && !strcmp(core->curtheme, th)) {
262  rz_cons_printf("> %s\n", th);
263  } else {
264  rz_cons_printf(" %s\n", th);
265  }
266  }
267  }
268  if (state->mode == RZ_OUTPUT_MODE_JSON) {
269  pj_end(pj);
270  }
271  rz_list_free(themes_list);
272  return RZ_CMD_STATUS_OK;
273 }
274 
277  return RZ_CMD_STATUS_OK;
278 }
279 
282  return RZ_CMD_STATUS_OK;
283 }
284 
286  char *dup = rz_str_newf("bgonly %s", argv[1]);
287  char *color_code = rz_cons_pal_parse(dup, NULL);
288  RZ_FREE(dup);
289  if (!color_code) {
290  eprintf("Unknown color %s\n", argv[1]);
291  return RZ_CMD_STATUS_ERROR;
292  }
294  const char *str = rz_meta_get_string(core->analysis, RZ_META_TYPE_HIGHLIGHT, core->offset);
295  dup = rz_str_newf("%s \"%s\"", str ? str : "", color_code ? color_code : rz_cons_singleton()->context->pal.wordhl);
297  RZ_FREE(color_code);
298  RZ_FREE(dup);
299  return RZ_CMD_STATUS_OK;
300 }
301 
303  char *color_code = NULL, *dup = NULL;
304  if (argc == 3) {
305  dup = rz_str_newf("bgonly %s", argv[2]);
306  color_code = rz_cons_pal_parse(dup, NULL);
307  RZ_FREE(dup);
308  if (!color_code) {
309  eprintf("Unknown color %s\n", argv[2]);
310  return RZ_CMD_STATUS_ERROR;
311  }
312  }
314  const char *str = rz_meta_get_string(core->analysis, RZ_META_TYPE_HIGHLIGHT, core->offset);
315  dup = rz_str_newf("%s \"%s%s\"", str, argv[1], color_code ? color_code : rz_cons_singleton()->context->pal.wordhl);
317  RZ_FREE(dup);
318  RZ_FREE(color_code);
319  return RZ_CMD_STATUS_OK;
320 }
321 
323  RzCmdStateOutput state = { 0 };
328  return RZ_CMD_STATUS_OK;
329 }
330 
333  return RZ_CMD_STATUS_OK;
334 }
335 
338  return RZ_CMD_STATUS_OK;
339 }
340 
341 RZ_IPI RzCmdStatus rz_eval_getset_handler(RzCore *core, int argc, const char **argv) {
342  int i;
343  for (i = 1; i < argc; i++) {
344  RzList *l = rz_str_split_duplist_n(argv[i], "=", 1, false);
345  if (!l) {
346  return RZ_CMD_STATUS_ERROR;
347  }
348  size_t llen = rz_list_length(l);
349  if (!llen) {
350  return RZ_CMD_STATUS_ERROR;
351  }
352  char *key = rz_list_get_n(l, 0);
353  if (RZ_STR_ISEMPTY(key)) {
354  eprintf("No string specified before `=`. Make sure to use the format <key>=<value> without spaces.\n");
355  continue;
356  }
357 
358  if (llen == 1 && rz_str_endswith(key, ".")) {
359  // no value was set, only key with ".". List possible sub-keys.
360  RzCmdStateOutput state = { 0 };
365  } else if (llen == 1) {
366  // no value was set, show the value of the key
367  const char *v = rz_config_get(core->config, key);
368  if (!v) {
369  eprintf("Invalid config key '%s'\n", key);
370  return RZ_CMD_STATUS_ERROR;
371  }
372  rz_cons_printf("%s\n", v);
373  } else if (llen == 2) {
374  char *value = rz_list_get_n(l, 1);
375  rz_config_set(core->config, key, value);
376  }
377  rz_list_free(l);
378  }
379  return RZ_CMD_STATUS_OK;
380 }
381 
383  const char *arg = argc > 1 ? argv[1] : "";
385  return RZ_CMD_STATUS_OK;
386 }
387 
388 RZ_IPI RzCmdStatus rz_eval_reset_handler(RzCore *core, int argc, const char **argv) {
390 }
391 
392 RZ_IPI RzCmdStatus rz_eval_bool_invert_handler(RzCore *core, int argc, const char **argv) {
393  if (!rz_config_toggle(core->config, argv[1])) {
394  eprintf("Cannot toggle config key '%s'\n", argv[1]);
395  return RZ_CMD_STATUS_ERROR;
396  }
397  return RZ_CMD_STATUS_OK;
398 }
399 
400 RZ_IPI RzCmdStatus rz_eval_editor_handler(RzCore *core, int argc, const char **argv) {
401  const char *val = rz_config_get(core->config, argv[1]);
402  if (!val) {
403  eprintf("Invalid config key '%s'", argv[1]);
404  return RZ_CMD_STATUS_ERROR;
405  }
406  char *p = rz_core_editor(core, NULL, val);
407  if (!p) {
408  return RZ_CMD_STATUS_ERROR;
409  }
410  rz_str_replace_char(p, '\n', ';');
411  rz_config_set(core->config, argv[1], p);
412  return RZ_CMD_STATUS_OK;
413 }
414 
415 RZ_IPI RzCmdStatus rz_eval_readonly_handler(RzCore *core, int argc, const char **argv) {
416  if (!rz_config_readonly(core->config, argv[1])) {
417  eprintf("Cannot make eval '%s' readonly.\n", argv[1]);
418  return RZ_CMD_STATUS_ERROR;
419  }
420  return RZ_CMD_STATUS_OK;
421 }
422 
423 RZ_IPI RzCmdStatus rz_eval_spaces_handler(RzCore *core, int argc, const char **argv) {
424  const char *arg = argc > 1 ? argv[1] : NULL;
426  if (!list) {
427  return RZ_CMD_STATUS_ERROR;
428  }
429  RzListIter *iter;
430  char *name;
431  rz_list_foreach (list, iter, name) {
433  }
435  return RZ_CMD_STATUS_OK;
436 }
437 
438 RZ_IPI RzCmdStatus rz_eval_type_handler(RzCore *core, int argc, const char **argv) {
439  RzConfigNode *node = rz_config_node_get(core->config, argv[1]);
440  if (!node) {
441  eprintf("Cannot find eval '%s'.\n", argv[1]);
442  return RZ_CMD_STATUS_ERROR;
443  }
444 
445  const char *type = rz_config_node_type(node);
446  if (!type) {
447  eprintf("Cannot find type of eval '%s'.\n", argv[1]);
448  return RZ_CMD_STATUS_ERROR;
449  }
451  return RZ_CMD_STATUS_OK;
452 }
#define RZ_IPI
Definition: analysis_wasm.c:11
lzma_index ** i
Definition: index.h:629
ut16 val
Definition: armass64_const.h:6
RZ_API void rz_core_config_print_all(RzConfig *cfg, const char *str, RzCmdStateOutput *state)
Prints the configuation variables with their description and its values.
Definition: cconfig.c:1770
RZ_API int rz_core_config_init(RzCore *core)
Definition: cconfig.c:2830
RZ_API RZ_OWN RzList * rz_core_config_in_space(RZ_NONNULL RzCore *core, RZ_NULLABLE const char *space)
Get config variable spaces.
Definition: cconfig.c:3759
RZ_API int rz_core_cmd_file(RzCore *core, const char *file)
Definition: cmd.c:5341
RZ_API bool rz_cmd_state_output_init(RZ_NONNULL RzCmdStateOutput *state, RzOutputMode mode)
Initialize a RzCmdStateOutput structure and its inner fields based on the provided mode.
Definition: cmd_api.c:2634
RZ_API void rz_cmd_state_output_fini(RZ_NONNULL RzCmdStateOutput *state)
Clear the inner fields of RzCmdStateOutput structure, but do not free it.
Definition: cmd_api.c:2603
static int value
Definition: cmd_api.c:93
RZ_API void rz_cmd_state_output_print(RZ_NONNULL RzCmdStateOutput *state)
Print the output accumulated in state to RzCons, if necessary.
Definition: cmd_api.c:2668
RZ_IPI RzCmdStatus rz_cmd_eval_color_highlight_instruction_word_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_eval.c:302
RZ_IPI RzCmdStatus rz_cmd_eval_color_set_default_palette_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_eval.c:202
RZ_IPI RzCmdStatus rz_cmd_eval_color_set_random_palette_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_eval.c:207
RZ_IPI RzCmdStatus rz_cmd_eval_color_highlight_list_handler(RzCore *core, int argc, const char **argv, RzOutputMode mode)
Definition: cmd_eval.c:227
RZ_API void rz_core_theme_nextpal(RzCore *core, RzConsPalSeekMode mode)
Definition: cmd_eval.c:148
RZ_IPI RzCmdStatus rz_cmd_eval_color_highlight_current_instruction_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_eval.c:285
RZ_IPI RzCmdStatus rz_cmd_eval_color_list_reload_current_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_eval.c:280
static void list_themes_in_path(HtPU *themes, const char *path)
Definition: cmd_eval.c:91
RZ_IPI RzCmdStatus rz_cmd_eval_color_load_theme_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
Definition: cmd_eval.c:236
RZ_IPI RzCmdStatus rz_eval_list_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
Definition: cmd_eval.c:382
RZ_IPI RzCmdStatus rz_eval_bool_invert_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_eval.c:392
RZ_IPI RzCmdStatus rz_eval_type_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_eval.c:438
static bool dict2keylist(void *user, const void *key, const ut64 value)
Definition: cmd_eval.c:107
RZ_IPI RzCmdStatus rz_cmd_eval_color_display_palette_css_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_eval.c:197
RZ_IPI RzCmdStatus rz_cmd_eval_color_highlight_list_current_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_eval.c:322
RZ_IPI RzCmdStatus rz_eval_reset_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_eval.c:388
RZ_IPI RzCmdStatus rz_eval_getset_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_eval.c:341
static bool pal_seek(RzCore *core, RzConsPalSeekMode mode, const char *file, RzListIter *iter)
Definition: cmd_eval.c:22
static bool load_theme(RzCore *core, const char *path)
Definition: cmd_eval.c:9
RZ_IPI RzCmdStatus rz_cmd_eval_color_highlight_remove_current_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_eval.c:336
RZ_API RZ_OWN RzList * rz_core_theme_list(RZ_NONNULL RzCore *core)
Returns the list of the rizin themes.
Definition: cmd_eval.c:119
RZ_IPI RzCmdStatus rz_cmd_eval_color_list_current_theme_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_eval.c:275
RZ_IPI RzCmdStatus rz_cmd_eval_color_list_handler(RzCore *core, int argc, const char **argv, RzOutputMode mode)
Definition: cmd_eval.c:167
RZ_IPI RzCmdStatus rz_cmd_eval_color_highlight_remove_all_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_eval.c:331
RZ_IPI RzCmdStatus rz_eval_spaces_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_eval.c:423
RZ_IPI RzCmdStatus rz_cmd_eval_color_load_previous_theme_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_eval.c:217
RZ_API char * rz_core_theme_get(RzCore *core)
Definition: cmd_eval.c:103
RZ_IPI RzCmdStatus rz_cmd_eval_color_load_next_theme_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_eval.c:222
RZ_API bool rz_core_theme_load(RzCore *core, const char *name)
Definition: cmd_eval.c:56
RZ_IPI RzCmdStatus rz_eval_readonly_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_eval.c:415
RZ_IPI RzCmdStatus rz_cmd_eval_color_set_colorful_palette_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_eval.c:212
RZ_IPI RzCmdStatus rz_eval_editor_handler(RzCore *core, int argc, const char **argv)
Definition: cmd_eval.c:400
RZ_IPI void rz_core_meta_print_list_in_function(RzCore *core, RzAnalysisMetaType type, ut64 addr, RzCmdStateOutput *state)
Definition: cmeta.c:370
RZ_IPI void rz_core_meta_print_list_all(RzCore *core, RzAnalysisMetaType type, RzCmdStateOutput *state)
Definition: cmeta.c:364
RZ_API RzConfigNode * rz_config_set(RzConfig *cfg, RZ_NONNULL const char *name, const char *value)
Definition: config.c:267
RZ_API bool rz_config_readonly(RzConfig *cfg, const char *key)
Definition: config.c:481
RZ_API RZ_BORROW RzConfigNode * rz_config_node_get(RzConfig *cfg, RZ_NONNULL const char *name)
Definition: config.c:48
RZ_API RZ_BORROW const char * rz_config_get(RzConfig *cfg, RZ_NONNULL const char *name)
Definition: config.c:75
RZ_API const char * rz_config_node_type(RzConfigNode *node)
Definition: config.c:155
RZ_API bool rz_config_toggle(RzConfig *cfg, RZ_NONNULL const char *name)
Definition: config.c:97
RZ_API RzCons * rz_cons_singleton(void)
Definition: cons.c:300
RZ_API int rz_cons_printf(const char *format,...)
Definition: cons.c:1202
RZ_API void rz_cons_println(const char *str)
Definition: cons.c:233
#define RZ_API
static RzCmdStatus bool2status(bool val)
Definition: core_private.h:208
#define NULL
Definition: cris-opc.c:27
static static fork const void static count static fd const char const char static newpath const char static path const char path
Definition: sflib.h:35
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
const char * v
Definition: dsignal.c:12
struct tab * done
Definition: enough.c:233
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 special files
Definition: file_opts.h:46
RZ_API void Ht_() free(HtName_(Ht) *ht)
Definition: ht_inc.c:130
const char int mode
Definition: ioapi.h:137
void * p
Definition: libc.cpp:67
RZ_API RZ_OWN char * rz_core_editor(const RzCore *core, RZ_NULLABLE const char *file, RZ_NULLABLE const char *str)
Definition: core.c:3214
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 void * rz_list_get_n(RZ_NONNULL const RzList *list, ut32 n)
Returns the N-th element of the list.
Definition: list.c:574
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
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig const char static mode dup
Definition: sflib.h:68
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 const char * rz_meta_get_string(RzAnalysis *a, RzAnalysisMetaType type, ut64 addr)
Definition: meta.c:146
RZ_API void rz_meta_del(RzAnalysis *a, RzAnalysisMetaType type, ut64 addr, ut64 size)
Definition: meta.c:187
RZ_API bool rz_meta_set_string(RzAnalysis *a, RzAnalysisMetaType type, ut64 addr, const char *s)
Definition: meta.c:141
int type
Definition: mipsasm.c:17
const char * name
Definition: op.c:541
RZ_API RzColor rz_cons_pal_get(const char *key)
Definition: pal.c:626
RZ_API void rz_cons_pal_show(void)
Definition: pal.c:501
RZ_API void rz_cons_pal_update_event(void)
Definition: pal.c:652
RZ_API int rz_cons_pal_set(const char *key, const char *val)
Definition: pal.c:611
RZ_API void rz_cons_pal_list(int rad, const char *arg)
Definition: pal.c:528
RZ_API void rz_cons_pal_init(RzConsContext *ctx)
Definition: pal.c:154
RzColor rcolor
Definition: pal.c:97
RZ_API char * rz_cons_pal_parse(const char *str, RzColor *outcol)
Definition: pal.c:281
RZ_API void rz_cons_pal_random(void)
Definition: pal.c:270
RZ_API char * rz_cons_rgb_str(char *outstr, size_t sz, const RzColor *rcolor)
Definition: rgb.c:318
#define eprintf(x, y...)
Definition: rlcc.c:7
@ RZ_META_TYPE_HIGHLIGHT
Definition: rz_analysis.h:296
@ RZ_META_TYPE_COMMENT
Definition: rz_analysis.h:295
#define rz_return_val_if_fail(expr, val)
Definition: rz_assert.h:108
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
#define Color_RESET
Definition: rz_cons.h:617
RzConsPalSeekMode
Definition: rz_cons.h:460
@ RZ_CONS_PAL_SEEK_NEXT
Definition: rz_cons.h:462
@ RZ_CONS_PAL_SEEK_PREVIOUS
Definition: rz_cons.h:461
RZ_API bool rz_file_exists(const char *str)
Definition: file.c:192
RZ_API RZ_OWN char * rz_file_path_join(RZ_NONNULL const char *s1, RZ_NULLABLE const char *s2)
Concatenate two paths to create a new one with s1+s2 with the correct path separator.
Definition: file.c:1312
int(* RzListComparator)(const void *value, const void *list_data)
Definition: rz_list.h:33
RZ_API RZ_OWN char * rz_path_home_prefix(RZ_NULLABLE const char *path)
Return path prefixed by the home prefix.
Definition: path.c:182
RZ_API RZ_OWN char * rz_path_system(RZ_NULLABLE const char *path)
Return the full system path of the given subpath path.
Definition: path.c:162
RZ_API PJ * pj_end(PJ *j)
Definition: pj.c:87
RZ_API PJ * pj_s(PJ *j, const char *k)
Definition: pj.c:197
RZ_API PJ * pj_a(PJ *j)
Definition: pj.c:81
RZ_API const char * rz_str_lchr(const char *str, char chr)
Definition: str.c:669
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
RZ_API char * rz_str_dup(char *ptr, const char *string)
Definition: str.c:1021
#define RZ_STR_ISEMPTY(x)
Definition: rz_str.h:67
RZ_API int rz_str_replace_char(char *s, int a, int b)
Definition: str.c:169
RZ_API int rz_str_cmp(const char *dst, const char *orig, int len)
Definition: str.c:974
RZ_API bool rz_str_endswith(RZ_NONNULL const char *str, RZ_NONNULL const char *needle)
Checks if a string ends with a specifc sequence of characters (case sensitive)
Definition: str.c:3329
RZ_API RzList * rz_str_split_duplist_n(const char *str, const char *c, int n, bool trim)
Split the string str according to the substring c and returns a RzList with the result.
Definition: str.c:3485
RZ_API RzList * rz_sys_dir(const char *path)
Definition: sys.c:216
#define RZ_OWN
Definition: rz_types.h:62
#define RZ_NONNULL
Definition: rz_types.h:64
RzOutputMode
Enum to describe the way data are printed.
Definition: rz_types.h:38
@ 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 RZ_FREE(x)
Definition: rz_types.h:369
#define UT64_MAX
Definition: rz_types_base.h:86
#define RZ_THEMES
Definition: rz_userconf.h:76
Definition: gzappend.c:170
Definition: z80asm.h:102
Definition: rz_pj.h:12
Represent the output state of a command handler.
Definition: rz_cmd.h:91
RzConsContext * context
Definition: rz_cons.h:502
RzCons * cons
Definition: rz_core.h:312
ut64 offset
Definition: rz_core.h:301
RzAnalysis * analysis
Definition: rz_core.h:322
char * cmdfilter
Definition: rz_core.h:371
char * curtheme
Definition: rz_core.h:372
RzConfig * config
Definition: rz_core.h:300
Definition: dis.h:43
static int color
Definition: visual.c:20
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static int file
Definition: z80asm.c:58