16 char *dash = strchr(
a,
'-');
26 "Usage:",
"%[name[=value]]",
"Set each NAME to VALUE in the environment",
27 "%",
"",
"list all environment variables",
28 "%",
"SHELL",
"prints SHELL value",
29 "%",
"TMPDIR=/tmp",
"sets TMPDIR value to \"/tmp\"",
38 "\nEnvironment:",
"",
"",
39 "RZ_FILE",
"",
"file name",
40 "RZ_OFFSET",
"",
"10base offset 64bit value",
41 "RZ_XOFFSET",
"",
"same as above, but in 16 base",
42 "RZ_BSIZE",
"",
"block size",
43 "RZ_ENDIAN",
"",
"'big' or 'little'",
44 "RZ_IOVA",
"",
"is io.va true? virtual addressing (1,0)",
45 "RZ_DEBUG",
"",
"debug mode enabled? (1,0)",
46 "RZ_SIZE",
"",
"file size",
47 "RZ_ARCH",
"",
"value of asm.arch",
48 "RZ_BITS",
"",
"arch reg size (8, 16, 32, 64)",
49 "RZ_BIN_LANG",
"",
"assume this lang to demangle",
50 "RZ_BIN_DEMANGLE",
"",
"demangle or not",
51 "RZ_BIN_PDBSERVER",
"",
"e pdb.server",
56 "Usage:",
"!<cmd>",
" Run given command as in system(3)",
57 "!",
"",
"list all historic commands",
58 "!*",
"rzp x",
"run rizin command via rzpipe in current session",
59 "!!",
"",
"save command history to hist file",
60 "!!",
"ls~txt",
"print output of 'ls' and grep for 'txt'",
61 "!!!",
"cmd [args|$type]",
"adds the autocomplete value",
62 "!!!-",
"cmd [args]",
"removes the autocomplete value",
63 ".!",
"rz_bin -rpsei ${FILE}",
"run each output line as a rizin cmd",
64 "!",
"echo $RZ_SIZE",
"display file size",
65 "!-",
"",
"clear history in current session",
66 "!-*",
"",
"clear and save empty history log",
67 "R=!",
"",
"enable remotecmd mode",
68 "R!=",
"",
"disable remotecmd mode",
73 "Usage: ?e[=bdgnpst] arg",
"print/echo things",
"",
74 "?e",
"",
"echo message with newline",
75 "?e=",
" 32",
"progress bar at 32 percentage",
76 "?eg",
" 10 20",
"move cursor to column 10, row 20",
77 "?en",
" nonl",
"echo message without ending newline",
78 "?et",
" msg",
"change terminal title",
83 "Usage: ?[?[?]] expression",
"",
"",
84 "?!",
" [cmd]",
"run cmd if $? == 0",
85 "?",
" eip-0x804800",
"show all representation result for this math expr",
86 "?$",
"",
"show value all the variables ($)",
87 "?+",
" [cmd]",
"run cmd if $? > 0",
88 "?-",
" [cmd]",
"run cmd if $? < 0",
89 "?=",
" eip-0x804800",
"hex and dec result for this math expr",
90 "?==",
" x86 `e asm.arch`",
"strcmp two strings",
91 "??",
" [cmd]",
"run cmd if $? != 0",
92 "??",
"",
"show value of operation",
93 "?a",
"",
"show ascii table",
94 "?B",
" [elem]",
"show range boundaries like 'e?search.in",
95 "?b",
" [num]",
"show binary value of number",
96 "?b64[-]",
" [str]",
"encode/decode in base64",
97 "?btw",
" num|expr num|expr num|expr",
"returns boolean value of a <= b <= c",
98 "?e",
"[=bdgnpst] arg",
"echo messages, bars, pie charts and more (see ?e? for details)",
99 "?f",
" [num] [str]",
"map each bit of the number as flag string index",
100 "?F",
"",
"flush cons output",
101 "?h",
" [str]",
"calculate hash for given string",
102 "?i",
"[ynmkp] arg",
"prompt for number or Yes,No,Msg,Key,Path and store in $$?",
103 "?ik",
"",
"press any key input dialog",
104 "?im",
" message",
"show message centered in screen",
105 "?in",
" prompt",
"noyes input prompt",
106 "?ip",
" prompt",
"path input prompt",
107 "?iy",
" prompt",
"yesno input prompt",
108 "?j",
" arg",
"same as '? num' but in JSON",
109 "?l",
"[q] str",
"returns the length of string ('q' for quiet, just set $?)",
110 "?o",
" num",
"get octal value",
111 "?P",
" paddr",
"get virtual address for given physical one",
112 "?p",
" vaddr",
"get physical address for given virtual address",
113 "?q",
" eip-0x804800",
"compute expression like ? or ?v but in quiet mode",
114 "?r",
" [from] [to]",
"generate random number between from-to",
115 "?s",
" from to step",
"sequence of numbers from to by steps",
116 "?t",
" cmd",
"returns the time to run a command",
117 "?T",
"",
"show loading times",
118 "?u",
" num",
"get value in human units (KB, MB, GB, TB)",
119 "?v",
" eip-0x804800",
"show hex value of math expr",
120 "?vi",
" rsp-rbp",
"show decimal value of math expr",
121 "?V",
"",
"show library version of rz_core",
122 "?w",
" addr",
"show what's in this address (like pxr/pxq does)",
123 "?X",
" num|expr",
"returns the hexadecimal value numeric expr",
124 "?x",
" str",
"returns the hexpair of number or string",
125 "?x",
"+num",
"like ?v, but in hexpairs honoring cfg.bigendian",
126 "?x",
"-hexst",
"convert hexpair into raw string with newline",
127 "?_",
" hudfile",
"load hud menu with given file",
128 "[cmd]?*",
"",
"recursive help for the given cmd",
133 "Usage: ?v [$.]",
"",
"",
134 "flag",
"",
"offset of flag",
135 "$",
"{ev}",
"get value of eval config variable",
136 "$$",
"",
"here (current virtual seek)",
137 "$$$",
"",
"current non-temporary virtual seek",
138 "$?",
"",
"last comparison value",
139 "$alias",
"=value",
"alias commands (simple macros)",
140 "$B",
"",
"base address (aligned lowest map address)",
141 "$b",
"",
"block size",
142 "$c",
"",
"get terminal width in character columns",
143 "$Cn",
"",
"get nth call of function",
144 "$D",
"",
"current debug map base address ?v $D @ rsp",
145 "$DB",
"",
"same as dbg.baddr, progam base address",
146 "$DD",
"",
"current debug map size",
147 "$Dn",
"",
"get nth data reference in function",
148 "$e",
"",
"1 if end of block, else 0",
149 "$e",
"{flag}",
"end of flag (flag->offset + flag->size)",
150 "$f",
"",
"jump fail address (e.g. jz 0x10 => next instruction)",
151 "$F",
"",
"Same as $FB",
152 "$Fb",
"",
"begin of basic block",
153 "$FB",
"",
"begin of function",
154 "$Fe",
"",
"end of basic block",
155 "$FE",
"",
"end of function",
156 "$Ff",
"",
"function false destination",
157 "$Fi",
"",
"basic block instructions",
158 "$FI",
"",
"function instructions",
159 "$Fj",
"",
"function jump destination",
160 "$fl",
"",
"flag length (size) at current address (fla; pD $l @ entry0)",
161 "$FS",
"",
"function size (linear length)",
162 "$Fs",
"",
"size of the current basic block",
163 "$FSS",
"",
"function size (sum bb sizes)",
164 "$j",
"",
"jump address (e.g. jmp 0x10, jz 0x10 => 0x10)",
165 "$Ja",
"",
"get nth jump of function",
166 "$k{kv}",
"",
"get value of an sdb query value",
167 "$l",
"",
"opcode length",
168 "$M",
"",
"map address (lowest map address)",
169 "$m",
"",
"opcode memory reference (e.g. mov eax,[0x10] => 0x10)",
170 "$MM",
"",
"map size (lowest map address)",
171 "$O",
"",
"cursor here (current offset pointed by the cursor)",
172 "$o",
"",
"here (current disk io offset)",
173 "$p",
"",
"getpid()",
174 "$P",
"",
"pid of children (only in debug)",
175 "$r",
"",
"get console height (in rows, see $c for columns)",
176 "$r",
"{reg}",
"get value of named register",
177 "$s",
"",
"file size",
178 "$S",
"",
"section offset",
179 "$SS",
"",
"section size",
180 "$s",
"{flag}",
"get size of flag",
181 "$v",
"",
"opcode immediate value (e.g. lui a0,0x8010 => 0x8010)",
182 "$w",
"",
"get word size, 4 if asm.bits=32, 8 if 64, ...",
183 "$Xn",
"",
"get nth xref of function",
184 "RzNum",
"",
"$variables usable in math expressions",
189 "Usage: ?V[jq]",
"",
"",
190 "?V",
"",
"show version information",
191 "?V0",
"",
"show major version",
192 "?V1",
"",
"show minor version",
193 "?V2",
"",
"show patch version",
194 "?Vn",
"",
"show numeric version (2)",
195 "?Vc",
"",
"show numeric version",
196 "?Vj",
"",
"same as above but in JSON",
197 "?Vq",
"",
"quiet mode, just show the version number",
202 "Usage:",
"[cmd]>[file]",
"redirects console from 'cmd' output to 'file'",
203 "[cmd] > [file]",
"",
"redirect STDOUT of 'cmd' to 'file'",
204 "[cmd] > $alias",
"",
"save the output of the command as an alias (see $?)",
205 "[cmd] H> [file]",
"",
"redirect html output of 'cmd' to 'file'",
206 "[cmd] 2> [file]",
"",
"redirect STDERR of 'cmd' to 'file'",
207 "[cmd] 2> /dev/null",
"",
"omit the STDERR output of 'cmd'",
232 const char *dollar, *
end;
235 dollar = strchr(
msg,
'$');
240 if (dollar[1] ==
'{') {
242 end = strchr(dollar + 2,
'}');
254 end = dollar + strlen(dollar);
276 " _| ( o) (o)\\_ | %s |\n"
277 " / _ .\\. | \\ <| %s |\n"
278 " \\| \\ ____ / 7` | %s |\n"
279 " '|\\| `---'/ `-%s-'\n"
310 " â•â”€â”€â•® â•â”€%s─╮\n"
311 " │ _│ │ %s │\n"
312 " │ O O < %s │\n"
313 " │ │╠│ %s │\n"
314 " ││ ││ ╰─%s─╯\n"
316 " ╰───╯\n",
317 " â•â”€â”€â•® â•â”€%s─╮\n"
318 " │ ╶│╶ │ %s │\n"
319 " │ O o < %s │\n"
320 " │ │ ╱ │ %s │\n"
321 " │ â•â”˜ ╱ ╰─%s─╯\n"
324 " â•â”€â”€â•® â•â”€%s─╮\n"
325 " │ _│_ │ %s │\n"
326 " │ O O < %s │\n"
327 " │ │╷ │ %s │\n"
328 " │ ││ ╰─%s─╯\n"
330 " ╰───╯\n",
334 " /\\.---./\\ .-%s-.\n"
336 "---- ^ ^ ---- < %s |\n"
337 " _.- Y -._ | %s |\n"
339 " /\\.---./\\ .-%s-.\n"
340 " '-- @ @ --' | %s |\n"
341 "---- Y ---- < %s |\n"
342 " _.- O -._ | %s |\n"
344 " /\\.---./\\ .-%s-.\n"
345 " '-- = = --' | %s |\n"
346 "---- Y ---- < %s |\n"
347 " _.- U -._ | %s |\n"
361 static const char *vars[] = {
362 "$$",
"$$$",
"$?",
"$B",
"$b",
"$c",
"$Cn",
"$D",
"$DB",
"$DD",
"$Dn",
363 "$e",
"$f",
"$F",
"$Fb",
"$FB",
"$Fe",
"$FE",
"$Ff",
"$Fi",
"$FI",
"$Fj",
364 "$fl",
"$FS",
"$Fs",
"$FSS",
"$j",
"$Ja",
"$l",
"$M",
"$m",
"$MM",
"$O",
365 "$o",
"$p",
"$P",
"$r",
"$s",
"$S",
"$SS",
"$v",
"$w",
"$Xn",
NULL
387 if (*
msg ==
'+' || *
msg ==
'3') {
388 char *space = strchr(
msg,
' ');
445 p = strchr(
out + 1,
' ');
473 if (
input[3] ==
'-') {
475 }
else if (
input[3] ==
' ') {
476 const char *
s =
input + 4;
481 }
else if (
input[1] ==
't' &&
input[2] ==
'w') {
483 eprintf(
"Usage: ?btw num|(expr) num|(expr) num|(expr)\n");
503 if (
input[1] ==
' ') {
507 eprintf(
"Usage: ?h [string-to-hash]\n");
514 if (
input[1] ==
' ') {
527 eprintf(
"Usage: \"?b value bitstring\"\n");
531 eprintf(
"Whitespace expected after '?f'\n");
556 char *asnum, unit[8];
569 for (
i = 0;
i < list_len;
i++) {
576 eprintf(
"RzNum ERROR: Division by Zero\n");
590 pj_ks(pj,
"unit", unit);
615 if (isnan(
f) && signbit(
f)) {
618 if (isnan(
d) && signbit(
d)) {
651 eprintf(
"RzNum ERROR: Division by Zero\n");
653 if (
input[1] ==
'?') {
654 rz_cons_printf(
"|Usage: ?q [num] # Update $? without printing anything\n"
655 "|?q 123; ?? x # hexdump if 123 != 0");
657 const char *space = strchr(
input,
' ');
668 const char *space = strchr(
input,
' ');
676 eprintf(
"RzNum ERROR: Division by Zero\n");
681 "|?vx number -> show 8 digit padding in hex\n"
682 "|?vi1 200 -> 1 byte size value (char)\n"
683 "|?vi2 0xffff -> 2 byte size value (short)\n"
684 "|?vi4 0xffff -> 4 byte size value (int)\n"
685 "|?vi8 0xffff -> 8 byte size value (st64)\n"
686 "| No argument shows $? value\n"
687 "|?vi will show in decimal instead of hex\n");
723 if (
input[1] ==
'=') {
724 if (
input[2] ==
' ') {
726 char *
e = strchr(
s,
' ');
731 eprintf(
"Missing secondary word in expression to compare\n");
735 eprintf(
"Usage: ?== str1 str2\n");
768 if (
input[1] ==
'?') {
779 if (
input[1] ==
'@') {
780 if (
input[2] ==
'@') {
793 if (
input[1] ==
'?') {
798 if (
input[1] ==
'?') {
853 if (
input[1] ==
'q') {
881 eprintf(
"Error parsing the hexpair string\n");
885 }
else if (*
input ==
'+') {
922 int y =
arg ? atoi(
arg + 1) : 0;
930 rz_cons_print(newmsg);
959 p2 = strchr(
p + 1,
' ');
999 eprintf(
"Not running in interactive mode\n");
1034 foo[
sizeof(
foo) - 1] = 0;
1063 if (
input[1] ==
'?') {
1064 if (
input[2] ==
'?') {
1076 }
else if (
input[1]) {
1082 eprintf(
"RzNum ERROR: Division by Zero\n");
int bits(struct state *s, int need)
const lzma_allocator const uint8_t size_t uint8_t * out
RZ_API void rz_core_cmd_help(const RzCore *core, const char *help[])
RZ_API int rz_core_cmd(RzCore *core, const char *cstr, int log)
static void cmd_help_exclamation(RzCore *core)
static const char * help_msg_question_v[]
static const char * avatar_clippy[]
RZ_API void rz_core_help_vars_print(RzCore *core)
static const char * avatar_orangg[]
static const char * help_msg_env[]
static const char * help_msg_question_V[]
static const char * help_msg_exclamation[]
RZ_API const char ** rz_core_help_vars_get(RzCore *core)
Returns all the $ variable names in a NULL-terminated array.
static char * filterFlags(RzCore *core, const char *msg)
static const char * help_msg_greater_sign[]
RZ_API void rz_core_clippy(RzCore *core, const char *msg)
static const char * help_msg_percent[]
static ut32 vernum(const char *s)
static const char * avatar_cybcat[]
static const char * avatar_clippy_utf8[]
static const char * help_msg_question_e[]
static void cmd_help_percent(RzCore *core)
static const char * help_msg_question[]
RZ_IPI int rz_cmd_help(void *data, const char *input)
static const char * findBreakChar(const char *s)
static const char * help_msg_at_at[]
static void helpCmdTasks(RzCore *core)
static const char * help_msg_at_at_at[]
static const char * help_msg_at[]
RZ_API RZ_OWN RzList * rz_core_get_boundaries_prot(RzCore *core, int perm, const char *mode, const char *prefix)
RZ_API ut64 rz_config_get_i(RzConfig *cfg, RZ_NONNULL const char *name)
RZ_API void rz_cons_set_raw(bool is_raw)
RZ_API void rz_cons_set_title(const char *str)
RZ_API void rz_cons_column(int c)
RZ_API void rz_cons_newline(void)
RZ_API int rz_cons_printf(const char *format,...)
RZ_API bool rz_cons_is_interactive(void)
RZ_API void rz_cons_flush(void)
RZ_API void rz_cons_println(const char *str)
RZ_API void rz_cons_gotoxy(int x, int y)
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 struct timespec static rem const char static group const void start
static states step(struct re_guts *, sopno, sopno, states, int, states)
size_t map(int syms, int left, int len)
RZ_API void Ht_() free(HtName_(Ht) *ht)
RZ_API void rz_cons_message(RZ_NONNULL const char *msg)
static void list(RzEgg *egg)
RZ_API ut32 rz_list_length(RZ_NONNULL const RzList *list)
Returns the length of the list.
RZ_API RZ_OWN void * rz_list_pop_head(RZ_NONNULL RzList *list)
Removes and returns the first element of the list.
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
void * malloc(size_t size)
void * calloc(size_t number, size_t size)
RZ_API void rz_line_set_prompt(const char *prompt)
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig const char static mode static oldfd struct tms static buf static getgid static geteuid const char static filename static arg static mask struct ustat static ubuf static getppid static setsid static egid sigset_t static set struct timeval struct timezone static tz fd_set fd_set fd_set struct timeval static timeout const char char static bufsiz const char static swapflags void static offset const char static length static mode static who const char struct statfs static buf unsigned unsigned num
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
RZ_API void rz_print_progressbar(RzPrint *p, int pc, int _cols)
static void pad(RzStrBuf *sb, ut32 count)
RZ_API const char * ret_ascii_table(void)
RZ_API size_t rz_base64_encode(char *bout, const ut8 *bin, size_t sz)
RZ_API int rz_base64_decode(ut8 *bout, const char *bin, int len)
RZ_API int rz_hex_str2bin(const char *in, ut8 *out)
Convert an input string in into the binary form in out.
RZ_API ut64 rz_io_v2p(RzIO *io, ut64 va)
RZ_API ut64 rz_io_p2v(RzIO *io, ut64 pa)
static ut64 rz_itv_end(RzInterval itv)
RZ_API bool rz_name_validate_char(const char ch, bool strict)
RZ_API RzList * rz_num_str_split_list(char *str)
RZ_API ut64 rz_num_get(RzNum *num, const char *str)
RZ_API int rz_num_to_bits(char *out, ut64 num)
RZ_API ut64 rz_num_math(RzNum *num, const char *str)
RZ_API int rz_num_conditional(RzNum *num, const char *str)
RZ_API int rz_num_to_trits(char *out, ut64 num)
RZ_API char * rz_num_units(char *buf, size_t len, ut64 number)
RZ_API int rz_num_between(RzNum *num, const char *input_value)
RZ_API char * rz_num_as_string(RzNum *___, ut64 n, bool printable_only)
RZ_API int rz_num_rand(int max)
RZ_API PJ * pj_ki(PJ *j, const char *k, int d)
RZ_API PJ * pj_end(PJ *j)
RZ_API const char * pj_string(PJ *pj)
RZ_API void pj_free(PJ *j)
RZ_API PJ * pj_ks(PJ *j, const char *k, const char *v)
RZ_API char * rz_str_repeat(const char *ch, int sz)
RZ_API char * rz_str_append(char *ptr, const char *string)
RZ_API ut64 rz_str_djb2_hash(const char *str)
RZ_API char RZ_API char * rz_str_newlen(const char *str, int len)
RZ_API const char * rz_str_bool(int b)
RZ_API char * rz_str_appendlen(char *ptr, const char *string, int slen)
RZ_API int rz_str_bits64(char *strout, ut64 in)
RZ_API size_t rz_str_len_utf8(const char *s)
RZ_API int rz_str_bits(char *strout, const ut8 *buf, int len, const char *bitz)
RZ_API const char * rz_str_trim_head_ro(const char *str)
RZ_API char * rz_str_replace(char *str, const char *key, const char *val, int g)
RZ_API const char * rz_str_pad(const char ch, int len)
RZ_API char * rz_str_version(const char *program)
RZ_API int rz_str_unescape(char *buf)
#define rz_strf(buf,...)
Convenience macro for local temporary strings.
RZ_API ut64 rz_time_now_mono(void)
Returns the current time in microseconds, using the monotonic clock.
#define RZ_VERSION_NUMBER
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr from
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr socklen_t static fromlen const void const struct sockaddr to
static struct sockaddr static addrlen static backlog const void msg
if(dbg->bits==RZ_SYS_BITS_64)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
RZ_API bool rz_core_yank_hud_file(RzCore *core, const char *input)
RZ_API bool rz_core_yank_set_str(RzCore *core, ut64 addr, RZ_NONNULL const char *str)
RZ_API bool rz_core_yank_hud_path(RzCore *core, const char *input, int dir)
static bool input(void *ud, zip_uint8_t *data, zip_uint64_t length)