Rizin
unix-like reverse engineering framework and cli tools
cconfig.c File Reference
#include <rz_core.h>
#include <rz_cons.h>
#include <rz_basefind.h>
#include <rz_th.h>
#include <rz_windows.h>
#include <rz_config.h>
#include "core_private.h"

Go to the source code of this file.

Classes

struct  namealiases_pair
 

Functions

static bool boolify_var_cb (void *user, void *data)
 
static void set_options (RzConfigNode *node,...)
 
static bool isGdbPlugin (RzCore *core)
 
static void print_node_options (RzConfigNode *node)
 
static int compareName (const RzAnalysisFunction *a, const RzAnalysisFunction *b)
 
static int compareNameLen (const RzAnalysisFunction *a, const RzAnalysisFunction *b)
 
static int compareAddress (const RzAnalysisFunction *a, const RzAnalysisFunction *b)
 
static int compareType (const RzAnalysisFunction *a, const RzAnalysisFunction *b)
 
static int compareSize (const RzAnalysisFunction *a, const RzAnalysisFunction *b)
 
static int compareDist (const RzAnalysisFunction *a, const RzAnalysisFunction *b)
 
static bool cb_diff_sort (void *_core, void *_node)
 
static void __setsegoff (RzConfig *cfg, const char *asmarch, int asmbits)
 
static bool cb_debug_hitinfo (void *user, void *data)
 
static bool cb_analysis_jmpretpoline (void *user, void *data)
 
static bool cb_analysis_jmptailcall (void *user, void *data)
 
static bool cb_analysis_armthumb (void *user, void *data)
 
static bool cb_analysis_depth (void *user, void *data)
 
static bool cb_analysis_graphdepth (void *user, void *data)
 
static bool cb_analysis_afterjmp (void *user, void *data)
 
static bool cb_analysis_aftertrap (void *user, void *data)
 
static bool cb_analysis_delay (void *user, void *data)
 
static bool cb_analysis_vars (void *user, void *data)
 
static bool cb_analysis_vars_stackname (void *user, void *data)
 
static bool cb_analysis_nonull (void *user, void *data)
 
static bool cb_analysis_strings (void *user, void *data)
 
static bool cb_analysis_ignbithints (void *user, void *data)
 
static bool cb_analysis_sleep (void *user, void *data)
 
static bool cb_analysis_maxrefs (void *user, void *data)
 
static bool cb_analysis_norevisit (void *user, void *data)
 
static bool cb_analysis_nopskip (void *user, void *data)
 
static bool cb_analysis_hpskip (void *user, void *data)
 
static void update_analysis_arch_options (RzCore *core, RzConfigNode *node)
 
static bool cb_analysis_arch (void *user, void *data)
 
static bool cb_analysis_cpu (void *user, void *data)
 
static bool cb_analysis_recont (void *user, void *data)
 
static bool cb_analysis_ijmp (void *user, void *data)
 
static bool cb_asmsubvarmin (void *user, void *data)
 
static bool cb_asmsubtail (void *user, void *data)
 
static bool cb_scrlast (void *user, void *data)
 
static bool cb_scr_vi (void *user, void *data)
 
static bool cb_scr_prompt_mode (void *user, void *data)
 
static bool cb_scr_wideoff (void *user, void *data)
 
static bool cb_scrrainbow (void *user, void *data)
 
static bool cb_asmpseudo (void *user, void *data)
 
static bool cb_asmsubsec (void *user, void *data)
 
static bool cb_asmassembler (void *user, void *data)
 
static void update_asmcpu_options (RzCore *core, RzConfigNode *node)
 
static bool cb_asmcpu (void *user, void *data)
 
static void update_asmarch_options (RzCore *core, RzConfigNode *node)
 
static void update_asmbits_options (RzCore *core, RzConfigNode *node)
 
static void update_syscall_ns (RzCore *core)
 
static bool cb_asmarch (void *user, void *data)
 
static bool cb_dbgbtdepth (void *user, void *data)
 
static bool cb_asmbits (void *user, void *data)
 
static void update_asmfeatures_options (RzCore *core, RzConfigNode *node)
 
static bool cb_flag_realnames (void *user, void *data)
 
static bool cb_asmfeatures (void *user, void *data)
 
static void update_asmplatforms_options (RzCore *core, RzConfigNode *node)
 
static bool cb_asmplatform (void *user, void *data)
 
static bool cb_asmlineswidth (void *user, void *data)
 
static bool cb_emustr (void *user, void *data)
 
static bool cb_emuskip (void *user, void *data)
 
static bool cb_asm_immhash (void *user, void *data)
 
static bool cb_asm_invhex (void *user, void *data)
 
static bool cb_asm_pcalign (void *user, void *data)
 
static bool cb_asmos (void *user, void *data)
 
static void update_asmparser_options (RzCore *core, RzConfigNode *node)
 
static bool cb_asmparser (void *user, void *data)
 
static bool cb_binstrenc (void *user, void *data)
 
static bool cb_binfilter (void *user, void *data)
 
static bool cb_binat (void *user, void *data)
 
static bool cb_usextr (void *user, void *data)
 
static bool cb_strpurge (void *user, void *data)
 
static bool cb_maxname (void *user, void *data)
 
static bool cb_midflags (void *user, void *data)
 
static bool cb_strfilter (void *user, void *data)
 
static bool cb_binforce (void *user, void *data)
 
static bool cb_asmsyntax (void *user, void *data)
 
static bool cb_bigendian (void *user, void *data)
 
static bool cb_cfgdatefmt (void *user, void *data)
 
static bool cb_timezone (void *user, void *data)
 
static bool cb_cfgdebug (void *user, void *data)
 
static bool cb_dirhome (void *user, void *data)
 
static bool cb_dirtmp (void *user, void *data)
 
static bool cb_dirsrc (void *user, void *data)
 
static bool cb_str_escbslash (void *user, void *data)
 
static bool cb_strsearch_check_ascii_freq (void *user, void *data)
 
static bool cb_completion_maxtab (void *user, void *data)
 
static bool cb_cfg_fortunes (void *user, void *data)
 
static bool cb_cfg_fortunes_file (void *user, void *data)
 
static bool cb_cmdtimes (void *user, void *data)
 
static bool cb_cmdrepeat (void *user, void *data)
 
static bool cb_scrnull (void *user, void *data)
 
static bool cb_color (void *user, void *data)
 
static bool cb_color_getter (void *user, RzConfigNode *node)
 
static bool cb_decoff (void *user, void *data)
 
static bool cb_dbgbep (void *user, void *data)
 
static bool cb_dbg_btalgo (void *user, void *data)
 
static bool cb_dbg_libs (void *user, void *data)
 
static bool cb_dbg_unlibs (void *user, void *data)
 
static bool cb_dbg_bpinmaps (void *user, void *data)
 
static bool cb_dbg_forks (void *user, void *data)
 
static bool cb_dbg_gdb_page_size (void *user, void *data)
 
static bool cb_dbg_gdb_retries (void *user, void *data)
 
static bool cb_dbg_execs (void *user, void *data)
 
static bool cb_dbg_clone (void *user, void *data)
 
static bool cb_dbg_follow_child (void *user, void *data)
 
static bool cb_dbg_create_new_console (void *user, void *data)
 
static bool cb_dbg_trace_continue (void *user, void *data)
 
static bool cb_dbg_aftersc (void *user, void *data)
 
static bool cb_runprofile (void *user, void *data)
 
static bool cb_dbg_args (void *user, void *data)
 
static bool cb_dbgbackend (void *user, void *data)
 
static bool cb_gotolimit (void *user, void *data)
 
static bool cb_esilverbose (void *user, void *data)
 
static bool cb_esilstackdepth (void *user, void *data)
 
static bool cb_fixrows (void *user, void *data)
 
static bool cb_fixcolumns (void *user, void *data)
 
static bool cb_rows (void *user, void *data)
 
static bool cb_cmd_hexcursor (void *user, void *data)
 
static bool cb_hexcompact (void *user, void *data)
 
static bool cb_hex_pairs (void *user, void *data)
 
static bool cb_hex_section (void *user, void *data)
 
static bool cb_hex_align (void *user, void *data)
 
static bool cb_io_unalloc (void *user, void *data)
 
static bool cb_io_unalloc_ch (void *user, void *data)
 
static bool cb_hex_header (void *user, void *data)
 
static bool cb_hex_bytes (void *user, void *data)
 
static bool cb_hex_ascii (void *user, void *data)
 
static bool cb_hex_style (void *user, void *data)
 
static bool cb_hex_hdroff (void *user, void *data)
 
static bool cb_log_events (void *user, void *data)
 
static bool cb_hexcomments (void *user, void *data)
 
static bool cb_iopcache (void *user, void *data)
 
static bool cb_iopcacheread (void *user, void *data)
 
static bool cb_iopcachewrite (void *user, void *data)
 
RZ_API bool rz_core_esil_cmd (RzAnalysisEsil *esil, const char *cmd, ut64 a1, ut64 a2)
 
static void config_print_node (RzConfig *cfg, RzConfigNode *node, RzCmdStateOutput *state)
 
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. More...
 
static bool cb_cmd_esil_ioer (void *user, void *data)
 
static bool cb_cmd_esil_todo (void *user, void *data)
 
static bool cb_cmd_esil_intr (void *user, void *data)
 
static bool cb_mdevrange (void *user, void *data)
 
static bool cb_cmd_esil_step (void *user, void *data)
 
static bool cb_cmd_esil_step_out (void *user, void *data)
 
static bool cb_cmd_esil_mdev (void *user, void *data)
 
static bool cb_cmd_esil_trap (void *user, void *data)
 
static bool cb_cmddepth (void *user, void *data)
 
static bool cb_hexcols (void *user, void *data)
 
static bool cb_hexstride (void *user, void *data)
 
static bool cb_search_kwidx (void *user, void *data)
 
static bool cb_io_cache_mode (void *user, void *data)
 
static bool cb_io_cache_read (void *user, void *data)
 
static bool cb_io_cache_write (void *user, void *data)
 
static bool cb_io_cache (void *user, void *data)
 
static bool cb_ioaslr (void *user, void *data)
 
static bool cb_io_pava (void *user, void *data)
 
static bool cb_iova (void *user, void *data)
 
static bool cb_ioff (void *user, void *data)
 
static bool cb_io_oxff (void *user, void *data)
 
static bool cb_filepath (void *user, void *data)
 
static bool cb_ioautofd (void *user, void *data)
 
static bool cb_scr_color_grep (void *user, void *data)
 
static bool cb_scr_color_grep_highlight (void *user, void *data)
 
static bool cb_pager (void *user, void *data)
 
static bool cb_breaklines (void *user, void *data)
 
static bool cb_scr_gadgets (void *user, void *data)
 
static bool cb_scrbreakword (void *user, void *data)
 
static bool cb_scrcolumns (void *user, void *data)
 
static bool cb_scrfgets (void *user, void *data)
 
static bool cb_scrhtml (void *user, void *data)
 
static bool cb_scrhighlight (void *user, void *data)
 
static bool cb_screcho (void *user, void *data)
 
static bool cb_scrlinesleep (void *user, void *data)
 
static bool cb_scrpagesize (void *user, void *data)
 
static bool cb_scrflush (void *user, void *data)
 
static bool cb_scrstrconv (void *user, void *data)
 
static bool cb_graphformat (void *user, void *data)
 
static bool cb_exectrap (void *user, void *data)
 
static bool cb_iotrap (void *user, void *data)
 
static bool cb_scr_bgfill (void *user, void *data)
 
static bool cb_scrint (void *user, void *data)
 
static bool cb_scrnkey (void *user, void *data)
 
static bool cb_scr_histblock (void *user, void *data)
 
static bool cb_scrprompt (void *user, void *data)
 
static bool cb_scrrows (void *user, void *data)
 
static bool cb_contiguous (void *user, void *data)
 
static bool cb_searchalign (void *user, void *data)
 
static bool cb_segoff (void *user, void *data)
 
static bool cb_seggrn (void *user, void *data)
 
static bool cb_stopthreads (void *user, void *data)
 
static bool cb_scr_prompt_popup (void *user, void *data)
 
static bool cb_swstep (void *user, void *data)
 
static bool cb_consbreak (void *user, void *data)
 
static bool cb_teefile (void *user, void *data)
 
static bool cb_trace (void *user, void *data)
 
static bool cb_tracetag (void *user, void *data)
 
static bool cb_utf8 (void *user, void *data)
 
static bool cb_utf8_curvy (void *user, void *data)
 
static bool cb_visual_mode (void *user, void *data)
 
static bool cb_dotted (void *user, void *data)
 
static bool cb_zoombyte (void *user, void *data)
 
static bool cb_binverbose (void *user, void *data)
 
static bool cb_debase64 (void *user, void *data)
 
static bool cb_binstrings (void *user, void *data)
 
static bool cb_bindbginfo (void *user, void *data)
 
static bool cb_binprefix (void *user, void *data)
 
static bool cb_binmaxstrbuf (void *user, void *data)
 
static bool cb_binmaxstr (void *user, void *data)
 
static bool cb_binminstr (void *user, void *data)
 
static bool cb_searchin (void *user, void *data)
 
static int __dbg_swstep_getter (void *user, RzConfigNode *node)
 
static bool cb_analysis_roregs (RzCore *core, RzConfigNode *node)
 
static bool cb_analysissyscc (RzCore *core, RzConfigNode *node)
 
static bool cb_analysiscc (RzCore *core, RzConfigNode *node)
 
static bool cb_analysis_gp (RzCore *core, RzConfigNode *node)
 
static bool cb_analysis_from (RzCore *core, RzConfigNode *node)
 
static bool cb_analysis_limits (void *user, RzConfigNode *node)
 
static bool cb_analysis_rnr (void *user, RzConfigNode *node)
 
static bool cb_analysis_jmptbl (void *user, void *data)
 
static bool cb_analysis_jmptblmax (void *user, void *data)
 
static bool cb_analysis_jmptblmaxoffset (void *user, void *data)
 
static bool cb_analysis_cjmpref (void *user, void *data)
 
static bool cb_analysis_jmpref (void *user, void *data)
 
static bool cb_analysis_jmpabove (void *user, void *data)
 
static bool cb_analysis_loads (void *user, void *data)
 
static bool cb_analysis_followdatarefs (void *user, void *data)
 
static bool cb_analysis_jmpmid (void *user, void *data)
 
static bool cb_analysis_searchstringrefs (void *user, void *data)
 
static bool cb_analysis_pushret (void *user, void *data)
 
static bool cb_analysis_brokenrefs (void *user, void *data)
 
static bool cb_analysis_trycatch (void *user, void *data)
 
static bool cb_analysis_bb_max_size (void *user, void *data)
 
static bool cb_analysis_cpp_abi (void *user, void *data)
 
static bool cb_malloc (void *user, void *data)
 
static bool cb_log_config_level (void *coreptr, void *nodeptr)
 
static bool cb_log_config_traplevel (void *coreptr, void *nodeptr)
 
static bool cb_log_config_file (void *coreptr, void *nodeptr)
 
static bool cb_log_config_srcinfo (void *coreptr, void *nodeptr)
 
static bool cb_log_config_colors (void *coreptr, void *nodeptr)
 
static bool cb_dbg_verbose (void *user, void *data)
 
static bool cb_flirt (void *user, void *data)
 
RZ_API int rz_core_config_init (RzCore *core)
 
RZ_API void rz_core_parse_rizinrc (RzCore *r)
 
RZ_API RZ_OWN RzListrz_core_config_in_space (RZ_NONNULL RzCore *core, RZ_NULLABLE const char *space)
 Get config variable spaces. More...
 

Function Documentation

◆ __dbg_swstep_getter()

static int __dbg_swstep_getter ( void *  user,
RzConfigNode node 
)
static

Definition at line 2564 of file cconfig.c.

2564  {
2565  RzCore *core = (RzCore *)user;
2566  node->i_value = core->dbg->swstep;
2567  return true;
2568 }
RzDebug * dbg
Definition: rz_core.h:329
int swstep
Definition: rz_debug.h:261

References rz_core_t::dbg, rz_config_node_t::i_value, and rz_debug_t::swstep.

Referenced by rz_core_config_init().

◆ __setsegoff()

static void __setsegoff ( RzConfig cfg,
const char *  asmarch,
int  asmbits 
)
inlinestatic

Definition at line 115 of file cconfig.c.

115  {
116  int autoseg = (!strncmp(asmarch, "x86", 3) && asmbits == 16);
117  rz_config_set(cfg, "asm.segoff", rz_str_bool(autoseg));
118 }
RZ_API RzConfigNode * rz_config_set(RzConfig *cfg, RZ_NONNULL const char *name, const char *value)
Definition: config.c:267
RZ_API const char * rz_str_bool(int b)
Definition: str.c:3896

References rz_config_set(), and rz_str_bool().

Referenced by cb_asmarch(), cb_asmbits(), and cb_asmos().

◆ boolify_var_cb()

static bool boolify_var_cb ( void *  user,
void *  data 
)
static

Definition at line 13 of file cconfig.c.

13  {
14  RzConfigNode *node = (RzConfigNode *)data;
15  if (node->i_value || rz_str_is_false(node->value)) {
16  free(node->value);
17  node->value = strdup(rz_str_bool(node->i_value));
18  }
19  return true;
20 }
RZ_API void Ht_() free(HtName_(Ht) *ht)
Definition: ht_inc.c:130
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 bool rz_str_is_false(const char *s)
Definition: str.c:3904

References free(), rz_config_node_t::i_value, rz_str_bool(), rz_str_is_false(), strdup(), and rz_config_node_t::value.

◆ cb_analysis_afterjmp()

static bool cb_analysis_afterjmp ( void *  user,
void *  data 
)
static

Definition at line 161 of file cconfig.c.

161  {
162  RzCore *core = (RzCore *)user;
163  RzConfigNode *node = (RzConfigNode *)data;
164  core->analysis->opt.afterjmp = node->i_value;
165  return true;
166 }
RzAnalysisOptions opt
Definition: rz_analysis.h:608
RzAnalysis * analysis
Definition: rz_core.h:322

References rz_analysis_options_t::afterjmp, rz_core_t::analysis, rz_config_node_t::i_value, and rz_analysis_t::opt.

Referenced by rz_core_config_init().

◆ cb_analysis_aftertrap()

static bool cb_analysis_aftertrap ( void *  user,
void *  data 
)
static

Definition at line 168 of file cconfig.c.

168  {
169  RzCore *core = (RzCore *)user;
170  RzConfigNode *node = (RzConfigNode *)data;
171  core->analysis->opt.aftertrap = node->i_value;
172  return true;
173 }

References rz_analysis_options_t::aftertrap, rz_core_t::analysis, rz_config_node_t::i_value, and rz_analysis_t::opt.

Referenced by rz_core_config_init().

◆ cb_analysis_arch()

static bool cb_analysis_arch ( void *  user,
void *  data 
)
static

Definition at line 265 of file cconfig.c.

265  {
266  RzCore *core = (RzCore *)user;
267  RzConfigNode *node = (RzConfigNode *)data;
268  if (*node->value == '?') {
269  update_analysis_arch_options(core, node);
270  print_node_options(node);
271  return false;
272  }
273  if (*node->value) {
274  if (rz_analysis_use(core->analysis, node->value)) {
275  return true;
276  }
277  const char *aa = rz_config_get(core->config, "asm.arch");
278  if (!aa || strcmp(aa, node->value)) {
279  eprintf("analysis.arch: cannot find '%s'\n", node->value);
280  }
281  }
282  return false;
283 }
RZ_API bool rz_analysis_use(RzAnalysis *analysis, const char *name)
Definition: analysis.c:184
static void update_analysis_arch_options(RzCore *core, RzConfigNode *node)
Definition: cconfig.c:254
static void print_node_options(RzConfigNode *node)
Definition: cconfig.c:43
RZ_API RZ_BORROW const char * rz_config_get(RzConfig *cfg, RZ_NONNULL const char *name)
Definition: config.c:75
#define eprintf(x, y...)
Definition: rlcc.c:7
RzConfig * config
Definition: rz_core.h:300

References rz_core_t::analysis, rz_core_t::config, eprintf, print_node_options(), rz_analysis_use(), rz_config_get(), update_analysis_arch_options(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_analysis_armthumb()

static bool cb_analysis_armthumb ( void *  user,
void *  data 
)
static

Definition at line 140 of file cconfig.c.

140  {
141  RzCore *core = (RzCore *)user;
142  RzConfigNode *node = (RzConfigNode *)data;
143  core->analysis->opt.armthumb = node->i_value;
144  return true;
145 }

References rz_core_t::analysis, rz_analysis_options_t::armthumb, rz_config_node_t::i_value, and rz_analysis_t::opt.

Referenced by rz_core_config_init().

◆ cb_analysis_bb_max_size()

static bool cb_analysis_bb_max_size ( void *  user,
void *  data 
)
static

Definition at line 2723 of file cconfig.c.

2723  {
2724  RzCore *core = (RzCore *)user;
2725  RzConfigNode *node = (RzConfigNode *)data;
2726  core->analysis->opt.bb_max_size = node->i_value;
2727  return true;
2728 }

References rz_core_t::analysis, rz_analysis_options_t::bb_max_size, rz_config_node_t::i_value, and rz_analysis_t::opt.

Referenced by rz_core_config_init().

◆ cb_analysis_brokenrefs()

static bool cb_analysis_brokenrefs ( void *  user,
void *  data 
)
static

Definition at line 2709 of file cconfig.c.

2709  {
2710  RzCore *core = (RzCore *)user;
2711  RzConfigNode *node = (RzConfigNode *)data;
2712  core->analysis->opt.followbrokenfcnsrefs = node->i_value;
2713  return true;
2714 }

References rz_core_t::analysis, rz_analysis_options_t::followbrokenfcnsrefs, rz_config_node_t::i_value, and rz_analysis_t::opt.

Referenced by rz_core_config_init().

◆ cb_analysis_cjmpref()

static bool cb_analysis_cjmpref ( void *  user,
void *  data 
)
static

Definition at line 2653 of file cconfig.c.

2653  {
2654  RzCore *core = (RzCore *)user;
2655  RzConfigNode *node = (RzConfigNode *)data;
2656  core->analysis->opt.cjmpref = node->i_value;
2657  return true;
2658 }

References rz_core_t::analysis, rz_analysis_options_t::cjmpref, rz_config_node_t::i_value, and rz_analysis_t::opt.

Referenced by rz_core_config_init().

◆ cb_analysis_cpp_abi()

static bool cb_analysis_cpp_abi ( void *  user,
void *  data 
)
static

Definition at line 2730 of file cconfig.c.

2730  {
2731  RzCore *core = (RzCore *)user;
2732  RzConfigNode *node = (RzConfigNode *)data;
2733 
2734  if (*node->value == '?') {
2735  print_node_options(node);
2736  return false;
2737  }
2738 
2739  if (*node->value) {
2740  if (strcmp(node->value, "itanium") == 0) {
2742  return true;
2743  } else if (strcmp(node->value, "msvc") == 0) {
2745  return true;
2746  }
2747  eprintf("analysis.cpp.abi: cannot find '%s'\n", node->value);
2748  }
2749  return false;
2750 }
@ RZ_ANALYSIS_CPP_ABI_ITANIUM
Definition: rz_analysis.h:542
@ RZ_ANALYSIS_CPP_ABI_MSVC
Definition: rz_analysis.h:543
RzAnalysisCPPABI cpp_abi
Definition: rz_analysis.h:560

References rz_core_t::analysis, rz_analysis_t::cpp_abi, eprintf, print_node_options(), RZ_ANALYSIS_CPP_ABI_ITANIUM, RZ_ANALYSIS_CPP_ABI_MSVC, and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_analysis_cpu()

static bool cb_analysis_cpu ( void *  user,
void *  data 
)
static

Definition at line 285 of file cconfig.c.

285  {
286  RzCore *core = (RzCore *)user;
287  RzConfigNode *node = (RzConfigNode *)data;
288  rz_analysis_set_cpu(core->analysis, node->value);
289  /* set pcalign */
290  {
292  rz_config_set_i(core->config, "asm.pcalign", (v != -1) ? v : 0);
293  }
294  return true;
295 }
RZ_API void rz_analysis_set_cpu(RzAnalysis *analysis, const char *cpu)
Definition: analysis.c:311
RZ_API int rz_analysis_archinfo(RzAnalysis *analysis, int query)
Definition: analysis.c:449
RZ_API RzConfigNode * rz_config_set_i(RzConfig *cfg, RZ_NONNULL const char *name, const ut64 i)
Definition: config.c:419
const char * v
Definition: dsignal.c:12
#define RZ_ANALYSIS_ARCHINFO_ALIGN
Definition: rz_analysis.h:100

References rz_core_t::analysis, rz_core_t::config, rz_analysis_archinfo(), RZ_ANALYSIS_ARCHINFO_ALIGN, rz_analysis_set_cpu(), rz_config_set_i(), v, and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_analysis_delay()

static bool cb_analysis_delay ( void *  user,
void *  data 
)
static

Definition at line 175 of file cconfig.c.

175  {
176  RzCore *core = (RzCore *)user;
177  RzConfigNode *node = (RzConfigNode *)data;
178  core->analysis->opt.delay = node->i_value;
179  return true;
180 }

References rz_core_t::analysis, rz_analysis_options_t::delay, rz_config_node_t::i_value, and rz_analysis_t::opt.

Referenced by rz_core_config_init().

◆ cb_analysis_depth()

static bool cb_analysis_depth ( void *  user,
void *  data 
)
static

Definition at line 147 of file cconfig.c.

147  {
148  RzCore *core = (RzCore *)user;
149  RzConfigNode *node = (RzConfigNode *)data;
150  core->analysis->opt.depth = node->i_value;
151  return true;
152 }

References rz_core_t::analysis, rz_analysis_options_t::depth, rz_config_node_t::i_value, and rz_analysis_t::opt.

Referenced by rz_core_config_init().

◆ cb_analysis_followdatarefs()

static bool cb_analysis_followdatarefs ( void *  user,
void *  data 
)
static

Definition at line 2681 of file cconfig.c.

2681  {
2682  RzCore *core = (RzCore *)user;
2683  RzConfigNode *node = (RzConfigNode *)data;
2684  core->analysis->opt.followdatarefs = node->i_value;
2685  return true;
2686 }

References rz_core_t::analysis, rz_analysis_options_t::followdatarefs, rz_config_node_t::i_value, and rz_analysis_t::opt.

Referenced by rz_core_config_init().

◆ cb_analysis_from()

static bool cb_analysis_from ( RzCore core,
RzConfigNode node 
)
static

Definition at line 2605 of file cconfig.c.

2605  {
2606  if (rz_config_get_i(core->config, "analysis.limits")) {
2608  rz_config_get_i(core->config, "analysis.from"),
2609  rz_config_get_i(core->config, "analysis.to"));
2610  }
2611  return true;
2612 }
RZ_API void rz_analysis_set_limits(RzAnalysis *analysis, ut64 from, ut64 to)
Definition: analysis.c:15
RZ_API ut64 rz_config_get_i(RzConfig *cfg, RZ_NONNULL const char *name)
Definition: config.c:119

References rz_core_t::analysis, rz_core_t::config, rz_analysis_set_limits(), and rz_config_get_i().

Referenced by rz_core_config_init().

◆ cb_analysis_gp()

static bool cb_analysis_gp ( RzCore core,
RzConfigNode node 
)
static

Definition at line 2600 of file cconfig.c.

2600  {
2601  core->analysis->gp = node->i_value;
2602  return true;
2603 }

References rz_core_t::analysis, rz_analysis_t::gp, and rz_config_node_t::i_value.

Referenced by rz_core_config_init().

◆ cb_analysis_graphdepth()

static bool cb_analysis_graphdepth ( void *  user,
void *  data 
)
static

Definition at line 154 of file cconfig.c.

154  {
155  RzCore *core = (RzCore *)user;
156  RzConfigNode *node = (RzConfigNode *)data;
157  core->analysis->opt.graph_depth = node->i_value;
158  return true;
159 }

References rz_core_t::analysis, rz_analysis_options_t::graph_depth, rz_config_node_t::i_value, and rz_analysis_t::opt.

Referenced by rz_core_config_init().

◆ cb_analysis_hpskip()

static bool cb_analysis_hpskip ( void *  user,
void *  data 
)
static

Definition at line 247 of file cconfig.c.

247  {
248  RzCore *core = (RzCore *)user;
249  RzConfigNode *node = (RzConfigNode *)data;
250  core->analysis->opt.hpskip = node->i_value;
251  return true;
252 }

References rz_core_t::analysis, rz_analysis_options_t::hpskip, rz_config_node_t::i_value, and rz_analysis_t::opt.

Referenced by rz_core_config_init().

◆ cb_analysis_ignbithints()

static bool cb_analysis_ignbithints ( void *  user,
void *  data 
)
static

Definition at line 212 of file cconfig.c.

212  {
213  RzCore *core = (RzCore *)user;
214  RzConfigNode *node = (RzConfigNode *)data;
215  core->analysis->opt.ignbithints = node->i_value;
216  return true;
217 }

References rz_core_t::analysis, rz_config_node_t::i_value, rz_analysis_options_t::ignbithints, and rz_analysis_t::opt.

Referenced by rz_core_config_init().

◆ cb_analysis_ijmp()

static bool cb_analysis_ijmp ( void *  user,
void *  data 
)
static

Definition at line 304 of file cconfig.c.

304  {
305  RzCore *core = (RzCore *)user;
306  RzConfigNode *node = (RzConfigNode *)data;
307  core->analysis->opt.ijmp = node->i_value;
308  return true;
309 }

References rz_core_t::analysis, rz_config_node_t::i_value, rz_analysis_options_t::ijmp, and rz_analysis_t::opt.

Referenced by rz_core_config_init().

◆ cb_analysis_jmpabove()

static bool cb_analysis_jmpabove ( void *  user,
void *  data 
)
static

Definition at line 2667 of file cconfig.c.

2667  {
2668  RzCore *core = (RzCore *)user;
2669  RzConfigNode *node = (RzConfigNode *)data;
2670  core->analysis->opt.jmpabove = node->i_value;
2671  return true;
2672 }

References rz_core_t::analysis, rz_config_node_t::i_value, rz_analysis_options_t::jmpabove, and rz_analysis_t::opt.

Referenced by rz_core_config_init().

◆ cb_analysis_jmpmid()

static bool cb_analysis_jmpmid ( void *  user,
void *  data 
)
static

Definition at line 2688 of file cconfig.c.

2688  {
2689  RzCore *core = (RzCore *)user;
2690  RzConfigNode *node = (RzConfigNode *)data;
2691  core->analysis->opt.jmpmid = node->i_value;
2692  return true;
2693 }

References rz_core_t::analysis, rz_config_node_t::i_value, rz_analysis_options_t::jmpmid, and rz_analysis_t::opt.

Referenced by rz_core_config_init().

◆ cb_analysis_jmpref()

static bool cb_analysis_jmpref ( void *  user,
void *  data 
)
static

Definition at line 2660 of file cconfig.c.

2660  {
2661  RzCore *core = (RzCore *)user;
2662  RzConfigNode *node = (RzConfigNode *)data;
2663  core->analysis->opt.jmpref = node->i_value;
2664  return true;
2665 }

References rz_core_t::analysis, rz_config_node_t::i_value, rz_analysis_options_t::jmpref, and rz_analysis_t::opt.

Referenced by rz_core_config_init().

◆ cb_analysis_jmpretpoline()

static bool cb_analysis_jmpretpoline ( void *  user,
void *  data 
)
static

Definition at line 127 of file cconfig.c.

127  {
128  RzCore *core = (RzCore *)user;
129  RzConfigNode *node = (RzConfigNode *)data;
130  core->analysis->opt.retpoline = node->i_value;
131  return true;
132 }

References rz_core_t::analysis, rz_config_node_t::i_value, rz_analysis_t::opt, and rz_analysis_options_t::retpoline.

Referenced by rz_core_config_init().

◆ cb_analysis_jmptailcall()

static bool cb_analysis_jmptailcall ( void *  user,
void *  data 
)
static

Definition at line 133 of file cconfig.c.

133  {
134  RzCore *core = (RzCore *)user;
135  RzConfigNode *node = (RzConfigNode *)data;
136  core->analysis->opt.tailcall = node->i_value;
137  return true;
138 }

References rz_core_t::analysis, rz_config_node_t::i_value, rz_analysis_t::opt, and rz_analysis_options_t::tailcall.

Referenced by rz_core_config_init().

◆ cb_analysis_jmptbl()

static bool cb_analysis_jmptbl ( void *  user,
void *  data 
)
static

Definition at line 2632 of file cconfig.c.

2632  {
2633  RzCore *core = (RzCore *)user;
2634  RzConfigNode *node = (RzConfigNode *)data;
2635  core->analysis->opt.jmptbl = node->i_value;
2636  return true;
2637 }

References rz_core_t::analysis, rz_config_node_t::i_value, rz_analysis_options_t::jmptbl, and rz_analysis_t::opt.

Referenced by rz_core_config_init().

◆ cb_analysis_jmptblmax()

static bool cb_analysis_jmptblmax ( void *  user,
void *  data 
)
static

Definition at line 2639 of file cconfig.c.

2639  {
2640  RzCore *core = (RzCore *)user;
2641  RzConfigNode *node = (RzConfigNode *)data;
2642  core->analysis->opt.jmptbl_maxcount = node->i_value;
2643  return true;
2644 }

References rz_core_t::analysis, rz_config_node_t::i_value, rz_analysis_options_t::jmptbl_maxcount, and rz_analysis_t::opt.

Referenced by rz_core_config_init().

◆ cb_analysis_jmptblmaxoffset()

static bool cb_analysis_jmptblmaxoffset ( void *  user,
void *  data 
)
static

Definition at line 2646 of file cconfig.c.

2646  {
2647  RzCore *core = (RzCore *)user;
2648  RzConfigNode *node = (RzConfigNode *)data;
2649  core->analysis->opt.jmptbl_maxoffset = node->i_value > UT32_MAX ? UT32_MAX : node->i_value;
2650  return true;
2651 }
#define UT32_MAX
Definition: rz_types_base.h:99

References rz_core_t::analysis, rz_config_node_t::i_value, rz_analysis_options_t::jmptbl_maxoffset, rz_analysis_t::opt, and UT32_MAX.

Referenced by rz_core_config_init().

◆ cb_analysis_limits()

static bool cb_analysis_limits ( void *  user,
RzConfigNode node 
)
static

Definition at line 2614 of file cconfig.c.

2614  {
2615  RzCore *core = (RzCore *)user;
2616  if (node->i_value) {
2618  rz_config_get_i(core->config, "analysis.from"),
2619  rz_config_get_i(core->config, "analysis.to"));
2620  } else {
2622  }
2623  return 1;
2624 }
RZ_API void rz_analysis_unset_limits(RzAnalysis *analysis)
Definition: analysis.c:24

References rz_core_t::analysis, rz_core_t::config, rz_config_node_t::i_value, rz_analysis_set_limits(), rz_analysis_unset_limits(), and rz_config_get_i().

Referenced by rz_core_config_init().

◆ cb_analysis_loads()

static bool cb_analysis_loads ( void *  user,
void *  data 
)
static

Definition at line 2674 of file cconfig.c.

2674  {
2675  RzCore *core = (RzCore *)user;
2676  RzConfigNode *node = (RzConfigNode *)data;
2677  core->analysis->opt.loads = node->i_value;
2678  return true;
2679 }

References rz_core_t::analysis, rz_config_node_t::i_value, rz_analysis_options_t::loads, and rz_analysis_t::opt.

Referenced by rz_core_config_init().

◆ cb_analysis_maxrefs()

static bool cb_analysis_maxrefs ( void *  user,
void *  data 
)
static

Definition at line 226 of file cconfig.c.

226  {
227  RzCore *core = (RzCore *)user;
228  RzConfigNode *node = (RzConfigNode *)data;
229  core->analysis->maxreflines = node->i_value;
230  return true;
231 }

References rz_core_t::analysis, rz_config_node_t::i_value, and rz_analysis_t::maxreflines.

Referenced by rz_core_config_init().

◆ cb_analysis_nonull()

static bool cb_analysis_nonull ( void *  user,
void *  data 
)
static

Definition at line 196 of file cconfig.c.

196  {
197  RzCore *core = (RzCore *)user;
198  RzConfigNode *node = (RzConfigNode *)data;
199  core->analysis->opt.nonull = node->i_value;
200  return true;
201 }

References rz_core_t::analysis, rz_config_node_t::i_value, rz_analysis_options_t::nonull, and rz_analysis_t::opt.

Referenced by rz_core_config_init().

◆ cb_analysis_nopskip()

static bool cb_analysis_nopskip ( void *  user,
void *  data 
)
static

Definition at line 240 of file cconfig.c.

240  {
241  RzCore *core = (RzCore *)user;
242  RzConfigNode *node = (RzConfigNode *)data;
243  core->analysis->opt.nopskip = node->i_value;
244  return true;
245 }

References rz_core_t::analysis, rz_config_node_t::i_value, rz_analysis_options_t::nopskip, and rz_analysis_t::opt.

Referenced by rz_core_config_init().

◆ cb_analysis_norevisit()

static bool cb_analysis_norevisit ( void *  user,
void *  data 
)
static

Definition at line 233 of file cconfig.c.

233  {
234  RzCore *core = (RzCore *)user;
235  RzConfigNode *node = (RzConfigNode *)data;
236  core->analysis->opt.norevisit = node->i_value;
237  return true;
238 }

References rz_core_t::analysis, rz_config_node_t::i_value, rz_analysis_options_t::norevisit, and rz_analysis_t::opt.

Referenced by rz_core_config_init().

◆ cb_analysis_pushret()

static bool cb_analysis_pushret ( void *  user,
void *  data 
)
static

Definition at line 2702 of file cconfig.c.

2702  {
2703  RzCore *core = (RzCore *)user;
2704  RzConfigNode *node = (RzConfigNode *)data;
2705  core->analysis->opt.pushret = node->i_value;
2706  return true;
2707 }

References rz_core_t::analysis, rz_config_node_t::i_value, rz_analysis_t::opt, and rz_analysis_options_t::pushret.

Referenced by rz_core_config_init().

◆ cb_analysis_recont()

static bool cb_analysis_recont ( void *  user,
void *  data 
)
static

Definition at line 297 of file cconfig.c.

297  {
298  RzCore *core = (RzCore *)user;
299  RzConfigNode *node = (RzConfigNode *)data;
300  core->analysis->opt.recont = node->i_value;
301  return true;
302 }

References rz_core_t::analysis, rz_config_node_t::i_value, rz_analysis_t::opt, and rz_analysis_options_t::recont.

Referenced by rz_core_config_init().

◆ cb_analysis_rnr()

static bool cb_analysis_rnr ( void *  user,
RzConfigNode node 
)
static

Definition at line 2626 of file cconfig.c.

2626  {
2627  RzCore *core = (RzCore *)user;
2628  core->analysis->recursive_noreturn = node->i_value;
2629  return 1;
2630 }
bool recursive_noreturn
Definition: rz_analysis.h:593

References rz_core_t::analysis, rz_config_node_t::i_value, and rz_analysis_t::recursive_noreturn.

Referenced by rz_core_config_init().

◆ cb_analysis_roregs()

static bool cb_analysis_roregs ( RzCore core,
RzConfigNode node 
)
static

Definition at line 2570 of file cconfig.c.

2570  {
2571  if (core && core->analysis && core->analysis->reg) {
2572  rz_list_free(core->analysis->reg->roregs);
2573  core->analysis->reg->roregs = rz_str_split_duplist(node->value, ",", true);
2574  }
2575  return true;
2576 }
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
Definition: list.c:137
RZ_API RzList * rz_str_split_duplist(const char *str, const char *c, bool trim)
Split the string str according to the substring c and returns a RzList with the result.
Definition: str.c:3464
RzList * roregs
Definition: rz_reg.h:152

References rz_core_t::analysis, rz_analysis_t::reg, rz_reg_t::roregs, rz_list_free(), rz_str_split_duplist(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_analysis_searchstringrefs()

static bool cb_analysis_searchstringrefs ( void *  user,
void *  data 
)
static

Definition at line 2695 of file cconfig.c.

2695  {
2696  RzCore *core = (RzCore *)user;
2697  RzConfigNode *node = (RzConfigNode *)data;
2698  core->analysis->opt.searchstringrefs = node->i_value;
2699  return true;
2700 }

References rz_core_t::analysis, rz_config_node_t::i_value, rz_analysis_t::opt, and rz_analysis_options_t::searchstringrefs.

Referenced by rz_core_config_init().

◆ cb_analysis_sleep()

static bool cb_analysis_sleep ( void *  user,
void *  data 
)
static

Definition at line 219 of file cconfig.c.

219  {
220  RzCore *core = (RzCore *)user;
221  RzConfigNode *node = (RzConfigNode *)data;
222  core->analysis->sleep = node->i_value;
223  return true;
224 }

References rz_core_t::analysis, rz_config_node_t::i_value, and rz_analysis_t::sleep.

Referenced by rz_core_config_init().

◆ cb_analysis_strings()

static bool cb_analysis_strings ( void *  user,
void *  data 
)
static

Definition at line 203 of file cconfig.c.

203  {
204  RzCore *core = (RzCore *)user;
205  RzConfigNode *node = (RzConfigNode *)data;
206  if (node->i_value) {
207  rz_config_set(core->config, "bin.strings", "false");
208  }
209  return true;
210 }

References rz_core_t::config, rz_config_node_t::i_value, and rz_config_set().

Referenced by rz_core_config_init().

◆ cb_analysis_trycatch()

static bool cb_analysis_trycatch ( void *  user,
void *  data 
)
static

Definition at line 2716 of file cconfig.c.

2716  {
2717  RzCore *core = (RzCore *)user;
2718  RzConfigNode *node = (RzConfigNode *)data;
2719  core->analysis->opt.trycatch = node->i_value;
2720  return true;
2721 }

References rz_core_t::analysis, rz_config_node_t::i_value, rz_analysis_t::opt, and rz_analysis_options_t::trycatch.

Referenced by rz_core_config_init().

◆ cb_analysis_vars()

static bool cb_analysis_vars ( void *  user,
void *  data 
)
static

Definition at line 182 of file cconfig.c.

182  {
183  RzCore *core = (RzCore *)user;
184  RzConfigNode *node = (RzConfigNode *)data;
185  core->analysis->opt.vars = node->i_value;
186  return true;
187 }

References rz_core_t::analysis, rz_config_node_t::i_value, rz_analysis_t::opt, and rz_analysis_options_t::vars.

Referenced by rz_core_config_init().

◆ cb_analysis_vars_stackname()

static bool cb_analysis_vars_stackname ( void *  user,
void *  data 
)
static

Definition at line 189 of file cconfig.c.

189  {
190  RzCore *core = (RzCore *)user;
191  RzConfigNode *node = (RzConfigNode *)data;
192  core->analysis->opt.varname_stack = node->i_value;
193  return true;
194 }

References rz_core_t::analysis, rz_config_node_t::i_value, rz_analysis_t::opt, and rz_analysis_options_t::varname_stack.

Referenced by rz_core_config_init().

◆ cb_analysiscc()

static bool cb_analysiscc ( RzCore core,
RzConfigNode node 
)
static

Definition at line 2589 of file cconfig.c.

2589  {
2590  if (core && core->analysis) {
2591  if (!strcmp(node->value, "?")) {
2593  return false;
2594  }
2596  }
2597  return true;
2598 }
RZ_API void rz_analysis_set_cc_default(RzAnalysis *analysis, const char *cc)
Definition: cc.c:205
RZ_IPI void rz_core_types_calling_conventions_print(RzCore *core, RzOutputMode mode)
Definition: ctypes.c:19
@ RZ_OUTPUT_MODE_STANDARD
Definition: rz_types.h:39

References rz_core_t::analysis, rz_analysis_set_cc_default(), rz_core_types_calling_conventions_print(), RZ_OUTPUT_MODE_STANDARD, and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_analysissyscc()

static bool cb_analysissyscc ( RzCore core,
RzConfigNode node 
)
static

Definition at line 2578 of file cconfig.c.

2578  {
2579  if (core && core->analysis) {
2580  if (!strcmp(node->value, "?")) {
2582  return false;
2583  }
2585  }
2586  return true;
2587 }
RZ_API void rz_analysis_set_syscc_default(RzAnalysis *analysis, const char *cc)
Definition: cc.c:215

References rz_core_t::analysis, rz_analysis_set_syscc_default(), rz_core_types_calling_conventions_print(), RZ_OUTPUT_MODE_STANDARD, and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_asm_immhash()

static bool cb_asm_immhash ( void *  user,
void *  data 
)
static

Definition at line 812 of file cconfig.c.

812  {
813  RzCore *core = (RzCore *)user;
814  RzConfigNode *node = (RzConfigNode *)data;
815  core->rasm->immdisp = node->i_value ? true : false;
816  return true;
817 }
#define true
bool immdisp
Definition: rz_asm.h:122
RzAsm * rasm
Definition: rz_core.h:323

References rz_config_node_t::i_value, rz_asm_t::immdisp, rz_core_t::rasm, and true.

Referenced by rz_core_config_init().

◆ cb_asm_invhex()

static bool cb_asm_invhex ( void *  user,
void *  data 
)
static

Definition at line 819 of file cconfig.c.

819  {
820  RzCore *core = (RzCore *)user;
821  RzConfigNode *node = (RzConfigNode *)data;
822  core->rasm->invhex = node->i_value;
823  return true;
824 }
int invhex
Definition: rz_asm.h:117

References rz_config_node_t::i_value, rz_asm_t::invhex, and rz_core_t::rasm.

Referenced by rz_core_config_init().

◆ cb_asm_pcalign()

static bool cb_asm_pcalign ( void *  user,
void *  data 
)
static

Definition at line 826 of file cconfig.c.

826  {
827  RzCore *core = (RzCore *)user;
828  RzConfigNode *node = (RzConfigNode *)data;
829  int align = node->i_value;
830  if (align < 0) {
831  align = 0;
832  }
833  core->rasm->pcalign = align;
834  core->analysis->pcalign = align;
835  return true;
836 }
int pcalign
Definition: rz_asm.h:118

References rz_core_t::analysis, rz_config_node_t::i_value, rz_analysis_t::pcalign, rz_asm_t::pcalign, and rz_core_t::rasm.

Referenced by rz_core_config_init().

◆ cb_asmarch()

static bool cb_asmarch ( void *  user,
void *  data 
)
static

Definition at line 477 of file cconfig.c.

477  {
478  char asmparser[32];
479  RzCore *core = (RzCore *)user;
480  RzConfigNode *node = (RzConfigNode *)data;
481  const char *asmos = NULL;
482  int bits = RZ_SYS_BITS;
483  if (!*node->value || !core || !core->rasm) {
484  return false;
485  }
486  asmos = rz_config_get(core->config, "asm.os");
487  if (core && core->analysis && core->analysis->bits) {
488  bits = core->analysis->bits;
489  }
490  if (node->value[0] == '?') {
491  update_asmarch_options(core, node);
492  if (strlen(node->value) > 1 && node->value[1] == '?') {
493  /* print more verbose help instead of plain option values */
494  RzCmdStateOutput state = { 0 };
499  return false;
500  } else {
501  print_node_options(node);
502  return false;
503  }
504  }
505  rz_egg_setup(core->egg, node->value, bits, 0, RZ_SYS_OS);
506 
507  if (!rz_asm_use(core->rasm, node->value)) {
508  eprintf("asm.arch: cannot find (%s)\n", node->value);
509  return false;
510  }
511  // we should strdup here otherwise will crash if any rz_config_set
512  // free the old value
513  char *asm_cpu = strdup(rz_config_get(core->config, "asm.cpu"));
514  if (core->rasm->cur) {
515  const char *newAsmCPU = core->rasm->cur->cpus;
516  if (newAsmCPU) {
517  if (*newAsmCPU) {
518  char *nac = strdup(newAsmCPU);
519  char *comma = strchr(nac, ',');
520  if (comma) {
521  if (!*asm_cpu || (*asm_cpu && !strstr(nac, asm_cpu))) {
522  *comma = 0;
523  rz_config_set(core->config, "asm.cpu", nac);
524  }
525  }
526  free(nac);
527  } else {
528  rz_config_set(core->config, "asm.cpu", "");
529  }
530  }
531  bits = core->rasm->cur->bits;
532  if (8 & bits) {
533  bits = 8;
534  } else if (16 & bits) {
535  bits = 16;
536  } else if (32 & bits) {
537  bits = 32;
538  } else {
539  bits = 64;
540  }
541  update_asmbits_options(core, rz_config_node_get(core->config, "asm.bits"));
542  }
543  snprintf(asmparser, sizeof(asmparser), "%s.pseudo", node->value);
544  rz_config_set(core->config, "asm.parser", asmparser);
545  if (core->rasm->cur && core->analysis &&
546  !(core->rasm->cur->bits & core->analysis->bits)) {
547  rz_config_set_i(core->config, "asm.bits", bits);
548  }
549 
550  rz_debug_set_arch(core->dbg, node->value, bits);
551  if (!rz_config_set(core->config, "analysis.arch", node->value)) {
552  char *p, *s = strdup(node->value);
553  if (s) {
554  p = strchr(s, '.');
555  if (p) {
556  *p = 0;
557  }
558  if (!rz_config_set(core->config, "analysis.arch", s)) {
559  /* fall back to the analysis.null plugin */
560  rz_config_set(core->config, "analysis.arch", "null");
561  }
562  free(s);
563  }
564  }
565  // set pcalign
566  if (core->analysis) {
567  const char *asmcpu = rz_config_get(core->config, "asm.cpu");
568  const char *platform = rz_config_get(core->config, "asm.platform");
569  rz_syscall_setup(core->analysis->syscall, node->value, core->analysis->bits, asmcpu, asmos);
570  update_syscall_ns(core);
571  char *platforms_dir = rz_path_system(RZ_SDB_ARCH_PLATFORMS);
572  char *cpus_dir = rz_path_system(RZ_SDB_ARCH_CPUS);
573  rz_platform_target_index_init(core->analysis->platform_target, node->value, asmcpu, platform, platforms_dir);
574  rz_platform_profiles_init(core->analysis->arch_target, asmcpu, node->value, cpus_dir);
575  free(platforms_dir);
576  free(cpus_dir);
577  }
578  __setsegoff(core->config, node->value, core->rasm->bits);
579 
580  // set a default endianness
581  bool big_endian = rz_config_get_b(core->config, "cfg.bigendian");
582 
583  // try to set endian of RzAsm to match binary
584  rz_asm_set_big_endian(core->rasm, big_endian);
585  // set endian of display to match binary
586  core->print->big_endian = big_endian;
587 
588  rz_asm_set_cpu(core->rasm, asm_cpu);
589  free(asm_cpu);
590  RzConfigNode *asmcpu = rz_config_node_get(core->config, "asm.cpu");
591  if (asmcpu) {
592  update_asmcpu_options(core, asmcpu);
593  }
594  {
596  if (v != -1) {
597  rz_config_set_i(core->config, "asm.pcalign", v);
598  } else {
599  rz_config_set_i(core->config, "asm.pcalign", 0);
600  }
601  }
602  /* reload types and cc info */
603  // changing asm.arch changes analysis.arch
604  // changing analysis.arch sets types db
605  // so ressetting is redundant and may lead to bugs
606  // 1 case this is usefull is when types is null
607  if (!core->analysis || !core->analysis->typedb) {
609  }
610  // set endian of RzAnalysis to match binary
611  rz_analysis_set_big_endian(core->analysis, big_endian);
613 
614  const char *platform = rz_config_get(core->config, "asm.platform");
615  if (asmcpu) {
616  char *platforms_dir = rz_path_system(RZ_SDB_ARCH_PLATFORMS);
617  char *cpus_dir = rz_path_system(RZ_SDB_ARCH_CPUS);
618  rz_platform_target_index_init(core->analysis->platform_target, node->value, asmcpu->value, platform, platforms_dir);
619  rz_platform_profiles_init(core->analysis->arch_target, asmcpu->value, node->value, cpus_dir);
620  free(cpus_dir);
621  free(platforms_dir);
622  }
623 
624  return true;
625 }
RZ_API int rz_analysis_set_big_endian(RzAnalysis *analysis, int bigend)
Definition: analysis.c:325
RZ_API bool rz_asm_set_big_endian(RzAsm *a, bool b)
Definition: asm.c:496
RZ_DEPRECATE RZ_API void rz_asm_set_cpu(RzAsm *a, const char *cpu)
Definition: asm.c:477
RZ_API bool rz_asm_use(RzAsm *a, const char *name)
Puts an Asm plugin in use and disables the previous one.
Definition: asm.c:429
int bits(struct state *s, int need)
Definition: blast.c:72
RZ_API void rz_core_analysis_type_init(RzCore *core)
Definition: canalysis.c:6610
RZ_API void rz_core_analysis_cc_init(RzCore *core)
Definition: canalysis.c:6628
RZ_API RzCmdStatus rz_core_asm_plugins_print(RzCore *core, const char *arch, RzCmdStateOutput *state)
Definition: casm.c:150
static void update_syscall_ns(RzCore *core)
Definition: cconfig.c:469
static void __setsegoff(RzConfig *cfg, const char *asmarch, int asmbits)
Definition: cconfig.c:115
static void update_asmarch_options(RzCore *core, RzConfigNode *node)
Definition: cconfig.c:444
static void update_asmbits_options(RzCore *core, RzConfigNode *node)
Definition: cconfig.c:455
static void update_asmcpu_options(RzCore *core, RzConfigNode *node)
Definition: cconfig.c:392
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
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_API bool rz_config_get_b(RzConfig *cfg, RZ_NONNULL const char *name)
Definition: config.c:142
RZ_API RZ_BORROW RzConfigNode * rz_config_node_get(RzConfig *cfg, RZ_NONNULL const char *name)
Definition: config.c:48
#define NULL
Definition: cris-opc.c:27
RZ_API bool rz_egg_setup(RzEgg *egg, const char *arch, int bits, int endian, const char *os)
Definition: egg.c:139
snprintf
Definition: kernel.h:364
void * p
Definition: libc.cpp:67
RZ_API bool rz_debug_set_arch(RzDebug *dbg, const char *arch, int bits)
Definition: debug.c:465
RZ_API bool rz_platform_profiles_init(RzPlatformTarget *t, const char *cpu, const char *arch, const char *cpus_dir)
Initializes RzPlatformProfile by loading the path to the SDB file of the CPU profile.
RZ_API bool rz_platform_target_index_init(RzPlatformTargetIndex *t, RZ_NONNULL const char *arch, RZ_NONNULL const char *cpu, const char *platform, RZ_NONNULL const char *platforms_dir)
Initialize Platform Profiles by setting the path to the corresponding SDB file.
static RzSocket * s
Definition: rtr.c:28
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
#define RZ_SYS_BITS
Definition: rz_types.h:520
#define RZ_SYS_OS
Definition: rz_types.h:587
#define RZ_SDB_ARCH_PLATFORMS
Definition: rz_userconf.h:81
#define RZ_SDB_ARCH_CPUS
Definition: rz_userconf.h:82
RzPlatformTarget * arch_target
Definition: rz_analysis.h:622
RzSyscall * syscall
Definition: rz_analysis.h:570
RzPlatformTargetIndex * platform_target
Definition: rz_analysis.h:623
RzTypeDB * typedb
Definition: rz_analysis.h:602
int bits
Definition: rz_asm.h:100
_RzAsmPlugin * cur
Definition: rz_asm.h:106
Represent the output state of a command handler.
Definition: rz_cmd.h:91
RzEgg * egg
Definition: rz_core.h:332
RzPrint * print
Definition: rz_core.h:327
int big_endian
Definition: rz_print.h:124
Definition: dis.h:43
RZ_API bool rz_syscall_setup(RzSyscall *s, const char *arch, int bits, const char *cpu, const char *os)
Definition: syscall.c:234
static int comma
Definition: z80asm.c:76

References __setsegoff(), rz_core_t::analysis, rz_analysis_t::arch_target, rz_print_t::big_endian, rz_analysis_t::bits, rz_asm_t::bits, bits(), comma, rz_core_t::config, rz_asm_t::cur, rz_core_t::dbg, rz_core_t::egg, eprintf, free(), NULL, p, rz_analysis_t::platform_target, rz_core_t::print, print_node_options(), rz_core_t::rasm, rz_analysis_archinfo(), RZ_ANALYSIS_ARCHINFO_ALIGN, rz_analysis_set_big_endian(), rz_asm_set_big_endian(), rz_asm_set_cpu(), rz_asm_use(), rz_cmd_state_output_fini(), rz_cmd_state_output_init(), rz_cmd_state_output_print(), rz_config_get(), rz_config_get_b(), rz_config_node_get(), rz_config_set(), rz_config_set_i(), rz_core_analysis_cc_init(), rz_core_analysis_type_init(), rz_core_asm_plugins_print(), rz_debug_set_arch(), rz_egg_setup(), RZ_OUTPUT_MODE_STANDARD, rz_path_system(), rz_platform_profiles_init(), rz_platform_target_index_init(), RZ_SDB_ARCH_CPUS, RZ_SDB_ARCH_PLATFORMS, RZ_SYS_BITS, RZ_SYS_OS, rz_syscall_setup(), s, snprintf, strdup(), rz_analysis_t::syscall, rz_analysis_t::typedb, update_asmarch_options(), update_asmbits_options(), update_asmcpu_options(), update_syscall_ns(), v, and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_asmassembler()

static bool cb_asmassembler ( void *  user,
void *  data 
)
static

Definition at line 385 of file cconfig.c.

385  {
386  RzCore *core = (RzCore *)user;
387  RzConfigNode *node = (RzConfigNode *)data;
388  rz_asm_use_assembler(core->rasm, node->value);
389  return true;
390 }
RZ_API bool rz_asm_use_assembler(RzAsm *a, const char *name)
Definition: asm.c:363

References rz_core_t::rasm, rz_asm_use_assembler(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_asmbits()

static bool cb_asmbits ( void *  user,
void *  data 
)
static

Definition at line 634 of file cconfig.c.

634  {
635  RzCore *core = (RzCore *)user;
636  RzConfigNode *node = (RzConfigNode *)data;
637 
638  if (node->value[0] == '?') {
639  update_asmbits_options(core, node);
640  print_node_options(node);
641  return false;
642  }
643 
644  bool ret = false;
645  if (!core) {
646  eprintf("user can't be NULL\n");
647  return false;
648  }
649 
650  int bits = node->i_value;
651  if (!bits) {
652  return false;
653  }
654  if (bits > 0) {
655  ret = rz_asm_set_bits(core->rasm, bits);
656  if (!ret) {
657  RzAsmPlugin *h = core->rasm->cur;
658  if (!h) {
659  eprintf("e asm.bits: Cannot set value, no plugins defined yet\n");
660  ret = true;
661  }
662  // else { eprintf ("Cannot set bits %d to '%s'\n", bits, h->name); }
663  }
664  if (!rz_analysis_set_bits(core->analysis, bits)) {
665  eprintf("asm.arch: Cannot setup '%d' bits analysis engine\n", bits);
666  ret = false;
667  }
668  core->print->bits = bits;
669  }
670  if (core->dbg && core->analysis && core->analysis->cur) {
671  rz_debug_set_arch(core->dbg, core->analysis->cur->arch, bits);
673  }
675  const char *asmos = rz_config_get(core->config, "asm.os");
676  const char *asmarch = rz_config_get(core->config, "asm.arch");
677  const char *asmcpu = rz_config_get(core->config, "asm.cpu");
678  if (core->analysis) {
679  if (!rz_syscall_setup(core->analysis->syscall, asmarch, bits, asmcpu, asmos)) {
680  // eprintf ("asm.arch: Cannot setup syscall '%s/%s' from '%s'\n",
681  // node->value, asmos, RZ_LIBDIR"/rizin/"RZ_VERSION"/syscall");
682  }
683  update_syscall_ns(core);
684  __setsegoff(core->config, asmarch, core->analysis->bits);
685  if (core->dbg) {
686  rz_bp_use(core->dbg->bp, asmarch);
687  }
688  /* set pcalign */
690  rz_config_set_i(core->config, "asm.pcalign", (v != -1) ? v : 0);
691  }
692  return ret;
693 }
RZ_API bool rz_analysis_set_bits(RzAnalysis *analysis, int bits)
Definition: analysis.c:270
RZ_API bool rz_analysis_set_reg_profile(RzAnalysis *analysis)
Definition: analysis.c:218
RZ_DEPRECATE RZ_API int rz_asm_set_bits(RzAsm *a, int bits)
Definition: asm.c:488
RZ_API int rz_bp_use(RZ_NONNULL RzBreakpoint *bp, RZ_NONNULL const char *name)
Definition: bp_plugin.c:47
#define h(i)
Definition: sha256.c:48
struct rz_analysis_plugin_t * cur
Definition: rz_analysis.h:586
RzBreakpoint * bp
Definition: rz_debug.h:288
int bits
Definition: rz_print.h:127

References __setsegoff(), rz_core_t::analysis, rz_analysis_plugin_t::arch, rz_analysis_t::bits, rz_print_t::bits, bits(), rz_debug_t::bp, rz_core_t::config, rz_analysis_t::cur, rz_asm_t::cur, rz_core_t::dbg, eprintf, h, rz_config_node_t::i_value, rz_core_t::print, print_node_options(), rz_core_t::rasm, rz_analysis_archinfo(), RZ_ANALYSIS_ARCHINFO_ALIGN, rz_analysis_set_bits(), rz_analysis_set_reg_profile(), rz_asm_set_bits(), rz_bp_use(), rz_config_get(), rz_config_set_i(), rz_core_analysis_cc_init(), rz_debug_set_arch(), rz_syscall_setup(), rz_analysis_t::syscall, update_asmbits_options(), update_syscall_ns(), v, and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_asmcpu()

static bool cb_asmcpu ( void *  user,
void *  data 
)
static

Definition at line 417 of file cconfig.c.

417  {
418  RzCore *core = (RzCore *)user;
419  RzConfigNode *node = (RzConfigNode *)data;
420  if (*node->value == '?') {
421  update_asmcpu_options(core, node);
422  /* print verbose help instead of plain option listing */
423  RzCmdStateOutput state = { 0 };
425  rz_core_asm_plugins_print(core, rz_config_get(core->config, "asm.arch"), &state);
428  return 0;
429  }
430  rz_asm_set_cpu(core->rasm, node->value);
431  rz_config_set(core->config, "analysis.cpu", node->value);
432 
433  char *cpus_dir = rz_path_system(RZ_SDB_ARCH_CPUS);
434  rz_platform_profiles_init(core->analysis->arch_target, node->value, rz_config_get(core->config, "asm.arch"), cpus_dir);
435  free(cpus_dir);
436  const char *platform = rz_config_get(core->config, "asm.platform");
437  char *platforms_dir = rz_path_system(RZ_SDB_ARCH_PLATFORMS);
438  rz_platform_target_index_init(core->analysis->platform_target, rz_config_get(core->config, "asm.arch"), node->value, platform, platforms_dir);
439  free(platforms_dir);
440 
441  return true;
442 }

References rz_core_t::analysis, rz_analysis_t::arch_target, rz_core_t::config, free(), rz_analysis_t::platform_target, rz_core_t::rasm, rz_asm_set_cpu(), rz_cmd_state_output_fini(), rz_cmd_state_output_init(), rz_cmd_state_output_print(), rz_config_get(), rz_config_set(), rz_core_asm_plugins_print(), RZ_OUTPUT_MODE_STANDARD, rz_path_system(), rz_platform_profiles_init(), rz_platform_target_index_init(), RZ_SDB_ARCH_CPUS, RZ_SDB_ARCH_PLATFORMS, update_asmcpu_options(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_asmfeatures()

static bool cb_asmfeatures ( void *  user,
void *  data 
)
static

Definition at line 722 of file cconfig.c.

722  {
723  RzCore *core = (RzCore *)user;
724  RzConfigNode *node = (RzConfigNode *)data;
725  if (*node->value == '?') {
726  update_asmfeatures_options(core, node);
727  print_node_options(node);
728  return 0;
729  }
730  RZ_FREE(core->rasm->features);
731  if (node->value[0]) {
732  core->rasm->features = strdup(node->value);
733  }
734  return 1;
735 }
static void update_asmfeatures_options(RzCore *core, RzConfigNode *node)
Definition: cconfig.c:695
#define RZ_FREE(x)
Definition: rz_types.h:369
char * features
Definition: rz_asm.h:115

References rz_asm_t::features, print_node_options(), rz_core_t::rasm, RZ_FREE, strdup(), update_asmfeatures_options(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_asmlineswidth()

static bool cb_asmlineswidth ( void *  user,
void *  data 
)
static

Definition at line 780 of file cconfig.c.

780  {
781  RzCore *core = (RzCore *)user;
782  RzConfigNode *node = (RzConfigNode *)data;
783  core->analysis->lineswidth = node->i_value;
784  return true;
785 }

References rz_core_t::analysis, rz_config_node_t::i_value, and rz_analysis_t::lineswidth.

Referenced by rz_core_config_init().

◆ cb_asmos()

static bool cb_asmos ( void *  user,
void *  data 
)
static

Definition at line 838 of file cconfig.c.

838  {
839  RzCore *core = (RzCore *)user;
840  int asmbits = rz_config_get_i(core->config, "asm.bits");
841  RzConfigNode *asmarch, *node = (RzConfigNode *)data;
842 
843  if (*node->value == '?') {
844  print_node_options(node);
845  return 0;
846  }
847  if (!node->value[0]) {
848  free(node->value);
849  node->value = strdup(RZ_SYS_OS);
850  }
851  asmarch = rz_config_node_get(core->config, "asm.arch");
852  if (asmarch) {
853  const char *asmcpu = rz_config_get(core->config, "asm.cpu");
854  rz_syscall_setup(core->analysis->syscall, asmarch->value, core->analysis->bits, asmcpu, node->value);
855  update_syscall_ns(core);
856  __setsegoff(core->config, asmarch->value, asmbits);
857  }
858  rz_analysis_set_os(core->analysis, node->value);
860  return true;
861 }
RZ_API bool rz_analysis_set_os(RzAnalysis *analysis, const char *os)
Definition: analysis.c:256

References __setsegoff(), rz_core_t::analysis, rz_analysis_t::bits, rz_core_t::config, free(), print_node_options(), rz_analysis_set_os(), rz_config_get(), rz_config_get_i(), rz_config_node_get(), rz_core_analysis_cc_init(), RZ_SYS_OS, rz_syscall_setup(), strdup(), rz_analysis_t::syscall, update_syscall_ns(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_asmparser()

static bool cb_asmparser ( void *  user,
void *  data 
)
static

Definition at line 874 of file cconfig.c.

874  {
875  RzCore *core = (RzCore *)user;
876  RzConfigNode *node = (RzConfigNode *)data;
877  if (node->value[0] == '?') {
878  update_asmparser_options(core, node);
879  print_node_options(node);
880  return false;
881  }
882 
883  return rz_parse_use(core->parser, node->value);
884 }
static void update_asmparser_options(RzCore *core, RzConfigNode *node)
Definition: cconfig.c:863
RZ_API bool rz_parse_use(RzParse *p, const char *name)
Definition: parse.c:56
RzParse * parser
Definition: rz_core.h:326

References rz_core_t::parser, print_node_options(), rz_parse_use(), update_asmparser_options(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_asmplatform()

static bool cb_asmplatform ( void *  user,
void *  data 
)
static

Definition at line 757 of file cconfig.c.

757  {
758  RzCore *core = (RzCore *)user;
759  RzConfigNode *node = (RzConfigNode *)data;
760  if (!core) {
761  return false;
762  }
763  if (*node->value == '?') {
764  update_asmplatforms_options(core, node);
765  print_node_options(node);
766  return 0;
767  }
768  RZ_FREE(core->rasm->platforms);
769  if (node->value[0]) {
770  core->rasm->platforms = strdup(node->value);
771  }
772  const char *asmcpu = rz_config_get(core->config, "asm.cpu");
773  const char *asmarch = rz_config_get(core->config, "asm.arch");
774  char *platforms_dir = rz_path_system(RZ_SDB_ARCH_PLATFORMS);
775  rz_platform_target_index_init(core->analysis->platform_target, asmarch, asmcpu, node->value, platforms_dir);
776  free(platforms_dir);
777  return 1;
778 }
static void update_asmplatforms_options(RzCore *core, RzConfigNode *node)
Definition: cconfig.c:737
char * platforms
Definition: rz_asm.h:116

References rz_core_t::analysis, rz_core_t::config, free(), rz_analysis_t::platform_target, rz_asm_t::platforms, print_node_options(), rz_core_t::rasm, rz_config_get(), RZ_FREE, rz_path_system(), rz_platform_target_index_init(), RZ_SDB_ARCH_PLATFORMS, strdup(), update_asmplatforms_options(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_asmpseudo()

static bool cb_asmpseudo ( void *  user,
void *  data 
)
static

Definition at line 366 of file cconfig.c.

366  {
367  RzCore *core = (RzCore *)user;
368  RzConfigNode *node = (RzConfigNode *)data;
369  core->rasm->pseudo = node->i_value;
370  return true;
371 }
bool pseudo
Definition: rz_asm.h:126

References rz_config_node_t::i_value, rz_asm_t::pseudo, and rz_core_t::rasm.

Referenced by rz_core_config_init().

◆ cb_asmsubsec()

static bool cb_asmsubsec ( void *  user,
void *  data 
)
static

Definition at line 373 of file cconfig.c.

373  {
374  RzCore *core = (RzCore *)user;
375  RzConfigNode *node = (RzConfigNode *)data;
376  if (node->i_value) {
378  } else {
379  core->print->flags &= (~RZ_PRINT_FLAGS_SECSUB);
380  }
381  rz_print_set_flags(core->print, core->print->flags);
382  return true;
383 }
RZ_API void rz_print_set_flags(RzPrint *p, int _flags)
Definition: print.c:117
#define RZ_PRINT_FLAGS_SECSUB
Definition: rz_print.h:28
int flags
Definition: rz_print.h:137

References rz_print_t::flags, rz_config_node_t::i_value, rz_core_t::print, RZ_PRINT_FLAGS_SECSUB, and rz_print_set_flags().

Referenced by rz_core_config_init().

◆ cb_asmsubtail()

static bool cb_asmsubtail ( void *  user,
void *  data 
)
static

Definition at line 318 of file cconfig.c.

318  {
319  RzCore *core = (RzCore *)user;
320  RzConfigNode *node = (RzConfigNode *)data;
321  core->parser->subtail = node->i_value;
322  return true;
323 }
bool subtail
Definition: rz_parse.h:27

References rz_config_node_t::i_value, rz_core_t::parser, and rz_parse_t::subtail.

Referenced by rz_core_config_init().

◆ cb_asmsubvarmin()

static bool cb_asmsubvarmin ( void *  user,
void *  data 
)
static

Definition at line 311 of file cconfig.c.

311  {
312  RzCore *core = (RzCore *)user;
313  RzConfigNode *node = (RzConfigNode *)data;
314  core->parser->minval = node->i_value;
315  return true;
316 }
int minval
Definition: rz_parse.h:31

References rz_config_node_t::i_value, rz_parse_t::minval, and rz_core_t::parser.

Referenced by rz_core_config_init().

◆ cb_asmsyntax()

static bool cb_asmsyntax ( void *  user,
void *  data 
)
static

Definition at line 1042 of file cconfig.c.

1042  {
1043  RzCore *core = (RzCore *)user;
1044  RzConfigNode *node = (RzConfigNode *)data;
1045  if (*node->value == '?') {
1046  print_node_options(node);
1047  return false;
1048  } else {
1049  int syntax = rz_asm_syntax_from_string(node->value);
1050  if (syntax == -1) {
1051  return false;
1052  }
1053  rz_asm_set_syntax(core->rasm, syntax);
1054  }
1055  return true;
1056 }
RZ_API int rz_asm_syntax_from_string(const char *name)
Definition: asm.c:1227
RZ_API bool rz_asm_set_syntax(RzAsm *a, int syntax)
Definition: asm.c:518

References print_node_options(), rz_core_t::rasm, rz_asm_set_syntax(), rz_asm_syntax_from_string(), benchmark::syntax, and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_bigendian()

static bool cb_bigendian ( void *  user,
void *  data 
)
static

Definition at line 1058 of file cconfig.c.

1058  {
1059  RzCore *core = (RzCore *)user;
1060  RzConfigNode *node = (RzConfigNode *)data;
1061  // Try to set endian based on preference, restrict by RzAsmPlugin
1062  bool isbig = rz_asm_set_big_endian(core->rasm, node->i_value);
1063  // Set analysis endianness the same as asm
1064  rz_analysis_set_big_endian(core->analysis, isbig);
1065  // While analysis sets endianess for TypesDB there might
1066  // be cases when it isn't availble for the chosen analysis
1067  // plugin but types and printing commands still need the
1068  // corresponding endianness. Thus we set these explicitly:
1070  core->print->big_endian = node->i_value;
1071  // the big endian should also be assigned to dbg->bp->endian
1072  if (core->dbg && core->dbg->bp) {
1073  core->dbg->bp->endian = isbig;
1074  }
1075  return true;
1076 }
int endian
Definition: rz_bp.h:82
RZ_API void rz_type_db_set_endian(RzTypeDB *typedb, bool big_endian)
Set the RzType target architecture CPU.
Definition: type.c:202

References rz_core_t::analysis, rz_print_t::big_endian, rz_debug_t::bp, rz_core_t::dbg, rz_bp_t::endian, rz_config_node_t::i_value, rz_core_t::print, rz_core_t::rasm, rz_analysis_set_big_endian(), rz_asm_set_big_endian(), rz_type_db_set_endian(), and rz_analysis_t::typedb.

Referenced by rz_core_config_init().

◆ cb_binat()

static bool cb_binat ( void *  user,
void *  data 
)
static

Definition at line 951 of file cconfig.c.

951  {
952  RzCore *core = (RzCore *)user;
953  RzConfigNode *node = (RzConfigNode *)data;
954  core->binat = node->i_value;
955  return true;
956 }
bool binat
Definition: rz_core.h:374

References rz_core_t::binat, and rz_config_node_t::i_value.

Referenced by rz_core_config_init().

◆ cb_bindbginfo()

static bool cb_bindbginfo ( void *  user,
void *  data 
)
static

Definition at line 2435 of file cconfig.c.

2435  {
2436  RzCore *core = (RzCore *)user;
2437  RzConfigNode *node = (RzConfigNode *)data;
2438  if (!core || !core->bin) {
2439  return false;
2440  }
2441  core->bin->want_dbginfo = node->i_value;
2442  return true;
2443 }
bool want_dbginfo
Definition: rz_bin.h:351
RzBin * bin
Definition: rz_core.h:298

References rz_core_t::bin, rz_config_node_t::i_value, and rz_bin_t::want_dbginfo.

Referenced by rz_core_config_init().

◆ cb_binfilter()

static bool cb_binfilter ( void *  user,
void *  data 
)
static

Definition at line 944 of file cconfig.c.

944  {
945  RzCore *core = (RzCore *)user;
946  RzConfigNode *node = (RzConfigNode *)data;
947  core->bin->filter = node->i_value;
948  return true;
949 }
int filter
Definition: rz_bin.h:352

References rz_core_t::bin, rz_bin_t::filter, and rz_config_node_t::i_value.

Referenced by rz_core_config_init().

◆ cb_binforce()

static bool cb_binforce ( void *  user,
void *  data 
)
static

Definition at line 1035 of file cconfig.c.

1035  {
1036  RzCore *core = (RzCore *)user;
1037  RzConfigNode *node = (RzConfigNode *)data;
1038  rz_bin_force_plugin(core->bin, node->value);
1039  return true;
1040 }
RZ_API void rz_bin_force_plugin(RzBin *bin, const char *name)
Definition: bin.c:906

References rz_core_t::bin, rz_bin_force_plugin(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_binmaxstr()

static bool cb_binmaxstr ( void *  user,
void *  data 
)
static

Definition at line 2491 of file cconfig.c.

2491  {
2492  RzCore *core = (RzCore *)user;
2493  RzConfigNode *node = (RzConfigNode *)data;
2494  if (core->bin) {
2495  int v = node->i_value;
2496  if (v < 0) {
2497  v = 0;
2498  }
2499  core->bin->maxstrlen = v;
2500  RzBinFile *bf = rz_bin_cur(core->bin);
2501  if (bf && bf->o) {
2502  rz_bin_object_reset_strings(core->bin, bf, bf->o);
2503  }
2504  return true;
2505  }
2506  return true;
2507 }
RZ_API RzBinFile * rz_bin_cur(RzBin *bin)
Definition: bin.c:895
RZ_API bool rz_bin_object_reset_strings(RZ_NONNULL RzBin *bin, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzBinObject *obj)
Remove all previously identified strings in the binary object and scan it again for strings.
Definition: bobj.c:833
XX curplugin == o->plugin.
Definition: rz_bin.h:298
RzBinObject * o
Definition: rz_bin.h:305
int maxstrlen
Definition: rz_bin.h:337

References rz_core_t::bin, rz_config_node_t::i_value, rz_bin_t::maxstrlen, rz_bin_file_t::o, rz_bin_cur(), rz_bin_object_reset_strings(), and v.

Referenced by rz_core_config_init().

◆ cb_binmaxstrbuf()

static bool cb_binmaxstrbuf ( void *  user,
void *  data 
)
static

Definition at line 2470 of file cconfig.c.

2470  {
2471  RzCore *core = (RzCore *)user;
2472  RzConfigNode *node = (RzConfigNode *)data;
2473  if (core->bin) {
2474  int v = node->i_value;
2475  ut64 old_v = core->bin->maxstrbuf;
2476  if (v < 1) {
2477  v = 4; // HACK
2478  }
2479  core->bin->maxstrbuf = v;
2480  if (v > old_v) {
2481  RzBinFile *bf = rz_bin_cur(core->bin);
2482  if (bf && bf->o) {
2483  rz_bin_object_reset_strings(core->bin, bf, bf->o);
2484  }
2485  }
2486  return true;
2487  }
2488  return true;
2489 }
ut64 maxstrbuf
Definition: rz_bin.h:338
ut64(WINAPI *w32_GetEnabledXStateFeatures)()

References rz_core_t::bin, rz_config_node_t::i_value, rz_bin_t::maxstrbuf, rz_bin_file_t::o, rz_bin_cur(), rz_bin_object_reset_strings(), ut64(), and v.

Referenced by rz_core_config_init().

◆ cb_binminstr()

static bool cb_binminstr ( void *  user,
void *  data 
)
static

Definition at line 2509 of file cconfig.c.

2509  {
2510  RzCore *core = (RzCore *)user;
2511  RzConfigNode *node = (RzConfigNode *)data;
2512  if (core->bin) {
2513  int v = node->i_value;
2514  if (v < 1) {
2515  v = 4; // HACK
2516  }
2517  core->bin->minstrlen = v;
2518  RzBinFile *bf = rz_bin_cur(core->bin);
2519  if (bf && bf->o) {
2520  rz_bin_object_reset_strings(core->bin, bf, bf->o);
2521  }
2522  return true;
2523  }
2524  return true;
2525 }
int minstrlen
Definition: rz_bin.h:336

References rz_core_t::bin, rz_config_node_t::i_value, rz_bin_t::minstrlen, rz_bin_file_t::o, rz_bin_cur(), rz_bin_object_reset_strings(), and v.

Referenced by rz_core_config_init().

◆ cb_binprefix()

static bool cb_binprefix ( void *  user,
void *  data 
)
static

Definition at line 2445 of file cconfig.c.

2445  {
2446  RzCore *core = (RzCore *)user;
2447  RzConfigNode *node = (RzConfigNode *)data;
2448  if (!core || !core->bin) {
2449  return false;
2450  }
2451  if (node->value && *node->value) {
2452  if (!strcmp(node->value, "auto")) {
2453  if (!core->bin->file) {
2454  return false;
2455  }
2456  char *name = (char *)rz_file_basename(core->bin->file);
2457  if (name) {
2458  rz_name_filter(name, strlen(name), true);
2460  core->bin->prefix = strdup(name);
2461  free(name);
2462  }
2463  } else {
2464  core->bin->prefix = node->value;
2465  }
2466  }
2467  return true;
2468 }
RZ_API const char * rz_file_basename(const char *path)
Definition: file.c:83
RZ_API bool rz_name_filter(char *name, int len, bool strict)
Definition: name.c:43
RZ_API void rz_str_filter(char *str)
Convert all non-printable characters in str with '.'.
Definition: str.c:2359
Definition: z80asm.h:102
char * prefix
Definition: rz_bin.h:356
const char * file
Definition: rz_bin.h:329

References rz_core_t::bin, rz_bin_t::file, free(), rz_bin_t::prefix, rz_file_basename(), rz_name_filter(), rz_str_filter(), strdup(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_binstrenc()

static bool cb_binstrenc ( void *  user,
void *  data 
)
static

Definition at line 891 of file cconfig.c.

891  {
892  RzCore *core = (RzCore *)user;
893  RzConfigNode *node = (RzConfigNode *)data;
894  if (node->value[0] == '?') {
895  print_node_options(node);
896  rz_cons_printf(" -- if string's 2nd & 4th bytes are 0 then utf16le else "
897  "if 2nd - 4th & 6th bytes are 0 & no char > 0x10ffff then utf32le else "
898  "if utf8 char detected then utf8 else 8bit\n");
899  return false;
900  }
901  const namealiases_pair names[] = {
902  { "guess", NULL },
903  { "8bit", "ascii" },
904  { "utf8", "utf-8" },
905  { "utf16le", "utf-16le,utf16-le" },
906  { "utf32le", "utf-32le,utf32-le" },
907  { "utf16be", "utf-16be,utf16-be" },
908  { "utf32be", "utf-32be,utf32-be" },
909  { "ibm037", "ebcdic" },
910  { "ibm290", NULL },
911  { "ebcdices", NULL },
912  { "ebcdicuk", NULL },
913  { "ebcdicus", NULL },
914 
915  };
916  int i;
917  char *enc = strdup(node->value);
918  if (!enc) {
919  return false;
920  }
921  rz_str_case(enc, false);
922  for (i = 0; i < RZ_ARRAY_SIZE(names); i++) {
923  const namealiases_pair *pair = &names[i];
924  if (!strcmp(pair->name, enc) || rz_str_cmp_list(pair->aliases, enc, ',')) {
925  free(node->value);
926  node->value = strdup(pair->name);
927  free(enc);
928  if (core->bin) {
929  free(core->bin->strenc);
930  core->bin->strenc = !strcmp(node->value, "guess") ? NULL : strdup(node->value);
931  RzBinFile *bf = rz_bin_cur(core->bin);
932  if (bf && bf->o) {
933  rz_bin_object_reset_strings(core->bin, bf, bf->o);
934  }
935  }
936  return true;
937  }
938  }
939  eprintf("Unknown encoding: %s\n", node->value);
940  free(enc);
941  return false;
942 }
lzma_index ** i
Definition: index.h:629
RZ_API int rz_cons_printf(const char *format,...)
Definition: cons.c:1202
RZ_API bool rz_str_cmp_list(const char *list, const char *item, char sep)
Definition: str.c:953
RZ_API void rz_str_case(char *str, bool up)
Definition: str.c:341
#define RZ_ARRAY_SIZE(x)
Definition: rz_types.h:300
const char * name
Definition: cconfig.c:887
const char * aliases
Definition: cconfig.c:888
Definition: names.h:123
char * strenc
Definition: rz_bin.h:357

References namealiases_pair::aliases, rz_core_t::bin, eprintf, free(), i, namealiases_pair::name, NULL, rz_bin_file_t::o, print_node_options(), RZ_ARRAY_SIZE, rz_bin_cur(), rz_bin_object_reset_strings(), rz_cons_printf(), rz_str_case(), rz_str_cmp_list(), strdup(), rz_bin_t::strenc, and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_binstrings()

static bool cb_binstrings ( void *  user,
void *  data 
)
static

Definition at line 2423 of file cconfig.c.

2423  {
2424  const ut32 req = RZ_BIN_REQ_STRINGS;
2425  RzCore *core = (RzCore *)user;
2426  RzConfigNode *node = (RzConfigNode *)data;
2427  if (node->i_value) {
2428  core->bin->filter_rules |= req;
2429  } else {
2430  core->bin->filter_rules &= ~req;
2431  }
2432  return true;
2433 }
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 static semflg const void static shmflg const struct timespec req
Definition: sflib.h:128
uint32_t ut32
#define RZ_BIN_REQ_STRINGS
Definition: rz_bin.h:52
ut64 filter_rules
Definition: rz_bin.h:358

References rz_core_t::bin, rz_bin_t::filter_rules, rz_config_node_t::i_value, req, and RZ_BIN_REQ_STRINGS.

Referenced by rz_core_config_init().

◆ cb_binverbose()

static bool cb_binverbose ( void *  user,
void *  data 
)
static

Definition at line 2409 of file cconfig.c.

2409  {
2410  RzCore *core = (RzCore *)user;
2411  RzConfigNode *node = (RzConfigNode *)data;
2412  core->bin->verbose = node->i_value;
2413  return true;
2414 }
bool verbose
Definition: rz_bin.h:359

References rz_core_t::bin, rz_config_node_t::i_value, and rz_bin_t::verbose.

Referenced by rz_core_config_init().

◆ cb_breaklines()

static bool cb_breaklines ( void *  user,
void *  data 
)
static

Definition at line 2055 of file cconfig.c.

2055  {
2056  RzConfigNode *node = (RzConfigNode *)data;
2058  return true;
2059 }
RZ_API RzCons * rz_cons_singleton(void)
Definition: cons.c:300
bool break_lines
Definition: rz_cons.h:515

References rz_cons_t::break_lines, rz_config_node_t::i_value, and rz_cons_singleton().

Referenced by rz_core_config_init().

◆ cb_cfg_fortunes()

static bool cb_cfg_fortunes ( void *  user,
void *  data 
)
static

Definition at line 1163 of file cconfig.c.

1163  {
1164  RzCore *core = (RzCore *)user;
1165  RzConfigNode *node = (RzConfigNode *)data;
1166  // TODO CN_BOOL option does not receive the right hand side of assignment as an argument
1167  if (node->value[0] == '?') {
1168  rz_core_fortune_list(core);
1169  return false;
1170  }
1171  return true;
1172 }
RZ_API void rz_core_fortune_list(RzCore *core)
Definition: fortune.c:28

References rz_core_fortune_list(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_cfg_fortunes_file()

static bool cb_cfg_fortunes_file ( void *  user,
void *  data 
)
static

Definition at line 1174 of file cconfig.c.

1174  {
1175  RzConfigNode *node = (RzConfigNode *)data;
1176  if (node->value[0] == '?') {
1178  return false;
1179  }
1180  return true;
1181 }
RZ_API void rz_core_fortune_list_types(void)
Definition: fortune.c:21

References rz_core_fortune_list_types(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_cfgdatefmt()

static bool cb_cfgdatefmt ( void *  user,
void *  data 
)
static

Definition at line 1078 of file cconfig.c.

1078  {
1079  RzCore *core = (RzCore *)user;
1080  RzConfigNode *node = (RzConfigNode *)data;
1081  snprintf(core->print->datefmt, 32, "%s", node->value);
1082  return true;
1083 }
char datefmt[32]
Definition: rz_print.h:115

References rz_print_t::datefmt, rz_core_t::print, snprintf, and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_cfgdebug()

static bool cb_cfgdebug ( void *  user,
void *  data 
)
static

Definition at line 1092 of file cconfig.c.

1092  {
1093  RzCore *core = (RzCore *)user;
1094  RzConfigNode *node = (RzConfigNode *)data;
1095  if (!core) {
1096  return false;
1097  }
1098  if (core->io) {
1099  rz_config_set_b(core->config, "io.va", !node->i_value);
1100  }
1101  if (core->dbg && node->i_value) {
1102  const char *dbgbackend = rz_config_get(core->config, "dbg.backend");
1103  core->bin->is_debugger = true;
1104  rz_debug_use(core->dbg, dbgbackend);
1105  if (!strcmp(dbgbackend, "bf")) {
1106  rz_config_set(core->config, "asm.arch", "bf");
1107  }
1108  if (core->file) {
1109  rz_debug_select(core->dbg, rz_io_fd_get_pid(core->io, core->file->fd),
1110  rz_io_fd_get_tid(core->io, core->file->fd));
1111  }
1112  } else {
1113  rz_debug_use(core->dbg, NULL);
1114  core->bin->is_debugger = false;
1115  }
1116  return true;
1117 }
RZ_API RzConfigNode * rz_config_set_b(RzConfig *cfg, RZ_NONNULL const char *name, bool value)
Definition: config.c:201
RZ_API bool rz_debug_select(RzDebug *dbg, int pid, int tid)
Definition: debug.c:595
RZ_API bool rz_debug_use(RzDebug *dbg, const char *str)
Definition: plugin.c:17
RZ_API int rz_io_fd_get_tid(RzIO *io, int fd)
Definition: io_fd.c:100
RZ_API int rz_io_fd_get_pid(RzIO *io, int fd)
Definition: io_fd.c:92
int is_debugger
Definition: rz_bin.h:350
RzIO * io
Definition: rz_core.h:313
RzCoreFile * file
Definition: rz_core.h:314

References rz_core_t::bin, rz_core_t::config, rz_core_t::dbg, rz_core_file_t::fd, rz_core_t::file, rz_config_node_t::i_value, rz_core_t::io, rz_bin_t::is_debugger, NULL, rz_config_get(), rz_config_set(), rz_config_set_b(), rz_debug_select(), rz_debug_use(), rz_io_fd_get_pid(), and rz_io_fd_get_tid().

Referenced by rz_core_config_init().

◆ cb_cmd_esil_intr()

static bool cb_cmd_esil_intr ( void *  user,
void *  data 
)
static

Definition at line 1816 of file cconfig.c.

1816  {
1817  RzCore *core = (RzCore *)user;
1818  RzConfigNode *node = (RzConfigNode *)data;
1819  if (core && core->analysis && core->analysis->esil) {
1820  core->analysis->esil->cmd = rz_core_esil_cmd;
1821  free(core->analysis->esil->cmd_intr);
1822  core->analysis->esil->cmd_intr = strdup(node->value);
1823  }
1824  return true;
1825 }
RZ_API bool rz_core_esil_cmd(RzAnalysisEsil *esil, const char *cmd, ut64 a1, ut64 a2)
Definition: cconfig.c:1669
bool(* cmd)(ANALYSIS_ESIL *esil, const char *name, ut64 a0, ut64 a1)
Definition: rz_analysis.h:1089
struct rz_analysis_esil_t * esil
Definition: rz_analysis.h:584

References rz_core_t::analysis, rz_analysis_esil_t::cmd, rz_analysis_esil_t::cmd_intr, rz_analysis_t::esil, free(), rz_core_esil_cmd(), strdup(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_cmd_esil_ioer()

static bool cb_cmd_esil_ioer ( void *  user,
void *  data 
)
static

Definition at line 1794 of file cconfig.c.

1794  {
1795  RzCore *core = (RzCore *)user;
1796  RzConfigNode *node = (RzConfigNode *)data;
1797  if (core && core->analysis && core->analysis->esil) {
1798  core->analysis->esil->cmd = rz_core_esil_cmd;
1799  free(core->analysis->esil->cmd_ioer);
1800  core->analysis->esil->cmd_ioer = strdup(node->value);
1801  }
1802  return true;
1803 }

References rz_core_t::analysis, rz_analysis_esil_t::cmd, rz_analysis_esil_t::cmd_ioer, rz_analysis_t::esil, free(), rz_core_esil_cmd(), strdup(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_cmd_esil_mdev()

static bool cb_cmd_esil_mdev ( void *  user,
void *  data 
)
static

Definition at line 1860 of file cconfig.c.

1860  {
1861  RzCore *core = (RzCore *)user;
1862  RzConfigNode *node = (RzConfigNode *)data;
1863  if (core && core->analysis && core->analysis->esil) {
1864  core->analysis->esil->cmd = rz_core_esil_cmd;
1865  free(core->analysis->esil->cmd_mdev);
1866  core->analysis->esil->cmd_mdev = strdup(node->value);
1867  }
1868  return true;
1869 }

References rz_core_t::analysis, rz_analysis_esil_t::cmd, rz_analysis_esil_t::cmd_mdev, rz_analysis_t::esil, free(), rz_core_esil_cmd(), strdup(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_cmd_esil_step()

static bool cb_cmd_esil_step ( void *  user,
void *  data 
)
static

Definition at line 1838 of file cconfig.c.

1838  {
1839  RzCore *core = (RzCore *)user;
1840  RzConfigNode *node = (RzConfigNode *)data;
1841  if (core && core->analysis && core->analysis->esil) {
1842  core->analysis->esil->cmd = rz_core_esil_cmd;
1843  free(core->analysis->esil->cmd_step);
1844  core->analysis->esil->cmd_step = strdup(node->value);
1845  }
1846  return true;
1847 }

References rz_core_t::analysis, rz_analysis_esil_t::cmd, rz_analysis_esil_t::cmd_step, rz_analysis_t::esil, free(), rz_core_esil_cmd(), strdup(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_cmd_esil_step_out()

static bool cb_cmd_esil_step_out ( void *  user,
void *  data 
)
static

Definition at line 1849 of file cconfig.c.

1849  {
1850  RzCore *core = (RzCore *)user;
1851  RzConfigNode *node = (RzConfigNode *)data;
1852  if (core && core->analysis && core->analysis->esil) {
1853  core->analysis->esil->cmd = rz_core_esil_cmd;
1854  free(core->analysis->esil->cmd_step_out);
1855  core->analysis->esil->cmd_step_out = strdup(node->value);
1856  }
1857  return true;
1858 }

References rz_core_t::analysis, rz_analysis_esil_t::cmd, rz_analysis_esil_t::cmd_step_out, rz_analysis_t::esil, free(), rz_core_esil_cmd(), strdup(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_cmd_esil_todo()

static bool cb_cmd_esil_todo ( void *  user,
void *  data 
)
static

Definition at line 1805 of file cconfig.c.

1805  {
1806  RzCore *core = (RzCore *)user;
1807  RzConfigNode *node = (RzConfigNode *)data;
1808  if (core && core->analysis && core->analysis->esil) {
1809  core->analysis->esil->cmd = rz_core_esil_cmd;
1810  free(core->analysis->esil->cmd_todo);
1811  core->analysis->esil->cmd_todo = strdup(node->value);
1812  }
1813  return true;
1814 }

References rz_core_t::analysis, rz_analysis_esil_t::cmd, rz_analysis_esil_t::cmd_todo, rz_analysis_t::esil, free(), rz_core_esil_cmd(), strdup(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_cmd_esil_trap()

static bool cb_cmd_esil_trap ( void *  user,
void *  data 
)
static

Definition at line 1871 of file cconfig.c.

1871  {
1872  RzCore *core = (RzCore *)user;
1873  RzConfigNode *node = (RzConfigNode *)data;
1874  if (core && core->analysis && core->analysis->esil) {
1875  core->analysis->esil->cmd = rz_core_esil_cmd;
1876  core->analysis->esil->cmd_trap = strdup(node->value);
1877  }
1878  return true;
1879 }

References rz_core_t::analysis, rz_analysis_esil_t::cmd, rz_analysis_esil_t::cmd_trap, rz_analysis_t::esil, rz_core_esil_cmd(), strdup(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_cmd_hexcursor()

static bool cb_cmd_hexcursor ( void *  user,
void *  data 
)
static

Definition at line 1475 of file cconfig.c.

1475  {
1476  RzCore *core = (RzCore *)user;
1477  RzConfigNode *node = (RzConfigNode *)data;
1478  core->print->cfmt = node->value;
1479  return true;
1480 }
const char * cfmt
Definition: rz_print.h:114

References rz_print_t::cfmt, rz_core_t::print, and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_cmddepth()

static bool cb_cmddepth ( void *  user,
void *  data 
)
static

Definition at line 1881 of file cconfig.c.

1881  {
1882  RzCore *core = (RzCore *)user;
1883  int c = RZ_MAX(((RzConfigNode *)data)->i_value, 0);
1884  core->max_cmd_depth = c;
1885  core->cons->context->cmd_depth = c;
1886  return true;
1887 }
#define RZ_MAX(x, y)
#define c(i)
Definition: sha256.c:43
RzConsContext * context
Definition: rz_cons.h:502
RzCons * cons
Definition: rz_core.h:312
int max_cmd_depth
Definition: rz_core.h:363

References c, rz_cons_context_t::cmd_depth, rz_core_t::cons, rz_cons_t::context, rz_core_t::max_cmd_depth, and RZ_MAX.

Referenced by rz_core_config_init().

◆ cb_cmdrepeat()

static bool cb_cmdrepeat ( void *  user,
void *  data 
)
static

Definition at line 1190 of file cconfig.c.

1190  {
1191  RzCore *core = (RzCore *)user;
1192  RzConfigNode *node = (RzConfigNode *)data;
1193  core->cmdrepeat = node->i_value;
1194  return true;
1195 }
int cmdrepeat
Definition: rz_core.h:341

References rz_core_t::cmdrepeat, and rz_config_node_t::i_value.

Referenced by rz_core_config_init().

◆ cb_cmdtimes()

static bool cb_cmdtimes ( void *  user,
void *  data 
)
static

Definition at line 1183 of file cconfig.c.

1183  {
1184  RzCore *core = (RzCore *)user;
1185  RzConfigNode *node = (RzConfigNode *)data;
1186  core->cmdtimes = node->value;
1187  return true;
1188 }
const char * cmdtimes
Definition: rz_core.h:342

References rz_core_t::cmdtimes, and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_color()

static bool cb_color ( void *  user,
void *  data 
)
static

Definition at line 1204 of file cconfig.c.

1204  {
1205  RzCore *core = (RzCore *)user;
1206  RzConfigNode *node = (RzConfigNode *)data;
1207  if (node->i_value) {
1208  core->print->flags |= RZ_PRINT_FLAGS_COLOR;
1209  } else {
1210  core->print->flags &= (~RZ_PRINT_FLAGS_COLOR);
1211  }
1212  if (!strcmp(node->value, "true")) {
1213  node->i_value = 1;
1214  } else if (!strcmp(node->value, "false")) {
1215  node->i_value = 0;
1216  }
1218  ? COLOR_MODE_16M
1219  : node->i_value;
1221  rz_print_set_flags(core->print, core->print->flags);
1222  return true;
1223 }
RZ_API void rz_cons_pal_update_event(void)
Definition: pal.c:652
@ COLOR_MODE_16M
Definition: rz_cons.h:445
#define RZ_PRINT_FLAGS_COLOR
Definition: rz_print.h:15

References rz_cons_context_t::color_mode, COLOR_MODE_16M, rz_cons_t::context, rz_print_t::flags, rz_config_node_t::i_value, rz_core_t::print, rz_cons_pal_update_event(), rz_cons_singleton(), RZ_PRINT_FLAGS_COLOR, rz_print_set_flags(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_color_getter()

static bool cb_color_getter ( void *  user,
RzConfigNode node 
)
static

Definition at line 1225 of file cconfig.c.

1225  {
1226  (void)user;
1228  char buf[128];
1229  rz_config_node_value_format_i(buf, sizeof(buf), rz_cons_singleton()->context->color_mode, node);
1230  if (!node->value || strcmp(node->value, buf) != 0) {
1231  free(node->value);
1232  node->value = strdup(buf);
1233  }
1234  return true;
1235 }
RZ_API void rz_config_node_value_format_i(char *buf, size_t buf_size, const ut64 i, RZ_NULLABLE RzConfigNode *node)
Definition: config.c:403
voidpf void * buf
Definition: ioapi.h:138

References rz_cons_context_t::color_mode, rz_cons_t::context, free(), rz_config_node_t::i_value, rz_config_node_value_format_i(), rz_cons_singleton(), strdup(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_completion_maxtab()

static bool cb_completion_maxtab ( void *  user,
void *  data 
)
static

Definition at line 1156 of file cconfig.c.

1156  {
1157  RzCore *core = (RzCore *)user;
1158  RzConfigNode *node = (RzConfigNode *)data;
1159  core->cons->line->completion.args_limit = node->i_value;
1160  return true;
1161 }
struct rz_line_t * line
Definition: rz_cons.h:553
size_t args_limit
Definition: rz_cons.h:1045
RzLineCompletion completion
Definition: rz_cons.h:1089

References rz_line_comp_t::args_limit, rz_line_t::completion, rz_core_t::cons, rz_config_node_t::i_value, and rz_cons_t::line.

Referenced by rz_core_config_init().

◆ cb_consbreak()

static bool cb_consbreak ( void *  user,
void *  data 
)
static

Definition at line 2329 of file cconfig.c.

2329  {
2330  RzCore *core = (RzCore *)user;
2331  RzConfigNode *node = (RzConfigNode *)data;
2332  core->dbg->consbreak = node->i_value;
2333  return true;
2334 }
bool consbreak
Definition: rz_debug.h:271

References rz_debug_t::consbreak, rz_core_t::dbg, and rz_config_node_t::i_value.

Referenced by rz_core_config_init().

◆ cb_contiguous()

static bool cb_contiguous ( void *  user,
void *  data 
)
static

Definition at line 2273 of file cconfig.c.

2273  {
2274  RzCore *core = (RzCore *)user;
2275  RzConfigNode *node = (RzConfigNode *)data;
2276  core->search->contiguous = node->i_value;
2277  return true;
2278 }
RzSearch * search
Definition: rz_core.h:331
int contiguous
Definition: rz_search.h:69

References rz_search_t::contiguous, rz_config_node_t::i_value, and rz_core_t::search.

Referenced by rz_core_config_init().

◆ cb_dbg_aftersc()

static bool cb_dbg_aftersc ( void *  user,
void *  data 
)
static

Definition at line 1378 of file cconfig.c.

1378  {
1379  RzCore *core = (RzCore *)user;
1380  RzConfigNode *node = (RzConfigNode *)data;
1381  core->dbg->trace_aftersyscall = node->i_value;
1382  if (core->bin->is_debugger) {
1383  rz_debug_attach(core->dbg, core->dbg->pid);
1384  }
1385  return true;
1386 }
RZ_API int rz_debug_attach(RzDebug *dbg, int pid)
Definition: debug.c:445
int trace_aftersyscall
Definition: rz_debug.h:265

References rz_core_t::bin, rz_core_t::dbg, rz_config_node_t::i_value, rz_bin_t::is_debugger, rz_debug_t::pid, rz_debug_attach(), and rz_debug_t::trace_aftersyscall.

Referenced by rz_core_config_init().

◆ cb_dbg_args()

static bool cb_dbg_args ( void *  user,
void *  data 
)
static

Definition at line 1400 of file cconfig.c.

1400  {
1401  RzCore *core = (RzCore *)user;
1402  RzConfigNode *node = (RzConfigNode *)data;
1403  if (!node || !*(node->value)) {
1404  core->io->args = NULL;
1405  } else {
1406  core->io->args = strdup(node->value);
1407  }
1408  return true;
1409 }
char * args
Definition: rz_io.h:89

References rz_io_t::args, rz_core_t::io, NULL, strdup(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_dbg_bpinmaps()

static bool cb_dbg_bpinmaps ( void *  user,
void *  data 
)
static

Definition at line 1286 of file cconfig.c.

1286  {
1287  RzCore *core = (RzCore *)user;
1288  RzConfigNode *node = (RzConfigNode *)data;
1289  core->dbg->bp->bpinmaps = node->i_value;
1290  return true;
1291 }
bool bpinmaps
Definition: rz_bp.h:83

References rz_debug_t::bp, rz_bp_t::bpinmaps, rz_core_t::dbg, and rz_config_node_t::i_value.

Referenced by rz_core_config_init().

◆ cb_dbg_btalgo()

static bool cb_dbg_btalgo ( void *  user,
void *  data 
)
static

Definition at line 1258 of file cconfig.c.

1258  {
1259  RzCore *core = (RzCore *)user;
1260  RzConfigNode *node = (RzConfigNode *)data;
1261  if (*node->value == '?') {
1262  print_node_options(node);
1263  return false;
1264  }
1265  free(core->dbg->btalgo);
1266  core->dbg->btalgo = strdup(node->value);
1267  return true;
1268 }
char * btalgo
Definition: rz_debug.h:258

References rz_debug_t::btalgo, rz_core_t::dbg, free(), print_node_options(), strdup(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_dbg_clone()

static bool cb_dbg_clone ( void *  user,
void *  data 
)
static

Definition at line 1347 of file cconfig.c.

1347  {
1348  RzCore *core = (RzCore *)user;
1349  RzConfigNode *node = (RzConfigNode *)data;
1350  core->dbg->trace_clone = node->i_value;
1351  if (core->bin->is_debugger) {
1352  rz_debug_attach(core->dbg, core->dbg->pid);
1353  }
1354  return true;
1355 }
int trace_clone
Definition: rz_debug.h:266

References rz_core_t::bin, rz_core_t::dbg, rz_config_node_t::i_value, rz_bin_t::is_debugger, rz_debug_t::pid, rz_debug_attach(), and rz_debug_t::trace_clone.

Referenced by rz_core_config_init().

◆ cb_dbg_create_new_console()

static bool cb_dbg_create_new_console ( void *  user,
void *  data 
)
static

Definition at line 1364 of file cconfig.c.

1364  {
1365  RzCore *core = (RzCore *)user;
1366  RzConfigNode *node = (RzConfigNode *)data;
1367  core->dbg->create_new_console = node->i_value;
1368  return true;
1369 }
bool create_new_console
Definition: rz_debug.h:268

References rz_debug_t::create_new_console, rz_core_t::dbg, and rz_config_node_t::i_value.

Referenced by rz_core_config_init().

◆ cb_dbg_execs()

static bool cb_dbg_execs ( void *  user,
void *  data 
)
static

Definition at line 1331 of file cconfig.c.

1331  {
1332  RzConfigNode *node = (RzConfigNode *)data;
1333 #if __linux__
1334  RzCore *core = (RzCore *)user;
1335  core->dbg->trace_execs = node->i_value;
1336  if (core->bin->is_debugger) {
1337  rz_debug_attach(core->dbg, core->dbg->pid);
1338  }
1339 #else
1340  if (node->i_value) {
1341  eprintf("Warning: dbg.execs is not supported in this platform.\n");
1342  }
1343 #endif
1344  return true;
1345 }
int trace_execs
Definition: rz_debug.h:264

References rz_core_t::bin, rz_core_t::dbg, eprintf, rz_config_node_t::i_value, rz_bin_t::is_debugger, rz_debug_t::pid, rz_debug_attach(), and rz_debug_t::trace_execs.

Referenced by rz_core_config_init().

◆ cb_dbg_follow_child()

static bool cb_dbg_follow_child ( void *  user,
void *  data 
)
static

Definition at line 1357 of file cconfig.c.

1357  {
1358  RzCore *core = (RzCore *)user;
1359  RzConfigNode *node = (RzConfigNode *)data;
1360  core->dbg->follow_child = node->i_value;
1361  return true;
1362 }
int follow_child
Definition: rz_debug.h:267

References rz_core_t::dbg, rz_debug_t::follow_child, and rz_config_node_t::i_value.

Referenced by rz_core_config_init().

◆ cb_dbg_forks()

static bool cb_dbg_forks ( void *  user,
void *  data 
)
static

Definition at line 1293 of file cconfig.c.

1293  {
1294  RzCore *core = (RzCore *)user;
1295  RzConfigNode *node = (RzConfigNode *)data;
1296  core->dbg->trace_forks = node->i_value;
1297  if (core->bin->is_debugger) {
1298  rz_debug_attach(core->dbg, core->dbg->pid);
1299  }
1300  return true;
1301 }
int trace_forks
Definition: rz_debug.h:263

References rz_core_t::bin, rz_core_t::dbg, rz_config_node_t::i_value, rz_bin_t::is_debugger, rz_debug_t::pid, rz_debug_attach(), and rz_debug_t::trace_forks.

Referenced by rz_core_config_init().

◆ cb_dbg_gdb_page_size()

static bool cb_dbg_gdb_page_size ( void *  user,
void *  data 
)
static

Definition at line 1303 of file cconfig.c.

1303  {
1304  RzCore *core = (RzCore *)user;
1305  RzConfigNode *node = (RzConfigNode *)data;
1306  if (node->i_value < 64) { // 64 is hardcoded min packet size
1307  return false;
1308  }
1309  if (isGdbPlugin(core)) {
1310  char cmd[64];
1311  snprintf(cmd, sizeof(cmd), "page_size %" PFMT64d, node->i_value);
1312  free(rz_io_system(core->io, cmd));
1313  }
1314  return true;
1315 }
static bool isGdbPlugin(RzCore *core)
Definition: cconfig.c:34
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
RZ_API char * rz_io_system(RzIO *io, const char *cmd)
Definition: io.c:411
#define PFMT64d
Definition: rz_types.h:394

References cmd, free(), rz_config_node_t::i_value, rz_core_t::io, isGdbPlugin(), PFMT64d, rz_io_system(), and snprintf.

Referenced by rz_core_config_init().

◆ cb_dbg_gdb_retries()

static bool cb_dbg_gdb_retries ( void *  user,
void *  data 
)
static

Definition at line 1317 of file cconfig.c.

1317  {
1318  RzCore *core = (RzCore *)user;
1319  RzConfigNode *node = (RzConfigNode *)data;
1320  if (node->i_value <= 0) {
1321  return false;
1322  }
1323  if (isGdbPlugin(core)) {
1324  char cmd[64];
1325  snprintf(cmd, sizeof(cmd), "retries %" PFMT64d, node->i_value);
1326  free(rz_io_system(core->io, cmd));
1327  }
1328  return true;
1329 }

References cmd, free(), rz_config_node_t::i_value, rz_core_t::io, isGdbPlugin(), PFMT64d, rz_io_system(), and snprintf.

Referenced by rz_core_config_init().

◆ cb_dbg_libs()

static bool cb_dbg_libs ( void *  user,
void *  data 
)
static

Definition at line 1270 of file cconfig.c.

1270  {
1271  RzCore *core = (RzCore *)user;
1272  RzConfigNode *node = (RzConfigNode *)data;
1273  free(core->dbg->glob_libs);
1274  core->dbg->glob_libs = strdup(node->value);
1275  return true;
1276 }
char * glob_libs
Definition: rz_debug.h:269

References rz_core_t::dbg, free(), rz_debug_t::glob_libs, strdup(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_dbg_trace_continue()

static bool cb_dbg_trace_continue ( void *  user,
void *  data 
)
static

Definition at line 1371 of file cconfig.c.

1371  {
1372  RzCore *core = (RzCore *)user;
1373  RzConfigNode *node = (RzConfigNode *)data;
1374  core->dbg->trace_continue = node->i_value;
1375  return true;
1376 }
bool trace_continue
Definition: rz_debug.h:309

References rz_core_t::dbg, rz_config_node_t::i_value, and rz_debug_t::trace_continue.

Referenced by rz_core_config_init().

◆ cb_dbg_unlibs()

static bool cb_dbg_unlibs ( void *  user,
void *  data 
)
static

Definition at line 1278 of file cconfig.c.

1278  {
1279  RzCore *core = (RzCore *)user;
1280  RzConfigNode *node = (RzConfigNode *)data;
1281  free(core->dbg->glob_unlibs);
1282  core->dbg->glob_unlibs = strdup(node->value);
1283  return true;
1284 }
char * glob_unlibs
Definition: rz_debug.h:270

References rz_core_t::dbg, free(), rz_debug_t::glob_unlibs, strdup(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_dbg_verbose()

static bool cb_dbg_verbose ( void *  user,
void *  data 
)
static

Definition at line 2813 of file cconfig.c.

2813  {
2814  RzCore *core = (RzCore *)user;
2815  RzConfigNode *node = (RzConfigNode *)data;
2816  core->dbg->verbose = node->i_value;
2817  return true;
2818 }
bool verbose
Definition: rz_debug.h:319

References rz_core_t::dbg, rz_config_node_t::i_value, and rz_debug_t::verbose.

Referenced by rz_core_config_init().

◆ cb_dbgbackend()

static bool cb_dbgbackend ( void *  user,
void *  data 
)
static

Definition at line 1411 of file cconfig.c.

1411  {
1412  RzCore *core = (RzCore *)user;
1413  RzConfigNode *node = (RzConfigNode *)data;
1414  RzCmdStateOutput state = { 0 };
1416  if (!strcmp(node->value, "?")) {
1420  return false;
1421  }
1422  if (!strcmp(node->value, "bf")) {
1423  // hack
1424  rz_config_set(core->config, "asm.arch", "bf");
1425  }
1426  rz_debug_use(core->dbg, node->value);
1427  return true;
1428 }
RZ_API RzCmdStatus rz_core_debug_plugins_print(RzCore *core, RzCmdStateOutput *state)
Definition: cdebug.c:329
@ RZ_OUTPUT_MODE_QUIET
Definition: rz_types.h:42

References rz_core_t::config, rz_core_t::dbg, rz_cmd_state_output_fini(), rz_cmd_state_output_init(), rz_cmd_state_output_print(), rz_config_set(), rz_core_debug_plugins_print(), rz_debug_use(), RZ_OUTPUT_MODE_QUIET, and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_dbgbep()

static bool cb_dbgbep ( void *  user,
void *  data 
)
static

Definition at line 1249 of file cconfig.c.

1249  {
1250  RzConfigNode *node = (RzConfigNode *)data;
1251  if (*node->value == '?') {
1252  print_node_options(node);
1253  return false;
1254  }
1255  return true;
1256 }

References print_node_options(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_dbgbtdepth()

static bool cb_dbgbtdepth ( void *  user,
void *  data 
)
static

Definition at line 627 of file cconfig.c.

627  {
628  RzCore *core = (RzCore *)user;
629  RzConfigNode *node = (RzConfigNode *)data;
630  core->dbg->btdepth = node->i_value;
631  return true;
632 }
int btdepth
Definition: rz_debug.h:259

References rz_debug_t::btdepth, rz_core_t::dbg, and rz_config_node_t::i_value.

Referenced by rz_core_config_init().

◆ cb_debase64()

static bool cb_debase64 ( void *  user,
void *  data 
)
static

Definition at line 2416 of file cconfig.c.

2416  {
2417  RzCore *core = (RzCore *)user;
2418  RzConfigNode *node = (RzConfigNode *)data;
2419  core->bin->debase64 = node->i_value;
2420  return true;
2421 }
int debase64
Definition: rz_bin.h:335

References rz_core_t::bin, rz_bin_t::debase64, and rz_config_node_t::i_value.

Referenced by rz_core_config_init().

◆ cb_debug_hitinfo()

static bool cb_debug_hitinfo ( void *  user,
void *  data 
)
static

Definition at line 120 of file cconfig.c.

120  {
121  RzCore *core = (RzCore *)user;
122  RzConfigNode *node = (RzConfigNode *)data;
123  core->dbg->hitinfo = node->i_value;
124  return true;
125 }
int hitinfo
XXX: MUST SET ///.
Definition: rz_debug.h:244

References rz_core_t::dbg, rz_debug_t::hitinfo, and rz_config_node_t::i_value.

Referenced by rz_core_config_init().

◆ cb_decoff()

static bool cb_decoff ( void *  user,
void *  data 
)
static

Definition at line 1237 of file cconfig.c.

1237  {
1238  RzCore *core = (RzCore *)user;
1239  RzConfigNode *node = (RzConfigNode *)data;
1240  if (node->i_value) {
1242  } else {
1243  core->print->flags &= (~RZ_PRINT_FLAGS_ADDRDEC);
1244  }
1245  rz_print_set_flags(core->print, core->print->flags);
1246  return true;
1247 }
#define RZ_PRINT_FLAGS_ADDRDEC
Definition: rz_print.h:24

References rz_print_t::flags, rz_config_node_t::i_value, rz_core_t::print, RZ_PRINT_FLAGS_ADDRDEC, and rz_print_set_flags().

Referenced by rz_core_config_init().

◆ cb_diff_sort()

static bool cb_diff_sort ( void *  _core,
void *  _node 
)
static

Definition at line 88 of file cconfig.c.

88  {
89  RzConfigNode *node = _node;
90  const char *column = node->value;
91  RzCore *core = _core;
92  if (column && strcmp(column, "?")) {
93  if (!strcmp(column, "name")) {
95  } else if (!strcmp(column, "namelen")) {
97  } else if (!strcmp(column, "addr")) {
99  } else if (!strcmp(column, "type")) {
101  } else if (!strcmp(column, "size")) {
103  } else if (!strcmp(column, "dist")) {
105  } else {
106  goto fail;
107  }
108  return true;
109  }
110 fail:
111  eprintf("e diff.sort = [name, namelen, addr, type, size, dist]\n");
112  return false;
113 }
static int compareAddress(const RzAnalysisFunction *a, const RzAnalysisFunction *b)
Definition: cconfig.c:65
static int compareSize(const RzAnalysisFunction *a, const RzAnalysisFunction *b)
Definition: cconfig.c:73
static int compareDist(const RzAnalysisFunction *a, const RzAnalysisFunction *b)
Definition: cconfig.c:84
static int compareName(const RzAnalysisFunction *a, const RzAnalysisFunction *b)
Definition: cconfig.c:51
static int compareType(const RzAnalysisFunction *a, const RzAnalysisFunction *b)
Definition: cconfig.c:69
static int compareNameLen(const RzAnalysisFunction *a, const RzAnalysisFunction *b)
Definition: cconfig.c:55
static RzCore * _core
Definition: cmd_debug.c:1622
int(* RzListComparator)(const void *value, const void *list_data)
Definition: rz_list.h:33
RzListComparator columnSort
Definition: rz_analysis.h:611
#define fail(test)
Definition: tests.h:29

References _core, rz_core_t::analysis, rz_analysis_t::columnSort, compareAddress(), compareDist(), compareName(), compareNameLen(), compareSize(), compareType(), eprintf, fail, and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_dirhome()

static bool cb_dirhome ( void *  user,
void *  data 
)
static

Definition at line 1119 of file cconfig.c.

1119  {
1120  RzConfigNode *node = (RzConfigNode *)data;
1121  if (node->value) {
1123  }
1124  return true;
1125 }
RZ_API int rz_sys_setenv(const char *key, const char *value)
Set an environment variable in the calling process.
Definition: sys.c:405
#define RZ_SYS_HOME
Definition: rz_types.h:220

References RZ_SYS_HOME, rz_sys_setenv(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_dirsrc()

static bool cb_dirsrc ( void *  user,
void *  data 
)
static

Definition at line 1134 of file cconfig.c.

1134  {
1135  RzConfigNode *node = (RzConfigNode *)data;
1136  RzCore *core = (RzCore *)user;
1137  free(core->bin->srcdir);
1138  core->bin->srcdir = strdup(node->value);
1139  return true;
1140 }
char * srcdir
Definition: rz_bin.h:355

References rz_core_t::bin, free(), rz_bin_t::srcdir, strdup(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_dirtmp()

static bool cb_dirtmp ( void *  user,
void *  data 
)
static

Definition at line 1127 of file cconfig.c.

1127  {
1128  RzConfigNode *node = (RzConfigNode *)data;
1129  char *value = RZ_STR_ISNOTEMPTY(node->value) ? node->value : NULL;
1131  return true;
1132 }
static int value
Definition: cmd_api.c:93
#define RZ_STR_ISNOTEMPTY(x)
Definition: rz_str.h:68
#define RZ_SYS_TMP
Definition: rz_types.h:221

References NULL, RZ_STR_ISNOTEMPTY, rz_sys_setenv(), RZ_SYS_TMP, value, and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_dotted()

static bool cb_dotted ( void *  user,
void *  data 
)
static

Definition at line 2381 of file cconfig.c.

2381  {
2382  RzCore *core = (RzCore *)user;
2383  RzConfigNode *node = (RzConfigNode *)data;
2384  core->cons->dotted_lines = node->i_value;
2385  return true;
2386 }
bool dotted_lines
Definition: rz_cons.h:561

References rz_core_t::cons, rz_cons_t::dotted_lines, and rz_config_node_t::i_value.

Referenced by rz_core_config_init().

◆ cb_emuskip()

static bool cb_emuskip ( void *  user,
void *  data 
)
static

Definition at line 796 of file cconfig.c.

796  {
797  RzConfigNode *node = (RzConfigNode *)data;
798  if (*node->value == '?') {
799  if (strlen(node->value) > 1 && node->value[1] == '?') {
800  rz_cons_printf("Concatenation of meta types encoded as characters:\n"
801  "'d': data\n'c': code\n's': string\n'f': format\n'm': magic\n"
802  "'h': hide\n'C': comment\n'r': run\n"
803  "(default is 'ds' to skip data and strings)\n");
804  } else {
805  print_node_options(node);
806  }
807  return false;
808  }
809  return true;
810 }

References print_node_options(), rz_cons_printf(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_emustr()

static bool cb_emustr ( void *  user,
void *  data 
)
static

Definition at line 787 of file cconfig.c.

787  {
788  RzCore *core = (RzCore *)user;
789  RzConfigNode *node = (RzConfigNode *)data;
790  if (node->i_value) {
791  rz_config_set(core->config, "asm.emu", "true");
792  }
793  return true;
794 }

References rz_core_t::config, rz_config_node_t::i_value, and rz_config_set().

Referenced by rz_core_config_init().

◆ cb_esilstackdepth()

static bool cb_esilstackdepth ( void *  user,
void *  data 
)
static

Definition at line 1448 of file cconfig.c.

1448  {
1449  RzConfigNode *node = (RzConfigNode *)data;
1450  if (node->i_value < 3) {
1451  eprintf("esil.stack.depth must be greater than 2\n");
1452  node->i_value = 32;
1453  }
1454  return true;
1455 }

References eprintf, and rz_config_node_t::i_value.

Referenced by rz_core_config_init().

◆ cb_esilverbose()

static bool cb_esilverbose ( void *  user,
void *  data 
)
static

Definition at line 1439 of file cconfig.c.

1439  {
1440  RzCore *core = (RzCore *)user;
1441  RzConfigNode *node = (RzConfigNode *)data;
1442  if (core->analysis->esil) {
1443  core->analysis->esil->verbose = node->i_value;
1444  }
1445  return true;
1446 }

References rz_core_t::analysis, rz_analysis_t::esil, rz_config_node_t::i_value, and rz_analysis_esil_t::verbose.

Referenced by rz_core_config_init().

◆ cb_exectrap()

static bool cb_exectrap ( void *  user,
void *  data 
)
static

Definition at line 2206 of file cconfig.c.

2206  {
2207  RzConfigNode *node = (RzConfigNode *)data;
2208  RzCore *core = (RzCore *)user;
2209  if (core->analysis && core->analysis->esil) {
2210  core->analysis->esil->exectrap = node->i_value;
2211  }
2212  return true;
2213 }

References rz_core_t::analysis, rz_analysis_t::esil, rz_analysis_esil_t::exectrap, and rz_config_node_t::i_value.

Referenced by rz_core_config_init().

◆ cb_filepath()

static bool cb_filepath ( void *  user,
void *  data 
)
static

Definition at line 2001 of file cconfig.c.

2001  {
2002  RzCore *core = (RzCore *)user;
2003  RzConfigNode *node = (RzConfigNode *)data;
2004  char *pikaboo = strstr(node->value, "://");
2005  if (pikaboo) {
2006  if (pikaboo[3] == '/') {
2007  rz_config_set(core->config, "file.lastpath", node->value);
2008  char *ovalue = node->value;
2009  node->value = strdup(pikaboo + 3);
2010  free(ovalue);
2011  return true;
2012  }
2013  return false;
2014  }
2015  rz_config_set(core->config, "file.lastpath", node->value);
2016  return true;
2017 }

References rz_core_t::config, free(), rz_config_set(), strdup(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_fixcolumns()

static bool cb_fixcolumns ( void *  user,
void *  data 
)
static

Definition at line 1463 of file cconfig.c.

1463  {
1464  RzConfigNode *node = (RzConfigNode *)data;
1465  rz_cons_singleton()->fix_columns = atoi(node->value);
1466  return true;
1467 }
int fix_columns
Definition: rz_cons.h:514

References rz_cons_t::fix_columns, rz_cons_singleton(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_fixrows()

static bool cb_fixrows ( void *  user,
void *  data 
)
static

Definition at line 1457 of file cconfig.c.

1457  {
1458  RzConfigNode *node = (RzConfigNode *)data;
1459  rz_cons_singleton()->fix_rows = (int)node->i_value;
1460  return true;
1461 }
static int
Definition: sfsocketcall.h:114
int fix_rows
Definition: rz_cons.h:513

References rz_cons_t::fix_rows, rz_config_node_t::i_value, int, and rz_cons_singleton().

Referenced by rz_core_config_init().

◆ cb_flag_realnames()

static bool cb_flag_realnames ( void *  user,
void *  data 
)
static

Definition at line 715 of file cconfig.c.

715  {
716  RzCore *core = (RzCore *)user;
717  RzConfigNode *node = (RzConfigNode *)data;
718  core->flags->realnames = node->i_value;
719  return true;
720 }
RzFlag * flags
Definition: rz_core.h:330
bool realnames
Definition: rz_flag.h:49

References rz_core_t::flags, rz_config_node_t::i_value, and rz_flag_t::realnames.

Referenced by rz_core_config_init().

◆ cb_flirt()

static bool cb_flirt ( void *  user,
void *  data 
)
static

Definition at line 2820 of file cconfig.c.

2820  {
2821  rz_return_val_if_fail(data, false);
2822  RzConfigNode *node = (RzConfigNode *)data;
2823  if (*node->value == '?') {
2824  print_node_options(node);
2825  return false;
2826  }
2827  return true;
2828 }
#define rz_return_val_if_fail(expr, val)
Definition: rz_assert.h:108

References print_node_options(), rz_return_val_if_fail, and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_gotolimit()

static bool cb_gotolimit ( void *  user,
void *  data 
)
static

Definition at line 1430 of file cconfig.c.

1430  {
1431  RzCore *core = (RzCore *)user;
1432  RzConfigNode *node = (RzConfigNode *)data;
1433  if (core->analysis->esil) {
1434  core->analysis->esil_goto_limit = node->i_value;
1435  }
1436  return true;
1437 }

References rz_core_t::analysis, rz_analysis_t::esil, rz_analysis_t::esil_goto_limit, and rz_config_node_t::i_value.

Referenced by rz_core_config_init().

◆ cb_graphformat()

static bool cb_graphformat ( void *  user,
void *  data 
)
static

Definition at line 2197 of file cconfig.c.

2197  {
2198  RzConfigNode *node = (RzConfigNode *)data;
2199  if (!strcmp(node->value, "?")) {
2200  rz_cons_printf("png\njpg\npdf\nps\nsvg\njson\n");
2201  return false;
2202  }
2203  return true;
2204 }

References rz_cons_printf(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_hex_align()

static bool cb_hex_align ( void *  user,
void *  data 
)
static

Definition at line 1511 of file cconfig.c.

1511  {
1512  RzCore *core = (RzCore *)user;
1513  RzConfigNode *node = (RzConfigNode *)data;
1514  if (node->i_value) {
1515  core->print->flags |= RZ_PRINT_FLAGS_ALIGN;
1516  } else {
1517  core->print->flags &= ~RZ_PRINT_FLAGS_ALIGN;
1518  }
1519  return true;
1520 }
#define RZ_PRINT_FLAGS_ALIGN
Definition: rz_print.h:33

References rz_print_t::flags, rz_config_node_t::i_value, rz_core_t::print, and RZ_PRINT_FLAGS_ALIGN.

Referenced by rz_core_config_init().

◆ cb_hex_ascii()

static bool cb_hex_ascii ( void *  user,
void *  data 
)
static

Definition at line 1562 of file cconfig.c.

1562  {
1563  RzCore *core = (RzCore *)user;
1564  RzConfigNode *node = (RzConfigNode *)data;
1565  if (node->i_value) {
1566  core->print->flags &= ~RZ_PRINT_FLAGS_NONASCII;
1567  } else {
1569  }
1570  return true;
1571 }
#define RZ_PRINT_FLAGS_NONASCII
Definition: rz_print.h:32

References rz_print_t::flags, rz_config_node_t::i_value, rz_core_t::print, and RZ_PRINT_FLAGS_NONASCII.

Referenced by rz_core_config_init().

◆ cb_hex_bytes()

static bool cb_hex_bytes ( void *  user,
void *  data 
)
static

Definition at line 1551 of file cconfig.c.

1551  {
1552  RzCore *core = (RzCore *)user;
1553  RzConfigNode *node = (RzConfigNode *)data;
1554  if (node->i_value) {
1555  core->print->flags &= ~RZ_PRINT_FLAGS_NONHEX;
1556  } else {
1557  core->print->flags |= RZ_PRINT_FLAGS_NONHEX;
1558  }
1559  return true;
1560 }
#define RZ_PRINT_FLAGS_NONHEX
Definition: rz_print.h:27

References rz_print_t::flags, rz_config_node_t::i_value, rz_core_t::print, and RZ_PRINT_FLAGS_NONHEX.

Referenced by rz_core_config_init().

◆ cb_hex_hdroff()

static bool cb_hex_hdroff ( void *  user,
void *  data 
)
static

Definition at line 1584 of file cconfig.c.

1584  {
1585  RzCore *core = (RzCore *)user;
1586  RzConfigNode *node = (RzConfigNode *)data;
1587  if (node->i_value) {
1588  core->print->flags |= RZ_PRINT_FLAGS_HDROFF;
1589  } else {
1590  core->print->flags &= ~RZ_PRINT_FLAGS_HDROFF;
1591  }
1592  return true;
1593 }
#define RZ_PRINT_FLAGS_HDROFF
Definition: rz_print.h:30

References rz_print_t::flags, rz_config_node_t::i_value, rz_core_t::print, and RZ_PRINT_FLAGS_HDROFF.

Referenced by rz_core_config_init().

◆ cb_hex_header()

static bool cb_hex_header ( void *  user,
void *  data 
)
static

Definition at line 1540 of file cconfig.c.

1540  {
1541  RzCore *core = (RzCore *)user;
1542  RzConfigNode *node = (RzConfigNode *)data;
1543  if (node->i_value) {
1544  core->print->flags |= RZ_PRINT_FLAGS_HEADER;
1545  } else {
1546  core->print->flags &= ~RZ_PRINT_FLAGS_HEADER;
1547  }
1548  return true;
1549 }
#define RZ_PRINT_FLAGS_HEADER
Definition: rz_print.h:18

References rz_print_t::flags, rz_config_node_t::i_value, rz_core_t::print, and RZ_PRINT_FLAGS_HEADER.

Referenced by rz_core_config_init().

◆ cb_hex_pairs()

static bool cb_hex_pairs ( void *  user,
void *  data 
)
static

Definition at line 1493 of file cconfig.c.

1493  {
1494  RzCore *core = (RzCore *)user;
1495  RzConfigNode *node = (RzConfigNode *)data;
1496  core->print->pairs = node->i_value;
1497  return true;
1498 }
int pairs
Definition: rz_print.h:144

References rz_config_node_t::i_value, rz_print_t::pairs, and rz_core_t::print.

Referenced by rz_core_config_init().

◆ cb_hex_section()

static bool cb_hex_section ( void *  user,
void *  data 
)
static

Definition at line 1500 of file cconfig.c.

1500  {
1501  RzCore *core = (RzCore *)user;
1502  RzConfigNode *node = (RzConfigNode *)data;
1503  if (node->i_value) {
1505  } else {
1506  core->print->flags &= ~RZ_PRINT_FLAGS_SECTION;
1507  }
1508  return true;
1509 }
#define RZ_PRINT_FLAGS_SECTION
Definition: rz_print.h:36

References rz_print_t::flags, rz_config_node_t::i_value, rz_core_t::print, and RZ_PRINT_FLAGS_SECTION.

Referenced by rz_core_config_init().

◆ cb_hex_style()

static bool cb_hex_style ( void *  user,
void *  data 
)
static

Definition at line 1573 of file cconfig.c.

1573  {
1574  RzCore *core = (RzCore *)user;
1575  RzConfigNode *node = (RzConfigNode *)data;
1576  if (node->i_value) {
1577  core->print->flags |= RZ_PRINT_FLAGS_STYLE;
1578  } else {
1579  core->print->flags &= ~RZ_PRINT_FLAGS_STYLE;
1580  }
1581  return true;
1582 }
#define RZ_PRINT_FLAGS_STYLE
Definition: rz_print.h:31

References rz_print_t::flags, rz_config_node_t::i_value, rz_core_t::print, and RZ_PRINT_FLAGS_STYLE.

Referenced by rz_core_config_init().

◆ cb_hexcols()

static bool cb_hexcols ( void *  user,
void *  data 
)
static

Definition at line 1889 of file cconfig.c.

1889  {
1890  RzCore *core = (RzCore *)user;
1891  int c = RZ_MIN(1024, RZ_MAX(((RzConfigNode *)data)->i_value, 0));
1892  core->print->cols = c; // & ~1;
1893  core->dbg->regcols = c / 4;
1894  return true;
1895 }
#define RZ_MIN(x, y)
int regcols
Definition: rz_debug.h:260
int cols
Definition: rz_print.h:136

References c, rz_print_t::cols, rz_core_t::dbg, rz_core_t::print, rz_debug_t::regcols, RZ_MAX, and RZ_MIN.

Referenced by rz_core_config_init().

◆ cb_hexcomments()

static bool cb_hexcomments ( void *  user,
void *  data 
)
static

Definition at line 1602 of file cconfig.c.

1602  {
1603  RzCore *core = (RzCore *)user;
1604  RzConfigNode *node = (RzConfigNode *)data;
1605  if (node->i_value) {
1607  } else {
1608  core->print->flags &= ~RZ_PRINT_FLAGS_COMMENT;
1609  }
1610  return true;
1611 }
#define RZ_PRINT_FLAGS_COMMENT
Definition: rz_print.h:25

References rz_print_t::flags, rz_config_node_t::i_value, rz_core_t::print, and RZ_PRINT_FLAGS_COMMENT.

Referenced by rz_core_config_init().

◆ cb_hexcompact()

static bool cb_hexcompact ( void *  user,
void *  data 
)
static

Definition at line 1482 of file cconfig.c.

1482  {
1483  RzCore *core = (RzCore *)user;
1484  RzConfigNode *node = (RzConfigNode *)data;
1485  if (node->i_value) {
1487  } else {
1488  core->print->flags &= (~RZ_PRINT_FLAGS_COMPACT);
1489  }
1490  return true;
1491 }
#define RZ_PRINT_FLAGS_COMPACT
Definition: rz_print.h:26

References rz_print_t::flags, rz_config_node_t::i_value, rz_core_t::print, and RZ_PRINT_FLAGS_COMPACT.

Referenced by rz_core_config_init().

◆ cb_hexstride()

static bool cb_hexstride ( void *  user,
void *  data 
)
static

Definition at line 1897 of file cconfig.c.

1897  {
1898  RzConfigNode *node = (RzConfigNode *)data;
1899  ((RzCore *)user)->print->stride = node->i_value;
1900  return true;
1901 }

References rz_config_node_t::i_value.

Referenced by rz_core_config_init().

◆ cb_io_cache()

static bool cb_io_cache ( void *  user,
void *  data 
)
static

Definition at line 1943 of file cconfig.c.

1943  {
1944  (void)cb_io_cache_read(user, data);
1945  (void)cb_io_cache_write(user, data);
1946  return true;
1947 }
static bool cb_io_cache_read(void *user, void *data)
Definition: cconfig.c:1921
static bool cb_io_cache_write(void *user, void *data)
Definition: cconfig.c:1932

References cb_io_cache_read(), and cb_io_cache_write().

Referenced by rz_core_config_init().

◆ cb_io_cache_mode()

static bool cb_io_cache_mode ( void *  user,
void *  data 
)
static

Definition at line 1910 of file cconfig.c.

1910  {
1911  RzCore *core = (RzCore *)user;
1912  RzConfigNode *node = (RzConfigNode *)data;
1913  if (node->i_value) {
1914  core->io->cachemode = true;
1915  } else {
1916  core->io->cachemode = false;
1917  }
1918  return true;
1919 }
bool cachemode
Definition: rz_io.h:70

References rz_io_t::cachemode, rz_config_node_t::i_value, and rz_core_t::io.

Referenced by rz_core_config_init().

◆ cb_io_cache_read()

static bool cb_io_cache_read ( void *  user,
void *  data 
)
static

Definition at line 1921 of file cconfig.c.

1921  {
1922  RzCore *core = (RzCore *)user;
1923  RzConfigNode *node = (RzConfigNode *)data;
1924  if (node->i_value) {
1925  core->io->cached |= RZ_PERM_R;
1926  } else {
1927  core->io->cached &= ~RZ_PERM_R;
1928  }
1929  return true;
1930 }
#define RZ_PERM_R
Definition: rz_types.h:93
int cached
Definition: rz_io.h:69

References rz_io_t::cached, rz_config_node_t::i_value, rz_core_t::io, and RZ_PERM_R.

Referenced by cb_io_cache(), and rz_core_config_init().

◆ cb_io_cache_write()

static bool cb_io_cache_write ( void *  user,
void *  data 
)
static

Definition at line 1932 of file cconfig.c.

1932  {
1933  RzCore *core = (RzCore *)user;
1934  RzConfigNode *node = (RzConfigNode *)data;
1935  if (node->i_value) {
1936  core->io->cached |= RZ_PERM_W;
1937  } else {
1938  core->io->cached &= ~RZ_PERM_W;
1939  }
1940  return true;
1941 }
#define RZ_PERM_W
Definition: rz_types.h:94

References rz_io_t::cached, rz_config_node_t::i_value, rz_core_t::io, and RZ_PERM_W.

Referenced by cb_io_cache(), and rz_core_config_init().

◆ cb_io_oxff()

static bool cb_io_oxff ( void *  user,
void *  data 
)
static

Definition at line 1994 of file cconfig.c.

1994  {
1995  RzCore *core = (RzCore *)user;
1996  RzConfigNode *node = (RzConfigNode *)data;
1997  core->io->Oxff = node->i_value;
1998  return true;
1999 }
int Oxff
Definition: rz_io.h:65

References rz_config_node_t::i_value, rz_core_t::io, and rz_io_t::Oxff.

Referenced by rz_core_config_init().

◆ cb_io_pava()

static bool cb_io_pava ( void *  user,
void *  data 
)
static

Definition at line 1958 of file cconfig.c.

1958  {
1959  RzCore *core = (RzCore *)user;
1960  RzConfigNode *node = (RzConfigNode *)data;
1961  core->print->pava = node->i_value;
1962  if (node->i_value && core->io->va) {
1963  eprintf("WARNING: You may probably want to disable io.va too\n");
1964  }
1965  return true;
1966 }
int va
Definition: rz_io.h:63
bool pava
Definition: rz_print.h:112

References eprintf, rz_config_node_t::i_value, rz_core_t::io, rz_print_t::pava, rz_core_t::print, and rz_io_t::va.

Referenced by rz_core_config_init().

◆ cb_io_unalloc()

static bool cb_io_unalloc ( void *  user,
void *  data 
)
static

Definition at line 1522 of file cconfig.c.

1522  {
1523  RzCore *core = (RzCore *)user;
1524  RzConfigNode *node = (RzConfigNode *)data;
1525  if (node->i_value) {
1527  } else {
1528  core->print->flags &= ~RZ_PRINT_FLAGS_UNALLOC;
1529  }
1530  return true;
1531 }
#define RZ_PRINT_FLAGS_UNALLOC
Definition: rz_print.h:34

References rz_print_t::flags, rz_config_node_t::i_value, rz_core_t::print, and RZ_PRINT_FLAGS_UNALLOC.

Referenced by rz_core_config_init().

◆ cb_io_unalloc_ch()

static bool cb_io_unalloc_ch ( void *  user,
void *  data 
)
static

Definition at line 1533 of file cconfig.c.

1533  {
1534  RzCore *core = (RzCore *)user;
1535  RzConfigNode *node = (RzConfigNode *)data;
1536  core->print->io_unalloc_ch = *node->value ? node->value[0] : ' ';
1537  return true;
1538 }
char io_unalloc_ch
Definition: rz_print.h:165

References rz_print_t::io_unalloc_ch, rz_core_t::print, and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_ioaslr()

static bool cb_ioaslr ( void *  user,
void *  data 
)
static

Definition at line 1949 of file cconfig.c.

1949  {
1950  RzCore *core = (RzCore *)user;
1951  RzConfigNode *node = (RzConfigNode *)data;
1952  if (node->i_value != core->io->aslr) {
1953  core->io->aslr = node->i_value;
1954  }
1955  return true;
1956 }
int aslr
Definition: rz_io.h:67

References rz_io_t::aslr, rz_config_node_t::i_value, and rz_core_t::io.

Referenced by rz_core_config_init().

◆ cb_ioautofd()

static bool cb_ioautofd ( void *  user,
void *  data 
)
static

Definition at line 2019 of file cconfig.c.

2019  {
2020  RzCore *core = (RzCore *)user;
2021  RzConfigNode *node = (RzConfigNode *)data;
2022  core->io->autofd = node->i_value;
2023  return true;
2024 }
int autofd
Definition: rz_io.h:68

References rz_io_t::autofd, rz_config_node_t::i_value, and rz_core_t::io.

Referenced by rz_core_config_init().

◆ cb_ioff()

static bool cb_ioff ( void *  user,
void *  data 
)
static

Definition at line 1987 of file cconfig.c.

1987  {
1988  RzCore *core = (RzCore *)user;
1989  RzConfigNode *node = (RzConfigNode *)data;
1990  core->io->ff = node->i_value;
1991  return true;
1992 }
int ff
Definition: rz_io.h:64

References rz_io_t::ff, rz_config_node_t::i_value, and rz_core_t::io.

Referenced by rz_core_config_init().

◆ cb_iopcache()

static bool cb_iopcache ( void *  user,
void *  data 
)
static

Definition at line 1613 of file cconfig.c.

1613  {
1614  RzCore *core = (RzCore *)user;
1615  RzConfigNode *node = (RzConfigNode *)data;
1616  if ((bool)node->i_value) {
1617  if (core) {
1618  rz_config_set_b(core->config, "io.pcache.read", true);
1619  rz_config_set_b(core->config, "io.pcache.write", true);
1620  }
1621  } else {
1622  if (core && core->io) {
1624  rz_config_set_b(core->config, "io.pcache.read", false);
1625  rz_config_set_b(core->config, "io.pcache.write", false);
1626  }
1627  }
1628  return true;
1629 }
RZ_API void rz_io_desc_cache_fini_all(RzIO *io)
Definition: p_cache.c:362

References rz_core_t::config, rz_config_node_t::i_value, rz_core_t::io, rz_config_set_b(), and rz_io_desc_cache_fini_all().

Referenced by rz_core_config_init().

◆ cb_iopcacheread()

static bool cb_iopcacheread ( void *  user,
void *  data 
)
static

Definition at line 1631 of file cconfig.c.

1631  {
1632  RzCore *core = (RzCore *)user;
1633  RzConfigNode *node = (RzConfigNode *)data;
1634  if ((bool)node->i_value) {
1635  if (core && core->io) {
1636  core->io->p_cache |= 1;
1637  }
1638  } else {
1639  if (core && core->io && core->io->p_cache) {
1640  core->io->p_cache &= 2;
1641  if (!(core->io->p_cache & 2)) {
1643  rz_config_set_b(core->config, "io.pcache", false);
1644  }
1645  }
1646  }
1647  return true;
1648 }
int p_cache
Definition: rz_io.h:71

References rz_core_t::config, rz_config_node_t::i_value, rz_core_t::io, rz_io_t::p_cache, rz_config_set_b(), and rz_io_desc_cache_fini_all().

Referenced by rz_core_config_init().

◆ cb_iopcachewrite()

static bool cb_iopcachewrite ( void *  user,
void *  data 
)
static

Definition at line 1650 of file cconfig.c.

1650  {
1651  RzCore *core = (RzCore *)user;
1652  RzConfigNode *node = (RzConfigNode *)data;
1653  if ((bool)node->i_value) {
1654  if (core && core->io) {
1655  core->io->p_cache |= 2;
1656  }
1657  } else {
1658  if (core && core->io && core->io->p_cache) {
1659  core->io->p_cache &= 1;
1660  if (!(core->io->p_cache & 1)) {
1662  rz_config_set_b(core->config, "io.pcache", false);
1663  }
1664  }
1665  }
1666  return true;
1667 }

References rz_core_t::config, rz_config_node_t::i_value, rz_core_t::io, rz_io_t::p_cache, rz_config_set_b(), and rz_io_desc_cache_fini_all().

Referenced by rz_core_config_init().

◆ cb_iotrap()

static bool cb_iotrap ( void *  user,
void *  data 
)
static

Definition at line 2215 of file cconfig.c.

2215  {
2216  RzConfigNode *node = (RzConfigNode *)data;
2217  RzCore *core = (RzCore *)user;
2218  if (core->analysis && core->analysis->esil) {
2219  core->analysis->esil->iotrap = node->i_value;
2220  }
2221  return true;
2222 }

References rz_core_t::analysis, rz_analysis_t::esil, rz_config_node_t::i_value, and rz_analysis_esil_t::iotrap.

Referenced by rz_core_config_init().

◆ cb_iova()

static bool cb_iova ( void *  user,
void *  data 
)
static

Definition at line 1968 of file cconfig.c.

1968  {
1969  RzCore *core = (RzCore *)user;
1970  RzConfigNode *node = (RzConfigNode *)data;
1971  if (node->i_value != core->io->va) {
1972  core->io->va = node->i_value;
1973  /* ugly fix for rizin -d ... "rizin is going to die soon ..." */
1974  if (core->io->desc) {
1975  rz_core_block_read(core);
1976  }
1977 #if 0
1978  /* reload symbol information */
1979  if (rz_list_length (rz_bin_get_sections (core->bin)) > 0) {
1980  rz_core_cmd0 (core, ".ia*");
1981  }
1982 #endif
1983  }
1984  return true;
1985 }
RZ_DEPRECATE RZ_API RZ_BORROW RzList * rz_bin_get_sections(RZ_NONNULL RzBin *bin)
Definition: bin.c:597
RZ_API int rz_core_block_read(RzCore *core)
Definition: cio.c:243
RZ_API int rz_core_cmd0(RzCore *core, const char *cmd)
Definition: cmd.c:5428
RZ_API ut32 rz_list_length(RZ_NONNULL const RzList *list)
Returns the length of the list.
Definition: list.c:109
struct rz_io_desc_t * desc
Definition: rz_io.h:60

References rz_core_t::bin, rz_io_t::desc, rz_config_node_t::i_value, rz_core_t::io, rz_bin_get_sections(), rz_core_block_read(), rz_core_cmd0(), rz_list_length(), and rz_io_t::va.

Referenced by rz_core_config_init().

◆ cb_log_config_colors()

static bool cb_log_config_colors ( void *  coreptr,
void *  nodeptr 
)
static

Definition at line 2799 of file cconfig.c.

2799  {
2800  RzConfigNode *node = (RzConfigNode *)nodeptr;
2801  const char *value = node->value;
2802  switch (value[0]) {
2803  case 't':
2804  case 'T':
2805  rz_log_set_colors(true);
2806  break;
2807  default:
2808  rz_log_set_colors(false);
2809  }
2810  return true;
2811 }
RZ_API void rz_log_set_colors(bool show_colors)
Definition: log.c:46

References rz_log_set_colors(), value, and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_log_config_file()

static bool cb_log_config_file ( void *  coreptr,
void *  nodeptr 
)
static

Definition at line 2778 of file cconfig.c.

2778  {
2779  RzConfigNode *node = (RzConfigNode *)nodeptr;
2780  const char *value = node->value;
2782  return true;
2783 }
RZ_API void rz_log_set_file(const char *filename)
Definition: log.c:37

References rz_log_set_file(), value, and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_log_config_level()

static bool cb_log_config_level ( void *  coreptr,
void *  nodeptr 
)
static

Definition at line 2766 of file cconfig.c.

2766  {
2767  RzConfigNode *node = (RzConfigNode *)nodeptr;
2768  rz_log_set_level(node->i_value);
2769  return true;
2770 }
RZ_API void rz_log_set_level(RzLogLevel level)
Definition: log.c:29

References rz_config_node_t::i_value, and rz_log_set_level().

Referenced by rz_core_config_init().

◆ cb_log_config_srcinfo()

static bool cb_log_config_srcinfo ( void *  coreptr,
void *  nodeptr 
)
static

Definition at line 2785 of file cconfig.c.

2785  {
2786  RzConfigNode *node = (RzConfigNode *)nodeptr;
2787  const char *value = node->value;
2788  switch (value[0]) {
2789  case 't':
2790  case 'T':
2791  rz_log_set_srcinfo(true);
2792  break;
2793  default:
2794  rz_log_set_srcinfo(false);
2795  }
2796  return true;
2797 }
RZ_API void rz_log_set_srcinfo(bool show_info)
Definition: log.c:42

References rz_log_set_srcinfo(), value, and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_log_config_traplevel()

static bool cb_log_config_traplevel ( void *  coreptr,
void *  nodeptr 
)
static

Definition at line 2772 of file cconfig.c.

2772  {
2773  RzConfigNode *node = (RzConfigNode *)nodeptr;
2775  return true;
2776 }
RZ_API void rz_log_set_traplevel(RzLogLevel level)
Definition: log.c:33

References rz_config_node_t::i_value, and rz_log_set_traplevel().

Referenced by rz_core_config_init().

◆ cb_log_events()

static bool cb_log_events ( void *  user,
void *  data 
)
static

Definition at line 1595 of file cconfig.c.

1595  {
1596  RzCore *core = (RzCore *)user;
1597  RzConfigNode *node = (RzConfigNode *)data;
1598  core->log_events = node->i_value;
1599  return true;
1600 }
bool log_events
Definition: rz_core.h:386

References rz_config_node_t::i_value, and rz_core_t::log_events.

Referenced by rz_core_config_init().

◆ cb_malloc()

static bool cb_malloc ( void *  user,
void *  data 
)
static

Definition at line 2752 of file cconfig.c.

2752  {
2753  RzCore *core = (RzCore *)user;
2754  RzConfigNode *node = (RzConfigNode *)data;
2755 
2756  if (node->value) {
2757  if (!strcmp("jemalloc", node->value) || !strcmp("glibc", node->value)) {
2758  if (core->dbg) {
2759  core->dbg->malloc = data;
2760  }
2761  }
2762  }
2763  return true;
2764 }
char * malloc
Definition: rz_debug.h:253

References rz_core_t::dbg, rz_debug_t::malloc, and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_maxname()

static bool cb_maxname ( void *  user,
void *  data 
)
static

Definition at line 995 of file cconfig.c.

995  {
996  RzConfigNode *node = (RzConfigNode *)data;
997  RzCore *core = (RzCore *)user;
998  core->parser->maxflagnamelen = node->i_value;
999  return true;
1000 }
int maxflagnamelen
Definition: rz_parse.h:30

References rz_config_node_t::i_value, rz_parse_t::maxflagnamelen, and rz_core_t::parser.

Referenced by rz_core_config_init().

◆ cb_mdevrange()

static bool cb_mdevrange ( void *  user,
void *  data 
)
static

Definition at line 1827 of file cconfig.c.

1827  {
1828  RzCore *core = (RzCore *)user;
1829  RzConfigNode *node = (RzConfigNode *)data;
1830  if (core && core->analysis && core->analysis->esil) {
1831  core->analysis->esil->cmd = rz_core_esil_cmd;
1832  free(core->analysis->esil->mdev_range);
1833  core->analysis->esil->mdev_range = strdup(node->value);
1834  }
1835  return true;
1836 }

References rz_core_t::analysis, rz_analysis_esil_t::cmd, rz_analysis_t::esil, free(), rz_analysis_esil_t::mdev_range, rz_core_esil_cmd(), strdup(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_midflags()

static bool cb_midflags ( void *  user,
void *  data 
)
static

Definition at line 1002 of file cconfig.c.

1002  {
1003  RzConfigNode *node = (RzConfigNode *)data;
1004  if (node->value[0] == '?') {
1005  print_node_options(node);
1006  return false;
1007  }
1008  return true;
1009 }

References print_node_options(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_pager()

static bool cb_pager ( void *  user,
void *  data 
)
static

Definition at line 2042 of file cconfig.c.

2042  {
2043  RzCore *core = (RzCore *)user;
2044  RzConfigNode *node = (RzConfigNode *)data;
2045  if (!strcmp(node->value, "?")) {
2046  eprintf("Usage: scr.pager must be '..' for internal less, or the path to a program in $PATH");
2047  return false;
2048  }
2049  /* Let cons know we have a new pager. */
2050  free(core->cons->pager);
2051  core->cons->pager = strdup(node->value);
2052  return true;
2053 }
char * pager
Definition: rz_cons.h:546

References rz_core_t::cons, eprintf, free(), rz_cons_t::pager, strdup(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_rows()

static bool cb_rows ( void *  user,
void *  data 
)
static

Definition at line 1469 of file cconfig.c.

1469  {
1470  RzConfigNode *node = (RzConfigNode *)data;
1472  return true;
1473 }
int force_rows
Definition: rz_cons.h:511

References rz_cons_t::force_rows, rz_config_node_t::i_value, and rz_cons_singleton().

Referenced by rz_core_config_init().

◆ cb_runprofile()

static bool cb_runprofile ( void *  user,
void *  data 
)
static

Definition at line 1388 of file cconfig.c.

1388  {
1389  RzCore *r = (RzCore *)user;
1390  RzConfigNode *node = (RzConfigNode *)data;
1391  free((void *)r->io->runprofile);
1392  if (!node || !*(node->value)) {
1393  r->io->runprofile = NULL;
1394  } else {
1395  r->io->runprofile = strdup(node->value);
1396  }
1397  return true;
1398 }
#define r
Definition: crypto_rc6.c:12

References free(), NULL, r, strdup(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_scr_bgfill()

static bool cb_scr_bgfill ( void *  user,
void *  data 
)
static

Definition at line 2224 of file cconfig.c.

2224  {
2225  RzCore *core = (RzCore *)user;
2226  RzConfigNode *node = (RzConfigNode *)data;
2227  if (node->i_value) {
2228  core->print->flags |= RZ_PRINT_FLAGS_BGFILL;
2229  } else {
2230  core->print->flags &= (~RZ_PRINT_FLAGS_BGFILL);
2231  }
2232  rz_print_set_flags(core->print, core->print->flags);
2233  return true;
2234 }
#define RZ_PRINT_FLAGS_BGFILL
Definition: rz_print.h:35

References rz_print_t::flags, rz_config_node_t::i_value, rz_core_t::print, RZ_PRINT_FLAGS_BGFILL, and rz_print_set_flags().

Referenced by rz_core_config_init().

◆ cb_scr_color_grep()

static bool cb_scr_color_grep ( void *  user,
void *  data 
)
static

Definition at line 2026 of file cconfig.c.

2026  {
2027  RzCore *core = (RzCore *)user;
2028  RzConfigNode *node = (RzConfigNode *)data;
2029 
2030  /* Let cons know we have a new pager. */
2031  core->cons->grep_color = node->i_value;
2032  return true;
2033 }
bool grep_color
Definition: rz_cons.h:567

References rz_core_t::cons, rz_cons_t::grep_color, and rz_config_node_t::i_value.

Referenced by rz_core_config_init().

◆ cb_scr_color_grep_highlight()

static bool cb_scr_color_grep_highlight ( void *  user,
void *  data 
)
static

Definition at line 2035 of file cconfig.c.

2035  {
2036  RzCore *core = (RzCore *)user;
2037  RzConfigNode *node = (RzConfigNode *)data;
2038  core->cons->grep_highlight = node->i_value;
2039  return true;
2040 }
bool grep_highlight
Definition: rz_cons.h:568

References rz_core_t::cons, rz_cons_t::grep_highlight, and rz_config_node_t::i_value.

Referenced by rz_core_config_init().

◆ cb_scr_gadgets()

static bool cb_scr_gadgets ( void *  user,
void *  data 
)
static

Definition at line 2061 of file cconfig.c.

2061  {
2062  RzCore *core = (RzCore *)user;
2063  RzConfigNode *node = (RzConfigNode *)data;
2064  core->scr_gadgets = node->i_value;
2065  return true;
2066 }
bool scr_gadgets
Definition: rz_core.h:385

References rz_config_node_t::i_value, and rz_core_t::scr_gadgets.

Referenced by rz_core_config_init().

◆ cb_scr_histblock()

static bool cb_scr_histblock ( void *  user,
void *  data 
)
static

Definition at line 2251 of file cconfig.c.

2251  {
2252  RzCore *core = (RzCore *)user;
2253  RzConfigNode *node = (RzConfigNode *)data;
2254  core->print->histblock = node->i_value;
2255  return true;
2256 }
bool histblock
Definition: rz_print.h:128

References rz_print_t::histblock, rz_config_node_t::i_value, and rz_core_t::print.

Referenced by rz_core_config_init().

◆ cb_scr_prompt_mode()

static bool cb_scr_prompt_mode ( void *  user,
void *  data 
)
static

Definition at line 338 of file cconfig.c.

338  {
339  RzCore *core = (RzCore *)user;
340  RzConfigNode *node = (RzConfigNode *)data;
341  core->cons->line->prompt_mode = node->i_value;
342  return true;
343 }
bool prompt_mode
Definition: rz_cons.h:1115

References rz_core_t::cons, rz_config_node_t::i_value, rz_cons_t::line, and rz_line_t::prompt_mode.

Referenced by rz_core_config_init().

◆ cb_scr_prompt_popup()

static bool cb_scr_prompt_popup ( void *  user,
void *  data 
)
static

Definition at line 2315 of file cconfig.c.

2315  {
2316  RzCore *core = (RzCore *)user;
2317  RzConfigNode *node = (RzConfigNode *)data;
2318  core->cons->show_autocomplete_widget = node->i_value;
2319  return true;
2320 }
bool show_autocomplete_widget
Definition: rz_cons.h:516

References rz_core_t::cons, rz_config_node_t::i_value, and rz_cons_t::show_autocomplete_widget.

Referenced by rz_core_config_init().

◆ cb_scr_vi()

static bool cb_scr_vi ( void *  user,
void *  data 
)
static

Definition at line 331 of file cconfig.c.

331  {
332  RzCore *core = (RzCore *)user;
333  RzConfigNode *node = (RzConfigNode *)data;
334  core->cons->line->enable_vi_mode = node->i_value;
335  return true;
336 }
bool enable_vi_mode
Definition: rz_cons.h:1113

References rz_core_t::cons, rz_line_t::enable_vi_mode, rz_config_node_t::i_value, and rz_cons_t::line.

Referenced by rz_core_config_init().

◆ cb_scr_wideoff()

static bool cb_scr_wideoff ( void *  user,
void *  data 
)
static

Definition at line 345 of file cconfig.c.

345  {
346  RzCore *core = (RzCore *)user;
347  RzConfigNode *node = (RzConfigNode *)data;
348  core->print->wide_offsets = node->i_value;
349  return true;
350 }
bool wide_offsets
Definition: rz_print.h:162

References rz_config_node_t::i_value, rz_core_t::print, and rz_print_t::wide_offsets.

Referenced by rz_core_config_init().

◆ cb_scrbreakword()

static bool cb_scrbreakword ( void *  user,
void *  data 
)
static

Definition at line 2068 of file cconfig.c.

2068  {
2069  RzConfigNode *node = (RzConfigNode *)data;
2070  if (*node->value) {
2071  rz_cons_breakword(node->value);
2072  } else {
2074  }
2075  return true;
2076 }
RZ_API void rz_cons_breakword(RZ_NULLABLE const char *s)
Definition: cons.c:1939

References NULL, rz_cons_breakword(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_scrcolumns()

static bool cb_scrcolumns ( void *  user,
void *  data 
)
static

Definition at line 2078 of file cconfig.c.

2078  {
2079  RzConfigNode *node = (RzConfigNode *)data;
2080  RzCore *core = (RzCore *)user;
2081  int n = atoi(node->value);
2082  core->cons->force_columns = n;
2083  core->dbg->regcols = n / 20;
2085  return true;
2086 }
RZ_API int rz_cons_get_size(int *rows)
Definition: cons.c:1446
int n
Definition: mipsasm.c:19
int force_columns
Definition: rz_cons.h:512

References rz_core_t::cons, rz_core_t::dbg, rz_cons_t::force_columns, n, NULL, rz_debug_t::regcols, rz_cons_get_size(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_screcho()

static bool cb_screcho ( void *  user,
void *  data 
)
static

Definition at line 2149 of file cconfig.c.

2149  {
2150  RzConfigNode *node = (RzConfigNode *)data;
2151  rz_cons_singleton()->echo = node->i_value;
2152  return true;
2153 }
int echo
Definition: rz_cons.h:509

References rz_cons_t::echo, rz_config_node_t::i_value, and rz_cons_singleton().

Referenced by rz_core_config_init().

◆ cb_scrfgets()

static bool cb_scrfgets ( void *  user,
void *  data 
)
static

Definition at line 2088 of file cconfig.c.

2088  {
2089  RzCore *core = (RzCore *)user;
2090  RzConfigNode *node = (RzConfigNode *)data;
2091  core->cons->user_fgets = node->i_value
2092  ? NULL
2093  : (void *)rz_core_fgets;
2094  core->cons->user_fgets_user = core;
2095  return true;
2096 }
RZ_API int rz_core_fgets(char *buf, int len, void *user)
Definition: core.c:1694
void * user_fgets_user
Definition: rz_cons.h:521
int(* user_fgets)(char *buf, int len, void *user)
Definition: rz_cons.h:520

References rz_core_t::cons, rz_config_node_t::i_value, NULL, rz_core_fgets(), rz_cons_t::user_fgets, and rz_cons_t::user_fgets_user.

Referenced by rz_core_config_init().

◆ cb_scrflush()

static bool cb_scrflush ( void *  user,
void *  data 
)
static

Definition at line 2167 of file cconfig.c.

2167  {
2168  RzConfigNode *node = (RzConfigNode *)data;
2169  rz_cons_singleton()->flush = node->i_value;
2170  return true;
2171 }
bool flush
Definition: rz_cons.h:558

References rz_cons_t::flush, rz_config_node_t::i_value, and rz_cons_singleton().

Referenced by rz_core_config_init().

◆ cb_scrhighlight()

static bool cb_scrhighlight ( void *  user,
void *  data 
)
static

Definition at line 2105 of file cconfig.c.

2105  {
2106  RzConfigNode *node = (RzConfigNode *)data;
2107  rz_cons_highlight(node->value);
2108  return true;
2109 }
RZ_API void rz_cons_highlight(const char *word)
Definition: cons.c:1756

References rz_cons_highlight(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_scrhtml()

static bool cb_scrhtml ( void *  user,
void *  data 
)
static

Definition at line 2098 of file cconfig.c.

2098  {
2099  RzConfigNode *node = (RzConfigNode *)data;
2100  rz_cons_singleton()->is_html = node->i_value;
2101  // TODO: control error and restore old value (return false?) show errormsg?
2102  return true;
2103 }
bool is_html
Definition: rz_cons.h:505

References rz_config_node_t::i_value, rz_cons_t::is_html, and rz_cons_singleton().

Referenced by rz_core_config_init().

◆ cb_scrint()

static bool cb_scrint ( void *  user,
void *  data 
)
static

Definition at line 2236 of file cconfig.c.

2236  {
2237  RzConfigNode *node = (RzConfigNode *)data;
2239  return true;
2240 }
bool is_interactive
Definition: rz_cons.h:485

References rz_cons_t::context, rz_config_node_t::i_value, rz_cons_context_t::is_interactive, and rz_cons_singleton().

Referenced by rz_core_config_init().

◆ cb_scrlast()

static bool cb_scrlast ( void *  user,
void *  data 
)
static

Definition at line 325 of file cconfig.c.

325  {
326  RzConfigNode *node = (RzConfigNode *)data;
328  return true;
329 }

References rz_cons_t::context, rz_config_node_t::i_value, rz_cons_context_t::lastEnabled, and rz_cons_singleton().

Referenced by rz_core_config_init().

◆ cb_scrlinesleep()

static bool cb_scrlinesleep ( void *  user,
void *  data 
)
static

Definition at line 2155 of file cconfig.c.

2155  {
2156  RzConfigNode *node = (RzConfigNode *)data;
2157  rz_cons_singleton()->linesleep = node->i_value;
2158  return true;
2159 }
int linesleep
Definition: rz_cons.h:562

References rz_config_node_t::i_value, rz_cons_t::linesleep, and rz_cons_singleton().

Referenced by rz_core_config_init().

◆ cb_scrnkey()

static bool cb_scrnkey ( void *  user,
void *  data 
)
static

Definition at line 2242 of file cconfig.c.

2242  {
2243  RzConfigNode *node = (RzConfigNode *)data;
2244  if (!strcmp(node->value, "help") || *node->value == '?') {
2245  print_node_options(node);
2246  return false;
2247  }
2248  return true;
2249 }

References print_node_options(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_scrnull()

static bool cb_scrnull ( void *  user,
void *  data 
)
static

Definition at line 1197 of file cconfig.c.

1197  {
1198  RzCore *core = (RzCore *)user;
1199  RzConfigNode *node = (RzConfigNode *)data;
1200  core->cons->null = node->i_value;
1201  return true;
1202 }
int null
Definition: rz_cons.h:550

References rz_core_t::cons, rz_config_node_t::i_value, and rz_cons_t::null.

Referenced by rz_core_config_init().

◆ cb_scrpagesize()

static bool cb_scrpagesize ( void *  user,
void *  data 
)
static

Definition at line 2161 of file cconfig.c.

2161  {
2162  RzConfigNode *node = (RzConfigNode *)data;
2163  rz_cons_singleton()->pagesize = node->i_value;
2164  return true;
2165 }
int pagesize
Definition: rz_cons.h:563

References rz_config_node_t::i_value, rz_cons_t::pagesize, and rz_cons_singleton().

Referenced by rz_core_config_init().

◆ cb_scrprompt()

static bool cb_scrprompt ( void *  user,
void *  data 
)
static

Definition at line 2258 of file cconfig.c.

2258  {
2259  RzCore *core = (RzCore *)user;
2260  RzConfigNode *node = (RzConfigNode *)data;
2261  core->print->scr_prompt = node->i_value;
2262  rz_line_singleton()->echo = node->i_value;
2263  return true;
2264 }
RZ_API RzLine * rz_line_singleton(void)
Definition: line.c:15
int echo
Definition: rz_cons.h:1101
bool scr_prompt
Definition: rz_print.h:121

References rz_line_t::echo, rz_config_node_t::i_value, rz_core_t::print, rz_line_singleton(), and rz_print_t::scr_prompt.

Referenced by rz_core_config_init().

◆ cb_scrrainbow()

static bool cb_scrrainbow ( void *  user,
void *  data 
)
static

Definition at line 352 of file cconfig.c.

352  {
353  RzCore *core = (RzCore *)user;
354  RzConfigNode *node = (RzConfigNode *)data;
355  if (node->i_value) {
358  } else {
359  core->print->flags &= (~RZ_PRINT_FLAGS_RAINBOW);
361  }
362  rz_print_set_flags(core->print, core->print->flags);
363  return true;
364 }
RZ_API char * rz_core_theme_get(RzCore *core)
Definition: cmd_eval.c:103
RZ_API bool rz_core_theme_load(RzCore *core, const char *name)
Definition: cmd_eval.c:56
RZ_API void rz_cons_pal_random(void)
Definition: pal.c:270
#define RZ_PRINT_FLAGS_RAINBOW
Definition: rz_print.h:29

References rz_print_t::flags, rz_config_node_t::i_value, rz_core_t::print, rz_cons_pal_random(), rz_core_theme_get(), rz_core_theme_load(), RZ_PRINT_FLAGS_RAINBOW, and rz_print_set_flags().

Referenced by rz_core_config_init().

◆ cb_scrrows()

static bool cb_scrrows ( void *  user,
void *  data 
)
static

Definition at line 2266 of file cconfig.c.

2266  {
2267  RzConfigNode *node = (RzConfigNode *)data;
2268  int n = atoi(node->value);
2269  ((RzCore *)user)->cons->force_rows = n;
2270  return true;
2271 }

References n, and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_scrstrconv()

static bool cb_scrstrconv ( void *  user,
void *  data 
)
static

Definition at line 2173 of file cconfig.c.

2173  {
2174  RzCore *core = (RzCore *)user;
2175  RzConfigNode *node = (RzConfigNode *)data;
2176  if (node->value[0] == '?') {
2177  if (strlen(node->value) > 1 && node->value[1] == '?') {
2178  rz_cons_printf("Valid values for scr.strconv:\n"
2179  " asciiesc convert to ascii with non-ascii chars escaped\n"
2180  " asciidot convert to ascii with non-ascii chars turned into a dot (except control chars stated below)\n"
2181  "\n"
2182  "Ascii chars are in the range 0x20-0x7e. Always escaped control chars are alert (\\a),\n"
2183  "backspace (\\b), formfeed (\\f), newline (\\n), carriage return (\\r), horizontal tab (\\t)\n"
2184  "and vertical tab (\\v). Also, double quotes (\\\") are always escaped, but backslashes (\\\\)\n"
2185  "are only escaped if str.escbslash = true.\n");
2186  } else {
2187  print_node_options(node);
2188  }
2189  return false;
2190  } else {
2191  free((char *)core->print->strconv_mode);
2192  core->print->strconv_mode = strdup(node->value);
2193  }
2194  return true;
2195 }
const char * strconv_mode
Definition: rz_print.h:163

References free(), rz_core_t::print, print_node_options(), rz_cons_printf(), rz_print_t::strconv_mode, strdup(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_search_kwidx()

static bool cb_search_kwidx ( void *  user,
void *  data 
)
static

Definition at line 1903 of file cconfig.c.

1903  {
1904  RzCore *core = (RzCore *)user;
1905  RzConfigNode *node = (RzConfigNode *)data;
1906  core->search->n_kws = node->i_value;
1907  return true;
1908 }

References rz_config_node_t::i_value, rz_search_t::n_kws, and rz_core_t::search.

Referenced by rz_core_config_init().

◆ cb_searchalign()

static bool cb_searchalign ( void *  user,
void *  data 
)
static

Definition at line 2280 of file cconfig.c.

2280  {
2281  RzCore *core = (RzCore *)user;
2282  RzConfigNode *node = (RzConfigNode *)data;
2283  core->search->align = node->i_value;
2284  core->print->addrmod = node->i_value;
2285  return true;
2286 }
int addrmod
Definition: rz_print.h:140

References rz_print_t::addrmod, rz_search_t::align, rz_config_node_t::i_value, rz_core_t::print, and rz_core_t::search.

Referenced by rz_core_config_init().

◆ cb_searchin()

static bool cb_searchin ( void *  user,
void *  data 
)
static

Definition at line 2527 of file cconfig.c.

2527  {
2528  RzCore *core = (RzCore *)user;
2529  RzConfigNode *node = (RzConfigNode *)data;
2530  if (node->value[0] == '?') {
2531  if (strlen(node->value) > 1 && node->value[1] == '?') {
2532  rz_cons_printf("Valid values for search.in (depends on .from/.to and io.va):\n"
2533  "raw search in raw io (ignoring bounds)\n"
2534  "block search in the current block\n"
2535  "io.map search in current map\n"
2536  "io.sky.[rwx] search in all skyline segments\n"
2537  "io.maps search in all maps\n"
2538  "io.maps.[rwx] search in all r-w-x io maps\n"
2539  "bin.segment search in current mapped segment\n"
2540  "bin.segments search in all mapped segments\n"
2541  "bin.segments.[rwx] search in all r-w-x segments\n"
2542  "bin.section search in current mapped section\n"
2543  "bin.sections search in all mapped sections\n"
2544  "bin.sections.[rwx] search in all r-w-x sections\n"
2545  "dbg.stack search in the stack\n"
2546  "dbg.heap search in the heap\n"
2547  "dbg.map search in current memory map\n"
2548  "dbg.maps search in all memory maps\n"
2549  "dbg.maps.[rwx] search in all executable marked memory maps\n"
2550  "analysis.fcn search in the current function\n"
2551  "analysis.bb search in the current basic-block\n");
2552  } else {
2553  print_node_options(node);
2554  }
2555  return false;
2556  }
2557  // Set analysis.noncode if exec bit set in analysis.in
2558  if (rz_str_startswith(node->name, "analysis")) {
2559  core->analysis->opt.noncode = (strchr(node->value, 'x') == NULL);
2560  }
2561  return true;
2562 }
RZ_API bool rz_str_startswith(RZ_NONNULL const char *str, RZ_NONNULL const char *needle)
Checks if a string starts with a specifc sequence of characters (case sensitive)
Definition: str.c:3286

References rz_core_t::analysis, rz_config_node_t::name, rz_analysis_options_t::noncode, NULL, rz_analysis_t::opt, print_node_options(), rz_cons_printf(), rz_str_startswith(), and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_seggrn()

static bool cb_seggrn ( void *  user,
void *  data 
)
static

Definition at line 2299 of file cconfig.c.

2299  {
2300  RzCore *core = (RzCore *)user;
2301  RzConfigNode *node = (RzConfigNode *)data;
2302  core->rasm->seggrn = node->i_value;
2303  core->analysis->seggrn = node->i_value;
2304  core->print->seggrn = node->i_value;
2305  return true;
2306 }
int seggrn
Definition: rz_asm.h:125
int seggrn
Definition: rz_print.h:138

References rz_core_t::analysis, rz_config_node_t::i_value, rz_core_t::print, rz_core_t::rasm, rz_analysis_t::seggrn, rz_asm_t::seggrn, and rz_print_t::seggrn.

Referenced by rz_core_config_init().

◆ cb_segoff()

static bool cb_segoff ( void *  user,
void *  data 
)
static

Definition at line 2288 of file cconfig.c.

2288  {
2289  RzCore *core = (RzCore *)user;
2290  RzConfigNode *node = (RzConfigNode *)data;
2291  if (node->i_value) {
2292  core->print->flags |= RZ_PRINT_FLAGS_SEGOFF;
2293  } else {
2294  core->print->flags &= (((ut32)-1) & (~RZ_PRINT_FLAGS_SEGOFF));
2295  }
2296  return true;
2297 }
#define RZ_PRINT_FLAGS_SEGOFF
Definition: rz_print.h:20

References rz_print_t::flags, rz_config_node_t::i_value, rz_core_t::print, and RZ_PRINT_FLAGS_SEGOFF.

Referenced by rz_core_config_init().

◆ cb_stopthreads()

static bool cb_stopthreads ( void *  user,
void *  data 
)
static

Definition at line 2308 of file cconfig.c.

2308  {
2309  RzCore *core = (RzCore *)user;
2310  RzConfigNode *node = (RzConfigNode *)data;
2311  core->dbg->stop_all_threads = node->i_value;
2312  return true;
2313 }
int stop_all_threads
Definition: rz_debug.h:262

References rz_core_t::dbg, rz_config_node_t::i_value, and rz_debug_t::stop_all_threads.

Referenced by rz_core_config_init().

◆ cb_str_escbslash()

static bool cb_str_escbslash ( void *  user,
void *  data 
)
static

Definition at line 1142 of file cconfig.c.

1142  {
1143  RzCore *core = (RzCore *)user;
1144  RzConfigNode *node = (RzConfigNode *)data;
1145  core->print->esc_bslash = node->i_value;
1146  return true;
1147 }
bool esc_bslash
Definition: rz_print.h:161

References rz_print_t::esc_bslash, rz_config_node_t::i_value, and rz_core_t::print.

Referenced by rz_core_config_init().

◆ cb_strfilter()

static bool cb_strfilter ( void *  user,
void *  data 
)
static

Definition at line 1011 of file cconfig.c.

1011  {
1012  RzCore *core = (RzCore *)user;
1013  RzConfigNode *node = (RzConfigNode *)data;
1014  if (node->value[0] == '?') {
1015  if (strlen(node->value) > 1 && node->value[1] == '?') {
1016  rz_cons_printf("Valid values for bin.str.filter:\n"
1017  "a only alphanumeric printable\n"
1018  "8 only strings with utf8 chars\n"
1019  "p file/directory paths\n"
1020  "e email-like addresses\n"
1021  "u urls\n"
1022  "i IPv4 address-like strings\n"
1023  "U only uppercase strings\n"
1024  "f format-strings\n");
1025  } else {
1026  print_node_options(node);
1027  }
1028  return false;
1029  } else {
1030  core->bin->strfilter = node->value[0];
1031  }
1032  return true;
1033 }
char strfilter
Definition: rz_bin.h:353

References rz_core_t::bin, print_node_options(), rz_cons_printf(), rz_bin_t::strfilter, and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_strpurge()

static bool cb_strpurge ( void *  user,
void *  data 
)
static

Definition at line 965 of file cconfig.c.

965  {
966  RzCore *core = (RzCore *)user;
967  RzConfigNode *node = (RzConfigNode *)data;
968  if (*node->value == '?') {
970  "There can be multiple entries separated by commas. No whitespace before/after entries.\n"
971  "Possible entries:\n"
972  " all : purge all strings\n"
973  " true : use the false_positive() classifier in cbin.c\n"
974  " addr : purge string at addr\n"
975  " addr1-addr2 : purge all strings in the range addr1-addr2 inclusive\n"
976  " !addr : prevent purge of string at addr by prev entries\n"
977  " !addr1-addr2 : prevent purge of strings in range addr1-addr2 inclusive by prev entries\n"
978  "Neither !true nor !false is supported.\n"
979  "\n"
980  "Examples:\n"
981  " e bin.str.purge=true,0-0xff,!0x1a\n"
982  " -- purge strings using the false_positive() classifier in cbin.c and also strings \n"
983  " with addresses in the range 0-0xff, but not the string at 0x1a.\n"
984  " e bin.str.purge=all,!0x1000-0x1fff\n"
985  " -- purge all strings except the strings with addresses in the range 0x1000-0x1fff.\n");
986  return false;
987  }
988  free(core->bin->strpurge);
989  core->bin->strpurge = !*node->value || !strcmp(node->value, "false")
990  ? NULL
991  : strdup(node->value);
992  return true;
993 }
char * strpurge
Definition: rz_bin.h:354

References rz_core_t::bin, free(), NULL, rz_cons_printf(), strdup(), rz_bin_t::strpurge, and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_strsearch_check_ascii_freq()

static bool cb_strsearch_check_ascii_freq ( void *  user,
void *  data 
)
static

Definition at line 1149 of file cconfig.c.

1149  {
1150  RzCore *core = (RzCore *)user;
1151  RzConfigNode *node = (RzConfigNode *)data;
1152  core->bin->strseach_check_ascii_freq = node->i_value;
1153  return true;
1154 }
bool strseach_check_ascii_freq
Definition: rz_bin.h:361

References rz_core_t::bin, rz_config_node_t::i_value, and rz_bin_t::strseach_check_ascii_freq.

Referenced by rz_core_config_init().

◆ cb_swstep()

static bool cb_swstep ( void *  user,
void *  data 
)
static

Definition at line 2322 of file cconfig.c.

2322  {
2323  RzCore *core = (RzCore *)user;
2324  RzConfigNode *node = (RzConfigNode *)data;
2325  core->dbg->swstep = node->i_value;
2326  return true;
2327 }

References rz_core_t::dbg, rz_config_node_t::i_value, and rz_debug_t::swstep.

Referenced by rz_core_config_init().

◆ cb_teefile()

static bool cb_teefile ( void *  user,
void *  data 
)
static

Definition at line 2336 of file cconfig.c.

2336  {
2337  RzConfigNode *node = (RzConfigNode *)data;
2338  rz_cons_singleton()->teefile = node->value;
2339  return true;
2340 }
const char * teefile
Definition: rz_cons.h:519

References rz_cons_singleton(), rz_cons_t::teefile, and rz_config_node_t::value.

Referenced by rz_core_config_init().

◆ cb_timezone()

static bool cb_timezone ( void *  user,
void *  data 
)
static

Definition at line 1085 of file cconfig.c.

1085  {
1086  RzCore *core = (RzCore *)user;
1087  RzConfigNode *node = (RzConfigNode *)data;
1088  core->print->datezone = node->i_value;
1089  return true;
1090 }
int datezone
Definition: rz_print.h:116

References rz_print_t::datezone, rz_config_node_t::i_value, and rz_core_t::print.

Referenced by rz_core_config_init().

◆ cb_trace()

static bool cb_trace ( void *  user,
void *  data 
)
static

Definition at line 2342 of file cconfig.c.

2342  {
2343  RzCore *core = (RzCore *)user;
2344  RzConfigNode *node = (RzConfigNode *)data;
2345  core->dbg->trace->enabled = node->i_value;
2346  return true;
2347 }
RzDebugTrace * trace
Definition: rz_debug.h:281

References rz_core_t::dbg, rz_debug_trace_t::enabled, rz_config_node_t::i_value, and rz_debug_t::trace.

Referenced by rz_core_config_init().

◆ cb_tracetag()

static bool cb_tracetag ( void *  user,
void *  data 
)
static

Definition at line 2349 of file cconfig.c.

2349  {
2350  RzCore *core = (RzCore *)user;
2351  RzConfigNode *node = (RzConfigNode *)data;
2352  core->dbg->trace->tag = node->i_value;
2353  return true;
2354 }

References rz_core_t::dbg, rz_config_node_t::i_value, rz_debug_trace_t::tag, and rz_debug_t::trace.

Referenced by rz_core_config_init().

◆ cb_usextr()

static bool cb_usextr ( void *  user,
void *  data 
)
static

Definition at line 958 of file cconfig.c.

958  {
959  RzCore *core = (RzCore *)user;
960  RzConfigNode *node = (RzConfigNode *)data;
961  core->bin->use_xtr = node->i_value;
962  return true;
963 }
bool use_xtr
Definition: rz_bin.h:360

References rz_core_t::bin, rz_config_node_t::i_value, and rz_bin_t::use_xtr.

Referenced by rz_core_config_init().

◆ cb_utf8()

static bool cb_utf8 ( void *  user,
void *  data 
)
static

Definition at line 2356 of file cconfig.c.

2356  {
2357  RzCore *core = (RzCore *)user;
2358  RzConfigNode *node = (RzConfigNode *)data;
2359  core->rasm->utf8 = (bool)node->i_value;
2360  rz_cons_set_utf8((bool)node->i_value);
2361  return true;
2362 }
RZ_API void rz_cons_set_utf8(bool b)
Definition: cons.c:1658
bool utf8
Definition: rz_asm.h:123
#define bool
Definition: sysdefs.h:146

References bool, rz_config_node_t::i_value, rz_core_t::rasm, rz_cons_set_utf8(), and rz_asm_t::utf8.

Referenced by rz_core_config_init().

◆ cb_utf8_curvy()

static bool cb_utf8_curvy ( void *  user,
void *  data 
)
static

Definition at line 2364 of file cconfig.c.

2364  {
2365  RzCore *core = (RzCore *)user;
2366  RzConfigNode *node = (RzConfigNode *)data;
2367  core->cons->use_utf8_curvy = node->i_value;
2368  return true;
2369 }
bool use_utf8_curvy
Definition: rz_cons.h:560

References rz_core_t::cons, rz_config_node_t::i_value, and rz_cons_t::use_utf8_curvy.

Referenced by rz_core_config_init().

◆ cb_visual_mode()

static bool cb_visual_mode ( void *  user,
void *  data 
)
static

Definition at line 2371 of file cconfig.c.

2371  {
2372  RzConfigNode *node = (RzConfigNode *)data;
2373  if (node->i_value > RZ_CORE_VISUAL_MODE_CD) {
2375  }
2376  RzCore *core = (RzCore *)user;
2377  core->printidx = node->i_value;
2378  return true;
2379 }
@ RZ_CORE_VISUAL_MODE_CD
Print in string format.
Definition: rz_core.h:102
@ RZ_CORE_VISUAL_MODE_PX
Hexadecimal view.
Definition: rz_core.h:98
RzCoreVisualMode printidx
Definition: rz_core.h:357

References rz_config_node_t::i_value, rz_core_t::printidx, RZ_CORE_VISUAL_MODE_CD, and RZ_CORE_VISUAL_MODE_PX.

Referenced by rz_core_config_init().

◆ cb_zoombyte()

static bool cb_zoombyte ( void *  user,
void *  data 
)
static

Definition at line 2388 of file cconfig.c.

2388  {
2389  RzCore *core = (RzCore *)user;
2390  RzConfigNode *node = (RzConfigNode *)data;
2391  switch (*node->value) {
2392  case 'p':
2393  case 'f':
2394  case 's':
2395  case '0':
2396  case 'F':
2397  case 'e':
2398  case 'h':
2399  core->print->zoom->mode = *node->value;
2400  break;
2401  default:
2402  eprintf("Invalid zoom.byte value. See pz? for help\n");
2403  rz_cons_printf("pzp\npzf\npzs\npz0\npzF\npze\npzh\n");
2404  return false;
2405  }
2406  return true;
2407 }
RzPrintZoom * zoom
Definition: rz_print.h:146

References eprintf, rz_print_zoom_t::mode, rz_core_t::print, rz_cons_printf(), rz_config_node_t::value, and rz_print_t::zoom.

Referenced by rz_core_config_init().

◆ compareAddress()

static int compareAddress ( const RzAnalysisFunction a,
const RzAnalysisFunction b 
)
static

Definition at line 65 of file cconfig.c.

65  {
66  return (a && b && a->addr && b->addr ? (a->addr > b->addr) - (a->addr < b->addr) : 0);
67 }
#define b(i)
Definition: sha256.c:42
#define a(i)
Definition: sha256.c:41

References a, and b.

Referenced by cb_diff_sort().

◆ compareDist()

static int compareDist ( const RzAnalysisFunction a,
const RzAnalysisFunction b 
)
static

Definition at line 84 of file cconfig.c.

84  {
85  return (a && b && a->diff->dist && b->diff->dist ? (a->diff->dist > b->diff->dist) - (a->diff->dist < b->diff->dist) : 0);
86 }

References a, and b.

Referenced by cb_diff_sort().

◆ compareName()

static int compareName ( const RzAnalysisFunction a,
const RzAnalysisFunction b 
)
static

Definition at line 51 of file cconfig.c.

51  {
52  return (a && b && a->name && b->name ? strcmp(a->name, b->name) : 0);
53 }

References a, and b.

Referenced by cb_diff_sort().

◆ compareNameLen()

static int compareNameLen ( const RzAnalysisFunction a,
const RzAnalysisFunction b 
)
static

Definition at line 55 of file cconfig.c.

55  {
56  size_t la, lb;
57  if (!a || !b || !a->name || !b->name) {
58  return 0;
59  }
60  la = strlen(a->name);
61  lb = strlen(a->name);
62  return (la > lb) - (la < lb);
63 }

References a, and b.

Referenced by cb_diff_sort().

◆ compareSize()

static int compareSize ( const RzAnalysisFunction a,
const RzAnalysisFunction b 
)
static

Definition at line 73 of file cconfig.c.

73  {
74  ut64 sa, sb;
75  // return a && b && a->_size < b->_size;
76  if (!a || !b) {
77  return 0;
78  }
81  return (sa > sb) - (sa < sb);
82 }
RZ_API ut64 rz_analysis_function_realsize(const RzAnalysisFunction *fcn)
Definition: function.c:338
static SblHeader sb
Definition: bin_mbn.c:26

References a, b, rz_analysis_function_realsize(), sb, and ut64().

Referenced by cb_diff_sort().

◆ compareType()

static int compareType ( const RzAnalysisFunction a,
const RzAnalysisFunction b 
)
static

Definition at line 69 of file cconfig.c.

69  {
70  return (a && b && a->diff->type && b->diff->type ? (a->diff->type > b->diff->type) - (a->diff->type < b->diff->type) : 0);
71 }

References a, and b.

Referenced by cb_diff_sort().

◆ config_print_node()

static void config_print_node ( RzConfig cfg,
RzConfigNode node,
RzCmdStateOutput state 
)
static

Definition at line 1678 of file cconfig.c.

1678  {
1679  rz_return_if_fail(cfg && node && state);
1680  char *option;
1681  bool isFirst;
1682  RzOutputMode mode = state->mode;
1683  PJ *pj = state->d.pj;
1684  RzListIter *iter;
1685  char *es = NULL;
1686 
1687  switch (mode) {
1688  case RZ_OUTPUT_MODE_JSON:
1689  if (rz_str_isnumber(node->value)) {
1690  pj_kn(pj, node->name, rz_num_math(NULL, node->value));
1691  return;
1692  } else if (rz_str_is_bool(node->value)) {
1693  pj_kb(pj, node->name, (node->value));
1694  return;
1695  } else {
1696  pj_ks(pj, node->name, node->value);
1697  }
1698  break;
1700  pj_o(pj);
1701  pj_ks(pj, "name", node->name);
1702  if (rz_str_isnumber(node->value)) {
1703  pj_kn(pj, "value", rz_num_math(NULL, node->value));
1704  } else if (rz_str_is_bool(node->value)) {
1705  pj_kb(pj, "value", (node->value));
1706  } else {
1707  pj_ks(pj, "value", node->value);
1708  }
1709  pj_ks(pj, "type", rz_config_node_type(node));
1710  es = rz_str_escape(node->desc);
1711  if (es) {
1712  pj_ks(pj, "desc", es);
1713  free(es);
1714  }
1715  pj_kb(pj, "ro", rz_config_node_is_ro(node));
1716  if (!rz_list_empty(node->options)) {
1717  pj_ka(pj, "options");
1718  rz_list_foreach (node->options, iter, option) {
1719  pj_s(pj, option);
1720  }
1721  pj_end(pj);
1722  }
1723  pj_end(pj);
1724  break;
1725  case RZ_OUTPUT_MODE_LONG:
1726  rz_cons_printf("%s = %s %s; %s",
1727  node->name, node->value,
1728  rz_config_node_is_ro(node) ? "(ro)" : "",
1729  node->desc);
1730  if (!rz_list_empty(node->options)) {
1731  isFirst = true;
1732  rz_cons_printf(" [");
1733  rz_list_foreach (node->options, iter, option) {
1734  if (isFirst) {
1735  isFirst = false;
1736  } else {
1737  rz_cons_printf(", ");
1738  }
1739  rz_cons_printf("%s", option);
1740  }
1741  rz_cons_printf("]");
1742  }
1743  rz_cons_println("");
1744  break;
1745  case RZ_OUTPUT_MODE_QUIET:
1746  rz_cons_printf("%s=%s\n", node->name, node->value);
1747  break;
1748  case RZ_OUTPUT_MODE_RIZIN:
1750  rz_cons_printf("e %s=%s\n", node->name, es);
1751  free(es);
1752  break;
1754  rz_cons_printf("%20s: %s\n", node->name,
1755  node->desc ? node->desc : "");
1756  break;
1757  default:
1759  break;
1760  }
1761 }
RZ_API char * rz_cmd_escape_arg(const char *arg, RzCmdEscape esc)
Definition: cmd_api.c:2516
RZ_API const char * rz_config_node_type(RzConfigNode *node)
Definition: config.c:155
RZ_API void rz_cons_println(const char *str)
Definition: cons.c:233
const char int mode
Definition: ioapi.h:137
#define rz_warn_if_reached()
Definition: rz_assert.h:29
#define rz_return_if_fail(expr)
Definition: rz_assert.h:100
@ RZ_CMD_ESCAPE_ONE_ARG
The string should be escaped so that it appears as one single argument.
Definition: rz_cmd.h:79
static bool rz_config_node_is_ro(RzConfigNode *node)
Definition: rz_config.h:123
RZ_API ut64 rz_num_math(RzNum *num, const char *str)
Definition: unum.c:456
RZ_API PJ * pj_ka(PJ *j, const char *k)
Definition: pj.c:163
RZ_API PJ * pj_kb(PJ *j, const char *k, bool v)
Definition: pj.c:177
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 RZ_OWN char * rz_str_escape(RZ_NONNULL const char *buf)
Definition: str.c:1550
RZ_API bool rz_str_isnumber(const char *str)
Definition: str.c:3550
RZ_API bool rz_str_is_bool(const char *val)
Definition: str.c:3908
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_LONG_JSON
Definition: rz_types.h:45
@ RZ_OUTPUT_MODE_RIZIN
Definition: rz_types.h:41
Definition: getopt.h:84
Definition: rz_pj.h:12
RzList * options
Definition: rz_config.h:47
static int option
Definition: vmenus.c:2426

References rz_config_node_t::desc, free(), rz_config_node_t::name, NULL, option, rz_config_node_t::options, pj_end(), pj_ka(), pj_kb(), pj_kn(), pj_ks(), pj_o(), pj_s(), rz_cmd_escape_arg(), RZ_CMD_ESCAPE_ONE_ARG, rz_config_node_is_ro(), rz_config_node_type(), rz_cons_printf(), rz_cons_println(), rz_num_math(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_LONG, RZ_OUTPUT_MODE_LONG_JSON, RZ_OUTPUT_MODE_QUIET, RZ_OUTPUT_MODE_RIZIN, RZ_OUTPUT_MODE_STANDARD, rz_return_if_fail, rz_str_escape(), rz_str_is_bool(), rz_str_isnumber(), rz_warn_if_reached, and rz_config_node_t::value.

Referenced by rz_core_config_print_all().

◆ isGdbPlugin()

static bool isGdbPlugin ( RzCore core)
static

Definition at line 34 of file cconfig.c.

34  {
35  if (core->io && core->io->desc && core->io->desc->plugin) {
36  if (core->io->desc->plugin->name && !strcmp(core->io->desc->plugin->name, "gdb")) {
37  return true;
38  }
39  }
40  return false;
41 }
struct rz_io_plugin_t * plugin
Definition: rz_io.h:103
const char * name
Definition: rz_io.h:115

References rz_io_t::desc, rz_core_t::io, rz_io_plugin_t::name, and rz_io_desc_t::plugin.

Referenced by cb_dbg_gdb_page_size(), and cb_dbg_gdb_retries().

◆ print_node_options()

◆ rz_core_config_in_space()

RZ_API RZ_OWN RzList* rz_core_config_in_space ( RZ_NONNULL RzCore core,
RZ_NULLABLE const char *  space 
)

Get config variable spaces.

Parameters
coreThe RzCore instance
spaceThe config space
Returns
RzList of config variable spaces

Definition at line 3759 of file cconfig.c.

3759  {
3760  rz_return_val_if_fail(core && core->config, NULL);
3761  RzList *list = rz_list_new();
3762  if (!list) {
3763  return NULL;
3764  }
3765  RzConfigNode *node;
3766  RzListIter *iter;
3767  rz_list_foreach (core->config->nodes, iter, node) {
3768  char *name = strdup(node->name);
3769  if (!name) {
3770  continue;
3771  }
3772  char *dot = strchr(name, '.');
3773  if (dot) {
3774  *dot = 0;
3775  }
3776 
3777  if (RZ_STR_ISNOTEMPTY(space)) {
3778  if (0 == strcmp(name, space) && dot && !rz_list_find(list, dot + 1, (RzListComparator)strcmp)) {
3779  rz_list_append(list, strdup(dot + 1));
3780  }
3781  } else {
3782  if (!rz_list_find(list, name, (RzListComparator)strcmp)) {
3784  }
3785  }
3786  free(name);
3787  }
3788  return list;
3789 }
static void list(RzEgg *egg)
Definition: rz-gg.c:52
RZ_API RZ_BORROW RzListIter * rz_list_find(RZ_NONNULL const RzList *list, const void *p, RZ_NONNULL RzListComparator cmp)
Returns RzListIter element which matches via the RzListComparator.
Definition: list.c:620
RZ_API RZ_OWN RzList * rz_list_new(void)
Returns a new initialized RzList pointer (free method is not initialized)
Definition: list.c:235
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
Definition: list.c:288

References free(), list(), rz_config_node_t::name, NULL, rz_list_append(), rz_list_find(), rz_list_new(), rz_return_val_if_fail, RZ_STR_ISNOTEMPTY, and strdup().

Referenced by rz_eval_spaces_handler().

◆ rz_core_config_init()

RZ_API int rz_core_config_init ( RzCore core)

Definition at line 2830 of file cconfig.c.

2830  {
2831  int i;
2832  char buf[128], *p, *tmpdir;
2833  RzConfigNode *n;
2834  RzConfig *cfg = core->config = rz_config_new(core);
2835  if (!cfg) {
2836  return 0;
2837  }
2838  cfg->num = core->num;
2839  /* dir.prefix is used in other modules, set it first */
2840  {
2841  char *pfx = rz_sys_getenv("RZ_PREFIX");
2842  if (!pfx) {
2843  pfx = rz_path_prefix(NULL);
2844  }
2845  SETCB("dir.prefix", pfx, NULL, "Default prefix rizin was compiled for");
2846  free(pfx);
2847  }
2848 #if __ANDROID__
2849  { // use dir.home and also adjust check for permissions in directory before choosing a home
2850  char *h = rz_sys_getenv(RZ_SYS_HOME);
2851  if (h) {
2852  if (!strcmp(h, "/")) {
2853  rz_sys_setenv(RZ_SYS_HOME, "/data/local/tmp");
2854  }
2855  free(h);
2856  }
2857  }
2858 #endif
2859  SETCB("cmd.times", "", &cb_cmdtimes, "Run when a command is repeated (number prefix)");
2860  /* pdb */
2861  SETPREF("pdb.server", "https://msdl.microsoft.com/download/symbols", "Semi-colon separated list of base URLs for Microsoft symbol servers");
2862  {
2863  char *pdb_path = rz_path_home_prefix(RZ_PDB);
2864  SETPREF("pdb.symstore", pdb_path, "Path to downstream symbol store");
2865  RZ_FREE(pdb_path);
2866  }
2867  SETI("pdb.extract", 1, "Avoid extract of the pdb file, just download");
2868  SETI("pdb.autoload", false, "Automatically load the required pdb files for loaded DLLs");
2869 
2870  /* elf */
2871  SETBPREF("elf.checks.sections", "true", "Check elf sections during loading");
2872  SETBPREF("elf.checks.segments", "true", "Check elf segments during loading");
2873  SETBPREF("elf.load.sections", "true", "Automatically load elf sections");
2874 
2875  /* analysis */
2876  SETBPREF("analysis.detectwrites", "false", "Automatically reanalyze function after a write");
2877  SETPREF("analysis.fcnprefix", "fcn", "Prefix new function names with this");
2878  const char *analysiscc = rz_analysis_cc_default(core->analysis);
2879  SETCB("analysis.cc", analysiscc ? analysiscc : "", (RzConfigCallback)&cb_analysiscc, "Specify default calling convention");
2880  const char *analysissyscc = rz_analysis_syscc_default(core->analysis);
2881  SETCB("analysis.syscc", analysissyscc ? analysissyscc : "", (RzConfigCallback)&cb_analysissyscc, "Specify default syscall calling convention");
2882  SETCB("analysis.roregs", "gp,zero", (RzConfigCallback)&cb_analysis_roregs, "Comma separated list of register names to be readonly");
2883  SETICB("analysis.gp", 0, (RzConfigCallback)&cb_analysis_gp, "Set the value of the GP register (MIPS)");
2884  SETBPREF("analysis.gpfixed", "true", "Set gp register to analysis.gp before emulating each instruction in aae");
2885  SETCB("analysis.limits", "false", (RzConfigCallback)&cb_analysis_limits, "Restrict analysis to address range [analysis.from:analysis.to]");
2886  SETCB("analysis.rnr", "false", (RzConfigCallback)&cb_analysis_rnr, "Recursive no return checks (EXPERIMENTAL)");
2887  SETCB("analysis.limits", "false", (RzConfigCallback)&cb_analysis_limits, "Restrict analysis to address range [analysis.from:analysis.to]");
2888  SETICB("analysis.from", -1, (RzConfigCallback)&cb_analysis_from, "Lower limit on the address range for analysis");
2889  SETICB("analysis.to", -1, (RzConfigCallback)&cb_analysis_from, "Upper limit on the address range for analysis");
2890  n = NODECB("analysis.in", "io.maps.x", &cb_searchin);
2891  SETDESC(n, "Specify search boundaries for analysis");
2892  SETOPTIONS(n, "range", "block",
2893  "bin.segment", "bin.segments", "bin.segments.x", "bin.segments.r", "bin.section", "bin.sections", "bin.sections.rwx", "bin.sections.r", "bin.sections.rw", "bin.sections.rx", "bin.sections.wx", "bin.sections.x",
2894  "io.map", "io.maps", "io.maps.rwx", "io.maps.r", "io.maps.rw", "io.maps.rx", "io.maps.wx", "io.maps.x",
2895  "dbg.stack", "dbg.heap",
2896  "dbg.map", "dbg.maps", "dbg.maps.rwx", "dbg.maps.r", "dbg.maps.rw", "dbg.maps.rx", "dbg.maps.wx", "dbg.maps.x",
2897  "analysis.fcn", "analysis.bb",
2898  NULL);
2899  SETI("analysis.timeout", 0, "Stop analyzing after a couple of seconds");
2900  SETCB("analysis.jmp.retpoline", "true", &cb_analysis_jmpretpoline, "Analyze retpolines, may be slower if not needed");
2901  SETICB("analysis.jmp.tailcall", 0, &cb_analysis_jmptailcall, "Consume a branch as a call if delta is big");
2902 
2903  SETCB("analysis.armthumb", "false", &cb_analysis_armthumb, "aae computes arm/thumb changes (lot of false positives ahead)");
2904  SETCB("analysis.jmp.after", "true", &cb_analysis_afterjmp, "Continue analysis after jmp/ujmp");
2905  SETCB("analysis.trap.after", "false", &cb_analysis_aftertrap, "Continue analysis after trap instructions.");
2906  SETCB("analysis.delay", "true", &cb_analysis_delay, "Enable delay slot analysis if supported by the architecture");
2907  SETICB("analysis.depth", 64, &cb_analysis_depth, "Max depth at code analysis"); // XXX: warn if depth is > 50 .. can be problematic
2908  SETICB("analysis.graph_depth", 256, &cb_analysis_graphdepth, "Max depth for path search");
2909  SETICB("analysis.sleep", 0, &cb_analysis_sleep, "Sleep N usecs every so often during analysis. Avoid 100% CPU usage");
2910  SETCB("analysis.ignbithints", "false", &cb_analysis_ignbithints, "Ignore the ahb hints (only obey asm.bits)");
2911  SETBPREF("analysis.calls", "false", "Make basic af analysis walk into calls");
2912  SETBPREF("analysis.autoname", "false", "Speculatively set a name for the functions, may result in some false positives");
2913  SETBPREF("analysis.hasnext", "false", "Continue analysis after each function");
2914  SETICB("analysis.nonull", 0, &cb_analysis_nonull, "Do not analyze regions of N null bytes");
2915  SETBPREF("analysis.esil", "false", "Use the new ESIL code analysis");
2916  SETCB("analysis.strings", "false", &cb_analysis_strings, "Identify and register strings during analysis (aar only)");
2917  SETPREF("analysis.types.spec", "gcc", "Set profile for specifying format chars used in type analysis");
2918  SETBPREF("analysis.types.verbose", "false", "Verbose output from type analysis");
2919  SETBPREF("analysis.types.constraint", "false", "Enable constraint types analysis for variables");
2920  SETCB("analysis.vars", "true", &cb_analysis_vars, "Analyze local variables and arguments");
2921  SETCB("analysis.vars.stackname", "false", &cb_analysis_vars_stackname, "Name variables based on their offset on the stack");
2922  SETBPREF("analysis.vinfun", "true", "Search values in functions (aav) (false by default to only find on non-code)");
2923  SETBPREF("analysis.vinfunrange", "false", "Search values outside function ranges (requires analysis.vinfun=false)\n");
2924  SETCB("analysis.norevisit", "false", &cb_analysis_norevisit, "Do not visit function analysis twice (EXPERIMENTAL)");
2925  SETCB("analysis.nopskip", "true", &cb_analysis_nopskip, "Skip nops at the beginning of functions");
2926  SETCB("analysis.hpskip", "false", &cb_analysis_hpskip, "Skip `mov reg, reg` and `lea reg, [reg] at the beginning of functions");
2927  n = NODECB("analysis.arch", RZ_SYS_ARCH, &cb_analysis_arch);
2928  SETDESC(n, "Select the architecture to use");
2930  SETCB("analysis.cpu", RZ_SYS_ARCH, &cb_analysis_cpu, "Specify the analysis.cpu to use");
2931  SETPREF("analysis.prelude", "", "Specify an hexpair to find preludes in code");
2932  SETCB("analysis.recont", "false", &cb_analysis_recont, "End block after splitting a basic block instead of error"); // testing
2933  SETCB("analysis.jmp.indir", "false", &cb_analysis_ijmp, "Follow the indirect jumps in function analysis"); // testing
2934  SETI("analysis.ptrdepth", 3, "Maximum number of nested pointers to follow in analysis");
2935  SETICB("asm.lines.maxref", 0, &cb_analysis_maxrefs, "Maximum number of reflines to be analyzed and displayed in asm.lines with pd");
2936 
2937  SETCB("analysis.jmp.tbl", "true", &cb_analysis_jmptbl, "Analyze jump tables in switch statements");
2938  SETICB("analysis.jmp.tblmax", 512, &cb_analysis_jmptblmax, "Maximum amount of entries to analyze in jump tables");
2939  SETICB("analysis.jmp.tblmaxoffset", 4096, &cb_analysis_jmptblmaxoffset, "Maximum offset from the jump table jump instruction to consider it valid");
2940 
2941  SETCB("analysis.jmp.cref", "false", &cb_analysis_cjmpref, "Create references for conditional jumps");
2942  SETCB("analysis.jmp.ref", "true", &cb_analysis_jmpref, "Create references for unconditional jumps");
2943 
2944  SETCB("analysis.jmp.above", "true", &cb_analysis_jmpabove, "Jump above function pointer");
2945  SETCB("analysis.loads", "false", &cb_analysis_loads, "Define as dword/string/qword when analyzing load instructions");
2946  SETCB("analysis.datarefs", "false", &cb_analysis_followdatarefs, "Follow data references for code coverage");
2947  SETCB("analysis.brokenrefs", "false", &cb_analysis_brokenrefs, "Follow function references as well if function analysis was failed");
2948  SETCB("analysis.jmp.mid", "true", &cb_analysis_jmpmid, "Continue analysis after jump to middle of instruction (x86 only)");
2949 
2950  SETCB("analysis.refstr", "false", &cb_analysis_searchstringrefs, "Search string references in data references");
2951  SETCB("analysis.trycatch", "false", &cb_analysis_trycatch, "Honor try.X.Y.{from,to,catch} flags");
2952  SETCB("analysis.bb.maxsize", "512K", &cb_analysis_bb_max_size, "Maximum basic block size");
2953  SETCB("analysis.pushret", "false", &cb_analysis_pushret, "Analyze push+ret as jmp");
2954 
2955  n = NODECB("analysis.cpp.abi", "itanium", &cb_analysis_cpp_abi);
2956  SETDESC(n, "Select C++ ABI (Compiler)");
2957  SETOPTIONS(n, "itanium", "msvc", NULL);
2958  SETB("analysis.apply.signature", true, "enables/disables auto-applying signatures to the loaded binary (see also flirt.sigdb.path)");
2959 
2960 #if __linux__ && __GNU_LIBRARY__ && __GLIBC__ && __GLIBC_MINOR__
2961  SETCB("dbg.malloc", "glibc", &cb_malloc, "Choose malloc structure parser");
2962 #else
2963  SETCB("dbg.malloc", "jemalloc", &cb_malloc, "Choose malloc structure parser");
2964 #endif
2965 #if __GLIBC_MINOR__ > 25
2966  SETBPREF("dbg.glibc.tcache", "true", "Set glib tcache parsing");
2967 #else
2968  SETBPREF("dbg.glibc.tcache", "false", "Set glib tcache parsing");
2969 #endif
2970 #if __x86_64__
2971  SETI("dbg.glibc.ma_offset", 0x000000, "Main_arena offset from his symbol");
2972  SETI("dbg.glibc.fc_offset", 0x00280, "First chunk offset from brk_start");
2973 #else
2974  SETI("dbg.glibc.ma_offset", 0x1bb000, "Main_arena offset from his symbol");
2975  SETI("dbg.glibc.fc_offset", 0x148, "First chunk offset from brk_start");
2976 #endif
2977  SETI("dbg.glibc.fastbinmax", 10, "Upper bound on the number of fastbins printed");
2978 
2979  SETBPREF("esil.prestep", "true", "Step before esil evaluation in `de` commands");
2980  SETPREF("esil.fillstack", "", "Initialize ESIL stack with (random, debrujn, sequence, zeros, ...)");
2981  SETICB("esil.verbose", 0, &cb_esilverbose, "Show ESIL verbose level (0, 1, 2)");
2982  SETICB("esil.gotolimit", core->analysis->esil_goto_limit, &cb_gotolimit, "Maximum number of gotos per ESIL expression");
2983  SETICB("esil.stack.depth", 256, &cb_esilstackdepth, "Number of elements that can be pushed on the esilstack");
2984  SETI("esil.stack.size", 0xf0000, "Set stack size in ESIL VM");
2985  SETI("esil.stack.addr", 0x100000, "Set stack address in ESIL VM");
2986  SETPREF("esil.stack.pattern", "0", "Specify fill pattern to initialize the stack (0, w, d, i)");
2987  SETI("esil.addr.size", 64, "Maximum address size in accessed by the ESIL VM");
2988  SETBPREF("esil.breakoninvalid", "false", "Break esil execution when instruction is invalid");
2989  SETI("esil.timeout", 0, "A timeout (in seconds) for when we should give up emulating");
2990  /* asm */
2991  // asm.os needs to be first, since other asm.* depend on it
2992  n = NODECB("asm.os", "none", &cb_asmos);
2993  SETDESC(n, "Select operating system (kernel)");
2994  SETOPTIONS(n, "ios", "dos", "darwin", "linux", "freebsd", "openbsd", "netbsd", "windows", "s110", "none", NULL);
2995  SETI("asm.xrefs.fold", 5, "Maximum number of xrefs to be displayed as list (use columns above)");
2996  SETBPREF("asm.xrefs.code", "true", "Show the code xrefs (generated by jumps instead of calls)");
2997  SETI("asm.xrefs.max", 20, "Maximum number of xrefs to be displayed without folding");
2998  SETCB("asm.invhex", "false", &cb_asm_invhex, "Show invalid instructions as hexadecimal numbers");
2999  SETBPREF("asm.instr", "true", "Display the disassembled instruction");
3000  SETBPREF("asm.meta", "true", "Display the code/data/format conversions in disasm");
3001  SETBPREF("asm.bytes", "false", "Display the bytes of each instruction");
3002  SETBPREF("asm.bytes.right", "false", "Display the bytes at the right of the disassembly");
3003  SETI("asm.types", 1, "Display the fcn types in calls (0=no,1=quiet,2=verbose)");
3004  SETBPREF("asm.midcursor", "false", "Cursor in visual disasm mode breaks the instruction");
3005  SETBPREF("asm.cmt.flgrefs", "true", "Show comment flags associated to branch reference");
3006  SETBPREF("asm.cmt.right", "true", "Show comments at right of disassembly if they fit in screen");
3007  SETBPREF("asm.cmt.esil", "false", "Show ESIL expressions as comments");
3008  SETBPREF("asm.cmt.il", "false", "Show RzIL expressions as comments");
3009  SETI("asm.cmt.col", 71, "Column to align comments");
3010  SETICB("asm.pcalign", 0, &cb_asm_pcalign, "Only recognize as valid instructions aligned to this value");
3011  // maybe rename to asm.cmt.calls
3012  SETBPREF("asm.calls", "true", "Show callee function related info as comments in disasm");
3013  SETBPREF("asm.comments", "true", "Show comments in disassembly view");
3014  SETBPREF("asm.usercomments", "false", "Show user comments even if asm.comments is false");
3015  SETBPREF("asm.sub.jmp", "true", "Always substitute jump, call and branch targets in disassembly");
3016  SETBPREF("asm.hints", "true", "Disable all asm.hint* if false");
3017  SETBPREF("asm.hint.jmp", "false", "Show jump hints [numbers] in disasm");
3018  SETBPREF("asm.hint.call", "true", "Show call hints [numbers] in disasm");
3019  SETBPREF("asm.hint.call.indirect", "true", "Hints for indirect call intructions go to the call destination");
3020  SETBPREF("asm.hint.lea", "false", "Show LEA hints [numbers] in disasm");
3021  SETBPREF("asm.hint.emu", "false", "Show asm.emu hints [numbers] in disasm");
3022  SETBPREF("asm.hint.cdiv", "false", "Show CDIV hints optimization hint");
3023  SETI("asm.hint.pos", 1, "Shortcut hint position (-1, 0, 1)");
3024  SETBPREF("asm.slow", "true", "Perform slow analysis operations in disasm");
3025  SETBPREF("asm.decode", "false", "Use code analysis as a disassembler");
3026  SETICB("asm.imm.hash", 0, &cb_asm_immhash, "Display # for immediates in ARM and Hexagon (0 = on)");
3027  SETBPREF("asm.imm.str", "true", "Show immediates values as strings");
3028  SETBPREF("asm.imm.trim", "false", "Remove all offsets and constants from disassembly");
3029  SETBPREF("asm.indent", "false", "Indent disassembly based on reflines depth");
3030  SETI("asm.indentspace", 2, "How many spaces to indent the code");
3031  SETBPREF("asm.dwarf", "false", "Show dwarf comment at disassembly");
3032  SETBPREF("asm.dwarf.abspath", "false", "Show absolute path in asm.dwarf");
3033  SETBPREF("asm.dwarf.file", "true", "Show filename of asm.dwarf in pd");
3034  SETBPREF("asm.esil", "false", "Show ESIL instead of mnemonic");
3035  SETBPREF("asm.nodup", "false", "Do not show dupped instructions (collapse disasm)");
3036  SETBPREF("asm.emu", "false", "Run ESIL emulation analysis on disasm");
3037  SETBPREF("emu.pre", "false", "Run ESIL emulation starting at the closest flag in pd");
3038  SETBPREF("asm.refptr", "true", "Show refpointer information in disasm");
3039  SETBPREF("emu.lazy", "false", "Do not emulate all instructions with aae (optimization)");
3040  SETBPREF("emu.stack", "false", "Create a temporary fake stack when emulating in disasm (asm.emu)");
3041  SETCB("emu.str", "false", &cb_emustr, "Show only strings if any in the asm.emu output");
3042  SETBPREF("emu.str.lea", "true", "Disable this in ARM64 code to remove some false positives");
3043  SETBPREF("emu.str.off", "false", "Always show offset when printing asm.emu strings");
3044  SETBPREF("emu.str.inv", "true", "Color-invert emu.str strings");
3045  SETBPREF("emu.str.flag", "true", "Also show flag (if any) for asm.emu string");
3046  SETBPREF("emu.write", "false", "Allow asm.emu to modify memory (WARNING)");
3047  SETBPREF("emu.ssa", "false", "Perform SSA checks and show the ssa reg names as comments");
3048  n = NODECB("emu.skip", "ds", &cb_emuskip);
3049  SETDESC(n, "Skip metadata of given types in asm.emu");
3050  SETOPTIONS(n, "d", "c", "s", "f", "m", "h", "C", "r", NULL);
3051  SETBPREF("asm.sub.names", "true", "Replace numeric values by flags (e.g. 0x4003e0 -> sym.imp.printf)");
3052  SETPREF("asm.strip", "", "strip all instructions given comma separated types");
3053  SETBPREF("asm.optype", "false", "show opcode type next to the instruction bytes");
3054  SETBPREF("asm.lines.fcn", "true", "Show function boundary lines");
3055  SETBPREF("asm.flags", "true", "Show flags");
3056  SETICB("asm.flags.maxname", 0, &cb_maxname, "Maximum length of flag name with smart chopping");
3057  SETI("asm.flags.limit", 0, "Maximum number of flags to show in a single offset");
3058  SETBPREF("asm.flags.offset", "false", "Show offset in flags");
3059  SETBPREF("asm.flags.inbytes", "false", "Display flags inside the bytes space");
3060  SETBPREF("asm.flags.inline", "false", "Display flags in line separated by commas instead of newlines");
3061  n = NODEICB("asm.flags.middle", 2, &cb_midflags);
3062  SETOPTIONS(n, "0 = do not show flag", "1 = show without realign", "2 = realign at middle flag",
3063  "3 = realign at middle flag if sym.*", NULL);
3064  SETDESC(n, "Realign disassembly if there is a flag in the middle of an instruction");
3065  SETCB("asm.flags.real", "false", &cb_flag_realnames,
3066  "Show flags' unfiltered realnames instead of names, except realnames from demangling");
3067  SETBPREF("asm.bb.line", "false", "Show empty line after every basic block");
3068  SETBPREF("asm.bb.middle", "true", "Realign disassembly if a basic block starts in the middle of an instruction");
3069  SETBPREF("asm.lbytes", "true", "Align disasm bytes to left");
3070  SETBPREF("asm.lines", "true", "Show ASCII-art lines at disassembly");
3071  SETBPREF("asm.lines.bb", "true", "Show flow lines at jumps");
3072  SETBPREF("asm.lines.call", "false", "Enable call lines");
3073  SETBPREF("asm.lines.ret", "false", "Show separator lines after ret");
3074  SETBPREF("asm.lines.out", "true", "Show out of block lines");
3075  SETBPREF("asm.lines.right", "false", "Show lines before opcode instead of offset");
3076  SETBPREF("asm.lines.wide", "false", "Put a space between lines");
3077  SETBPREF("asm.fcn.signature", "true", "Show function signature in disasm");
3078  SETBPREF("asm.fcn.size", "false", "Show function size in disasm");
3079  SETICB("asm.lines.width", 7, &cb_asmlineswidth, "Number of columns for program flow arrows");
3080  SETICB("asm.sub.varmin", 0x100, &cb_asmsubvarmin, "Minimum value to substitute in instructions (asm.sub.var)");
3081  SETCB("asm.sub.tail", "false", &cb_asmsubtail, "Replace addresses with prefix .. syntax");
3082  SETBPREF("asm.middle", "false", "Allow disassembling jumps in the middle of an instruction");
3083  SETBPREF("asm.noisy", "true", "Show comments considered noisy but possibly useful");
3084  SETBPREF("asm.offset", "true", "Show offsets in disassembly");
3085  SETBPREF("hex.offset", "true", "Show offsets in hex-dump");
3086  SETBPREF("scr.square", "true", "Use square pixels or not");
3087  SETCB("scr.prompt.vi", "false", &cb_scr_vi, "Use vi mode for input prompt");
3088  SETCB("scr.prompt.mode", "false", &cb_scr_prompt_mode, "Set prompt color based on vi mode");
3089  SETCB("scr.wideoff", "false", &cb_scr_wideoff, "Adjust offsets to match asm.bits");
3090  SETCB("scr.rainbow", "false", &cb_scrrainbow, "Shows rainbow colors depending of address");
3091  SETCB("scr.last", "true", &cb_scrlast, "Cache last output after flush to make _ command work (disable for performance)");
3092  SETBPREF("asm.reloff", "false", "Show relative offsets instead of absolute address in disasm");
3093  SETBPREF("asm.reloff.flags", "false", "Show relative offsets to flags (not only functions)");
3094  SETBPREF("asm.section", "false", "Show section name before offset");
3095  SETBPREF("asm.section.perm", "false", "Show section permissions in the disasm");
3096  SETBPREF("asm.section.name", "true", "Show section name in the disasm");
3097  SETI("asm.section.col", 30, "Columns width to show asm.section");
3098  SETCB("asm.sub.section", "false", &cb_asmsubsec, "Show offsets in disasm prefixed with section/map name");
3099  SETCB("asm.pseudo", "false", &cb_asmpseudo, "Enable pseudo syntax");
3100  SETBPREF("asm.size", "false", "Show size of opcodes in disassembly (pd)");
3101  SETBPREF("asm.stackptr", "false", "Show stack pointer at disassembly");
3102  SETBPREF("asm.cyclespace", "false", "Indent instructions depending on CPU-cycles");
3103  SETBPREF("asm.cycles", "false", "Show CPU-cycles taken by instruction at disassembly");
3104  SETI("asm.tabs", 6, "Use tabs in disassembly");
3105  SETBPREF("asm.tabs.once", "true", "Only tabulate the opcode, not the arguments");
3106  SETI("asm.tabs.off", 0, "tabulate spaces after the offset");
3107  SETBPREF("asm.trace", "false", "Show execution traces for each opcode");
3108  SETBPREF("asm.tracespace", "false", "Indent disassembly with trace.count information");
3109  SETBPREF("asm.ucase", "false", "Use uppercase syntax at disassembly");
3110  SETBPREF("asm.capitalize", "false", "Use camelcase at disassembly");
3111  SETBPREF("asm.var", "true", "Show local function variables in disassembly");
3112  SETBPREF("asm.var.access", "false", "Show accesses of local variables");
3113  SETBPREF("asm.sub.var", "true", "Substitute variables in disassembly");
3114  SETI("asm.var.summary", 0, "Show variables summary instead of full list in disasm (0, 1, 2)");
3115  SETBPREF("asm.sub.varonly", "true", "Substitute the entire variable expression with the local variable name (e.g. [local10h] instead of [ebp+local10h])");
3116  SETBPREF("asm.sub.reg", "false", "Substitute register names with their associated role name (drp~=)");
3117  SETBPREF("asm.sub.rel", "true", "Substitute pc relative expressions in disasm");
3118  SETBPREF("asm.family", "false", "Show family name in disasm");
3119  SETBPREF("asm.symbol", "false", "Show symbol+delta instead of absolute offset");
3120  SETBPREF("asm.analysis", "false", "Analyze code and refs while disassembling (see analysis.strings)");
3121  SETI("asm.symbol.col", 40, "Columns width to show asm.section");
3122  SETCB("asm.assembler", "", &cb_asmassembler, "Set the plugin name to use when assembling");
3123  SETBPREF("asm.minicols", "false", "Only show the instruction in the column disasm");
3124  RzConfigNode *asmcpu = NODECB("asm.cpu", RZ_SYS_ARCH, &cb_asmcpu);
3125  SETDESC(asmcpu, "Set the kind of asm.arch cpu");
3126  RzConfigNode *asmarch = NODECB("asm.arch", RZ_SYS_ARCH, &cb_asmarch);
3127  SETDESC(asmarch, "Set the arch to be used by asm");
3128  /* we need to have both asm.arch and asm.cpu defined before updating options */
3129  update_asmarch_options(core, asmarch);
3130  update_asmcpu_options(core, asmcpu);
3131  n = NODECB("asm.features", "", &cb_asmfeatures);
3132  SETDESC(n, "Specify supported features by the target CPU");
3134  n = NODECB("asm.platform", "", &cb_asmplatform);
3135  SETDESC(n, "Specify supported platforms by the target architecture");
3137  n = NODECB("asm.parser", "x86.pseudo", &cb_asmparser);
3138  SETDESC(n, "Set the asm parser to use");
3139  update_asmparser_options(core, n);
3140  SETCB("asm.segoff", "false", &cb_segoff, "Show segmented address in prompt (x86-16)");
3141  SETCB("asm.decoff", "false", &cb_decoff, "Show segmented address in prompt (x86-16)");
3142  SETICB("asm.seggrn", 4, &cb_seggrn, "Segment granularity in bits (x86-16)");
3143  n = NODECB("asm.syntax", "intel", &cb_asmsyntax);
3144  SETDESC(n, "Select assembly syntax");
3145  SETOPTIONS(n, "att", "intel", "masm", "jz", "regnum", NULL);
3146  SETI("asm.nbytes", 6, "Number of bytes for each opcode at disassembly");
3147  SETBPREF("asm.bytes.space", "false", "Separate hexadecimal bytes with a whitespace");
3148 #if RZ_SYS_BITS == RZ_SYS_BITS_64
3149  SETICB("asm.bits", 64, &cb_asmbits, "Word size in bits at assembler");
3150 #else
3151  SETICB("asm.bits", 32, &cb_asmbits, "Word size in bits at assembler");
3152 #endif
3153  n = rz_config_node_get(cfg, "asm.bits");
3154  update_asmbits_options(core, n);
3155  SETBPREF("asm.functions", "true", "Show functions in disassembly");
3156  SETBPREF("asm.xrefs", "true", "Show xrefs in disassembly");
3157  SETBPREF("asm.demangle", "true", "Show demangled symbols in disasm");
3158  SETBPREF("asm.describe", "false", "Show opcode description");
3159  SETPREF("asm.highlight", "", "Highlight current line");
3160  SETBPREF("asm.marks", "true", "Show marks before the disassembly");
3161  SETBPREF("asm.cmt.refs", "false", "Show flag and comments from refs in disasm");
3162  SETBPREF("asm.cmt.patch", "false", "Show patch comments in disasm");
3163  SETBPREF("asm.cmt.off", "nodup", "Show offset comment in disasm (true, false, nodup)");
3164  SETBPREF("asm.payloads", "false", "Show payload bytes in disasm");
3165 
3166  /* bin */
3167  SETPREF("bin.hashlimit", "10M", "Only compute hash when opening a file if smaller than this size");
3168  SETCB("bin.usextr", "true", &cb_usextr, "Use extract plugins when loading files");
3169  SETCB("bin.str.purge", "", &cb_strpurge, "Purge strings (e bin.str.purge=? provides more detail)");
3170  SETBPREF("bin.b64str", "false", "Try to debase64 the strings");
3171  SETCB("bin.at", "false", &cb_binat, "RzBin.cur depends on RzCore.offset");
3172  SETBPREF("bin.libs", "false", "Try to load libraries after loading main binary");
3173  n = NODECB("bin.str.filter", "", &cb_strfilter);
3174  SETDESC(n, "Filter strings");
3175  SETOPTIONS(n, "a", "8", "p", "e", "u", "i", "U", "f", NULL);
3176  SETCB("bin.filter", "true", &cb_binfilter, "Filter symbol names to fix dupped names");
3177  SETCB("bin.force", "", &cb_binforce, "Force that rbin plugin");
3178  SETPREF("bin.lang", "", "Language for bin.demangle");
3179  SETBPREF("bin.demangle", "true", "Import demangled symbols from RzBin");
3180  SETBPREF("bin.demangle.libs", "false", "Show library name on demangled symbols names");
3181  SETI("bin.baddr", -1, "Base address of the binary");
3182  SETI("bin.laddr", 0, "Base address for loading library ('*.so')");
3183  SETCB("bin.dbginfo", "true", &cb_bindbginfo, "Load debug information at startup if available");
3184  SETBPREF("bin.relocs", "true", "Load relocs information at startup if available");
3185  SETICB("bin.minstr", 0, &cb_binminstr, "Minimum string length for rz_bin");
3186  SETICB("bin.maxstr", 0, &cb_binmaxstr, "Maximum string length for rz_bin");
3187  SETICB("bin.maxstrbuf", 1024 * 1024 * 10, &cb_binmaxstrbuf, "Maximum size of range to load strings from");
3188  n = NODECB("bin.str.enc", "guess", &cb_binstrenc);
3189  SETDESC(n, "Default string encoding of binary");
3190  SETOPTIONS(n, "ascii", "8bit", "utf8", "utf16le", "utf32le", "utf16be", "utf32be", "guess", NULL);
3191  SETCB("bin.prefix", "", &cb_binprefix, "Prefix all symbols/sections/relocs with a specific string");
3192  SETCB("bin.strings", "true", &cb_binstrings, "Load strings from rbin on startup");
3193  SETCB("bin.debase64", "false", &cb_debase64, "Try to debase64 all strings");
3194  SETBPREF("bin.classes", "true", "Load classes from rbin on startup");
3195  SETCB("bin.verbose", "false", &cb_binverbose, "Show RzBin warnings when loading binaries");
3196 
3197  /* prj */
3198  SETPREF("prj.file", "", "Path of the currently opened project");
3199  SETBPREF("prj.compress", "false", "Compress the project file while saving");
3200 
3201  /* cfg */
3202  SETBPREF("cfg.plugins", "true", "Load plugins at startup");
3203  SETCB("time.fmt", "%Y-%m-%d %H:%M:%S %z", &cb_cfgdatefmt, "Date format (%Y-%m-%d %H:%M:%S %z)");
3204  SETICB("time.zone", 0, &cb_timezone, "Time zone, in hours relative to GMT: +2, -1,..");
3205  SETBPREF("cfg.newtab", "false", "Show descriptions in command completion");
3206  SETCB("cfg.debug", "false", &cb_cfgdebug, "Debugger mode");
3207  p = rz_sys_getenv("EDITOR");
3208 #if __WINDOWS__
3209  rz_config_set(cfg, "cfg.editor", p ? p : "notepad");
3210 #else
3211  rz_config_set(cfg, "cfg.editor", p ? p : "vi");
3212 #endif
3213  free(p);
3214  rz_config_desc(cfg, "cfg.editor", "Select default editor program");
3215  SETPREF("cfg.user", rz_sys_whoami(buf), "Set current username/pid");
3216  SETCB("cfg.fortunes", "true", &cb_cfg_fortunes, "If enabled show tips at start");
3217  SETCB("cfg.fortunes.file", "tips", &cb_cfg_fortunes_file, "Type of fortunes to show (tips, fun)");
3218  SETBPREF("cfg.fortunes.clippy", "false", "Use ?E instead of ?e");
3219  SETPREF("cfg.prefixdump", "dump", "Filename prefix for automated dumps");
3220  SETBPREF("cfg.wseek", "false", "Seek after write");
3221  SETICB("cfg.seek.histsize", 63, NULL, "Maximum size of the seek history");
3222  SETCB("cfg.seek.silent", "false", NULL, "When true, seek movements are not logged in seek history");
3223  SETCB("cfg.bigendian", "false", &cb_bigendian, "Use little (false) or big (true) endianness");
3224  SETI("cfg.cpuaffinity", 0, "Run on cpuid");
3225 
3226  /* log */
3227  // RZ_LOGLEVEL / log.level
3228  p = rz_sys_getenv("RZ_LOGLEVEL");
3229  SETICB("log.level", p ? atoi(p) : RZ_DEFAULT_LOGLVL, cb_log_config_level, "Target log level/severity"
3230  " (0:SILLY, 1:DEBUG, 2:VERBOSE, 3:INFO, 4:WARN, 5:ERROR, 6:FATAL)");
3231  free(p);
3232  // RZ_LOGTRAP_LEVEL / log.traplevel
3233  p = rz_sys_getenv("RZ_LOGTRAPLEVEL");
3234  SETICB("log.traplevel", p ? atoi(p) : RZ_LOGLVL_FATAL, cb_log_config_traplevel, "Log level for trapping rizin when hit"
3235  " (0:SILLY, 1:VERBOSE, 2:DEBUG, 3:INFO, 4:WARN, 5:ERROR, 6:FATAL)");
3236  free(p);
3237  // RZ_LOGFILE / log.file
3238  p = rz_sys_getenv("RZ_LOGFILE");
3239  SETCB("log.file", p ? p : "", cb_log_config_file, "Logging output filename / path");
3240  free(p);
3241  // RZ_LOGSRCINFO / log.srcinfo
3242  p = rz_sys_getenv("RZ_LOGSRCINFO");
3243  SETCB("log.srcinfo", p ? p : "false", cb_log_config_srcinfo, "Should the log output contain src info (filename:lineno)");
3244  free(p);
3245  // RZ_LOGCOLORS / log.colors
3246  p = rz_sys_getenv("RZ_LOGCOLORS");
3247  SETCB("log.colors", p ? p : "false", cb_log_config_colors, "Should the log output use colors (TODO)");
3248  free(p);
3249 
3250  SETCB("log.events", "false", &cb_log_events, "Remote HTTP server to sync events with");
3251 
3252  /* diff */
3253  SETCB("diff.sort", "addr", &cb_diff_sort, "Specify function diff sorting column see (e diff.sort=?)");
3254  SETI("diff.from", 0, "Set source diffing address for px (uses cc command)");
3255  SETI("diff.to", 0, "Set destination diffing address for px (uses cc command)");
3256  SETBPREF("diff.bare", "false", "Never show function names in diff output");
3257  SETBPREF("diff.levenstein", "false", "Use faster (and buggy) levenstein algorithm for buffer distance diffing");
3258 
3259  /* dir */
3260  SETI("dir.depth", 10, "Maximum depth when searching recursively for files");
3261  {
3262  char *path = rz_path_system(RZ_SDB_MAGIC);
3263  SETPREF("dir.magic", path, "Path to rz_magic files");
3264  free(path);
3266  SETPREF("dir.plugins", path, "Path to plugin files to be loaded at startup");
3267  free(path);
3268  }
3269  SETCB("dir.source", "", &cb_dirsrc, "Path to find source files");
3270  SETPREF("dir.types", "/usr/include", "Default path to look for cparse type files");
3271  SETPREF("dir.libs", "", "Specify path to find libraries to load when bin.libs=true");
3273  SETCB("dir.home", p ? p : "/", &cb_dirhome, "Path for the home directory");
3274  free(p);
3276  SETCB("dir.tmp", p ? p : "", &cb_dirtmp, "Path of the tmp directory");
3277  free(p);
3278 #if __ANDROID__
3279  SETPREF("dir.projects", "/data/data/org.rizin.rizininstaller/rizin/projects", "Default path for projects");
3280 #else
3281  char *projects_dir = rz_path_home_prefix(RZ_PROJECTS);
3282  SETPREF("dir.projects", projects_dir, "Default path for projects");
3283  free(projects_dir);
3284 #endif
3285  SETPREF("stack.reg", "SP", "Which register to use as stack pointer in the visual debug");
3286  SETBPREF("stack.bytes", "true", "Show bytes instead of words in stack");
3287  SETBPREF("stack.anotated", "false", "Show anotated hexdump in visual debug");
3288  SETI("stack.size", 64, "Size in bytes of stack hexdump in visual debug");
3289  SETI("stack.delta", 0, "Delta for the stack dump");
3290 
3291  SETCB("dbg.libs", "", &cb_dbg_libs, "If set stop when loading matching libname");
3292  SETBPREF("dbg.skipover", "false", "Make dso perform a dss (same goes for esil and visual/graph");
3293  SETI("dbg.hwbp", 0, "Set HW or SW breakpoints");
3294  SETCB("dbg.unlibs", "", &cb_dbg_unlibs, "If set stop when unloading matching libname");
3295  SETCB("dbg.verbose", "false", &cb_dbg_verbose, "Verbose debug output");
3296  SETBPREF("dbg.slow", "false", "Show stack and regs in visual mode in a slow but verbose mode");
3297  SETBPREF("dbg.funcarg", "false", "Display arguments to function call in visual mode");
3298 
3299  SETCB("dbg.bpinmaps", "true", &cb_dbg_bpinmaps, "Activate breakpoints only if they are inside a valid map");
3300  SETCB("dbg.forks", "false", &cb_dbg_forks, "Stop execution if fork() is done (see dbg.threads)");
3301 #if __WINDOWS__
3302  n = NODECB("dbg.btalgo", "default", &cb_dbg_btalgo);
3303 #else
3304  n = NODECB("dbg.btalgo", "fuzzy", &cb_dbg_btalgo);
3305 #endif
3306  SETDESC(n, "Select backtrace algorithm");
3307  SETOPTIONS(n, "default", "fuzzy", "analysis", "trace", NULL);
3308  SETCB("dbg.threads", "false", &cb_stopthreads, "Stop all threads when debugger breaks (see dbg.forks)");
3309  SETCB("dbg.clone", "false", &cb_dbg_clone, "Stop execution if new thread is created");
3310  SETCB("dbg.aftersyscall", "true", &cb_dbg_aftersc, "Stop execution before the syscall is executed (see dcs)");
3311  SETCB("dbg.profile", "", &cb_runprofile, "Path to RzRunProfile file");
3312  SETCB("dbg.args", "", &cb_dbg_args, "Set the args of the program to debug");
3313  SETCB("dbg.follow.child", "false", &cb_dbg_follow_child, "Continue tracing the child process on fork. By default the parent process is traced");
3314  SETCB("dbg.trace_continue", "true", &cb_dbg_trace_continue, "Trace every instruction between the initial PC position and the PC position at the end of continue's execution");
3315  SETCB("dbg.create_new_console", "true", &cb_dbg_create_new_console, "Create a new console window for the debugee on debug start");
3316  /* debug */
3317  SETBPREF("dbg.status", "false", "Set cmd.prompt to '.dr*' or '.dr*;drd;sr PC;pi 1;shu'");
3318 #if DEBUGGER
3319  SETCB("dbg.backend", "native", &cb_dbgbackend, "Select the debugger backend");
3320 #else
3321  SETCB("dbg.backend", "esil", &cb_dbgbackend, "Select the debugger backend");
3322 #endif
3323  n = NODECB("dbg.bep", "loader", &cb_dbgbep);
3324  SETDESC(n, "Break on entrypoint");
3325  SETOPTIONS(n, "loader", "entry", "constructor", "main", NULL);
3326  if (core->cons->rows > 30) { // HACKY
3327  rz_config_set_i(cfg, "dbg.follow", 64);
3328  } else {
3329  rz_config_set_i(cfg, "dbg.follow", 32);
3330  }
3331  rz_config_desc(cfg, "dbg.follow", "Follow program counter when pc > core->offset + dbg.follow");
3332  SETBPREF("dbg.rebase", "true", "Rebase analysis/meta/comments/flags when reopening file in debugger");
3333  SETCB("dbg.swstep", "false", &cb_swstep, "Force use of software steps (code analysis+breakpoint)");
3334  SETBPREF("dbg.trace.inrange", "false", "While tracing, avoid following calls outside specified range");
3335  SETBPREF("dbg.trace.libs", "true", "Trace library code too");
3336  SETBPREF("dbg.exitkills", "true", "Kill process on exit");
3337  SETPREF("dbg.exe.path", "", "Path to binary being debugged");
3338  SETCB("dbg.execs", "false", &cb_dbg_execs, "Stop execution if new thread is created");
3339  SETICB("dbg.gdb.page_size", 4096, &cb_dbg_gdb_page_size, "Page size on gdb target (useful for QEMU)");
3340  SETICB("dbg.gdb.retries", 10, &cb_dbg_gdb_retries, "Number of retries before gdb packet read times out");
3341  SETCB("dbg.consbreak", "false", &cb_consbreak, "SIGINT handle for attached processes");
3342 
3344 
3345  SETBPREF("dbg.bpsysign", "false", "Ignore system breakpoints");
3346  SETICB("dbg.btdepth", 128, &cb_dbgbtdepth, "Depth of backtrace");
3347  SETCB("dbg.trace", "false", &cb_trace, "Trace program execution (see asm.trace)");
3348  SETICB("dbg.trace.tag", 0, &cb_tracetag, "Trace tag");
3349 
3350  /* cmd */
3351  SETICB("cmd.depth", 10, &cb_cmddepth, "Maximum command depth");
3352  SETPREF("cmd.bp", "", "Run when a breakpoint is hit");
3353  SETPREF("cmd.onsyscall", "", "Run when a syscall is hit");
3354  SETICB("cmd.hitinfo", 1, &cb_debug_hitinfo, "Show info when a tracepoint/breakpoint is hit");
3355  SETPREF("cmd.stack", "", "Command to display the stack in visual debug mode");
3356  SETPREF("cmd.cprompt", "", "Column visual prompt commands");
3357  SETPREF("cmd.gprompt", "", "Graph visual prompt commands");
3358  SETPREF("cmd.hit", "", "Run when a search hit is found");
3359  SETPREF("cmd.open", "", "Run when file is opened");
3360  SETPREF("cmd.load", "", "Run when binary is loaded");
3361  SETPREF("cmd.prompt", "", "Prompt commands");
3362  SETCB("cmd.repeat", "false", &cb_cmdrepeat, "Empty command an alias for '..' (repeat last command)");
3363  SETPREF("cmd.fcn.new", "", "Run when new function is analyzed");
3364  SETPREF("cmd.fcn.delete", "", "Run when a function is deleted");
3365  SETPREF("cmd.fcn.rename", "", "Run when a function is renamed");
3366  SETPREF("cmd.visual", "", "Replace current print mode");
3367  SETPREF("cmd.vprompt", "", "Visual prompt commands");
3368 
3369  SETCB("cmd.esil.step", "", &cb_cmd_esil_step, "Command to run before performing a step in the emulator");
3370  SETCB("cmd.esil.stepout", "", &cb_cmd_esil_step_out, "Command to run after performing a step in the emulator");
3371  SETCB("cmd.esil.mdev", "", &cb_cmd_esil_mdev, "Command to run when memory device address is accessed");
3372  SETCB("cmd.esil.intr", "", &cb_cmd_esil_intr, "Command to run when an esil interrupt happens");
3373  SETCB("cmd.esil.trap", "", &cb_cmd_esil_trap, "Command to run when an esil trap happens");
3374  SETCB("cmd.esil.todo", "", &cb_cmd_esil_todo, "Command to run when the esil instruction contains TODO");
3375  SETCB("cmd.esil.ioer", "", &cb_cmd_esil_ioer, "Command to run when esil fails to IO (invalid read/write)");
3376 
3377  /* hexdump */
3378  SETCB("hex.header", "true", &cb_hex_header, "Show header in hexdump");
3379  SETCB("hex.bytes", "true", &cb_hex_bytes, "Show bytes column in hexdump");
3380  SETCB("hex.ascii", "true", &cb_hex_ascii, "Show ascii column in hexdump");
3381  SETCB("hex.hdroff", "false", &cb_hex_hdroff, "Show aligned 1 byte in header instead of delta nibble");
3382  SETCB("hex.style", "false", &cb_hex_style, "Improve the hexdump header style");
3383  SETCB("hex.pairs", "true", &cb_hex_pairs, "Show bytes paired in 'px' hexdump");
3384  SETCB("hex.align", "false", &cb_hex_align, "Align hexdump with flag + flagsize");
3385  SETCB("hex.section", "false", &cb_hex_section, "Show section name before the offset");
3386  SETCB("hex.compact", "false", &cb_hexcompact, "Show smallest 16 byte col hexdump (60 columns)");
3387  SETCB("cmd.hexcursor", "", &cb_cmd_hexcursor, "If set and cursor is enabled display given pf format string");
3388  SETI("hex.flagsz", 0, "If non zero, overrides the flag size in pxa");
3389  SETICB("hex.cols", 16, &cb_hexcols, "Number of columns in hexdump");
3390  SETI("hex.depth", 5, "Maximal level of recurrence while telescoping memory");
3391  SETBPREF("hex.onechar", "false", "Number of columns in hexdump");
3392  SETICB("hex.stride", 0, &cb_hexstride, "Line stride in hexdump (default is 0)");
3393  SETCB("hex.comments", "true", &cb_hexcomments, "Show comments in 'px' hexdump");
3394 
3395  /* http */
3396  SETBPREF("http.log", "true", "Show HTTP requests processed");
3397  SETBPREF("http.colon", "false", "Only accept the : command");
3398  SETPREF("http.logfile", "", "Specify a log file instead of stderr for http requests");
3399  SETBPREF("http.cors", "false", "Enable CORS");
3400  SETPREF("http.referer", "", "CSFR protection if set");
3401  SETBPREF("http.dirlist", "false", "Enable directory listing");
3402  SETPREF("http.allow", "", "Only accept clients from the comma separated IP list");
3403 #if __WINDOWS__
3404  rz_config_set(cfg, "http.browser", "start");
3405 #else
3406  if (rz_file_exists("/usr/bin/openURL")) { // iOS ericautils
3407  rz_config_set(cfg, "http.browser", "/usr/bin/openURL");
3408  } else if (rz_file_exists("/system/bin/toolbox")) {
3409  rz_config_set(cfg, "http.browser",
3410  "LD_LIBRARY_PATH=/system/lib am start -a android.intent.action.VIEW -d");
3411  } else if (rz_file_exists("/usr/bin/xdg-open")) {
3412  rz_config_set(cfg, "http.browser", "xdg-open");
3413  } else if (rz_file_exists("/usr/bin/open")) {
3414  rz_config_set(cfg, "http.browser", "open");
3415  } else {
3416  rz_config_set(cfg, "http.browser", "firefox");
3417  }
3418  rz_config_desc(cfg, "http.browser", "Command to open HTTP URLs");
3419 #endif
3420  SETI("http.maxsize", 0, "Maximum file size for upload");
3421  SETPREF("http.index", "index.html", "Main html file to check in directory");
3422  SETPREF("http.bind", "localhost", "Server address");
3423  char *wwwroot_dir = rz_path_home_prefix(RZ_WWWROOT);
3424  SETPREF("http.homeroot", wwwroot_dir, "http home root directory");
3425  free(wwwroot_dir);
3426 #if __ANDROID__
3427  SETPREF("http.root", "/data/data/org.rizin.rizininstaller/www", "http root directory");
3428 #else
3429  char *wwwroot = rz_path_system(RZ_WWWROOT);
3430  SETPREF("http.root", wwwroot, "http root directory");
3431  free(wwwroot);
3432 #endif
3433  SETPREF("http.port", "9090", "HTTP server port");
3434  SETPREF("http.maxport", "9999", "Last HTTP server port");
3435  SETI("http.timeout", 3, "Disconnect clients after N seconds of inactivity");
3436  SETI("http.dietime", 0, "Kill server after N seconds with no client");
3437  SETBPREF("http.verbose", "false", "Output server logs to stdout");
3438  SETBPREF("http.upget", "false", "/up/ answers GET requests, in addition to POST");
3439  SETBPREF("http.upload", "false", "Enable file uploads to /up/<filename>");
3440  SETPREF("http.uri", "", "Address of HTTP proxy");
3441  SETBPREF("http.auth", "false", "Enable/Disable HTTP Authentification");
3442  p = rz_sys_getenv("RZ_HTTP_AUTHFILE");
3443  SETPREF("http.authfile", p ? p : "", "HTTP Authentification user file");
3444  tmpdir = rz_file_tmpdir();
3445  rz_config_set(cfg, "http.uproot", tmpdir);
3446  free(tmpdir);
3447  rz_config_desc(cfg, "http.uproot", "Path where files are uploaded");
3448 
3449  /* tcp */
3450  SETBPREF("tcp.islocal", "false", "Bind a loopback for tcp command server");
3451 
3452  /* graph */
3453  SETBPREF("graph.aeab", "false", "Show aeab info on each basic block instead of disasm");
3454  SETBPREF("graph.trace", "false", "Fold all non-traced basic blocks");
3455  SETBPREF("graph.dummy", "true", "Create dummy nodes in the graph for better layout (20% slower)");
3456  SETBPREF("graph.few", "false", "Show few basic blocks in the graph");
3457  SETBPREF("graph.comments", "true", "Show disasm comments in graph");
3458  SETBPREF("graph.cmtright", "false", "Show comments at right");
3459  SETCB("graph.gv.format", "gif", &cb_graphformat, "Graph image extension when using 'w' format (png, jpg, pdf, ps, svg, json)");
3460  SETBPREF("graph.refs", "false", "Graph references in callgraphs (.agc*;aggi)");
3461  SETBPREF("graph.json.usenames", "true", "Use names instead of addresses in Global Call Graph (agCj)");
3462  SETI("graph.edges", 2, "0=no edges, 1=simple edges, 2=avoid collisions");
3463  SETI("graph.layout", 0, "Graph layout (0=vertical, 1=horizontal)");
3464  SETI("graph.linemode", 1, "Graph edges (0=diagonal, 1=square)");
3465  SETPREF("graph.font", "Courier", "Font for dot graphs");
3466  SETBPREF("graph.offset", "false", "Show offsets in graphs");
3467  SETBPREF("graph.bytes", "false", "Show opcode bytes in graphs");
3468  SETI("graph.from", UT64_MAX, "Lower bound address when drawing global graphs");
3469  SETI("graph.to", UT64_MAX, "Upper bound address when drawing global graphs");
3470  SETI("graph.scroll", 5, "Scroll speed in ascii-art graph");
3471  SETBPREF("graph.invscroll", "false", "Invert scroll direction in ascii-art graph");
3472  SETPREF("graph.title", "", "Title of the graph");
3473  SETBPREF("graph.body", "true", "Show body of the nodes in the graph");
3474  SETBPREF("graph.ntitles", "true", "Display title of node");
3475  SETPREF("graph.gv.node", "", "Graphviz node style. (color=gray, style=filled shape=box)");
3476  SETPREF("graph.gv.edge", "", "Graphviz edge style. (arrowhead=\"vee\")");
3477  SETPREF("graph.gv.spline", "", "Graphviz spline style. (splines=\"ortho\")");
3478  SETPREF("graph.gv.graph", "", "Graphviz global style attributes. (bgcolor=white)");
3479  SETPREF("graph.gv.current", "false", "Highlight the current node in graphviz graph.");
3480  SETBPREF("graph.nodejmps", "true", "Enables shortcuts for every node.");
3481  SETBPREF("graph.hints", "true", "Show true (t) and false (f) hints for conditional edges in graph");
3482  SETCB("graph.dotted", "false", &cb_dotted, "Dotted lines for conditional jumps in graph");
3483 
3484  /* hud */
3485  SETPREF("hud.path", "", "Set a custom path for the HUD file");
3486 
3487  SETCB("esil.exectrap", "false", &cb_exectrap, "trap when executing code in non-executable memory");
3488  SETCB("esil.iotrap", "true", &cb_iotrap, "invalid read or writes produce a trap exception");
3489  SETBPREF("esil.romem", "false", "Set memory as read-only for ESIL");
3490  SETBPREF("esil.stats", "false", "Statistics from ESIL emulation stored in sdb");
3491  SETBPREF("esil.nonull", "false", "Prevent memory read, memory write at null pointer");
3492  SETCB("esil.mdev.range", "", &cb_mdevrange, "Specify a range of memory to be handled by cmd.esil.mdev");
3493 
3494  /* scr */
3495 #if __EMSCRIPTEN__
3496  rz_config_set_cb(cfg, "scr.fgets", "true", cb_scrfgets);
3497 #else
3498  rz_config_set_cb(cfg, "scr.fgets", "false", cb_scrfgets);
3499 #endif
3500  rz_config_desc(cfg, "scr.fgets", "Use fgets() instead of dietline for prompt input");
3501  SETCB("scr.echo", "false", &cb_screcho, "Show rcons output in realtime to stderr and buffer");
3502  SETICB("scr.linesleep", 0, &cb_scrlinesleep, "Flush sleeping some ms in every line");
3503  SETICB("scr.maxtab", 4096, &cb_completion_maxtab, "Change max number of auto completion suggestions");
3504  SETICB("scr.pagesize", 1, &cb_scrpagesize, "Flush in pages when scr.linesleep is != 0");
3505  SETCB("scr.flush", "false", &cb_scrflush, "Force flush to console in realtime (breaks scripting)");
3506  SETBPREF("scr.slow", "true", "Do slow stuff on visual mode like RzFlag.get_at(true)");
3507  SETCB("scr.prompt.popup", "false", &cb_scr_prompt_popup, "Show widget dropdown for autocomplete");
3508 #if __WINDOWS__
3509  SETICB("scr.vtmode", rz_cons_singleton()->vtmode,
3510  &scr_vtmode, "Use VT sequences on Windows (0: Disable, 1: Output, 2: Input & Output)");
3511 #endif
3512 #if __ANDROID__
3513  SETBPREF("scr.responsive", "true", "Auto-adjust Visual depending on screen (e.g. unset asm.bytes)");
3514  SETI("scr.wheel.speed", 1, "Mouse wheel speed");
3515 #else
3516  SETBPREF("scr.responsive", "false", "Auto-adjust Visual depending on screen (e.g. unset asm.bytes)");
3517  SETI("scr.wheel.speed", 4, "Mouse wheel speed");
3518 #endif
3519  SETBPREF("scr.wheel.nkey", "false", "Use sn/sp and scr.nkey on wheel instead of scroll");
3520  // RENAME TO scr.mouse
3521  SETBPREF("scr.wheel", "true", "Mouse wheel in Visual; temporaryly disable/reenable by right click/Enter)");
3522  SETPREF("scr.layout", "", "Name of the selected layout");
3523  // DEPRECATED: USES hex.cols now SETI ("scr.colpos", 80, "Column position of cmd.cprompt in visual");
3524  SETCB("scr.breakword", "", &cb_scrbreakword, "Emulate console break (^C) when a word is printed (useful for pD)");
3525  SETCB("scr.breaklines", "false", &cb_breaklines, "Break lines in Visual instead of truncating them");
3526  SETCB("scr.gadgets", "true", &cb_scr_gadgets, "Run pg in prompt, visual and panels");
3527  SETBPREF("scr.panelborder", "false", "Specify panels border active area (0 by default)");
3528  SETICB("scr.columns", 0, &cb_scrcolumns, "Force console column count (width)");
3529  SETBPREF("scr.dumpcols", "false", "Prefer pC commands before p ones");
3530  SETCB("scr.rows", "0", &cb_scrrows, "Force console row count (height) ");
3531  SETICB("scr.rows", 0, &cb_rows, "Force console row count (height) (duplicate?)");
3532  SETICB("scr.fix.rows", 0, &cb_fixrows, "Workaround for Linux TTY");
3533  SETICB("scr.fix.columns", 0, &cb_fixcolumns, "Workaround for Prompt iOS SSH client");
3534  SETCB("scr.highlight", "", &cb_scrhighlight, "Highlight that word at RzCons level");
3535  SETCB("scr.interactive", "true", &cb_scrint, "Start in interactive mode");
3536  SETCB("scr.bgfill", "false", &cb_scr_bgfill, "Fill background for ascii art when possible");
3537  SETI("scr.feedback", 1, "Set visual feedback level (1=arrow on jump, 2=every key (useful for videos))");
3538  SETCB("scr.html", "false", &cb_scrhtml, "Disassembly uses HTML syntax");
3539  n = NODECB("scr.nkey", "flag", &cb_scrnkey);
3540  SETDESC(n, "Select visual seek mode (affects n/N visual commands)");
3541  SETOPTIONS(n, "fun", "hit", "flag", NULL);
3542  SETCB("scr.pager", "", &cb_pager, "System program (or '..') to use when output exceeds screen boundaries");
3543  SETI("scr.scrollbar", 0, "Show flagzone (fz) scrollbar in visual mode (0=no,1=right,2=top,3=bottom)");
3544  SETBPREF("scr.randpal", "false", "Random color palete or just get the next one from 'eco'");
3545  SETCB("scr.highlight.grep", "false", &cb_scr_color_grep_highlight, "Highlight (INVERT) the grepped words");
3546  SETBPREF("scr.prompt.file", "false", "Show user prompt file (used by rizin -q)");
3547  SETBPREF("scr.prompt.flag", "false", "Show flag name in the prompt");
3548  SETBPREF("scr.prompt.flag.only", "false", "Show the flag name only in the prompt");
3549  SETBPREF("scr.prompt.sect", "false", "Show section name in the prompt");
3550  SETCB("scr.hist.block", "true", &cb_scr_histblock, "Use blocks for histogram");
3551  SETCB("scr.prompt", "true", &cb_scrprompt, "Show user prompt (used by rizin -q)");
3552  SETCB("scr.tee", "", &cb_teefile, "Pipe output to file of this name");
3553  SETPREF("scr.seek", "", "Seek to the specified address on startup");
3554  SETICB("scr.color", (core->print->flags & RZ_PRINT_FLAGS_COLOR) ? COLOR_MODE_16 : COLOR_MODE_DISABLED, &cb_color, "Enable colors (0: none, 1: ansi, 2: 256 colors, 3: truecolor)");
3556  SETCB("scr.color.grep", "false", &cb_scr_color_grep, "Enable colors when using ~grep");
3557  SETBPREF("scr.color.pipe", "false", "Enable colors when using pipes");
3558  SETBPREF("scr.color.ops", "true", "Colorize numbers and registers in opcodes");
3559  SETBPREF("scr.color.args", "true", "Colorize arguments and variables of functions");
3560  SETBPREF("scr.color.bytes", "true", "Colorize bytes that represent the opcodes of the instruction");
3561  SETCB("scr.null", "false", &cb_scrnull, "Show no output");
3562  SETCB("scr.utf8", rz_str_bool(rz_cons_is_utf8()), &cb_utf8, "Show UTF-8 characters instead of ANSI");
3563  SETCB("scr.utf8.curvy", "false", &cb_utf8_curvy, "Show curved UTF-8 corners (requires scr.utf8)");
3564  SETBPREF("scr.histsave", "true", "Always save history on exit");
3565  n = NODECB("scr.strconv", "asciiesc", &cb_scrstrconv);
3566  SETDESC(n, "Convert string before display");
3567  SETOPTIONS(n, "asciiesc", "asciidot", NULL);
3568  SETBPREF("scr.confirmquit", "false", "Confirm on quit");
3569  SETICB("scr.visual.mode", RZ_CORE_VISUAL_MODE_PX, &cb_visual_mode, "Visual mode (0: hexdump, 1: disassembly, 2: debug, 3: color blocks, 4: strings)");
3570 
3571  /* str */
3572  SETCB("str.escbslash", "false", &cb_str_escbslash, "Escape the backslash");
3573  SETCB("str.search.check_ascii_freq", "true", &cb_strsearch_check_ascii_freq,
3574  "Perform ASCII frequency analysis when looking for false positives during string search");
3575 
3576  /* search */
3577  SETCB("search.contiguous", "true", &cb_contiguous, "Accept contiguous/adjacent search hits");
3578  SETICB("search.align", 0, &cb_searchalign, "Only catch aligned search hits");
3579  SETI("search.chunk", 0, "Chunk size for /+ (default size is asm.bits/8");
3580  SETI("search.esilcombo", 8, "Stop search after N consecutive hits");
3581  SETI("search.distance", 0, "Search string distance");
3582  SETBPREF("search.flags", "true", "All search results are flagged, otherwise only printed");
3583  SETBPREF("search.overlap", "false", "Look for overlapped search hits");
3584  SETI("search.maxhits", 0, "Maximum number of hits (0: no limit)");
3585  SETI("search.from", -1, "Search start address");
3586  n = NODECB("search.in", "io.maps", &cb_searchin);
3587  SETDESC(n, "Specify search boundaries");
3588  SETOPTIONS(n, "raw", "block",
3589  "bin.section", "bin.sections", "bin.sections.rwx", "bin.sections.r", "bin.sections.rw", "bin.sections.rx", "bin.sections.wx", "bin.sections.x",
3590  "io.map", "io.maps", "io.maps.rwx", "io.maps.r", "io.maps.rw", "io.maps.rx", "io.maps.wx", "io.maps.x",
3591  "dbg.stack", "dbg.heap",
3592  "dbg.map", "dbg.maps", "dbg.maps.rwx", "dbg.maps.r", "dbg.maps.rw", "dbg.maps.rx", "dbg.maps.wx", "dbg.maps.x",
3593  "analysis.fcn", "analysis.bb",
3594  NULL);
3595  SETICB("search.kwidx", 0, &cb_search_kwidx, "Store last search index count");
3596  SETPREF("search.prefix", "hit", "Prefix name in search hits label");
3597  SETBPREF("search.show", "true", "Show search results");
3598  SETI("search.to", -1, "Search end address");
3599 
3600  /* rop */
3601  SETI("rop.len", 5, "Maximum ROP gadget length");
3602  SETBPREF("rop.sdb", "false", "Cache results in sdb (experimental)");
3603  SETBPREF("rop.db", "true", "Categorize rop gadgets in sdb");
3604  SETBPREF("rop.subchains", "false", "Display every length gadget from rop.len=X to 2 in /Rl");
3605  SETBPREF("rop.conditional", "false", "Include conditional jump, calls and returns in ropsearch");
3606  SETBPREF("rop.comments", "false", "Display comments in rop search output");
3607 
3608  /* io */
3609  SETCB("io.cache", "false", &cb_io_cache, "Change both of io.cache.{read,write}");
3610  SETCB("io.cache.auto", "false", &cb_io_cache_mode, "Automatic cache all reads in the IO backend");
3611  SETCB("io.cache.read", "false", &cb_io_cache_read, "Enable read cache for vaddr (or paddr when io.va=0)");
3612  SETCB("io.cache.write", "false", &cb_io_cache_write, "Enable write cache for vaddr (or paddr when io.va=0)");
3613  SETCB("io.pcache", "false", &cb_iopcache, "io.cache for p-level");
3614  SETCB("io.pcache.write", "false", &cb_iopcachewrite, "Enable write-cache");
3615  SETCB("io.pcache.read", "false", &cb_iopcacheread, "Enable read-cache");
3616  SETCB("io.ff", "true", &cb_ioff, "Fill invalid buffers with 0xff instead of returning error");
3617  SETBPREF("io.exec", "true", "See !!rizin -h~-x");
3618  SETICB("io.0xff", 0xff, &cb_io_oxff, "Use this value instead of 0xff to fill unallocated areas");
3619  SETCB("io.aslr", "false", &cb_ioaslr, "Disable ASLR for spawn and such");
3620  SETCB("io.va", "true", &cb_iova, "Use virtual address layout");
3621  SETCB("io.pava", "false", &cb_io_pava, "Use EXPERIMENTAL paddr -> vaddr address mode");
3622  SETCB("io.autofd", "true", &cb_ioautofd, "Change fd when opening a new file");
3623  SETCB("io.unalloc", "false", &cb_io_unalloc, "Check each byte if it's allocated");
3624  SETCB("io.unalloc.ch", ".", &cb_io_unalloc_ch, "Char to display if byte is unallocated");
3625 
3626  /* file */
3627  SETBPREF("file.info", "true", "RzBin info loaded");
3628  SETPREF("file.offset", "", "Offset where the file will be mapped at");
3629  SETCB("file.path", "", &cb_filepath, "Path of current file");
3630  SETPREF("file.lastpath", "", "Path of current file");
3631  SETPREF("file.type", "", "Type of current file");
3632  SETI("file.loadalign", 1024, "Alignment of load addresses");
3633  SETI("file.openmany", 1, "Maximum number of files opened at once");
3634  /* magic */
3635  SETI("magic.depth", 100, "Recursivity depth in magic description strings");
3636 
3637  /* rap */
3638  SETBPREF("rap.loop", "true", "Run rap as a forever-listening daemon (=:9090)");
3639 
3640  /* basefind */
3641  SETB("basefind.progress", false, "Basefind threads progress (true: enable, false: disable)");
3642  SETI("basefind.search.start", RZ_BASEFIND_BASE_MIN_ADDRESS, "Basefind start search address");
3643  SETI("basefind.search.end", RZ_BASEFIND_BASE_MAX_ADDRESS, "Basefind end search address");
3644  SETI("basefind.alignment", RZ_BASEFIND_BASE_ALIGNMENT, "Basefind alignment in bytes");
3645  SETI("basefind.min.score", RZ_BASEFIND_SCORE_MIN_VALUE, "Basefind min score value to consider it valid");
3646  SETI("basefind.min.string", RZ_BASEFIND_STRING_MIN_LENGTH, "Basefind min string size to find to consider it valid");
3647  SETI("basefind.max.threads", RZ_THREAD_POOL_ALL_CORES, "Basefind max threads number (when 0 uses all available cores)");
3648 
3649  /* nkeys */
3650  SETPREF("key.s", "", "override step into action");
3651  SETPREF("key.S", "", "override step over action");
3652  for (i = 1; i < 13; i++) {
3653  snprintf(buf, sizeof(buf), "key.f%d", i);
3654  snprintf(buf + 10, sizeof(buf) - 10,
3655  "Run this when F%d key is pressed in visual mode", i);
3656  switch (i) {
3657  default: p = ""; break;
3658  }
3659  rz_config_set(cfg, buf, p);
3660  rz_config_desc(cfg, buf, buf + 10);
3661  }
3662 
3663  /* zoom */
3664  SETCB("zoom.byte", "h", &cb_zoombyte, "Zoom callback to calculate each byte (See pz? for help)");
3665  SETI("zoom.from", 0, "Zoom start address");
3666  SETI("zoom.maxsz", 512, "Zoom max size of block");
3667  SETI("zoom.to", 0, "Zoom end address");
3668  n = NODECB("zoom.in", "io.map", &cb_searchin);
3669  SETDESC(n, "Specify boundaries for zoom");
3670  SETOPTIONS(n, "raw", "block",
3671  "bin.section", "bin.sections", "bin.sections.rwx", "bin.sections.r", "bin.sections.rw", "bin.sections.rx", "bin.sections.wx", "bin.sections.x",
3672  "io.map", "io.maps", "io.maps.rwx", "io.maps.r", "io.maps.rw", "io.maps.rx", "io.maps.wx", "io.maps.x",
3673  "dbg.stack", "dbg.heap",
3674  "dbg.map", "dbg.maps", "dbg.maps.rwx", "dbg.maps.r", "dbg.maps.rw", "dbg.maps.rx", "dbg.maps.wx", "dbg.maps.x",
3675  "analysis.fcn", "analysis.bb",
3676  NULL);
3677 
3678  /* RzIL config */
3679  SETB("rzil.step.events.read", false, "enables/disables printing aezse read event");
3680  SETB("rzil.step.events.write", true, "enables/disables printing aezse write event");
3681 
3682  /* FLIRT config */
3683  SETBPREF("flirt.sig.library", RZ_FLIRT_LIBRARY_NAME_DFL, "FLIRT library name for sig format");
3684  SETI("flirt.sig.version", 10, "FLIRT version for sig format");
3685  n = NODECB("flirt.sig.file", "all", &cb_flirt);
3686  SETDESC(n, "FLIRT file list (comma separated) for sig format");
3687  SETOPTIONS(n, "msdos", "win", "os2", "netware", "unix", "other", "all", "none", NULL);
3688  n = NODECB("flirt.sig.os", "all", &cb_flirt);
3689  SETDESC(n, "FLIRT operating system list (comma separated) for sig format");
3690  SETOPTIONS(n,
3691  "aixar", "aout", "ar", "bin", "coff", "dos:com", "dos:com:old", "dos:exe", "dos:exe:old",
3692  "dosdrv", "elf", "intelhex", "le", "loader", "lx", "moshex", "ne", "nlm", "omf", "omflib",
3693  "pe", "pilot", "srec", "w32run", "zip", "all", "none", NULL);
3694  SETB("flirt.sig.deflate", false, "enables/disables FLIRT zlib compression when creating a signature file (available only for .sig files)");
3695  SETI("flirt.node.optimize", RZ_FLIRT_NODE_OPTIMIZE_MAX, "FLIRT optimization option when creating a signature file (none: 0, normal: 1, smallest: 2)");
3696  SETPREF("flirt.sigdb.path", "", "Additional user defined rizin sigdb location to load on the filesystem.");
3697  SETB("flirt.sigdb.load.system", true, "Load signatures from the system path");
3698  SETB("flirt.sigdb.load.home", true, "Load signatures from the home path");
3699 
3700  rz_config_lock(cfg, true);
3701  return true;
3702 }
RZ_API const char * rz_analysis_syscc_default(RzAnalysis *analysis)
Definition: cc.c:210
RZ_API const char * rz_analysis_cc_default(RzAnalysis *analysis)
Definition: cc.c:200
static bool cb_ioaslr(void *user, void *data)
Definition: cconfig.c:1949
static bool cb_cmd_esil_step_out(void *user, void *data)
Definition: cconfig.c:1849
static bool cb_analysis_afterjmp(void *user, void *data)
Definition: cconfig.c:161
static bool cb_analysissyscc(RzCore *core, RzConfigNode *node)
Definition: cconfig.c:2578
static bool cb_visual_mode(void *user, void *data)
Definition: cconfig.c:2371
static bool cb_asmsyntax(void *user, void *data)
Definition: cconfig.c:1042
static bool cb_hex_section(void *user, void *data)
Definition: cconfig.c:1500
static bool cb_io_unalloc_ch(void *user, void *data)
Definition: cconfig.c:1533
static bool cb_analysis_nopskip(void *user, void *data)
Definition: cconfig.c:240
static bool cb_analysis_jmptbl(void *user, void *data)
Definition: cconfig.c:2632
static bool cb_analysis_cpp_abi(void *user, void *data)
Definition: cconfig.c:2730
static bool cb_scrfgets(void *user, void *data)
Definition: cconfig.c:2088
static bool cb_dotted(void *user, void *data)
Definition: cconfig.c:2381
static bool cb_analysis_ijmp(void *user, void *data)
Definition: cconfig.c:304
static bool cb_strsearch_check_ascii_freq(void *user, void *data)
Definition: cconfig.c:1149
static bool cb_cmd_esil_intr(void *user, void *data)
Definition: cconfig.c:1816
static bool cb_dbg_bpinmaps(void *user, void *data)
Definition: cconfig.c:1286
static bool cb_analysis_armthumb(void *user, void *data)
Definition: cconfig.c:140
static bool cb_cfg_fortunes(void *user, void *data)
Definition: cconfig.c:1163
static bool cb_trace(void *user, void *data)
Definition: cconfig.c:2342
static bool cb_asmfeatures(void *user, void *data)
Definition: cconfig.c:722
static bool cb_mdevrange(void *user, void *data)
Definition: cconfig.c:1827
static bool cb_utf8(void *user, void *data)
Definition: cconfig.c:2356
static bool cb_binverbose(void *user, void *data)
Definition: cconfig.c:2409
static bool cb_asmparser(void *user, void *data)
Definition: cconfig.c:874
static bool cb_scrlinesleep(void *user, void *data)
Definition: cconfig.c:2155
static bool cb_scrbreakword(void *user, void *data)
Definition: cconfig.c:2068
static bool cb_hex_pairs(void *user, void *data)
Definition: cconfig.c:1493
static bool cb_dbg_gdb_retries(void *user, void *data)
Definition: cconfig.c:1317
static bool cb_log_config_traplevel(void *coreptr, void *nodeptr)
Definition: cconfig.c:2772
static bool cb_analysis_jmptblmaxoffset(void *user, void *data)
Definition: cconfig.c:2646
static bool cb_dbgbackend(void *user, void *data)
Definition: cconfig.c:1411
static bool cb_analysis_roregs(RzCore *core, RzConfigNode *node)
Definition: cconfig.c:2570
static bool cb_cmd_esil_trap(void *user, void *data)
Definition: cconfig.c:1871
static bool cb_utf8_curvy(void *user, void *data)
Definition: cconfig.c:2364
static bool cb_hex_hdroff(void *user, void *data)
Definition: cconfig.c:1584
static bool cb_scrpagesize(void *user, void *data)
Definition: cconfig.c:2161
static bool cb_scrhtml(void *user, void *data)
Definition: cconfig.c:2098
static bool cb_screcho(void *user, void *data)
Definition: cconfig.c:2149
static bool cb_cfgdatefmt(void *user, void *data)
Definition: cconfig.c:1078
static bool cb_analysis_ignbithints(void *user, void *data)
Definition: cconfig.c:212
static bool cb_analysis_graphdepth(void *user, void *data)
Definition: cconfig.c:154
static bool cb_iopcache(void *user, void *data)
Definition: cconfig.c:1613
static bool cb_asmpseudo(void *user, void *data)
Definition: cconfig.c:366
static bool cb_cmd_esil_mdev(void *user, void *data)
Definition: cconfig.c:1860
static bool cb_contiguous(void *user, void *data)
Definition: cconfig.c:2273
static bool cb_scr_bgfill(void *user, void *data)
Definition: cconfig.c:2224
static bool cb_analysis_strings(void *user, void *data)
Definition: cconfig.c:203
static bool cb_analysis_jmpretpoline(void *user, void *data)
Definition: cconfig.c:127
static bool cb_maxname(void *user, void *data)
Definition: cconfig.c:995
static bool cb_strfilter(void *user, void *data)
Definition: cconfig.c:1011
static bool cb_debase64(void *user, void *data)
Definition: cconfig.c:2416
static bool cb_binminstr(void *user, void *data)
Definition: cconfig.c:2509
static bool cb_iopcacheread(void *user, void *data)
Definition: cconfig.c:1631
static bool cb_scr_gadgets(void *user, void *data)
Definition: cconfig.c:2061
static bool cb_scrint(void *user, void *data)
Definition: cconfig.c:2236
static bool cb_scrstrconv(void *user, void *data)
Definition: cconfig.c:2173
static bool cb_rows(void *user, void *data)
Definition: cconfig.c:1469
static bool cb_consbreak(void *user, void *data)
Definition: cconfig.c:2329
static bool cb_hex_style(void *user, void *data)
Definition: cconfig.c:1573
static bool cb_scrrainbow(void *user, void *data)
Definition: cconfig.c:352
static bool cb_analysis_nonull(void *user, void *data)
Definition: cconfig.c:196
static bool cb_segoff(void *user, void *data)
Definition: cconfig.c:2288
static bool cb_binmaxstr(void *user, void *data)
Definition: cconfig.c:2491
static bool cb_asmlineswidth(void *user, void *data)
Definition: cconfig.c:780
static bool cb_breaklines(void *user, void *data)
Definition: cconfig.c:2055
static bool cb_runprofile(void *user, void *data)
Definition: cconfig.c:1388
static bool cb_flag_realnames(void *user, void *data)
Definition: cconfig.c:715
static bool cb_analysis_jmpref(void *user, void *data)
Definition: cconfig.c:2660
static bool cb_hex_header(void *user, void *data)
Definition: cconfig.c:1540
static bool cb_asmsubvarmin(void *user, void *data)
Definition: cconfig.c:311
static bool cb_emustr(void *user, void *data)
Definition: cconfig.c:787
static bool cb_cmddepth(void *user, void *data)
Definition: cconfig.c:1881
static bool cb_asm_pcalign(void *user, void *data)
Definition: cconfig.c:826
static bool cb_search_kwidx(void *user, void *data)
Definition: cconfig.c:1903
static bool cb_dbgbep(void *user, void *data)
Definition: cconfig.c:1249
static bool cb_teefile(void *user, void *data)
Definition: cconfig.c:2336
static bool cb_dirtmp(void *user, void *data)
Definition: cconfig.c:1127
static bool cb_flirt(void *user, void *data)
Definition: cconfig.c:2820
static bool cb_decoff(void *user, void *data)
Definition: cconfig.c:1237
static bool cb_dbg_unlibs(void *user, void *data)
Definition: cconfig.c:1278
static bool cb_log_config_level(void *coreptr, void *nodeptr)
Definition: cconfig.c:2766
static bool cb_analysis_limits(void *user, RzConfigNode *node)
Definition: cconfig.c:2614
static bool cb_asm_invhex(void *user, void *data)
Definition: cconfig.c:819
static bool cb_malloc(void *user, void *data)
Definition: cconfig.c:2752
static bool cb_scr_prompt_mode(void *user, void *data)
Definition: cconfig.c:338
static bool cb_dirhome(void *user, void *data)
Definition: cconfig.c:1119
static bool cb_asm_immhash(void *user, void *data)
Definition: cconfig.c:812
static bool cb_tracetag(void *user, void *data)
Definition: cconfig.c:2349
static bool cb_log_config_colors(void *coreptr, void *nodeptr)
Definition: cconfig.c:2799
static bool cb_analysis_loads(void *user, void *data)
Definition: cconfig.c:2674
static bool cb_dbg_btalgo(void *user, void *data)
Definition: cconfig.c:1258
static bool cb_asmassembler(void *user, void *data)
Definition: cconfig.c:385
static bool cb_asmcpu(void *user, void *data)
Definition: cconfig.c:417
static bool cb_usextr(void *user, void *data)
Definition: cconfig.c:958
static bool cb_hexcompact(void *user, void *data)
Definition: cconfig.c:1482
static bool cb_fixrows(void *user, void *data)
Definition: cconfig.c:1457
static bool cb_analysis_vars_stackname(void *user, void *data)
Definition: cconfig.c:189
static bool cb_scrlast(void *user, void *data)
Definition: cconfig.c:325
static bool cb_gotolimit(void *user, void *data)
Definition: cconfig.c:1430
static bool cb_hexstride(void *user, void *data)
Definition: cconfig.c:1897
static bool cb_cmd_esil_step(void *user, void *data)
Definition: cconfig.c:1838
static int __dbg_swstep_getter(void *user, RzConfigNode *node)
Definition: cconfig.c:2564
static bool cb_cmd_esil_todo(void *user, void *data)
Definition: cconfig.c:1805
static bool cb_binstrenc(void *user, void *data)
Definition: cconfig.c:891
static bool cb_dbg_trace_continue(void *user, void *data)
Definition: cconfig.c:1371
static bool cb_searchalign(void *user, void *data)
Definition: cconfig.c:2280
static bool cb_analysis_bb_max_size(void *user, void *data)
Definition: cconfig.c:2723
static bool cb_binforce(void *user, void *data)
Definition: cconfig.c:1035
static bool cb_analysis_trycatch(void *user, void *data)
Definition: cconfig.c:2716
static bool cb_dbg_clone(void *user, void *data)
Definition: cconfig.c:1347
static bool cb_dbg_follow_child(void *user, void *data)
Definition: cconfig.c:1357
static bool cb_asmsubsec(void *user, void *data)
Definition: cconfig.c:373
static bool cb_scrflush(void *user, void *data)
Definition: cconfig.c:2167
static bool cb_dbg_forks(void *user, void *data)
Definition: cconfig.c:1293
static bool cb_dbg_gdb_page_size(void *user, void *data)
Definition: cconfig.c:1303
static bool cb_iotrap(void *user, void *data)
Definition: cconfig.c:2215
static bool cb_analysis_norevisit(void *user, void *data)
Definition: cconfig.c:233
static bool cb_cfg_fortunes_file(void *user, void *data)
Definition: cconfig.c:1174
static bool cb_analysis_cpu(void *user, void *data)
Definition: cconfig.c:285
static bool cb_dbg_aftersc(void *user, void *data)
Definition: cconfig.c:1378
static bool cb_esilstackdepth(void *user, void *data)
Definition: cconfig.c:1448
static bool cb_binmaxstrbuf(void *user, void *data)
Definition: cconfig.c:2470
static bool cb_io_cache(void *user, void *data)
Definition: cconfig.c:1943
static bool cb_asmplatform(void *user, void *data)
Definition: cconfig.c:757
static bool cb_cfgdebug(void *user, void *data)
Definition: cconfig.c:1092
static bool cb_analysis_depth(void *user, void *data)
Definition: cconfig.c:147
static bool cb_hex_align(void *user, void *data)
Definition: cconfig.c:1511
static bool cb_strpurge(void *user, void *data)
Definition: cconfig.c:965
static bool cb_str_escbslash(void *user, void *data)
Definition: cconfig.c:1142
static bool cb_analysis_aftertrap(void *user, void *data)
Definition: cconfig.c:168
static bool cb_dbg_verbose(void *user, void *data)
Definition: cconfig.c:2813
static bool cb_hexcols(void *user, void *data)
Definition: cconfig.c:1889
static bool cb_analysis_brokenrefs(void *user, void *data)
Definition: cconfig.c:2709
static bool cb_analysis_gp(RzCore *core, RzConfigNode *node)
Definition: cconfig.c:2600
static bool cb_graphformat(void *user, void *data)
Definition: cconfig.c:2197
static bool cb_scrnkey(void *user, void *data)
Definition: cconfig.c:2242
static bool cb_io_oxff(void *user, void *data)
Definition: cconfig.c:1994
static bool cb_swstep(void *user, void *data)
Definition: cconfig.c:2322
static bool cb_analysis_sleep(void *user, void *data)
Definition: cconfig.c:219
static bool cb_scr_color_grep_highlight(void *user, void *data)
Definition: cconfig.c:2035
static bool cb_analysis_searchstringrefs(void *user, void *data)
Definition: cconfig.c:2695
static bool cb_cmdrepeat(void *user, void *data)
Definition: cconfig.c:1190
static bool cb_zoombyte(void *user, void *data)
Definition: cconfig.c:2388
static bool cb_log_config_srcinfo(void *coreptr, void *nodeptr)
Definition: cconfig.c:2785
static bool cb_scr_prompt_popup(void *user, void *data)
Definition: cconfig.c:2315
static bool cb_analysis_pushret(void *user, void *data)
Definition: cconfig.c:2702
static bool cb_analysis_followdatarefs(void *user, void *data)
Definition: cconfig.c:2681
static bool cb_analysis_from(RzCore *core, RzConfigNode *node)
Definition: cconfig.c:2605
static bool cb_io_unalloc(void *user, void *data)
Definition: cconfig.c:1522
static bool cb_timezone(void *user, void *data)
Definition: cconfig.c:1085
static bool cb_scrrows(void *user, void *data)
Definition: cconfig.c:2266
static bool cb_fixcolumns(void *user, void *data)
Definition: cconfig.c:1463
static bool cb_scrnull(void *user, void *data)
Definition: cconfig.c:1197
static bool cb_asmbits(void *user, void *data)
Definition: cconfig.c:634
static bool cb_filepath(void *user, void *data)
Definition: cconfig.c:2001
static bool cb_bigendian(void *user, void *data)
Definition: cconfig.c:1058
static bool cb_emuskip(void *user, void *data)
Definition: cconfig.c:796
static bool cb_seggrn(void *user, void *data)
Definition: cconfig.c:2299
static bool cb_cmd_hexcursor(void *user, void *data)
Definition: cconfig.c:1475
static bool cb_analysis_hpskip(void *user, void *data)
Definition: cconfig.c:247
static bool cb_iopcachewrite(void *user, void *data)
Definition: cconfig.c:1650
static bool cb_binfilter(void *user, void *data)
Definition: cconfig.c:944
static bool cb_analysis_arch(void *user, void *data)
Definition: cconfig.c:265
static bool cb_analysis_recont(void *user, void *data)
Definition: cconfig.c:297
static bool cb_searchin(void *user, void *data)
Definition: cconfig.c:2527
static bool cb_scr_wideoff(void *user, void *data)
Definition: cconfig.c:345
static bool cb_bindbginfo(void *user, void *data)
Definition: cconfig.c:2435
static bool cb_io_pava(void *user, void *data)
Definition: cconfig.c:1958
static bool cb_completion_maxtab(void *user, void *data)
Definition: cconfig.c:1156
static bool cb_iova(void *user, void *data)
Definition: cconfig.c:1968
static bool cb_dbg_create_new_console(void *user, void *data)
Definition: cconfig.c:1364
static bool cb_ioff(void *user, void *data)
Definition: cconfig.c:1987
static bool cb_analysis_cjmpref(void *user, void *data)
Definition: cconfig.c:2653
static bool cb_dbg_execs(void *user, void *data)
Definition: cconfig.c:1331
static bool cb_asmsubtail(void *user, void *data)
Definition: cconfig.c:318
static bool cb_io_cache_mode(void *user, void *data)
Definition: cconfig.c:1910
static bool cb_analysis_rnr(void *user, RzConfigNode *node)
Definition: cconfig.c:2626
static bool cb_scrprompt(void *user, void *data)
Definition: cconfig.c:2258
static bool cb_dirsrc(void *user, void *data)
Definition: cconfig.c:1134
static bool cb_analysis_jmptblmax(void *user, void *data)
Definition: cconfig.c:2639
static bool cb_asmarch(void *user, void *data)
Definition: cconfig.c:477
static bool cb_log_config_file(void *coreptr, void *nodeptr)
Definition: cconfig.c:2778
static bool cb_binat(void *user, void *data)
Definition: cconfig.c:951
static bool cb_dbg_args(void *user, void *data)
Definition: cconfig.c:1400
static bool cb_analysis_jmptailcall(void *user, void *data)
Definition: cconfig.c:133
static bool cb_scr_color_grep(void *user, void *data)
Definition: cconfig.c:2026
static bool cb_analysis_delay(void *user, void *data)
Definition: cconfig.c:175
static bool cb_hexcomments(void *user, void *data)
Definition: cconfig.c:1602
static bool cb_binstrings(void *user, void *data)
Definition: cconfig.c:2423
static bool cb_analysis_maxrefs(void *user, void *data)
Definition: cconfig.c:226
static bool cb_color(void *user, void *data)
Definition: cconfig.c:1204
static bool cb_scr_histblock(void *user, void *data)
Definition: cconfig.c:2251
static bool cb_midflags(void *user, void *data)
Definition: cconfig.c:1002
static bool cb_cmd_esil_ioer(void *user, void *data)
Definition: cconfig.c:1794
static bool cb_analysiscc(RzCore *core, RzConfigNode *node)
Definition: cconfig.c:2589
static bool cb_hex_ascii(void *user, void *data)
Definition: cconfig.c:1562
static bool cb_hex_bytes(void *user, void *data)
Definition: cconfig.c:1551
static bool cb_stopthreads(void *user, void *data)
Definition: cconfig.c:2308
static bool cb_exectrap(void *user, void *data)
Definition: cconfig.c:2206
static bool cb_asmos(void *user, void *data)
Definition: cconfig.c:838
static bool cb_scr_vi(void *user, void *data)
Definition: cconfig.c:331
static bool cb_dbgbtdepth(void *user, void *data)
Definition: cconfig.c:627
static bool cb_analysis_jmpmid(void *user, void *data)
Definition: cconfig.c:2688
static bool cb_log_events(void *user, void *data)
Definition: cconfig.c:1595
static bool cb_analysis_jmpabove(void *user, void *data)
Definition: cconfig.c:2667
static bool cb_scrcolumns(void *user, void *data)
Definition: cconfig.c:2078
static bool cb_dbg_libs(void *user, void *data)
Definition: cconfig.c:1270
static bool cb_analysis_vars(void *user, void *data)
Definition: cconfig.c:182
static bool cb_cmdtimes(void *user, void *data)
Definition: cconfig.c:1183
static bool cb_ioautofd(void *user, void *data)
Definition: cconfig.c:2019
static bool cb_esilverbose(void *user, void *data)
Definition: cconfig.c:1439
static bool cb_color_getter(void *user, RzConfigNode *node)
Definition: cconfig.c:1225
static bool cb_binprefix(void *user, void *data)
Definition: cconfig.c:2445
static bool cb_scrhighlight(void *user, void *data)
Definition: cconfig.c:2105
static bool cb_debug_hitinfo(void *user, void *data)
Definition: cconfig.c:120
static bool cb_pager(void *user, void *data)
Definition: cconfig.c:2042
static bool cb_diff_sort(void *_core, void *_node)
Definition: cconfig.c:88
RZ_API bool rz_config_set_getter(RzConfig *cfg, const char *key, RzConfigCallback cb)
Definition: config.c:53
RZ_API RzConfigNode * rz_config_set_cb(RzConfig *cfg, const char *name, const char *value, RzConfigCallback cb)
Definition: config.c:173
RZ_API const char * rz_config_desc(RzConfig *cfg, RZ_NONNULL const char *name, RZ_NULLABLE const char *desc)
Definition: config.c:377
RZ_API RzConfig * rz_config_new(void *user)
Definition: config.c:490
RZ_API void rz_config_lock(RzConfig *cfg, int l)
Definition: config.c:476
RZ_API bool rz_cons_is_utf8(void)
Definition: cutf8.c:242
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
#define RZ_BASEFIND_BASE_MAX_ADDRESS
Definition: rz_basefind.h:15
#define RZ_BASEFIND_STRING_MIN_LENGTH
Definition: rz_basefind.h:13
#define RZ_BASEFIND_SCORE_MIN_VALUE
Definition: rz_basefind.h:17
#define RZ_BASEFIND_BASE_MIN_ADDRESS
Definition: rz_basefind.h:14
#define RZ_BASEFIND_BASE_ALIGNMENT
Definition: rz_basefind.h:16
#define SETBPREF(x, y, z)
Definition: rz_config.h:32
#define NODEICB(w, x, y)
Definition: rz_config.h:24
#define SETOPTIONS(x,...)
Definition: rz_config.h:26
#define SETCB(w, x, y, z)
Definition: rz_config.h:31
#define SETI(x, y, z)
Definition: rz_config.h:27
#define SETICB(w, x, y, z)
Definition: rz_config.h:29
#define SETDESC(x, y)
Definition: rz_config.h:25
#define SETPREF(x, y, z)
Definition: rz_config.h:30
bool(* RzConfigCallback)(void *user, void *data)
Definition: rz_config.h:34
#define NODECB(w, x, y)
Definition: rz_config.h:23
#define SETB(x, y, z)
Definition: rz_config.h:28
@ COLOR_MODE_16
Definition: rz_cons.h:443
@ COLOR_MODE_DISABLED
Definition: rz_cons.h:442
RZ_API char * rz_file_tmpdir(void)
Definition: file.c:1132
RZ_API bool rz_file_exists(const char *str)
Definition: file.c:192
@ RZ_FLIRT_NODE_OPTIMIZE_MAX
optimize the tree structure and drops the tail bytes
Definition: rz_flirt.h:188
#define RZ_FLIRT_LIBRARY_NAME_DFL
Definition: rz_flirt.h:19
#define RZ_DEFAULT_LOGLVL
Definition: rz_log.h:30
@ RZ_LOGLVL_FATAL
Definition: rz_log.h:23
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_prefix(RZ_NULLABLE const char *path)
Return path prefixed by the Rizin install prefix.
Definition: path.c:121
RZ_API char * rz_sys_getenv(const char *key)
Get the value of an environment variable named key or NULL if none exists.
Definition: sys.c:483
RZ_API char * rz_sys_whoami(char *buf)
Definition: sys.c:1153
#define RZ_THREAD_POOL_ALL_CORES
Definition: rz_th.h:19
#define RZ_SYS_ARCH
Definition: rz_types.h:519
#define UT64_MAX
Definition: rz_types_base.h:86
#define RZ_PLUGINS
Definition: rz_userconf.h:72
#define RZ_PROJECTS
Definition: rz_userconf.h:89
#define RZ_SDB_MAGIC
Definition: rz_userconf.h:86
#define RZ_PDB
Definition: rz_userconf.h:88
#define RZ_WWWROOT
Definition: rz_userconf.h:70
RzNum * num
Definition: rz_config.h:55
int rows
Definition: rz_cons.h:508
RzNum * num
Definition: rz_core.h:316

References __dbg_swstep_getter(), rz_core_t::analysis, cb_analysis_afterjmp(), cb_analysis_aftertrap(), cb_analysis_arch(), cb_analysis_armthumb(), cb_analysis_bb_max_size(), cb_analysis_brokenrefs(), cb_analysis_cjmpref(), cb_analysis_cpp_abi(), cb_analysis_cpu(), cb_analysis_delay(), cb_analysis_depth(), cb_analysis_followdatarefs(), cb_analysis_from(), cb_analysis_gp(), cb_analysis_graphdepth(), cb_analysis_hpskip(), cb_analysis_ignbithints(), cb_analysis_ijmp(), cb_analysis_jmpabove(), cb_analysis_jmpmid(), cb_analysis_jmpref(), cb_analysis_jmpretpoline(), cb_analysis_jmptailcall(), cb_analysis_jmptbl(), cb_analysis_jmptblmax(), cb_analysis_jmptblmaxoffset(), cb_analysis_limits(), cb_analysis_loads(), cb_analysis_maxrefs(), cb_analysis_nonull(), cb_analysis_nopskip(), cb_analysis_norevisit(), cb_analysis_pushret(), cb_analysis_recont(), cb_analysis_rnr(), cb_analysis_roregs(), cb_analysis_searchstringrefs(), cb_analysis_sleep(), cb_analysis_strings(), cb_analysis_trycatch(), cb_analysis_vars(), cb_analysis_vars_stackname(), cb_analysiscc(), cb_analysissyscc(), cb_asm_immhash(), cb_asm_invhex(), cb_asm_pcalign(), cb_asmarch(), cb_asmassembler(), cb_asmbits(), cb_asmcpu(), cb_asmfeatures(), cb_asmlineswidth(), cb_asmos(), cb_asmparser(), cb_asmplatform(), cb_asmpseudo(), cb_asmsubsec(), cb_asmsubtail(), cb_asmsubvarmin(), cb_asmsyntax(), cb_bigendian(), cb_binat(), cb_bindbginfo(), cb_binfilter(), cb_binforce(), cb_binmaxstr(), cb_binmaxstrbuf(), cb_binminstr(), cb_binprefix(), cb_binstrenc(), cb_binstrings(), cb_binverbose(), cb_breaklines(), cb_cfg_fortunes(), cb_cfg_fortunes_file(), cb_cfgdatefmt(), cb_cfgdebug(), cb_cmd_esil_intr(), cb_cmd_esil_ioer(), cb_cmd_esil_mdev(), cb_cmd_esil_step(), cb_cmd_esil_step_out(), cb_cmd_esil_todo(), cb_cmd_esil_trap(), cb_cmd_hexcursor(), cb_cmddepth(), cb_cmdrepeat(), cb_cmdtimes(), cb_color(), cb_color_getter(), cb_completion_maxtab(), cb_consbreak(), cb_contiguous(), cb_dbg_aftersc(), cb_dbg_args(), cb_dbg_bpinmaps(), cb_dbg_btalgo(), cb_dbg_clone(), cb_dbg_create_new_console(), cb_dbg_execs(), cb_dbg_follow_child(), cb_dbg_forks(), cb_dbg_gdb_page_size(), cb_dbg_gdb_retries(), cb_dbg_libs(), cb_dbg_trace_continue(), cb_dbg_unlibs(), cb_dbg_verbose(), cb_dbgbackend(), cb_dbgbep(), cb_dbgbtdepth(), cb_debase64(), cb_debug_hitinfo(), cb_decoff(), cb_diff_sort(), cb_dirhome(), cb_dirsrc(), cb_dirtmp(), cb_dotted(), cb_emuskip(), cb_emustr(), cb_esilstackdepth(), cb_esilverbose(), cb_exectrap(), cb_filepath(), cb_fixcolumns(), cb_fixrows(), cb_flag_realnames(), cb_flirt(), cb_gotolimit(), cb_graphformat(), cb_hex_align(), cb_hex_ascii(), cb_hex_bytes(), cb_hex_hdroff(), cb_hex_header(), cb_hex_pairs(), cb_hex_section(), cb_hex_style(), cb_hexcols(), cb_hexcomments(), cb_hexcompact(), cb_hexstride(), cb_io_cache(), cb_io_cache_mode(), cb_io_cache_read(), cb_io_cache_write(), cb_io_oxff(), cb_io_pava(), cb_io_unalloc(), cb_io_unalloc_ch(), cb_ioaslr(), cb_ioautofd(), cb_ioff(), cb_iopcache(), cb_iopcacheread(), cb_iopcachewrite(), cb_iotrap(), cb_iova(), cb_log_config_colors(), cb_log_config_file(), cb_log_config_level(), cb_log_config_srcinfo(), cb_log_config_traplevel(), cb_log_events(), cb_malloc(), cb_maxname(), cb_mdevrange(), cb_midflags(), cb_pager(), cb_rows(), cb_runprofile(), cb_scr_bgfill(), cb_scr_color_grep(), cb_scr_color_grep_highlight(), cb_scr_gadgets(), cb_scr_histblock(), cb_scr_prompt_mode(), cb_scr_prompt_popup(), cb_scr_vi(), cb_scr_wideoff(), cb_scrbreakword(), cb_scrcolumns(), cb_screcho(), cb_scrfgets(), cb_scrflush(), cb_scrhighlight(), cb_scrhtml(), cb_scrint(), cb_scrlast(), cb_scrlinesleep(), cb_scrnkey(), cb_scrnull(), cb_scrpagesize(), cb_scrprompt(), cb_scrrainbow(), cb_scrrows(), cb_scrstrconv(), cb_search_kwidx(), cb_searchalign(), cb_searchin(), cb_seggrn(), cb_segoff(), cb_stopthreads(), cb_str_escbslash(), cb_strfilter(), cb_strpurge(), cb_strsearch_check_ascii_freq(), cb_swstep(), cb_teefile(), cb_timezone(), cb_trace(), cb_tracetag(), cb_usextr(), cb_utf8(), cb_utf8_curvy(), cb_visual_mode(), cb_zoombyte(), COLOR_MODE_16, COLOR_MODE_DISABLED, rz_core_t::config, rz_core_t::cons, rz_analysis_t::esil_goto_limit, rz_print_t::flags, free(), h, i, n, NODECB, NODEICB, NULL, rz_config_t::num, rz_core_t::num, p, path, rz_core_t::print, rz_cons_t::rows, rz_analysis_cc_default(), rz_analysis_syscc_default(), RZ_BASEFIND_BASE_ALIGNMENT, RZ_BASEFIND_BASE_MAX_ADDRESS, RZ_BASEFIND_BASE_MIN_ADDRESS, RZ_BASEFIND_SCORE_MIN_VALUE, RZ_BASEFIND_STRING_MIN_LENGTH, rz_config_desc(), rz_config_lock(), rz_config_new(), rz_config_node_get(), rz_config_set(), rz_config_set_cb(), rz_config_set_getter(), rz_config_set_i(), rz_cons_is_utf8(), rz_cons_singleton(), RZ_CORE_VISUAL_MODE_PX, RZ_DEFAULT_LOGLVL, rz_file_exists(), rz_file_tmpdir(), RZ_FLIRT_LIBRARY_NAME_DFL, RZ_FLIRT_NODE_OPTIMIZE_MAX, RZ_FREE, RZ_LOGLVL_FATAL, rz_path_home_prefix(), rz_path_prefix(), rz_path_system(), RZ_PDB, RZ_PLUGINS, RZ_PRINT_FLAGS_COLOR, RZ_PROJECTS, RZ_SDB_MAGIC, rz_str_bool(), RZ_SYS_ARCH, rz_sys_getenv(), RZ_SYS_HOME, rz_sys_setenv(), RZ_SYS_TMP, rz_sys_whoami(), RZ_THREAD_POOL_ALL_CORES, RZ_WWWROOT, SETB, SETBPREF, SETCB, SETDESC, SETI, SETICB, SETOPTIONS, SETPREF, snprintf, update_analysis_arch_options(), update_asmarch_options(), update_asmbits_options(), update_asmcpu_options(), update_asmfeatures_options(), update_asmparser_options(), update_asmplatforms_options(), and UT64_MAX.

Referenced by rz_core_init(), and rz_eval_reset_handler().

◆ rz_core_config_print_all()

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.

Parameters
cfgreference to RzConfig
strreference to the key that can be passed to filter the output
statereference to RzCmdStateOutput

Definition at line 1770 of file cconfig.c.

1770  {
1771  rz_return_if_fail(cfg);
1772  RzConfigNode *node;
1773  RzListIter *iter;
1774  PJ *pj = state->d.pj;
1775  RzOutputMode mode = state->mode;
1776 
1777  if (mode == RZ_OUTPUT_MODE_LONG_JSON) {
1778  pj_a(pj);
1779  } else if (mode == RZ_OUTPUT_MODE_JSON) {
1780  pj_o(pj);
1781  }
1782 
1783  rz_list_foreach (cfg->nodes, iter, node) {
1784  if (rz_str_startswith(node->name, str)) {
1785  config_print_node(cfg, node, state);
1786  }
1787  }
1788 
1790  pj_end(pj);
1791  }
1792 }
static void config_print_node(RzConfig *cfg, RzConfigNode *node, RzCmdStateOutput *state)
Definition: cconfig.c:1678
RZ_API PJ * pj_a(PJ *j)
Definition: pj.c:81
RzList * nodes
Definition: rz_config.h:56

References config_print_node(), rz_config_node_t::name, rz_config_t::nodes, pj_a(), pj_end(), pj_o(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_LONG_JSON, rz_return_if_fail, rz_str_startswith(), and cmd_descs_generate::str.

Referenced by rz_eval_getset_handler(), and rz_eval_list_handler().

◆ rz_core_esil_cmd()

RZ_API bool rz_core_esil_cmd ( RzAnalysisEsil esil,
const char *  cmd,
ut64  a1,
ut64  a2 
)

Definition at line 1669 of file cconfig.c.

1669  {
1670  if (cmd && *cmd) {
1671  RzCore *core = esil->analysis->core;
1672  rz_core_cmdf(core, "%s %" PFMT64d " %" PFMT64d, cmd, a1, a2);
1673  return core->num->value;
1674  }
1675  return false;
1676 }
RZ_API int rz_core_cmdf(RzCore *core, const char *fmt,...)
Definition: cmd.c:5413
RzAnalysis * analysis
Definition: rz_analysis.h:1043
ut64 value
Definition: rz_num.h:63

References rz_analysis_esil_t::analysis, cmd, rz_analysis_t::core, rz_core_t::num, PFMT64d, rz_core_cmdf(), and rz_num_t::value.

Referenced by cb_cmd_esil_intr(), cb_cmd_esil_ioer(), cb_cmd_esil_mdev(), cb_cmd_esil_step(), cb_cmd_esil_step_out(), cb_cmd_esil_todo(), cb_cmd_esil_trap(), cb_mdevrange(), and initializeEsil().

◆ rz_core_parse_rizinrc()

RZ_API void rz_core_parse_rizinrc ( RzCore r)

Definition at line 3704 of file cconfig.c.

3704  {
3705  bool has_debug = rz_sys_getenv_asbool("RZ_DEBUG");
3706  char *rcfile = rz_sys_getenv("RZ_RCFILE");
3707  char *homerc = NULL;
3708  if (!RZ_STR_ISEMPTY(rcfile)) {
3709  homerc = rcfile;
3710  } else {
3711  free(rcfile);
3712  homerc = rz_path_home_rc();
3713  }
3714  if (homerc && rz_file_is_regular(homerc)) {
3715  if (has_debug) {
3716  eprintf("USER CONFIG loaded from %s\n", homerc);
3717  }
3718  rz_core_cmd_file(r, homerc);
3719  }
3720  free(homerc);
3721  homerc = rz_path_home_config_rc();
3722  if (homerc && rz_file_is_regular(homerc)) {
3723  if (has_debug) {
3724  eprintf("USER CONFIG loaded from %s\n", homerc);
3725  }
3726  rz_core_cmd_file(r, homerc);
3727  }
3728  free(homerc);
3729  homerc = rz_path_home_config_rcdir();
3730  if (homerc) {
3731  if (rz_file_is_directory(homerc)) {
3732  char *file;
3733  RzListIter *iter;
3734  RzList *files = rz_sys_dir(homerc);
3735  rz_list_foreach (files, iter, file) {
3736  if (*file != '.') {
3737  char *path = rz_str_newf("%s/%s", homerc, file);
3738  if (rz_file_is_regular(path)) {
3739  if (has_debug) {
3740  eprintf("USER CONFIG loaded from %s\n", homerc);
3741  }
3743  }
3744  free(path);
3745  }
3746  }
3748  }
3749  free(homerc);
3750  }
3751 }
RZ_API int rz_core_cmd_file(RzCore *core, const char *file)
Definition: cmd.c:5341
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 bool rz_file_is_directory(const char *str)
Definition: file.c:167
RZ_API bool rz_file_is_regular(const char *str)
Definition: file.c:159
RZ_API RZ_OWN char * rz_path_home_config_rc(void)
Return the path of the rizinrc file in the home config directory.
Definition: path.c:226
RZ_API RZ_OWN char * rz_path_home_config_rcdir(void)
Return the home directory of config rizinrc.d.
Definition: path.c:233
RZ_API RZ_OWN char * rz_path_home_rc(void)
Return the path of the rizinrc file in the home directory.
Definition: path.c:219
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
#define RZ_STR_ISEMPTY(x)
Definition: rz_str.h:67
RZ_API bool rz_sys_getenv_asbool(const char *key)
Return true if the environment variable has the value 1, false otherwise.
Definition: sys.c:511
RZ_API RzList * rz_sys_dir(const char *path)
Definition: sys.c:216
Definition: gzappend.c:170
static int file
Definition: z80asm.c:58

References eprintf, file, files, free(), NULL, path, r, rz_core_cmd_file(), rz_file_is_directory(), rz_file_is_regular(), rz_list_free(), rz_path_home_config_rc(), rz_path_home_config_rcdir(), rz_path_home_rc(), RZ_STR_ISEMPTY, rz_str_newf(), rz_sys_dir(), rz_sys_getenv(), and rz_sys_getenv_asbool().

Referenced by rz_diff_hex_visual(), and rz_main_rizin().

◆ set_options()

static void set_options ( RzConfigNode node,
  ... 
)
static

Definition at line 22 of file cconfig.c.

22  {
23  va_list argp;
24  char *option = NULL;
25  va_start(argp, node);
26  option = va_arg(argp, char *);
27  while (option) {
29  option = va_arg(argp, char *);
30  }
31  va_end(argp);
32 }
static static sync static getppid static getegid const char static filename char argp
Definition: sflib.h:62

References argp, NULL, rz_config_node_t::options, and rz_list_append().

◆ update_analysis_arch_options()

static void update_analysis_arch_options ( RzCore core,
RzConfigNode node 
)
static

Definition at line 254 of file cconfig.c.

254  {
256  RzListIter *it;
257  if (core && core->analysis && node) {
258  rz_list_purge(node->options);
259  rz_list_foreach (core->analysis->plugins, it, h) {
260  SETOPTIONS(node, h->name, NULL);
261  }
262  }
263 }
RZ_API void rz_list_purge(RZ_NONNULL RzList *list)
Empties the list without freeing the list pointer.
Definition: list.c:120
RzList * plugins
Definition: rz_analysis.h:588

References rz_core_t::analysis, h, NULL, rz_config_node_t::options, rz_analysis_t::plugins, rz_list_purge(), and SETOPTIONS.

Referenced by cb_analysis_arch(), and rz_core_config_init().

◆ update_asmarch_options()

static void update_asmarch_options ( RzCore core,
RzConfigNode node 
)
static

Definition at line 444 of file cconfig.c.

444  {
445  RzAsmPlugin *h;
446  RzListIter *iter;
447  if (core && node && core->rasm) {
448  rz_list_purge(node->options);
449  rz_list_foreach (core->rasm->plugins, iter, h) {
450  SETOPTIONS(node, h->name, NULL);
451  }
452  }
453 }
RzList * plugins
Definition: rz_asm.h:108

References h, NULL, rz_config_node_t::options, rz_asm_t::plugins, rz_core_t::rasm, rz_list_purge(), and SETOPTIONS.

Referenced by cb_asmarch(), and rz_core_config_init().

◆ update_asmbits_options()

static void update_asmbits_options ( RzCore core,
RzConfigNode node 
)
static

Definition at line 455 of file cconfig.c.

455  {
456  if (core && core->rasm && core->rasm->cur && node) {
457  int bits = core->rasm->cur->bits;
458  int i;
459  node->options->free = free;
460  rz_list_purge(node->options);
461  for (i = 1; i <= bits; i <<= 1) {
462  if (i & bits) {
463  SETOPTIONS(node, rz_str_newf("%d", i), NULL);
464  }
465  }
466  }
467 }
RzListFree free
Definition: rz_list.h:21

References bits(), rz_asm_t::cur, rz_list_t::free, free(), i, NULL, rz_config_node_t::options, rz_core_t::rasm, rz_list_purge(), rz_str_newf(), and SETOPTIONS.

Referenced by cb_asmarch(), cb_asmbits(), and rz_core_config_init().

◆ update_asmcpu_options()

static void update_asmcpu_options ( RzCore core,
RzConfigNode node 
)
static

Definition at line 392 of file cconfig.c.

392  {
393  RzAsmPlugin *h;
394  RzListIter *iter;
395  rz_return_if_fail(core && core->rasm);
396  const char *arch = rz_config_get(core->config, "asm.arch");
397  if (!arch || !*arch) {
398  return;
399  }
400  rz_list_purge(node->options);
401  rz_list_foreach (core->rasm->plugins, iter, h) {
402  if (h->cpus && !strcmp(arch, h->name)) {
403  char *c = strdup(h->cpus);
404  int i, n = rz_str_split(c, ',');
405  for (i = 0; i < n; i++) {
406  const char *word = rz_str_word_get0(c, i);
407  if (word && *word) {
408  node->options->free = free;
409  SETOPTIONS(node, strdup(word), NULL);
410  }
411  }
412  free(c);
413  }
414  }
415 }
cs_arch arch
Definition: cstool.c:13
RZ_API const char * rz_str_word_get0(const char *str, int idx)
Definition: str.c:598
RZ_API size_t rz_str_split(char *str, char ch)
Split string str in place by using ch as a delimiter.
Definition: str.c:406

References arch, c, rz_core_t::config, rz_list_t::free, free(), h, i, n, NULL, rz_config_node_t::options, rz_asm_t::plugins, rz_core_t::rasm, rz_config_get(), rz_list_purge(), rz_return_if_fail, rz_str_split(), rz_str_word_get0(), SETOPTIONS, and strdup().

Referenced by cb_asmarch(), cb_asmcpu(), and rz_core_config_init().

◆ update_asmfeatures_options()

static void update_asmfeatures_options ( RzCore core,
RzConfigNode node 
)
static

Definition at line 695 of file cconfig.c.

695  {
696  int i, argc;
697 
698  if (core && core->rasm && core->rasm->cur) {
699  if (core->rasm->cur->features) {
700  char *features = strdup(core->rasm->cur->features);
701  rz_list_purge(node->options);
702  argc = rz_str_split(features, ',');
703  for (i = 0; i < argc; i++) {
704  node->options->free = free;
705  const char *feature = rz_str_word_get0(features, i);
706  if (feature) {
707  rz_list_append(node->options, strdup(feature));
708  }
709  }
710  free(features);
711  }
712  }
713 }
static const struct @646 features[]

References rz_asm_t::cur, features, rz_list_t::free, free(), i, rz_config_node_t::options, rz_core_t::rasm, rz_list_append(), rz_list_purge(), rz_str_split(), rz_str_word_get0(), and strdup().

Referenced by cb_asmfeatures(), and rz_core_config_init().

◆ update_asmparser_options()

static void update_asmparser_options ( RzCore core,
RzConfigNode node 
)
static

Definition at line 863 of file cconfig.c.

863  {
864  RzListIter *iter;
866  if (core && node && core->parser && core->parser->parsers) {
867  rz_list_purge(node->options);
868  rz_list_foreach (core->parser->parsers, iter, parser) {
869  SETOPTIONS(node, parser->name, NULL);
870  }
871  }
872 }
RzList * parsers
Definition: rz_parse.h:35

References NULL, rz_config_node_t::options, cmd_descs_generate::parser, rz_core_t::parser, rz_parse_t::parsers, rz_list_purge(), and SETOPTIONS.

Referenced by cb_asmparser(), and rz_core_config_init().

◆ update_asmplatforms_options()

static void update_asmplatforms_options ( RzCore core,
RzConfigNode node 
)
static

Definition at line 737 of file cconfig.c.

737  {
738  int i, argc;
739 
740  if (core && core->rasm && core->rasm->cur) {
741  if (core->rasm->cur->platforms) {
742  char *platforms = strdup(core->rasm->cur->platforms);
743  rz_list_purge(node->options);
744  argc = rz_str_split(platforms, ',');
745  for (i = 0; i < argc; i++) {
746  node->options->free = free;
747  const char *feature = rz_str_word_get0(platforms, i);
748  if (feature) {
749  rz_list_append(node->options, strdup(feature));
750  }
751  }
752  free(platforms);
753  }
754  }
755 }
struct platform platforms[]
Definition: fuzz_diff.c:18

References rz_asm_t::cur, rz_list_t::free, free(), i, rz_config_node_t::options, platforms, rz_core_t::rasm, rz_list_append(), rz_list_purge(), rz_str_split(), rz_str_word_get0(), and strdup().

Referenced by cb_asmplatform(), and rz_core_config_init().

◆ update_syscall_ns()

static void update_syscall_ns ( RzCore core)
static

Definition at line 469 of file cconfig.c.

469  {
470  if (core->analysis->syscall->db) {
471  sdb_ns_set(core->sdb, "syscall", core->analysis->syscall->db);
472  } else {
473  sdb_ns_unset(core->sdb, "syscall", NULL);
474  }
475 }
RZ_API int sdb_ns_set(Sdb *s, const char *name, Sdb *r)
Definition: ns.c:156
RZ_API bool sdb_ns_unset(Sdb *s, const char *name, Sdb *r)
Definition: ns.c:136
Sdb * sdb
Definition: rz_core.h:365

References rz_core_t::analysis, rz_syscall_t::db, NULL, rz_core_t::sdb, sdb_ns_set(), sdb_ns_unset(), and rz_analysis_t::syscall.

Referenced by cb_asmarch(), cb_asmbits(), and cb_asmos().