5 #define ALLOW_THREADED 0
6 #define UNCOLORIZE_NONTTY 0
16 return d && strncmp(
d->name,
"gdb://", 6);
21 return d && strncmp(
d->name,
"dmp://", 6);
34 typedef const char *(*vc)();
40 {
"rz_analysis", rz_analysis_version },
41 {
"rz_lib", rz_lib_version },
42 {
"rz_egg", rz_egg_version },
43 {
"rz_asm", rz_asm_version },
44 {
"rz_bin", rz_bin_version },
45 {
"rz_cons", rz_cons_version },
46 {
"rz_flag", rz_flag_version },
47 {
"rz_core", rz_core_version },
48 {
"rz_crypto", rz_crypto_version },
49 {
"rz_bp", rz_bp_version },
50 {
"rz_debug", rz_debug_version },
51 {
"rz_main", rz_main_version },
52 {
"rz_hash", rz_hash_version },
53 {
"rz_io", rz_io_version },
55 {
"rz_magic", rz_magic_version },
57 {
"rz_parse", rz_parse_version },
58 {
"rz_reg", rz_reg_version },
59 {
"rz_sign", rz_sign_version },
60 {
"rz_search", rz_search_version },
61 {
"rz_syscall", rz_syscall_version },
62 {
"rz_util", rz_util_version },
63 {
"rz_diff", rz_diff_version },
64 {
"rz_demangler", rz_demangler_version },
70 printf(
"%s rizin\n", base);
72 for (
i = ret = 0; vcs[
i].name;
i++) {
73 struct vcs_t *
v = &vcs[
i];
74 const char *
name =
v->callback();
75 if (!ret && strcmp(base,
name)) {
84 eprintf(
"WARNING: rizin library versions mismatch!\n");
86 eprintf(
"WARNING: rizin library versions mismatch! See rizin -V\n");
94 printf(
"Usage: rizin [-ACdfLMnNqStuvwzX] [-P patch] [-p prj] [-a arch] [-b bits] [-i file]\n"
95 " [-s addr] [-B baddr] [-m maddr] [-c cmd] [-e k=v] file|pid|-|--|=\n");
99 " -- run rizin without opening any file\n"
100 " = same as 'rizin malloc://512'\n"
101 " - read file from stdin \n"
102 " -= perform R=! command to run all commands remotely\n"
103 " -0 print \\x00 after init and every command\n"
104 " -2 close stderr file descriptor (silent warning messages)\n"
105 " -a [arch] set asm.arch\n"
106 " -A run 'aaa' command to analyze all referenced code\n"
107 " -b [bits] set asm.bits\n"
108 " -B [baddr] set base address for PIE binaries\n"
109 " -c 'cmd..' execute rizin command\n"
110 " -C file is host:port (alias for -cR+http://%%s/cmd/)\n"
111 " -d debug the executable 'file' or running process 'pid'\n"
112 " -D [backend] enable debug mode (e cfg.debug=true)\n"
113 " -e k=v evaluate config var\n"
114 " -f block size = file size\n"
115 " -F [binplug] force to use that rbin plugin\n"
116 " -h, -hh show help message, -hh for long\n"
117 " -H ([var]) display variable\n"
118 " -i [file] run script file\n"
119 " -I [file] run script file before the file is opened\n"
120 " -k [OS/kern] set asm.os (linux, macos, w32, netbsd, ...)\n"
121 " -l [lib] load plugin file\n"
122 " -L list supported IO plugins\n"
123 " -m [addr] map file at given address (loadaddr)\n"
124 " -M do not demangle symbol names\n"
125 " -n, -nn do not load RzBin info (-nn only load bin structures)\n"
126 " -N do not load user settings and scripts\n"
127 " -NN do not load any script or plugin\n"
128 " -q quiet mode (no prompt) and quit after -i\n"
129 " -qq quit after running all -c and -i\n"
130 " -Q quiet mode (no prompt) and quit faster (quickLeak=true)\n"
131 " -p [p.rzdb] load project file\n"
132 " -r [rz-run] specify rz-run profile to load (same as -e dbg.profile=X)\n"
133 " -R [rule] specify custom rz-run directive\n"
134 " -s [addr] initial seek\n"
136 " -t load rz-bin info in thread\n"
138 " -T do not compute file hashes\n"
139 " -u set bin.filter=false to get raw sym/sec/cls names\n"
140 " -v, -V show rizin version (-V show lib versions)\n"
141 " -w open file in write mode\n"
142 " -x open without exec-flag (asm.emu will not work), See io.exec\n"
143 " -X same as -e bin.usextr=false (useful for dyldcache)\n"
144 " -z, -zz do not load strings or load them even in raw\n");
165 " user %s %s (and %s)\n"
166 " file ${filename}.rz\n"
168 " binrc %s (elf, elf64, mach0, ..)\n"
169 " RZ_USER_PLUGINS %s\n"
170 " RZ_LIBR_PLUGINS %s\n"
172 " RZ_DEBUG if defined, show error messages and crash signal\n"
173 " RZ_DEBUG_ASSERT=1 set a breakpoint when hitting an assert\n"
175 " RZ_NOPLUGINS do not load rizin shared plugins\n"
176 " RZ_RCFILE %s (user preferences, batch script)\n"
178 " RZ_VERSION contains the current version of rizin\n"
186 home_rc, home_config_rc, home_config_rcdir,
202 free(home_config_rc);
203 free(home_config_rcdir);
209 free(system_plugins);
235 {
"RZ_MAGICPATH", magicpath },
236 {
"RZ_INCDIR", incdir },
237 {
"RZ_LIBDIR", libdir },
238 {
"RZ_SIGDB", sigdbdir },
240 {
"RZ_RCONFIGHOME", confighome },
241 {
"RZ_RDATAHOME", datahome },
242 {
"RZ_RCACHEHOME", cachehome },
243 {
"RZ_LIBR_PLUGINS", plugins },
244 {
"RZ_USER_PLUGINS", homeplugins },
245 {
"RZ_IS_PORTABLE", is_portable },
249 if (var_name && strncmp(var_name,
"RZ_", 3)) {
253 while (rz_vars[
i].
name) {
254 if (!strcmp(rz_vars[
i].
name +
delta, var_name)) {
261 while (rz_vars[
i].
name) {
294 if (ret < 0 || (ret == 0 && quiet)) {
300 rz_list_foreach (cmds,
iter, cmdn) {
310 if (cmds && !rz_list_empty(cmds)) {
313 if (!rz_list_empty(
files)) {
358 }
else if (!strcmp(
tmp,
"dumb")) {
372 bool forcequit =
false;
373 bool haveRarunProfile =
false;
379 const char *prj =
NULL;
382 bool do_connect =
false;
383 bool fullfile =
false;
384 bool zerosep =
false;
388 LOAD_BIN_STRUCTURES_ONLY } load_bin = LOAD_BIN_ALL;
393 bool do_list_io_plugins =
false;
396 const char *asmarch =
NULL;
397 const char *asmos =
NULL;
398 const char *forcebin =
NULL;
399 const char *asmbits =
NULL;
400 char *customRarunProfile =
NULL;
403 bool quietLeak =
false;
405 const char *s_seek =
NULL;
406 bool compute_hashes =
true;
413 #define LISTS_FREE() \
415 rz_list_free(cmds); \
416 rz_list_free(evals); \
417 rz_list_free(files); \
418 rz_list_free(prefiles); \
421 bool noStderr =
false;
425 sigemptyset(&sigBlockMask);
427 rz_signal_sigmask(SIG_BLOCK, &sigBlockMask,
NULL);
437 char *fmt = (sysdbg && *sysdbg)
464 r->io->envprofile = envprofile;
468 if (argc > 2 && !strcmp(
argv[1],
"-") && !strcmp(
argv[2],
"-i")) {
475 if (argc == 2 && !strcmp(
argv[1],
"-H")) {
483 char *debugbackend =
strdup(
"native");
486 rz_getopt_init(&opt, argc,
argv,
"=02AMCwxfF:H:hm:e:nk:NdqQs:p:b:B:a:Lui:I:l:R:r:c:D:vVSTzuXt");
519 do_analysis += do_analysis ? 1 : 2;
537 case 'd':
debug = 1;
break;
540 RZ_LOG_ERROR(
"Sorry. No debugger backend available.\n");
549 if (!strcmp(opt.
arg,
"?")) {
560 if (!strcmp(opt.
arg,
"q")) {
603 do_list_io_plugins =
true;
615 if (load_bin == LOAD_BIN_ALL) {
616 load_bin = LOAD_BIN_NOTHING;
617 }
else if (load_bin == LOAD_BIN_NOTHING) {
618 load_bin = LOAD_BIN_STRUCTURES_ONLY;
647 RZ_LOG_ERROR(
"Cannot open empty rz-run profile path\n");
651 haveRarunProfile =
true;
665 eprintf(
"WARNING: -t is temporarily disabled!\n");
670 compute_hashes =
false;
677 free(customRarunProfile);
683 free(customRarunProfile);
700 if (-1 ==
close(2)) {
707 int new_stderr = open(nul,
O_RDWR);
708 if (-1 == new_stderr) {
714 if (2 != new_stderr) {
715 if (-1 ==
dup2(new_stderr, 2)) {
721 if (-1 ==
close(new_stderr)) {
730 const char *dbg_profile =
rz_config_get(
r->config,
"dbg.profile");
731 if (dbg_profile && *dbg_profile) {
734 char *program = strstr(
msg,
"program=");
738 p = strstr(program,
"\r\n");
740 p = strchr(program,
'\n');
749 eprintf(
"Cannot read dbg.profile '%s'\n", dbg_profile);
757 if (pfile && !*pfile) {
763 if (do_list_io_plugins) {
789 if (customRarunProfile) {
791 if (!
rz_file_dump(tfn, (
const ut8 *)customRarunProfile, strlen(customRarunProfile), 0)) {
792 eprintf(
"Cannot create %s\n", tfn);
794 haveRarunProfile =
true;
800 if (opt.
ind >= argc && !haveRarunProfile) {
806 const char *
src = haveRarunProfile ? pfile :
argv[opt.
ind];
810 char *
p = strstr(uri,
"://");
814 if (!strcmp(uri,
"winedbg")) {
815 debugbackend =
strdup(
"io");
846 const char *uri =
argv[opt.
ind];
847 if (opt.
ind >= argc) {
853 if (strstr(uri,
"://")) {
883 RZ_LOG_ERROR(
"Error: Cannot debug directories, yet.\n");
899 int result = _setmode(_fileno(stdin), _O_BINARY);
909 const char *con_dev =
"CON";
911 const char *con_dev =
"/dev/tty";
914 const char *scr_interactive =
rz_config_get(
r->config,
"scr.interactive");
953 if (opt.
ind >= argc) {
961 if (strcmp(debugbackend,
"dmp")) {
964 if (strcmp(debugbackend,
"native")) {
965 if (!haveRarunProfile) {
969 if (strcmp(debugbackend,
"winkd")) {
972 if (!strstr(pfile,
"://")) {
977 if (!strcmp(debugbackend,
"gdb") || !strcmp(debugbackend,
"dmp")) {
996 filepath = iod->
name;
1006 iod->
name = (
char *)filepath;
1017 const char *
f = (haveRarunProfile && pfile) ? pfile :
argv[opt.
ind];
1018 is_gdb = (!memcmp(
f,
"gdb://",
RZ_MIN(
f ? strlen(
f) : 0, 6)));
1020 pfile =
strdup(
"dbg://");
1025 char *
path, *escaped_path;
1026 if (strchr(
f,
'/')) {
1052 while (opt.
ind < argc) {
1073 const char *dbg_profile =
rz_config_get(
r->config,
"dbg.profile");
1074 if (opt.
ind == argc && dbg_profile && *dbg_profile) {
1086 if (opt.
ind < argc) {
1088 while (opt.
ind < argc) {
1099 eprintf(
"rz_io_create: Permission denied.\n");
1107 if (load_bin == LOAD_BIN_ALL) {
1108 const char *filepath =
NULL;
1112 filepath = filepath ? filepath + 3 : pfile;
1114 if (
r->file && iod && (iod->
fd ==
r->file->fd) && iod->
name) {
1115 filepath = iod->
name;
1124 eprintf(
"Warning: Don't use -B on unknown files. Consider using -m.\n");
1128 if (load_bin == LOAD_BIN_STRUCTURES_ONLY) {
1149 opt.sz = 1024 * 1024 * 1;
1171 if (load_bin == LOAD_BIN_ALL) {
1177 if (obj && obj->
info) {
1178 if (
r->dbg->verbose) {
1181 #if __linux__ && __GNU_LIBRARY__ && __GLIBC__ && __GLIBC_MINOR__ && __x86_64__
1183 if (bitness == 32) {
1184 eprintf(
"glibc.fc_offset = 0x00148\n");
1203 if (pfile && *pfile) {
1206 RZ_LOG_ERROR(
"[w] Cannot open '%s' for writing.\n", pfile);
1220 if (
r->bin->cur &&
r->bin->cur->o &&
r->bin->cur->o->info &&
r->bin->cur->o->info->rclass && !strcmp(
"fs",
r->bin->cur->o->info->rclass)) {
1221 const char *fstype =
r->bin->cur->o->info->bclass;
1229 rz_list_foreach (evals,
iter, cmdn) {
1269 if (o && o->
info && compute_hashes) {
1292 if (iod && !strstr(iod->
uri,
"://")) {
1297 if (!quiet &&
path && *
path && npath && strcmp(
path, npath)) {
1298 eprintf(
"WARNING: file.path change: %s => %s\n",
path, npath);
1303 rz_list_foreach (evals,
iter, cmdn) {
1309 rz_flag_space_set(
r->flags,
NULL);
1313 const char *uri_splitter = strstr(
f,
"://");
1314 const char *
path = uri_splitter ? uri_splitter + 3 :
f;
1318 if (isInteractive &&
rz_cons_yesno(
'n',
"Do you want to run the '%s' script? (y/N) ",
path)) {
1327 rz_list_foreach (evals,
iter, cmdn) {
1349 if (do_analysis > 0) {
1350 switch (do_analysis) {
1358 #if UNCOLORIZE_NONTTY
1408 rz_flag_space_set(
r->flags,
NULL);
1411 ret =
r->num->value;
1415 bool no_question_debug = ret & 1;
1416 bool no_question_save = (ret & 2) >> 1;
1417 bool y_kill_debug = (ret & 4) >> 2;
1418 bool y_save_project = (ret & 8) >> 3;
1421 if (
rz_cons_yesno(
'y',
"There are running background tasks. Do you want to kill them? (Y/n)")) {
1430 if (no_question_debug) {
1438 rz_cons_yesno(
'y',
"Do you want to kill the process? (Y/n)")) {
1453 if (no_question_save) {
1454 if (prj && *prj && y_save_project) {
1458 question =
rz_str_newf(
"Do you want to save the '%s' project? (Y/n)", prj);
1490 ret =
r->num->value;
RZ_API RZ_OWN RzList * rz_bin_file_set_hashes(RzBin *bin, RZ_OWN RzList *new_hashes)
Set file_hashes on current RzBinInfo.
RZ_API RZ_OWN RzList * rz_bin_file_compute_hashes(RzBin *bin, RzBinFile *bf, ut64 limit)
RZ_API RzBinObject * rz_bin_cur_object(RzBin *bin)
RZ_API RzBinFile * rz_bin_open_io(RzBin *bin, RzBinOptions *opt)
RZ_API void rz_bin_force_plugin(RzBin *bin, const char *name)
RZ_API RzBinFile * rz_bin_cur(RzBin *bin)
RZ_DEPRECATE RZ_API RZ_BORROW RzList * rz_bin_get_sections(RZ_NONNULL RzBin *bin)
static ut64 baddr(RzBinFile *bf)
static RzList * maps(RzBinFile *bf)
RzList * sections(RzBinFile *bf)
RZ_API void rz_core_bin_options_init(RzCore *core, RZ_OUT RzBinOptions *opts, int fd, ut64 baseaddr, ut64 loadaddr)
RZ_API bool rz_core_bin_load_structs(RZ_NONNULL RzCore *core, RZ_NONNULL const char *file)
RZ_API bool rz_core_bin_apply_all_info(RzCore *r, RzBinFile *binfile)
RZ_API void rz_core_parse_rizinrc(RzCore *r)
RZ_API void rz_core_debug_map_update_flags(RzCore *core)
RZ_API RzCmdStatus rz_core_debug_plugins_print(RzCore *core, RzCmdStateOutput *state)
RZ_API RZ_BORROW RzCoreFile * rz_core_file_open(RZ_NONNULL RzCore *r, RZ_NONNULL const char *file, int flags, ut64 loadaddr)
Tries to open the file as is, otherwise tries as is a compilation of files.
RZ_API bool rz_core_bin_load(RZ_NONNULL RzCore *r, RZ_NULLABLE const char *filenameuri, ut64 baddr)
RZ_API int rz_core_setup_debugger(RzCore *r, const char *debugbackend, bool attach)
RZ_API int rz_core_block_read(RzCore *core)
RZ_API RzCmdStatus rz_core_io_plugins_print(RzIO *io, RzCmdStateOutput *state)
Print the registered IO plugins according to state.
RZ_API int rz_core_cmd_lines(RzCore *core, const char *lines)
RZ_API int rz_core_cmd0(RzCore *core, const char *cmd)
RZ_API int rz_core_cmd_file(RzCore *core, const char *file)
RZ_API bool rz_core_run_script(RzCore *core, RZ_NONNULL const char *file)
RZ_API int rz_core_cmdf(RzCore *core, const char *fmt,...)
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.
RZ_API void rz_cmd_state_output_fini(RZ_NONNULL RzCmdStateOutput *state)
Clear the inner fields of RzCmdStateOutput structure, but do not free it.
RZ_API void rz_cmd_state_output_print(RZ_NONNULL RzCmdStateOutput *state)
Print the output accumulated in state to RzCons, if necessary.
RZ_API bool rz_core_project_load_for_cli(RzCore *core, const char *file, bool load_bin_io)
int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)
RZ_API ut64 rz_config_get_i(RzConfig *cfg, RZ_NONNULL const char *name)
RZ_API bool rz_config_get_b(RzConfig *cfg, RZ_NONNULL const char *name)
RZ_API bool rz_config_eval(RZ_NONNULL RzConfig *cfg, RZ_NONNULL const char *str)
Sets the configuration variable and its value passed as argument.
RZ_API RzConfigNode * rz_config_set(RzConfig *cfg, RZ_NONNULL const char *name, const char *value)
RZ_API RzConfigNode * rz_config_set_i(RzConfig *cfg, RZ_NONNULL const char *name, const ut64 i)
RZ_API RZ_BORROW const char * rz_config_get(RzConfig *cfg, RZ_NONNULL const char *name)
RZ_API void rz_cons_zero(void)
RZ_API void rz_cons_set_raw(bool is_raw)
RZ_API RzCons * rz_cons_new(void)
RZ_API bool rz_cons_is_interactive(void)
RZ_API bool rz_cons_isatty(void)
RZ_API void rz_cons_flush(void)
RZ_API void rz_cons_reset(void)
RZ_API RzCons * rz_cons_free(void)
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
static static fork const void static count static fd const char const char static newpath const char static path const char path
static static fork const void static count close
RZ_API int rz_line_hist_save(RZ_NONNULL const char *path)
Save the history of commands executed until now to file path.
size_t map(int syms, int left, int len)
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
RZ_API RzFlagItem * rz_flag_get(RzFlag *f, const char *name)
RZ_API void rz_core_fortune_print_random(RzCore *core)
unsigned short prefix[65536]
RZ_API void Ht_() free(HtName_(Ht) *ht)
RZ_API void rz_core_prompt_loop(RzCore *r)
RZ_API bool rz_core_block_size(RzCore *core, ut32 bsize)
RZ_API void rz_core_free(RzCore *c)
RZ_API RzCore * rz_core_new(void)
RZ_API bool rz_debug_can_kill(RzDebug *dbg)
check whether rz_debug_kill() will not definitely fail (for example because kill is unimplemented by ...
RZ_API int rz_debug_kill(RzDebug *dbg, int pid, int tid, int sig)
RZ_API int rz_debug_detach(RzDebug *dbg, int pid)
RZ_API ut64 rz_debug_get_baddr(RzDebug *dbg, const char *file)
static bool mustSaveHistory(RzConfig *c)
static bool has_file_arg(int argc, const char **argv, RzGetopt *opt)
RZ_API int rz_main_rizin(int argc, const char **argv)
static bool is_valid_gdb_file(RzCoreFile *fh)
static void set_color_default(RzCore *r)
static int main_help(int line)
static int rz_main_version_verify(int show)
static bool is_valid_dmp_file(RzCoreFile *fh)
static char * get_file_in_cur_dir(const char *filepath)
static bool run_commands(RzCore *r, RzList *cmds, RzList *files, bool quiet, int do_analysis)
static int main_print_var(const char *var_name)
RZ_API RZ_OWN RzList * rz_list_new(void)
Returns a new initialized RzList pointer (free method is not initialized)
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
RZ_API int rz_core_loadlibs(RzCore *core, int where)
static static fork const void static count static fd const char const char static newpath char char argv
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
static static fork const void static count static fd const char static mode const char static pathname const char static path const char static dev const char static group static getpid static getuid void void static data static pause const char static mode static sync const char const char static newpath const char static pathname unsigned long static filedes void static end_data_segment static handler static getegid char static len static pgid const char static path dup2
static uint32_t const uint8_t uint32_t uint32_t limit
RZ_API bool rz_debug_use(RzDebug *dbg, const char *str)
RZ_API RZ_NONNULL const char * rz_project_err_message(RzProjectErr err)
RZ_API RzProjectErr rz_project_save_file(RzCore *core, const char *file, bool compress)
RZ_API RzRegItem * rz_reg_get(RzReg *reg, const char *name, int type)
RZ_API ut64 rz_reg_get_value(RzReg *reg, RzRegItem *item)
RZ_API const char * rz_file_basename(const char *path)
RZ_API char * rz_file_temp(const char *prefix)
RZ_API bool rz_file_is_directory(const char *str)
RZ_API bool rz_file_exists(const char *str)
RZ_API char * rz_stdin_slurp(int *sz)
RZ_API char * rz_file_abspath(const char *file)
RZ_API RZ_OWN char * rz_file_slurp(const char *str, RZ_NULLABLE size_t *usz)
RZ_API bool rz_file_dump(const char *file, const ut8 *buf, int len, bool append)
RZ_API char * rz_file_path(const char *bin)
RZ_API RZ_OWN char * rz_file_path_join(RZ_NONNULL const char *s1, RZ_NULLABLE const char *s2)
Concatenate two paths to create a new one with s1+s2 with the correct path separator.
RZ_API void rz_getopt_init(RzGetopt *go, int argc, const char **argv, const char *ostr)
RZ_API int rz_getopt_next(RzGetopt *opt)
RZ_API ut64 rz_io_fd_size(RzIO *io, int fd)
RZ_API ut64 rz_io_desc_size(RzIODesc *desc)
RZ_API RzIODesc * rz_io_desc_get(RzIO *io, int fd)
RZ_API RZ_BORROW RzPVector * rz_io_maps(RzIO *io)
Returns the pointer to vector containing maps list.
RZ_API int rz_io_fd_get_current(RzIO *io)
RZ_API bool rz_io_write_at(RzIO *io, ut64 addr, const ut8 *buf, int len)
RZ_API RzIOMap * rz_io_map_new(RzIO *io, int fd, int flags, ut64 delta, ut64 addr, ut64 size)
RZ_API int rz_lib_open(RzLib *lib, const char *file)
#define RZ_LOG_ERROR(fmtstr,...)
RZ_API int rz_main_version_print(const char *program)
RZ_API int rz_main_rz_find(int argc, const char **argv)
RZ_API int rz_main_rz_diff(int argc, const char **argv)
RZ_API int rz_main_rz_ax(int argc, const char **argv)
RZ_API int rz_main_rz_asm(int argc, const char **argv)
RZ_API int rz_main_rz_gg(int argc, const char **argv)
RZ_API int rz_main_rz_bin(int argc, const char **argv)
RZ_API ut64 rz_num_math(RzNum *num, const char *str)
RZ_API RZ_OWN char * rz_path_home_config(void)
Return the home directory for config files (e.g. ~/.config/rizin)
RZ_API RZ_OWN char * rz_path_system_rc(void)
Return the system path of the global rizinrc file.
RZ_API RZ_OWN char * rz_path_incdir(void)
Return the directory where include files are placed.
RZ_API RZ_OWN char * rz_path_home_config_rc(void)
Return the path of the rizinrc file in the home config directory.
RZ_API RZ_OWN char * rz_path_home_prefix(RZ_NULLABLE const char *path)
Return path prefixed by the home prefix.
RZ_API RZ_OWN char * rz_path_system(RZ_NULLABLE const char *path)
Return the full system path of the given subpath path.
RZ_API RZ_OWN char * rz_path_home_cache(void)
Return the home directory for cache files (e.g. ~/.cache/rizin)
RZ_API RZ_OWN char * rz_path_home_history(void)
Return the path for the command history file.
RZ_API RZ_OWN char * rz_path_libdir(void)
Return the directory where the Rizin libraries are placed.
RZ_API RZ_OWN char * rz_path_prefix(RZ_NULLABLE const char *path)
Return path prefixed by the Rizin install prefix.
RZ_API RZ_OWN char * rz_path_home_config_rcdir(void)
Return the home directory of config rizinrc.d.
RZ_API RZ_OWN char * rz_path_home_rc(void)
Return the path of the rizinrc file in the home directory.
enum rz_project_err RzProjectErr
RZ_API char * rz_run_get_environ_profile(char **env)
#define RZ_STR_ISNOTEMPTY(x)
RZ_API char * rz_str_appendf(char *ptr, const char *fmt,...) RZ_PRINTF_CHECK(2
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
RZ_API char * rz_str_append(char *ptr, const char *string)
#define RZ_STR_ISEMPTY(x)
RZ_API char * rz_str_prepend(char *ptr, const char *string)
RZ_API bool rz_str_endswith(RZ_NONNULL const char *str, RZ_NONNULL const char *needle)
Checks if a string ends with a specifc sequence of characters (case sensitive)
RZ_API char * rz_str_arg_escape(const char *arg)
RZ_API char * rz_sys_getenv(const char *key)
Get the value of an environment variable named key or NULL if none exists.
RZ_API void rz_sys_env_init(void)
RZ_API bool rz_sys_getenv_asbool(const char *key)
Return true if the environment variable has the value 1, false otherwise.
RZ_API bool rz_sys_chdir(RZ_NONNULL const char *s)
Change current directory to s, taking care of home expansion ~.
RZ_API int rz_sys_crash_handler(const char *cmd)
RZ_API int rz_sys_sleep(int secs)
Sleep for secs seconds.
RZ_API char ** rz_sys_get_environ(void)
#define rz_xfreopen(pathname, mode, stream)
@ RZ_OUTPUT_MODE_STANDARD
#define rz_pvector_foreach(vec, it)
RZ_API bool rz_core_seek(RzCore *core, ut64 addr, bool rb)
Seek to addr.
static struct sockaddr static addrlen static backlog const void msg
XX curplugin == o->plugin.
Represent the output state of a command handler.
struct rz_io_plugin_t * plugin
RZ_API void rz_core_task_join(RzCoreTaskScheduler *scheduler, RzCoreTask *current, int id)
RZ_API void rz_core_task_break_all(RzCoreTaskScheduler *scheduler)
RZ_API void rz_core_task_sync_end(RzCoreTaskScheduler *scheduler)
RZ_API int rz_core_task_running_tasks_count(RzCoreTaskScheduler *scheduler)
RZ_API void rz_core_task_sync_begin(RzCoreTaskScheduler *scheduler)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static const z80_opcode fd[]