9 #include "../core_private.h"
30 static char *
prompt(
const char *
str,
const char *txt) {
59 return (
b << 1) | high;
62 return (
b >> 1) | (lower << 7);
71 const char *nw = strchr(
w + 1,
',');
80 return (
size_t)(
w - esil);
90 const int nbits =
sizeof(
ut64) * 8;
135 word =
rz_str_ndup(
expr + (wp ? (wp + 1) : 0), (wp2 - wp) - (wp ? 1 : 0));
144 const char *
pad =
rz_str_pad(
'-', wp2 - ((wp > 0) ? wp + 1 : 0));
150 showreg(esil,
"$$",
"address");
154 showreg(esil,
"$o",
"overflow");
156 showreg(esil,
"$r",
"regsize");
174 if (ch == -1 || ch == 4) {
183 eprintf(
"step ((%s))\n", word);
189 eprintf(
"esil step over :D\n");
199 "Vd1?: Visual Bit Editor Help:\n\n"
200 " q - quit the bit editor\n"
201 " h/r - reset / go back (reinitialize esil state)\n"
202 " s - esil step in\n"
203 " j/k - toggle bit value (same as space key)\n"
204 " : - enter command\n");
235 const int nbits =
sizeof(
ut64) * 8;
236 bool colorBits =
false;
241 bool bitsInLine =
false;
268 ut32 word = (
x % 32);
281 for (
i = 0;
i < 8;
i++) {
294 for (
i = 0;
i < 8;
i++) {
302 for (
i = 0;
i < 8;
i++) {
311 for (
i = 0;
i < 8;
i++) {
316 if (colorBits &&
i >= asmop.
size) {
320 for (j = 0; j < 8; j++) {
329 for (set = 1; set >= 0; set--) {
331 for (
i = 0;
i < 8;
i++) {
336 if (colorBits &&
i >= asmop.
size) {
340 for (j = 0; j < 8; j++) {
344 }
else if (!set && !
bit) {
356 memset(str_pos,
'-', nbits + 9);
361 str_pos[
pos + (
x / 8)] =
'^';
362 str_pos[nbits + 9] = 0;
377 if (ch == -1 || ch == 4) {
399 int y =
RZ_MIN(
x + 8, nbits - 8);
408 const int nbyte =
x / 8;
409 const int nbit = 7 - (
x - (nbyte * 8));
453 bitsInLine = !bitsInLine;
458 "Vd1?: Visual Bit Editor Help:\n\n"
459 " q - quit the bit editor\n"
460 " R - randomize color palette\n"
461 " b - toggle bitsInLine\n"
462 " j/k - toggle bit value (same as space key)\n"
463 " h/l - select next/previous bit\n"
464 " +/- - increment or decrement byte value\n"
465 " </> - rotate left/right byte value\n"
466 " i - insert numeric value of byte\n"
467 " : - enter command\n");
508 rz_list_foreach (
c->fields, iter2,
f) {
511 rz_list_foreach (
c->methods, iter2,
m) {
512 const char *
name =
m->dname ?
m->dname :
m->name;
518 char *
p = strchr(res,
' ');
560 char *
p = strchr(res,
' ');
585 const char *oldvalue =
NULL;
587 char *
p = strchr(res,
' ');
595 eprintf(
"Set new value for %s (old=%s)\n", res, oldvalue);
645 i, clr,
c->addr,
c->name);
652 (
i == *
idx) ?
">>" :
"- ",
i,
c->addr,
c->name);
672 const char *
name =
f->name;
688 char *mflags =
strdup(
"");
697 i, clr,
f->vaddr, mflags,
name);
704 (
i == *
idx) ?
">>" :
"- ",
i,
f->vaddr, mflags,
name);
715 if (rz_list_empty(_c->
fields)) {
726 eprintf(
"No class selected.\n");
731 const char *
name =
m->dname ?
m->dname :
m->name;
757 i, clr,
m->vaddr, mflags,
name);
764 (
i == *
idx) ?
">>" :
"- ",
i,
m->vaddr, mflags,
name);
775 if (rz_list_empty(_c->
methods)) {
796 bool grepmode =
false;
798 if (rz_list_empty(
list)) {
825 if (ch == -1 || ch == 4) {
834 int len = strlen(grep);
867 case 'J': index += 10;
break;
868 case 'j': index++;
break;
894 if (
mode ==
'm' && mur) {
925 if (mur &&
mode ==
'm') {
942 "\nVF: Visual Classes help:\n\n"
944 " j/k - down/up keys\n"
946 " g/G - go first/last item\n"
947 " i - specify index\n"
949 " C - toggle colors\n"
950 " f - show class fields\n"
951 " m - show class methods\n"
952 " l/' ' - accept current selection\n"
953 " p - preview method disasm with less\n"
954 " : - enter command\n");
986 rz_cons_print(class_name);
988 RzAnalysisBaseClass *base;
997 rz_cons_print(base->class_name);
1002 rz_cons_print(
"\n");
1005 RzAnalysisVTable *vtable;
1012 rz_cons_print(
"\n");
1015 RzAnalysisMethod *meth;
1018 if (meth->vtable_offset >= 0) {
1021 rz_cons_print(
"\n");
1034 const char *cur_class =
NULL;
1037 if (
mode ==
'd' && class_name) {
1053 const char *pointer =
"- ";
1054 const char *txt_clr =
"";
1059 cur_class = class_name;
1063 pointer,
i, txt_clr, class_name);
1083 const char *class_name =
"";
1085 if (rz_list_empty(
list)) {
1099 if (ch == -1 || ch == 4) {
1110 if (index >=
list->length) {
1111 index =
list->length - 1;
1115 if (++index >=
list->length) {
1121 index =
list->length - 1;
1134 index =
list->length - 1;
1157 "\nVF: Visual Classes help:\n\n"
1159 " j/k - down/up keys\n"
1161 " g/G - go first/last item\n"
1162 " l/' ' - accept current selection\n"
1163 " : - enter command\n");
1247 eprintf(
"Searching ROP gadgets...\n");
1252 bool forceaddr =
false;
1281 char *
sp = strchr(curline,
' ');
1303 int chainstrlen = chainstr ? strlen(chainstr) : 0;
1305 int extra = chainstrlen / scr_w;
1316 if (ch == -1 || ch == 4) {
1322 #define NEWTYPE(x, y) rz_mem_dup(&(y), sizeof(x));
1331 " jk - select next/prev rop gadget\n"
1332 " JK - scroll next/prev page from list\n"
1333 " hl - increase/decrease delta offset in disasm\n"
1334 " \\n - enter key or dot will add the current offset into the chain\n"
1335 " i - enter a number to be pushed into the chain\n"
1336 " : - run rizin command\n"
1337 " ; - add comment in current offset\n"
1338 " <- - backspace - delete last gadget from the chain\n"
1339 " / - highlight given word\n"
1340 " y - yank current rop chain into the clipboard (y?)\n"
1341 " o - seek to given offset\n"
1342 " r - run /R again\n"
1343 " ? - show this help message\n"
1344 " q - quit this view\n");
1358 if (!*
cmd || *
cmd ==
'q') {
1400 rz_core_cmd0(core,
"?i highlight;e scr.highlight=`yp`");
1420 if (curline && *curline) {
1486 const char *fs =
NULL, *fs2 =
NULL;
1496 if (rz_flag_space_is_empty(core->
flags)) {
1504 rz_cons_printf(
"Flags in flagspace '%s'. Press '?' for help.\n\n",
1505 rz_flag_space_cur_name(core->
flags));
1512 rz_list_foreach (l,
iter, fi) {
1519 if (cur && hasColor) {
1524 if (cur && hasColor) {
1533 if (!
hit &&
i > 0) {
1556 case 3: strcpy(
cmd,
"f=");
break;
1557 default: format = 0;
continue;
1571 rz_flag_space_foreach(core->
flags, it,
s) {
1579 (
s == cur) ?
'*' :
' ',
1589 !cur ?
'*' :
' ',
"*");
1591 if (!
hit &&
i > 0) {
1598 if (ch == -1 || ch == 4) {
1611 case 'J':
option += 10;
break;
1614 case 'j':
option++;
break;
1638 if (rz_flag_space_is_empty(core->
flags)) {
1649 rz_flag_space_set(core->
flags,
cmd);
1702 eprintf(
"Rename flag '%s' as:\n", fs2);
1717 eprintf(
"Rename function '%s' as:\n", fs2);
1734 case 'p': format++;
break;
1744 rz_flag_space_set(core->
flags, fs);
1752 "\nVF: Visual Flags help:\n\n"
1754 " j/k - line down/up keys\n"
1755 " J/K - page down/up keys\n"
1757 " C - toggle colors\n"
1758 " l/' ' - accept current selection\n"
1759 " a/d/e - add/delete/edit flag\n"
1760 " +/- - increase/decrease block size\n"
1761 " o - sort flags by offset\n"
1762 " r/R - rename flag / Rename function\n"
1763 " n - sort flags by name\n"
1764 " p/P - rotate print format\n"
1765 " _ - hud for flags and comments\n"
1766 " : - enter command\n");
1778 cmd[
sizeof(
cmd) - 1] = 0;
1797 int format = 0,
i = 0;
1845 default: format = 0;
continue;
1905 "\nVT: Visual Comments/Analysis help:\n\n"
1907 " j/k - down/up keys\n"
1909 " l/' ' - accept current selection\n"
1910 " a/d/e - add/delete/edit comment/analysis symbol\n"
1911 " p/P - rotate print format\n");
1964 if (node && !rz_list_empty(node->
options)) {
1986 int i, j, ch,
hit, show;
2029 if (!
hit && j > 0) {
2055 if (!
hit && j > 0) {
2067 if (fs && !strncmp(fs,
"asm.", 4)) {
2072 if (ch == 4 || ch == -1) {
2078 case 'j':
option++;
break;
2080 case 'J':
option += 4;
break;
2128 " j/k - down/up keys\n"
2130 " $ - same as ?$ - show values of vars\n"
2131 " e/' ' - edit/toggle current variable\n"
2132 " E - edit variable with 'cfg.editor' (vi?)\n"
2133 " +/- - increase/decrease numeric value (* and /, too)\n"
2134 " : - enter command\n");
2179 rz_list_foreach (
list,
iter, var) {
2198 rz_list_foreach (
list,
iter, var) {
2216 char *
buf, *inputing;
2224 for (
int i = 0;
i < strlen(visual_inputing);
i++) {
2257 bool contain =
true;
2260 contain = contain && strstr(fcn->
name, (
char *)*it);
2276 int wdelta = (
idx > 5) ?
idx - 5 : 0;
2277 char *var_functions;
2282 int window,
i = 0, print_full_func;
2294 if (visual_filter) {
2299 filter_fcn = visual_filter;
2304 rz_list_foreach (filter_fcn,
iter, fcn) {
2305 print_full_func =
true;
2307 if (
i >
window + wdelta - 1) {
2319 (
idx ==
i) ?
'*' :
' ',
2321 color_fcn, fcn->
name);
2325 (
idx ==
i) ?
'*' :
' ',
2328 if (var_functions) {
2331 int columns = fun_len > cols ? cols - 2 : cols;
2335 print_full_func =
false;
2339 if (print_full_func) {
2360 int wdelta = (
idx > 5) ?
idx - 5 : 0;
2372 if (*vindex >= llen) {
2376 rz_list_foreach (
list,
iter, var) {
2384 switch (var->
kind & 0xff) {
2388 eprintf(
"Register not found");
2392 i == *vindex ?
"* " :
" ",
2398 i == *vindex ?
"* " :
" ",
2399 var->
delta < 0 ?
"var" :
"arg",
2402 (var->
kind ==
'v') ?
"-" :
"+",
2407 i == *vindex ?
"* " :
" ",
2408 var->
delta < 0 ?
"var" :
"arg",
2411 (var->
kind ==
'v') ?
"-" :
"+",
2430 #define lastPrintMode 6
2432 "pdf",
"pd $r",
"afi",
"pdsf",
"pdc",
"pdr"
2465 "(a)",
"analyze ",
"(-)",
"delete ",
"(x)",
"xrefs to ",
"(X)",
"xrefs from\n",
2466 "(r)",
"rename ",
"(c)",
"calls ",
"(d)",
"define ",
"(:)",
"shell ",
"(v)",
"vars\n",
2467 "(j/k)",
"next/prev ",
"(tab)",
"column ",
"(_)",
"hud ",
"(?)",
" help\n",
2468 "(f/F)",
"set/reset filter ",
"(s)",
"function signature ",
"(q)",
"quit\n\n",
2473 "(a)",
"add ",
"(x)",
"xrefs ",
"(r)",
"rename\n",
2474 "(t)",
"type ",
"(g)",
"go ",
"(-)",
"delete\n",
2475 "(q)",
"quit ",
"(s)",
"signature\n\n",
2480 "j,k",
"select next/prev item or scroll if tab pressed",
2481 "J,K",
"scroll next/prev page \"\"",
2482 "f,F",
"set/reset filter keyword",
2483 "h,q",
"go back, quit",
2484 "p,P",
"switch next/prev print mode",
2485 "v",
"view selected function arguments and variables",
2486 "x,X",
"see xrefs to the selected function",
2487 "tab",
"toggle disasm column selection (to scroll in code)",
2488 "!",
"run 'afls' to sort all functions by address",
2489 ".",
"seek to current function address",
2490 ":",
"run rizin commands",
2491 "_",
"hud mode. same as: s $(afl~...)",
2492 "enter",
"enter function view (variables), xrefs",
2497 " functions:",
"Add, Modify, Delete, Xrefs Calls Vars",
2498 " variables:",
"Add, Modify, Delete",
2509 for (
i = 0;
help[
i];
i += 2) {
2511 pal_args_color,
help[
i],
2512 pal_help_color,
help[
i + 1], pal_reset);
2625 "vbd: Visual Browse Debugtraces:\n\n"
2626 " q - quit the bit editor\n"
2627 " Q - Quit (jump into the disasm view)\n"
2628 " j/k - Select next/previous trace\n"
2629 " : - enter command\n");
2639 free(trace_addr_str);
2657 if (ch == 4 || ch == -1) {
2669 core->
vmode =
false;
2741 int nfcns, ch, _option = 0;
2799 if (ch == 4 || ch == -1) {
2857 rz_core_cmd0(core,
"?i highlight;e scr.highlight=`yp`");
2870 eprintf(
"Select variable source ('r'egister, 's'tackptr or 'b'aseptr): ");
2874 addVar(core,
type,
"Source Register Name: ");
3007 static int sortMode = 0;
3008 const char *sortModes[4] = {
"aflsa",
"aflss",
"aflsb",
"aflsn" };
3126 const char *
lines[] = {
"[dh]- Define analysis hint:",
" b [16,32,64] set bits hint",
NULL };
3152 int i,
h = 0,
n, ch, ntotal = 0;
3176 const char *
lines[] = {
"",
"[Vd]- Define current block as:",
" $ define flag size",
" 1 edit bits",
" a assembly",
" b as byte (1 byte)",
" B define half word (16 bit, 2 byte size)",
" c as code (unset any data / string / format) in here",
" C define flag color (fc)",
" d set as data",
" e end of function",
" f analyze function",
" F format",
" h define hint (for half-word, see 'B')",
" i (ahi) immediate base (b(in), o(ct), d(ec), h(ex), s(tr))",
" I (ahi1) immediate base (b(in), o(ct), d(ec), h(ex), s(tr))",
" j merge down (join this and next functions)",
" k merge up (join this and previous function)",
" h define analysis hint",
" m manpage for current call",
" n rename flag used at cursor",
" N edit function signature (afs!)",
" o opcode string",
" r rename function",
" R find references /r",
" s set string",
" S set strings in current block",
" t set opcode type via aht hints (call, nop, jump, ...)",
" u undefine metadata here",
" v rename variable at offset that matches some hex digits",
" x find xrefs to current address (./r)",
" w set as 32bit word",
" W set as 64bit word",
" q quit menu",
" z zone flag",
NULL };
3204 strcpy(
cmd,
"Cf 0 ");
3291 char *
p = strstr(man,
"INODE");
3316 if (newname && *newname) {
3360 eprintf(
"Sorry. No flag here\n");
3378 eprintf(
"Sorry. No flag here\n");
3424 bool is_wide =
false;
3433 strcpy(
name,
"str.");
3434 for (
i = 0, j = 0;
i <
n;
i++, j++) {
3435 name[4 +
i] =
p[j + ntotal];
3436 if (!
p[j + ntotal]) {
3439 if (!
p[j + 1 + ntotal]) {
3441 if (j + 3 + ntotal <
n) {
3453 off + ntotal, (
n * 2) + ntotal,
3454 (
const char *)
name + 4);
3457 off + ntotal,
n + ntotal,
3458 (
const char *)
name + 4);
3464 ntotal +=
n * 2 - 1;
3468 }
while (ntotal < plen);
3473 bool is_wide =
false;
3483 strcpy(
name,
"str.");
3484 for (
i = 0, j = 0;
i <
n;
i++, j++) {
3504 n * 2, (
const char *)
name + 4);
3507 n, (
const char *)
name + 4);
3537 char *endptr =
NULL;
3538 char *end_off =
rz_cons_input(
"Last hexadecimal digits of instruction: ");
3540 N = strtoull(end_off, &endptr, 16);
3542 if (!end_off || end_off == endptr) {
3543 eprintf(
"Invalid numeric input\n");
3551 ut64 tmp_N =
N >> 4;
3560 if (start_off > incr) {
3570 for (try_off = start_off; try_off < start_off + incr * 16; try_off += incr) {
3584 if (newname && *newname) {
3589 eprintf(
"Cannot find instruction with a variable\n");
3603 rep = rep * 10 + atoi((
char *)&ch);
3617 char preview_cmd[128] =
"pd $r";
3618 int ch, opt = 0, oopt = -1;
3620 char *rgb_xxx_fmt = truecolor ?
"rgb:%2.2x%2.2x%2.2x " :
"rgb:%x%x%x ";
3657 char *esc = strchr(cstr + 1,
'\x1b');
3660 rz_cons_printf(
"# Use '.' to randomize current color and ':' to randomize palette\n");
3663 "' to change foreground/background color\n");
3664 rz_cons_printf(
"# Export colorscheme with command 'ec* > filename'\n");
3665 rz_cons_printf(
"# Preview command: '%s' - Press 'c' to change it\n", preview_cmd);
3666 rz_cons_printf(
"# Selected colorscheme : %s - Use 'hl' or left/right arrow keys to change colorscheme\n", curtheme ? curtheme :
"default");
3667 rz_cons_printf(
"# Selected element: %s - Use 'jk' or up/down arrow keys to change element\n",
k);
3669 k,
color, atoi(cstr + 7), esc ? (
int)(esc - cstr - 1) : (
int)strlen(cstr + 1), cstr + 1);
3686 #define CASE_RGB(x, X, y) \
RZ_API RzAnalysisFunction * rz_analysis_get_function_at(RzAnalysis *analysis, ut64 addr)
RZ_API ut64 rz_analysis_function_size_from_entry(RzAnalysisFunction *fcn)
RZ_API ut64 rz_analysis_function_realsize(const RzAnalysisFunction *fcn)
static int analop(RzAnalysis *a, RzAnalysisOp *op, ut64 addr, const ut8 *buf, int len, RzAnalysisOpMask mask)
RZ_API char * rz_asm_op_get_hex(RzAsmOp *op)
RZ_API RZ_OWN RzAsmParseParam * rz_asm_get_parse_param(RZ_NULLABLE const RzReg *reg, ut32 ana_op_type)
Does all kinds of NULL checks on the parameters and returns an initialized RzAsmParseParam or NULL on...
RZ_DEPRECATE RZ_API RZ_OWN RzStrBuf * rz_asm_colorize_asm_str(RZ_BORROW RzStrBuf *asm_str, RZ_BORROW RzPrint *p, RZ_NULLABLE const RzAsmParseParam *param, RZ_NULLABLE const RzAsmTokenString *toks)
Colors a given asm string and returns it. If toks is not NULL it uses the tokens to color the asm str...
RZ_API int rz_asm_disassemble(RzAsm *a, RzAsmOp *op, const ut8 *buf, int len)
RZ_DEPRECATE RZ_API RZ_BORROW RzList * rz_bin_get_classes(RZ_NONNULL RzBin *bin)
static RzList * classes(RzBinFile *bf)
static RzBinSourceLineInfo * lines(RzBinFile *bf)
int bits(struct state *s, int need)
const lzma_allocator const uint8_t size_t uint8_t * out
RZ_API RZ_OWN RzType * rz_type_parse_string_single(RzTypeParser *parser, const char *code, char **error_msg)
Parses the single C type definition.
static RzNumCalcValue expr(RzNum *, RzNumCalc *, int)
RZ_API void rz_core_analysis_fcn_merge(RzCore *core, ut64 addr, ut64 addr2)
RZ_API void rz_core_analysis_undefine(RzCore *core, ut64 off)
RZ_API bool rz_core_analysis_function_add(RzCore *core, const char *name, ut64 addr, bool analyze_recursively)
RZ_API RzAnalysisOp * rz_core_analysis_op(RzCore *core, ut64 addr, int mask)
RZ_IPI void rz_core_analysis_function_signature_editor(RzCore *core, ut64 addr)
RZ_API bool rz_core_analysis_function_rename(RzCore *core, ut64 addr, const char *_name)
RZ_IPI bool rz_core_analysis_var_rename(RzCore *core, const char *name, const char *newname)
RZ_API char * rz_core_bin_method_flags_str(ut64 flags, int mode)
RZ_API bool rz_core_write_at(RzCore *core, ut64 addr, const ut8 *buf, int size)
RZ_API RzVector * rz_analysis_class_base_get_all(RzAnalysis *analysis, const char *class_name)
RZ_API RzVector * rz_analysis_class_method_get_all(RzAnalysis *analysis, const char *class_name)
RZ_API SdbList * rz_analysis_class_get_all(RzAnalysis *analysis, bool sorted)
RZ_API RzVector * rz_analysis_class_vtable_get_all(RzAnalysis *analysis, const char *class_name)
RZ_API int rz_core_cmd0(RzCore *core, const char *cmd)
RZ_API int rz_core_cmd(RzCore *core, const char *cstr, int log)
RZ_API char * rz_core_cmd_strf(RzCore *core, const char *fmt,...)
RZ_API int rz_core_cmdf(RzCore *core, const char *fmt,...)
RZ_API char * rz_core_cmd_str(RzCore *core, const char *cmd)
Executes a rizin command and returns the stdout as a string.
RZ_API bool rz_core_esil_dumpstack(RzAnalysisEsil *esil)
RZ_API void rz_core_debug_ri(RzCore *core)
RZ_API void rz_core_theme_nextpal(RzCore *core, RzConsPalSeekMode mode)
RZ_API char * rz_core_theme_get(RzCore *core)
RZ_API void rz_core_help_vars_print(RzCore *core)
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 RzConfigNode * rz_config_set(RzConfig *cfg, RZ_NONNULL const char *name, const char *value)
RZ_API RZ_BORROW RzConfigNode * rz_config_node_get(RzConfig *cfg, RZ_NONNULL const char *name)
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 bool rz_config_toggle(RzConfig *cfg, RZ_NONNULL const char *name)
RZ_API void rz_cons_clear00(void)
RZ_API void rz_cons_set_raw(bool is_raw)
RZ_API int rz_cons_get_size(int *rows)
RZ_API void rz_cons_column(int c)
RZ_API RzCons * rz_cons_singleton(void)
RZ_API void rz_cons_strcat(const char *str)
RZ_API void rz_cons_newline(void)
RZ_API void rz_cons_break_pop(void)
RZ_API void rz_cons_break_push(RzConsBreak cb, void *user)
RZ_API int rz_cons_printf(const char *format,...)
RZ_API void rz_cons_visual_flush(void)
RZ_API void rz_cons_strcat_at(const char *_str, int x, char y, int w, int h)
RZ_API void rz_cons_show_cursor(int cursor)
RZ_API void rz_cons_flush(void)
RZ_API void rz_cons_fill_line(void)
RZ_API void rz_cons_println(const char *str)
RZ_API void rz_cons_gotoxy(int x, int y)
RZ_API void rz_cons_clear(void)
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
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 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
RZ_API const char * rz_line_readline(void)
RZ_API RzAnalysisEsil * rz_analysis_esil_new(int stacksize, int iotrap, unsigned int addrsize)
RZ_API bool rz_analysis_esil_set_pc(RzAnalysisEsil *esil, ut64 addr)
RZ_API void rz_analysis_esil_free(RzAnalysisEsil *esil)
RZ_API bool rz_analysis_esil_runword(RzAnalysisEsil *esil, const char *word)
RZ_API int rz_analysis_function_resize(RzAnalysisFunction *fcn, int newsize)
RZ_API int rz_analysis_fcn_del(RzAnalysis *a, ut64 addr)
RZ_DEPRECATE RZ_API RzAnalysisFunction * rz_analysis_get_fcn_in(RzAnalysis *analysis, ut64 addr, int type)
RZ_API int rz_analysis_fcn_del_locs(RzAnalysis *analysis, ut64 addr)
RZ_API int rz_flag_rename(RzFlag *f, RzFlagItem *item, const char *name)
RZ_API RzFlagItem * rz_flag_get_i(RzFlag *f, ut64 off)
RZ_API const char * rz_flag_item_set_color(RzFlagItem *item, const char *color)
RZ_API RzList * rz_flag_all_list(RzFlag *f, bool by_space)
RZ_API RzFlagItem * rz_flag_set(RzFlag *f, const char *name, ut64 off, ut32 size)
RZ_API bool rz_flag_unset_name(RzFlag *f, const char *name)
RZ_API void rz_flag_foreach(RzFlag *f, RzFlagItemCb cb, void *user)
RZ_API char * sdb_fmt(const char *fmt,...)
void skip(file *in, unsigned n)
RZ_API void rz_analysis_hint_set_bits(RzAnalysis *a, ut64 addr, int bits)
RZ_API void rz_analysis_hint_set_immbase(RzAnalysis *a, ut64 addr, int base)
RZ_API void Ht_() free(HtName_(Ht) *ht)
RZ_API const KEY_TYPE bool * found
RZ_API void rz_cons_message(RZ_NONNULL const char *msg)
RZ_API char * rz_cons_hud(RzList *list, const char *prompt)
return memset(p, 0, total)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
RZ_API RZ_OWN char * rz_core_editor(const RzCore *core, RZ_NULLABLE const char *file, RZ_NULLABLE const char *str)
RZ_API bool rz_core_block_size(RzCore *core, ut32 bsize)
static int hit(RzSearchKeyword *kw, void *user, ut64 addr)
static void list(RzEgg *egg)
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
RZ_API RZ_OWN void * rz_list_pop(RZ_NONNULL RzList *list)
Removes and returns the last element of the list.
RZ_API RZ_OWN RzList * rz_list_new(void)
Returns a new initialized RzList pointer (free method is not initialized)
RZ_API void rz_list_sort(RZ_NONNULL RzList *list, RZ_NONNULL RzListComparator cmp)
Sorts via merge sort or via insertion sort a list.
RZ_API RZ_BORROW RzListIter * rz_list_push(RZ_NONNULL RzList *list, void *item)
Alias for rz_list_append.
RZ_API ut32 rz_list_length(RZ_NONNULL const RzList *list)
Returns the length of the list.
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.
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 times
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 ls_free(SdbList *list)
#define ls_foreach(list, it, pos)
RZ_API void rz_analysis_op_free(void *op)
RZ_API bool rz_analysis_op_fini(RzAnalysisOp *op)
RZ_API int rz_analysis_op(RzAnalysis *analysis, RzAnalysisOp *op, ut64 addr, const ut8 *data, int len, RzAnalysisOpMask mask)
RZ_API const char * rz_cons_pal_get_name(int index)
RZ_API RzColor rz_cons_pal_get_i(int index)
RZ_API int rz_cons_pal_len(void)
RZ_API void rz_cons_pal_random(void)
RZ_API char * rz_print_hexpair(RzPrint *p, const char *str, int n)
static void pad(RzStrBuf *sb, ut32 count)
RZ_API RzRegItem * rz_reg_index_get(RzReg *reg, int idx)
static void repeat(struct parse *, sopno, int, int)
RZ_API char * rz_cons_rgb_str(char *outstr, size_t sz, const RzColor *rcolor)
@ RZ_ANALYSIS_FCN_TYPE_NULL
@ RZ_ANALYSIS_OP_MASK_ALL
@ RZ_ANALYSIS_OP_MASK_BASIC
@ RZ_ANALYSIS_OP_MASK_ESIL
#define rz_warn_if_reached()
#define rz_return_val_if_fail(expr, val)
static bool rz_config_node_is_bool(RzConfigNode *node)
static bool rz_config_node_is_int(RzConfigNode *node)
void(* RzConsEvent)(void *)
static ut64 rz_read_be64(const void *src)
static ut32 rz_read_be32(const void *src)
static RzIntervalNode * rz_interval_tree_iter_get(RzIntervalTreeIter *it)
#define rz_interval_tree_foreach(tree, it, dat)
RZ_API bool rz_name_filter(char *name, int len, bool strict)
RZ_API ut64 rz_num_get(RzNum *num, const char *str)
RZ_API ut64 rz_num_math(RzNum *num, const char *str)
RZ_API size_t rz_num_base_of_string(RzNum *num, RZ_NONNULL const char *str)
Convert the base suffix to the numeric value.
RZ_API int rz_num_rand(int max)
#define RZ_PRINT_FLAGS_COLOR
RZ_API const char * rz_str_lchr(const char *str, char chr)
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_ndup(RZ_NULLABLE const char *ptr, int len)
Create new copy of string ptr limited to size len.
RZ_API char * rz_str_new(const char *str)
RZ_API size_t rz_str_ansi_len(const char *str)
RZ_API char * rz_str_dup(char *ptr, const char *string)
RZ_API char * rz_str_trim_dup(const char *str)
RZ_API int rz_str_ccpy(char *dst, char *orig, int ch)
RZ_API char RZ_API char * rz_str_appendch(char *x, char y)
RZ_API char * rz_str_ansi_crop(const char *str, unsigned int x, unsigned int y, unsigned int x2, unsigned int y2)
RZ_API const char * rz_str_trim_head_ro(const char *str)
RZ_API bool rz_str_ccmp(const char *dst, const char *orig, int ch)
RZ_API size_t rz_str_nlen_w(const char *s, int n)
RZ_API void rz_str_trim(RZ_NONNULL RZ_INOUT char *str)
Removes whitespace characters (space, tab, newline etc.) from the beginning and end of a string.
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)
RZ_API int rz_str_replace_char(char *s, int a, int b)
RZ_API const char * rz_str_casestr(const char *a, const char *b)
RZ_API const char * rz_str_pad(const char ch, int len)
RZ_API RzList * rz_str_split_list(char *str, const char *c, int n)
Split the string str according to the substring c and returns a RzList with the result.
RZ_API RZ_OWN char * rz_strbuf_drain(RzStrBuf *sb)
RZ_API char * rz_strbuf_get(RzStrBuf *sb)
RZ_API RzStrBuf * rz_strbuf_new(const char *s)
RZ_API void rz_strbuf_free(RzStrBuf *sb)
RZ_API bool rz_strbuf_appendf(RzStrBuf *sb, const char *fmt,...) RZ_PRINTF_CHECK(2
RZ_API int rz_strbuf_length(RzStrBuf *sb)
RZ_API int rz_sys_cmdf(const char *fmt,...) RZ_PRINTF_CHECK(1
RZ_API int rz_sys_usleep(int usecs)
Sleep for usecs microseconds.
RZ_API int rz_sys_sleep(int secs)
Sleep for secs seconds.
#define RZ_BIT_UNSET(x, y)
#define RZ_FREE_CUSTOM(x, y)
RZ_API RzPVector * rz_pvector_new(RzPVectorFree free)
#define rz_vector_foreach(vec, it)
static void ** rz_pvector_push(RzPVector *vec, void *x)
RZ_API void rz_vector_free(RzVector *vec)
RZ_API void rz_pvector_free(RzPVector *vec)
#define rz_pvector_foreach(vec, it)
static char * sdbkv_key(const SdbKv *kv)
RZ_API bool rz_core_seek_and_save(RzCore *core, ut64 addr, bool rb)
Save currently marked state in seek history and seek to addr .
RZ_API bool rz_core_seek(RzCore *core, ut64 addr, bool rb)
Seek to addr.
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr from
static struct sockaddr static addrlen static backlog const void msg
RzAsmTokenString * asm_toks
Tokenized asm string.
RzConsPrintablePalette pal
RzCoreVisualMode printidx
RzCoreTaskScheduler tasks
char * name[RZ_REG_NAME_LAST]
RZ_API void rz_core_task_enqueue_oneshot(RzCoreTaskScheduler *scheduler, RzCoreTaskOneShot func, void *user)
RZ_API RZ_OWN char * rz_type_as_string(const RzTypeDB *typedb, RZ_NONNULL const RzType *type)
Returns the type C representation.
RZ_DEPRECATE RZ_API RzList * rz_analysis_var_all_list(RzAnalysis *analysis, RzAnalysisFunction *fcn)
RZ_API bool rz_analysis_var_rename(RzAnalysisVar *var, const char *new_name, bool verbose)
RZ_API void rz_analysis_var_set_type(RzAnalysisVar *var, RZ_OWN RzType *type, bool resolve_overlaps)
RZ_DEPRECATE RZ_API RzAnalysisVar * rz_analysis_get_used_function_var(RzAnalysis *analysis, ut64 addr)
RZ_API void rz_core_visual_asm(RzCore *core, ut64 off)
RZ_API void rz_core_visual_offset(RzCore *core)
RZ_API void rz_core_visual_append_help(RzStrBuf *p, const char *title, const char **help)
RZ_API int rz_core_visual_prompt(RzCore *core)
RZ_API int rz_core_visual(RzCore *core, const char *input)
RZ_API int rz_core_visual_xrefs(RzCore *core, bool xref_to, bool fcnInsteadOfAddr)
RZ_API void rz_core_visual_showcursor(RzCore *core, int x)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
RZ_API bool rz_core_yank_hexpair(RzCore *core, const char *str)
static bool input(void *ud, zip_uint8_t *data, zip_uint64_t length)