8 #define TN_KEY_FMT "%" PFMT64u
14 #include "../linux_heap_jemalloc.c"
17 #include "../core_private.h"
19 #define CMD_CHECK_DEBUG_DEAD(core) \
21 if (rz_debug_is_dead(core->dbg)) { \
22 rz_cons_println("Debugging is not enabled. Run ood?"); \
23 return RZ_CMD_STATUS_ERROR; \
28 "Usage:",
"d",
" # Debug commands",
29 "db",
"[?]",
"Breakpoints commands",
30 "dbt",
"[?]",
"Display backtrace based on dbg.btdepth and dbg.btalgo",
31 "dc",
"[?]",
"Continue execution",
32 "dd",
"[?]",
"File descriptors (!fd in r1)",
33 "de",
"[-sc] [perm] [rm] [e]",
"Debug with ESIL (see de?)",
34 "dg",
" <file>",
"Generate a core-file (WIP)",
35 "dH",
" [handler]",
"Transplant process to a new handler",
36 "di",
"[?]",
"Show debugger backend information (See dh)",
37 "dk",
"[?]",
"List, send, get, set, signal handlers of child",
38 "dL",
"[?]",
"List or set debugger handler",
39 "dm",
"[?]",
"Show memory maps",
40 "do",
"[?]",
"Open process (reload, alias for 'oo')",
41 "doc",
"",
"Close debug session",
42 "dp",
"[?]",
"List, attach to process or thread id",
43 "dr",
"[?]",
"Cpu registers",
44 "ds",
"[?]",
"Step, over, source line",
45 "dt",
"[?]",
"Display instruction traces",
46 "dw",
" <pid>",
"Block prompt until pid dies",
48 "dW",
"",
"List process windows",
49 "dWi",
"",
"Identify window under cursor",
51 "dx",
"[?]",
"Inject and run code on target process (See gs)",
56 "Usage:",
"dcs",
" Continue until syscall",
57 "dcs",
"",
"Continue until next syscall",
58 "dcs [str]",
"",
"Continue until next call to the 'str' syscall",
59 "dcs",
"*",
"Trace all syscalls, a la strace",
64 "Usage:",
"dcu",
" Continue until address",
65 "dcu.",
"",
"Alias for dcu $$ (continue until current address",
66 "dcu",
" address",
"Continue until address",
67 "dcu",
" [..tail]",
"Continue until the range",
68 "dcu",
" [from] [to]",
"Continue until the range",
73 "Usage: dd",
"",
"Descriptors commands",
74 "dd",
"",
"List file descriptors",
75 "dd",
" <file>",
"Open and map that file into the UI",
76 "dd-",
"<fd>",
"Close stdout fd",
77 "dd*",
"",
"List file descriptors (in rizin commands)",
78 "dds",
" <fd> <off>",
"Seek given fd)",
79 "ddd",
" <fd1> <fd2>",
"Dup2 from fd1 to fd2",
80 "ddr",
" <fd> <size>",
"Read N bytes from fd",
81 "ddw",
" <fd> <hexpairs>",
"Write N bytes to fd",
86 "Usage:",
"de",
"[-sc] [perm] [rm] [expr]",
87 "de",
"",
"List esil watchpoints",
88 "de-*",
"",
"Delete all esil watchpoints",
89 "de",
" [perm] [rm] [addr|reg|from..to]",
"Stop on condition",
90 "dec",
"",
"Continue execution until matching expression",
91 "des",
"[?] [N]",
"Step-in N instructions with esildebug",
92 "desu",
" [addr]",
"Esildebug until specific address",
97 "Usage:",
"des",
"[u] [arg]",
98 "des",
" [N]",
"step-in N instructions with esildebug",
99 "desu",
" [addr]",
"esildebug until specific address",
104 "Usage: di",
"",
"Debugger target information",
105 "di",
"",
"Show debugger target information",
106 "di*",
"",
"Same as above, but in rizin commands",
107 "diq",
"",
"Same as above, but in one line",
108 "dij",
"",
"Same as above, but in JSON format",
109 "dif",
" [$a] [$b]",
"Compare two files (or $alias files)",
114 "Usage: dk",
"",
"Signal commands",
115 "dk",
"",
"List all signal handlers of child process",
116 "dk",
" <signal>",
"Send KILL signal to child",
117 "dk",
" <signal>=1",
"Set signal handler for <signal> in child",
118 "dk?",
"<signal>",
"Name/signum resolver",
119 "dko",
"[?] <signal>",
"Reset skip or cont options for given signal",
120 "dko",
" <signal> [|skip|cont]",
"On signal SKIP handler or CONT into",
121 "dkj",
"",
"List all signal handlers in JSON",
126 "Usage:",
"dko",
" # Signal handling commands",
127 "dko",
"",
"List existing signal handling",
128 "dko",
" [signal]",
"Clear handling for a signal",
129 "dko",
" [signal] [skip|cont]",
"Set handling for a signal",
134 "Usage: dmi",
"",
" # List/Load Symbols",
135 "dmi",
"[j|q|*] [libname] [symname]",
"List symbols of target lib",
136 "dmia",
"[j|q|*] [libname]",
"List all info of target lib",
137 "dmi*",
"",
"List symbols of target lib in rizin commands",
138 "dmi.",
"",
"List closest symbol to the current address",
139 "dmiv",
"",
"Show address of given symbol for given lib",
144 "Usage:",
"dp",
" # Process commands",
145 "dp",
"",
"List current pid and children",
146 "dp",
" <pid>",
"List children of pid",
147 "dpj",
" <pid>",
"List children of pid in JSON format",
148 "dpl",
"",
"List all attachable pids",
149 "dplj",
"",
"List all attachable pids in JSON format",
150 "dp-",
" <pid>",
"Detach select pid",
151 "dp=",
"<pid>",
"Select pid",
152 "dpa",
" <pid>",
"Attach and select pid",
153 "dpc",
"",
"Select forked pid (see dbg.forks)",
154 "dpc*",
"",
"Display forked pid (see dbg.forks)",
155 "dpe",
"",
"Show path to executable",
156 "dpf",
"",
"Attach to pid like file fd // HACK",
157 "dpk",
" <pid> [<signal>]",
"Send signal to process (default 0)",
158 "dpn",
"",
"Create new process (fork)",
159 "dptn",
"",
"Create new thread (clone)",
160 "dpt",
"",
"List threads of current pid",
161 "dptj",
"",
"List threads of current pid in JSON format",
162 "dpt",
" <pid>",
"List threads of process",
163 "dptj",
" <pid>",
"List threads of process in JSON format",
164 "dpt=",
"<thread>",
"Attach to thread",
169 "Usage: dx",
"",
" # Code injection commands",
170 "dx",
" <opcode>...",
"Inject opcodes",
171 "dxa",
" nop",
"Assemble code and inject",
172 "dxe",
" egg-expr",
"Compile egg expression and inject it",
173 "dxr",
" <opcode>...",
"Inject opcodes and restore state",
174 "dxs",
" write 1, 0x8048, 12",
"Syscall injection (see gs)",
175 "\nExamples:",
"",
"",
176 "dx",
" 9090",
"Inject two x86 nop",
177 "\"dxa mov eax,6;mov ebx,0;int 0x80\"",
"",
"Inject and restore state",
206 int i, *syscalls =
NULL;
217 }
else if (sig == 0) {
220 eprintf(
"Unknown syscall number\n");
228 eprintf(
"Running child until syscalls:");
235 eprintf(
"Running child until next syscall\n");
270 if (tn && tn_parent) {
297 vis.data = &aux_data;
306 "graph [bgcolor=white];\n"
307 " node [color=lightgray, style=filled"
308 " shape=box fontname=\"%s\" fontsize=\"8\"];\n",
311 rz_list_foreach (nodes,
iter,
n) {
319 "\" color=\"lightgray\" label=\"0x%08" PFMT64x
323 rz_list_foreach (neighbours, it_n,
w) {
334 "\" [color=\"red\"];\n",
359 eprintf(
"Cannot continue until address 0\n");
419 if (!instr || !core->
dbg) {
458 if (strstr(buf_asm, instr)) {
495 if (!core || !core->
dbg) {
501 RZ_LOG_ERROR(
"missing optypes. Usage example: 'dsuo ucall ujmp'\n");
525 goto cleanup_after_push;
530 goto cleanup_after_push;
541 goto cleanup_after_push;
548 rz_list_foreach (optypes_list,
iter,
optype) {
549 if (!strcmp(optype_str,
optype)) {
550 goto cleanup_after_push;
568 if (!core || !flagstr || !core->
dbg) {
584 rz_list_foreach (
list,
iter, flag) {
599 char file[512], file2[512];
600 int find_meta,
line = -1, line2 = -1;
601 char *tmp_ptr =
NULL;
630 }
while (!strcmp(
file, file2) &&
line == line2);
649 if (
input[2] ==
' ') {
657 if (
input[2] ==
'*') {
666 eprintf(
"No recently forked children\n");
676 ptr = strchr(ptr,
' ');
677 sig = ptr ? atoi(ptr + 1) : 0;
678 eprintf(
"Sending signal '%d' to pid '%d'\n", sig,
pid);
681 eprintf(
"cmd_debug_pid: Invalid arguments (%s)\n",
input);
692 if (
input[3] !=
' ') {
723 if (core->
file && core->
io) {
809 #define MAX_MAP_SIZE (1024 * 1024 * 512)
816 int ret = !rz_list_empty(core->
dbg->
maps);
820 if (
addr >=
map->addr && addr < map->addr_end) {
823 }
else if (perm == 0) {
825 }
else if (perm == (
map->perm & perm)) {
868 if (!(
addr >=
map->addr && addr < map->addr_end)) {
879 filtered_name,
map->addr);
903 pj_kn(pj,
"addr_end",
map->addr_end);
913 filtered_name,
map->addr);
926 if (!core || !libname) {
981 int mode,
bool symbols_only, RzCoreBinFilter *
filter) {
986 RzBinOptions opt = { 0 };
987 opt.obj_opts.elf_load_sections =
true;
988 opt.obj_opts.elf_checks_sections =
true;
989 opt.obj_opts.elf_checks_segments =
true;
999 int action = RZ_CORE_BIN_ACC_ALL & ~RZ_CORE_BIN_ACC_INFO;
1000 if (symbols_only ||
filter->name) {
1001 action = RZ_CORE_BIN_ACC_SYMBOLS;
1003 action &= ~RZ_CORE_BIN_ACC_ENTRIES & ~RZ_CORE_BIN_ACC_MAIN & ~RZ_CORE_BIN_ACC_MAPS;
1058 if (
addr >=
map->addr && addr < map->addr_end) {
1064 eprintf(
"The address doesn't match with any map.\n");
1096 }
else if (argc == 1) {
1141 const char *libname =
NULL, *symname =
NULL, *
a0;
1146 bool symbols_only =
true;
1147 if (
input[0] ==
'a') {
1148 symbols_only =
false;
1174 if (!ptr || !*ptr) {
1195 if (libname && !
addr) {
1198 eprintf(
"Unknown library, or not found in dm\n");
1205 filter.name = (
char *)symname;
1210 char *newfile =
NULL;
1221 eprintf(
"Error when removing %s\n", newfile);
1254 if (symbol->
vaddr -
addr < closest_addr) {
1256 closest_symbol = symbol;
1259 if (
addr - symbol->
vaddr < closest_addr) {
1261 closest_symbol = symbol;
1266 if (closest_symbol && bf) {
1299 }
else if (argc == 2) {
1323 const char *libname =
NULL, *sectname =
NULL, *
mode =
"";
1334 const char *
a0 =
argv[1];
1348 (libname !=
NULL && (strstr(
map->name, libname))))) {
1381 if (
addr >=
map->addr && addr < map->addr_end) {
1390 if (sz !=
map->size)
1399 eprintf(
"No debug region found here\n");
1420 return cmd_dbg_map_jemalloc_64(core,
input);
1422 return cmd_dbg_map_jemalloc_32(core,
input);
1433 rz_list_foreach (
regs, it, reg_item) {
1446 rz_flag_space_pop(core->
flags);
1469 rz_list_foreach (frames,
iter,
f) {
1475 char flagdesc[1024], flagdesc2[1024];
1477 flagdesc[0] = flagdesc2[0] = 0;
1482 snprintf(flagdesc,
sizeof(flagdesc),
1484 }
else if (
delta < 0) {
1485 snprintf(flagdesc,
sizeof(flagdesc),
1488 snprintf(flagdesc,
sizeof(flagdesc),
1492 snprintf(flagdesc,
sizeof(flagdesc),
1501 n,
f->addr,
f->sp, (
int)
f->size,
1502 fcn ? fcn->
name :
"??", flagdesc, flagdesc2);
1545 rz_list_foreach (frames,
iter,
f) {
1571 #include "..\debug\p\native\windows\windows_message.h"
1582 RZ_LOG_WARN(
"Invalid permissions provided for setting watchpoint. Defaulting to \"rw\".\n");
1593 if (
addr >
f->offset) {
1614 ht_up_insert(ht,
addr, t_node);
1625 const char *
name =
"";
1630 for (
i = 0;
i <
n->depth - 1;
i++) {
1646 fprintf(stderr,
"\x1b[2K\r");
1696 if (
addr == final_addr) {
1711 int called_in_range;
1718 called_in_range = called_addr >=
from && called_addr <
to;
1719 if (!called_in_range && addr_in_range && !shallow_trace) {
1722 if (addr_in_range || shallow_trace) {
1733 if (!called_in_range && addr_in_range && !shallow_trace) {
1736 if (addr_in_range || shallow_trace) {
1745 if (cur !=
tr->root) {
1758 eprintf(
"No process to debug.");
1768 eprintf(
"Cannot set breakpoint at final address (%" PFMT64x ")\n", final_addr);
1792 int perm = 0,
dev = 0;
1793 p = strchr(
line,
' ');
1796 if (strchr(
line,
'r'))
1798 if (strchr(
line,
'w'))
1800 if (strchr(
line,
'x'))
1813 const char *help_de_msg[] = {
1814 "Usage:",
"de",
" [perm] [reg|mem] [expr]",
1826 eprintf(
"Error: no esil watchpoints defined\n");
1838 while (
addr != fin) {
1842 if (naddr ==
addr) {
1843 eprintf(
"Detected loophole\n");
1862 " de r r rip # stop when reads rip\n"
1863 " de rw m ADDR # stop when read or write in ADDR\n"
1864 " de w r rdx # stop when rdx register is modified\n"
1865 " de x m FROM..TO # stop when rip in range\n");
1873 const char *signame, *
arg =
input + 1;
1888 }
else if (*
input ==
'o') {
1897 p = strchr(
name,
' ');
1909 }
else if (*
p ==
's') {
1911 }
else if (*
p ==
'c') {
1914 eprintf(
"Invalid option: %s\n",
p);
1927 rz_cons_println(
"NOTE: [signal] can be a number or a string that resolves with dk?\n"
1928 " skip means do not enter into the signal handler\n"
1929 " continue means enter into the signal handler");
1932 }
else if (*
input ==
'j') {
1934 }
else if (!*
input) {
1937 int sig = atoi(
input);
1938 char *
p = strchr(
input,
'=');
1948 const char *ptr =
NULL;
1950 bool dcu_range =
false;
1952 if (invalid || (
input[2] !=
' ' &&
input[2] !=
'.')) {
1957 if (
input[2] ==
'.') {
1958 ptr = strchr(
input + 3,
' ');
1961 if (ptr[1] ==
'.') {
1971 ptr = strchr(
input + 3,
' ');
1974 if (ptr[1] ==
'.') {
2002 }
while (pc < from || pc >
to);
2107 for (
int i = 1;
i < argc; ++
i) {
2197 RZ_LOG_ERROR(
"Cannot start session outside of debug mode, run ood?\n");
2293 if (!strncmp(
input,
"ate", 3)) {
2313 char *
str = strchr(
input + 2,
' ');
2330 char *
str = strchr(
input + 3,
' ');
2338 eprintf(
"Cannot dup %d %d\n",
fd, (
int)newfd);
2346 char *
str = strchr(
input + 2,
' ');
2350 str = strchr(
str + 1,
' ');
2357 "dx ",
"Cannot read");
2364 char *
str = strchr(
input + 2,
' ');
2368 str = strchr(
str + 1,
' ');
2400 eprintf(
"TODO: transplant process\n");
2412 #define P rz_cons_printf
2415 escaped_str = rz_str_escape(Y); \
2416 rz_cons_printf(X, escaped_str); \
2417 free(escaped_str); \
2422 P(
"signal=%s\n",
s ?
s :
"none");
2429 P(
"pid=%d\n",
rdi->pid);
2430 P(
"tid=%d\n",
rdi->tid);
2432 if (
rdi->uid != -1) {
2433 P(
"uid=%d\n",
rdi->uid);
2435 if (
rdi->gid != -1) {
2436 P(
"gid=%d\n",
rdi->gid);
2439 P(
"usr=%s\n",
rdi->usr);
2441 if (
rdi->exe && *
rdi->exe) {
2442 P(
"exe=%s\n",
rdi->exe);
2444 if (
rdi->cmdline && *
rdi->cmdline) {
2445 P(
"cmdline=%s\n",
rdi->cmdline);
2447 if (
rdi->cwd && *
rdi->cwd) {
2448 P(
"cwd=%s\n",
rdi->cwd);
2450 if (
rdi->kernel_stack && *
rdi->kernel_stack) {
2451 P(
"kernel_stack=\n%s\n",
rdi->kernel_stack);
2455 P(
"stopreason=%d\n", stop);
2459 if (
input[1] ==
'?') {
2460 eprintf(
"Usage: dif $a $b # diff two alias files\n");
2465 char *arg2 = strchr(
arg,
' ');
2477 eprintf(
"Cannot open those alias files\n");
2484 eprintf(
"Usage: dif $a $b # diff two alias files\n");
2506 P(
"\"signal\":\"%s\",",
s ?
s :
"none");
2513 P(
"\"pid\":%d,",
rdi->pid);
2514 P(
"\"tid\":%d,",
rdi->tid);
2515 P(
"\"uid\":%d,",
rdi->uid);
2516 P(
"\"gid\":%d,",
rdi->gid);
2518 PS(
"\"usr\":\"%s\",",
rdi->usr);
2521 PS(
"\"exe\":\"%s\",",
rdi->exe);
2524 PS(
"\"cmdline\":\"%s\",",
rdi->cmdline);
2527 PS(
"\"cwd\":\"%s\",",
rdi->cwd);
2530 P(
"\"stopreason\":%d}\n", stop);
2553 if (core->
dbg->
pid == -1) {
2554 eprintf(
"Not debugging, can't write core.\n");
2558 eprintf(
"Writing to file '%s'\n", corefile);
2563 eprintf(
"dg: coredump failed\n");
2567 perror(
"rz_buf_new_file");
2577 if (
input[1] ==
'i') {
2601 if (strlen(
input + 2) < 4096) {
2605 bytes, bytes_len, 0);
2607 eprintf(
"Invalid hexpairs\n");
2609 eprintf(
"Injection opcodes so long\n");
2645 if (
input[2] ==
' ') {
2647 if (strlen(
input + 2) < 4096) {
2650 if (bytes_len > 0) {
2655 eprintf(
"Invalid hexpairs\n");
2658 eprintf(
"Injection opcodes so long\n");
2669 eprintf(
"Missing parameter used in gs by dxs\n");
2705 "perm",
"hwsw",
"type",
"state",
"valid",
"cmd",
"cond",
"name",
"module");
2708 switch (
state->mode) {
2711 " %d %s %s %s %s %s cmd=\"%s\" cond=\"%s\" "
2712 "name=\"%s\" module=\"%s\"\n",
2713 b->addr,
b->addr +
b->size,
b->size,
2715 b->hw ?
"hw" :
"sw",
2716 b->trace ?
"trace" :
"break",
2717 b->enabled ?
"enabled" :
"disabled",
2726 rz_str_rwx_i(
b->perm),
b->hw ?
"hw" :
"sw",
b->trace ?
"trace" :
"break",
2731 if (
b->module_name) {
2739 pj_kN(pj,
"addr",
b->addr);
2740 pj_ki(pj,
"size",
b->size);
2743 pj_kb(pj,
"trace",
b->trace);
2744 pj_kb(pj,
"enabled",
b->enabled);
2870 }
else if (argc == 1) {
2874 }
else if (argc == 2) {
2895 unsigned int index = 0;
2898 RZ_LOG_ERROR(
"Unable to find breakpoint at index %d\n", index);
2910 for (
int i = 1;
i < argc;
i++) {
2941 RZ_LOG_ERROR(
"Unable to find breakpoint with index %d\n", index);
2954 RZ_LOG_ERROR(
"Unable to find breakpoint with index %d\n", index);
2967 RZ_LOG_ERROR(
"Unable to find breakpoint with index %d\n", index);
2980 RZ_LOG_ERROR(
"Unable to find breakpoint with index %d\n", index);
2993 RZ_LOG_ERROR(
"Unable to find breakpoint with index %d\n", index);
3006 RZ_LOG_ERROR(
"Unable to find breakpoint with index %d\n", index);
3017 }
else if (argc == 2) {
3028 for (
int i = 1;
i < argc;
i++) {
3040 RZ_LOG_ERROR(
"Unable to find debug backtrace frames\n");
3098 if (!strcmp(
argv[1],
"b")) {
3100 }
else if (!strcmp(
argv[1],
"s")) {
3106 RZ_LOG_ERROR(
"Unable to find debug backtrace frames\n");
3113 rz_list_foreach (
list,
iter, frame) {
3138 RZ_LOG_ERROR(
"Unable to find debug backtrace frames\n");
3150 RZ_LOG_ERROR(
"Unable to find debug backtrace frames\n");
3193 }
else if (argc == 2) {
3224 rz_cons_print(
"Breakpoint set.\n");
3226 rz_cons_print(
"Breakpoint not set.\n");
3229 RZ_LOG_ERROR(
"This command is only meant for Windows systems and cannot be used by your system\n");
3241 int old_pid = core->
dbg->
pid;
3262 eprintf(
"cannot continue back\n");
3312 eprintf(
"[+] Running 'dcs vfork fork clone' behind the scenes...\n");
3330 int old_pid = core->
dbg->
pid;
3331 int old_tid = core->
dbg->
tid;
3429 if (
input[0] ==
'?') {
3431 }
else if (
input[0] ==
'.' ||
input[0] ==
'\0') {
3455 for (
i = 1;
i < argc;
i++) {
3470 RZ_LOG_ERROR(
"Make sure to use the format <key>=<value> without spaces.\n");
3605 #define CMD_REGS_PREFIX debug
3606 #define CMD_REGS_REG_PATH dbg->reg
3610 #define CMD_REGS_SYNC cmd_regs_sync
3612 #undef CMD_REGS_PREFIX
3613 #undef CMD_REGS_REG_PATH
3614 #undef CMD_REGS_SYNC
RZ_API void * rz_asm_code_free(RzAsmCode *acode)
static int analop(RzAnalysis *a, RzAnalysisOp *op, ut64 addr, const ut8 *buf, int len, RzAnalysisOpMask mask)
RZ_API char * rz_asm_op_get_asm(RzAsmOp *op)
RZ_API int rz_reg_arena_push(RzReg *reg)
RZ_API void rz_reg_arena_pop(RzReg *reg)
RZ_API void rz_reg_arena_swap(RzReg *reg, int copy)
RZ_API int rz_asm_set_pc(RzAsm *a, ut64 pc)
RZ_API RzAsmCode * rz_asm_massemble(RzAsm *a, const char *assembly)
RZ_API int rz_asm_disassemble(RzAsm *a, RzAsmOp *op, const ut8 *buf, int len)
RZ_API bool rz_bin_file_set_cur_binfile(RzBin *bin, RzBinFile *bf)
RZ_API bool rz_bin_file_delete(RzBin *bin, RzBinFile *bf)
RZ_API RzBinObject * rz_bin_cur_object(RzBin *bin)
RZ_API RzBinFile * rz_bin_open_io(RzBin *bin, RzBinOptions *opt)
RZ_DEPRECATE RZ_API RZ_BORROW RzList * rz_bin_get_symbols(RZ_NONNULL RzBin *bin)
RZ_API RZ_BORROW RzBinSection * rz_bin_get_section_at(RzBinObject *o, ut64 off, int va)
Find the binary section at offset off.
RZ_API RzBinFile * rz_bin_cur(RzBin *bin)
RZ_API void rz_bin_set_baddr(RzBin *bin, ut64 baddr)
static ut64 baddr(RzBinFile *bf)
RzList * symbols(RzBinFile *bf)
const lzma_allocator const uint8_t size_t uint8_t * out
RZ_API bool rz_bp_is_valid(RzBreakpoint *bp, RzBreakpointItem *b)
RZ_API int rz_bp_del_index(RzBreakpoint *bp, int idx)
RZ_API RzBreakpointItem * rz_bp_get_in(RzBreakpoint *bp, ut64 addr, int perm)
RZ_API RzBreakpointItem * rz_bp_get_index(RzBreakpoint *bp, int idx)
RZ_API int rz_bp_get_index_at(RzBreakpoint *bp, ut64 addr)
RZ_API int rz_bp_set_trace(RzBreakpoint *bp, ut64 addr, int set)
RZ_API bool rz_bp_item_set_data(RZ_NONNULL RzBreakpointItem *item, RZ_NULLABLE const char *data)
set the data for a RzBreakpointItem
RZ_API RZ_BORROW RzBreakpointItem * rz_bp_get_at(RZ_NONNULL RzBreakpoint *bp, ut64 addr)
Get the breakpoint at exactly addr.
RZ_API bool rz_bp_del(RzBreakpoint *bp, ut64 addr)
RZ_API bool rz_bp_del_all(RzBreakpoint *bp)
RZ_API RzBreakpointItem * rz_bp_enable(RzBreakpoint *bp, ut64 addr, int set, int count)
RZ_API bool rz_bp_item_set_cond(RZ_NONNULL RzBreakpointItem *item, RZ_NULLABLE const char *cond)
set the condition for a RzBreakpointItem
RZ_API bool rz_bp_item_set_name(RZ_NONNULL RzBreakpointItem *item, RZ_NULLABLE const char *name)
set the name for a RzBreakpointItem
RZ_API bool rz_bp_item_set_expr(RZ_NONNULL RzBreakpointItem *item, RZ_NULLABLE const char *expr)
set the expr for a RzBreakpointItem
RZ_API void rz_bp_plugin_list(RzBreakpoint *bp)
RZ_API int rz_bp_use(RZ_NONNULL RzBreakpoint *bp, RZ_NONNULL const char *name)
RZ_API int rz_bp_plugin_del(RzBreakpoint *bp, const char *name)
RZ_API int rz_bp_traptrace_at(RzBreakpoint *bp, ut64 from, int len)
RZ_API void rz_bp_traptrace_list(RzBreakpoint *bp)
RZ_API void rz_bp_traptrace_enable(RzBreakpoint *bp, int enable)
RZ_API int rz_bp_traptrace_add(RzBreakpoint *bp, ut64 from, ut64 to)
RZ_API void rz_bp_traptrace_reset(RzBreakpoint *bp, int hard)
RZ_IPI void rz_core_agraph_print_interactive(RzCore *core)
RZ_IPI void rz_core_agraph_reset(RzCore *core)
RZ_IPI char * rz_core_analysis_all_vars_display(RzCore *core, RzAnalysisFunction *fcn, bool add_name)
RZ_API RzAnalysisOp * rz_core_analysis_op(RzCore *core, ut64 addr, int mask)
RZ_API bool rz_core_bin_apply_info(RzCore *r, RzBinFile *binfile, ut32 mask)
RZ_API bool rz_core_bin_print(RzCore *core, RZ_NONNULL RzBinFile *bf, ut32 mask, RzCoreBinFilter *filter, RzCmdStateOutput *state, RzList *hashes)
Print (to RzCons or inside RzCmdStateOutput) the binary information specified in mask.
RZ_API void rz_core_debug_bp_add_noreturn_func(RzCore *core)
Put a breakpoint into every no-return function.
RZ_API void rz_core_debug_map_print(RzCore *core, ut64 addr, RzCmdStateOutput *state)
RZ_API bool rz_core_debug_step_over(RzCore *core, int steps)
Step over.
RZ_API void rz_core_debug_breakpoint_toggle(RZ_NONNULL RzCore *core, ut64 addr)
Toggle breakpoint.
RZ_API bool rz_core_debug_step_skip(RzCore *core, int times)
Skip operations.
RZ_API bool rz_core_debug_step_back(RzCore *core, int steps)
Step back.
RZ_IPI void rz_core_debug_continue(RzCore *core)
RZ_API bool rz_core_debug_step_until_frame(RzCore *core)
Step until end of frame.
RZ_API void rz_debug_trace_print(RzDebug *dbg, RzCmdStateOutput *state, ut64 offset)
RZ_IPI void rz_core_debug_sync_bits(RzCore *core)
RZ_API void rz_debug_map_list_visual(RzDebug *dbg, ut64 addr, const char *input, int colors)
RZ_API RZ_OWN RzList * rz_core_debug_backtraces(RzCore *core)
Get backtraces based on dbg.btdepth and dbg.btalgo.
RZ_API void rz_debug_traces_ascii(RzDebug *dbg, ut64 offset)
RZ_API bool rz_core_debug_continue_until(RzCore *core, ut64 addr, ut64 to)
RZ_API bool rz_core_debug_process_close(RzCore *core)
Close debug process (Kill debugee and all child processes)
RZ_API RzCmdStatus rz_core_debug_plugins_print(RzCore *core, RzCmdStateOutput *state)
RZ_IPI void rz_core_debug_attach(RzCore *core, int pid)
RZ_API bool rz_core_debug_step_one(RzCore *core, int times)
RZ_IPI void rz_core_analysis_esil_init(RzCore *core)
RZ_API void rz_core_analysis_esil_reinit(RZ_NONNULL RzCore *core)
Reinitialize ESIL.
RZ_API bool rz_core_dump(RzCore *core, const char *file, ut64 addr, ut64 size, int append)
RZ_API int rz_core_cmd0(RzCore *core, const char *cmd)
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)
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 int rz_core_esil_step(RzCore *core, ut64 until_addr, const char *until_expr, ut64 *prev_addr, bool stepOver)
RZ_IPI int rz_output_mode_to_char(RzOutputMode mode)
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_set_columnsf(RzCmdStateOutput *state, const char *fmt,...)
Specify the columns of the command output.
RZ_API void rz_cmd_state_output_array_start(RzCmdStateOutput *state)
Mark the start of an array of elements in the output.
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 char * rz_cmd_alias_get(RzCmd *cmd, const char *k, int remote)
RZ_API void rz_cmd_state_output_print(RZ_NONNULL RzCmdStateOutput *state)
Print the output accumulated in state to RzCons, if necessary.
RZ_API void rz_cmd_state_output_array_end(RzCmdStateOutput *state)
Mark the end of an array of elements in the output.
RZ_IPI RzCmdStatus rz_cmd_debug_traces_reset_handler(RzCore *core, int argc, const char **argv)
RZ_IPI int rz_cmd_debug(void *data, const char *input)
RZ_IPI RzCmdStatus rz_cmd_debug_add_hw_bp_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_step_until_optype_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_dmS_handler(RzCore *core, int argc, const char **argv, RzOutputMode m)
static void cmd_debug_current_modules(RzCore *core, RzOutputMode mode)
RZ_IPI RzCmdStatus rz_cmd_debug_step_prog_handler(RzCore *core, int argc, const char **argv)
static const char * help_msg_di[]
RZ_IPI RzCmdStatus rz_cmd_debug_continue_unknown_call_handler(RzCore *core, int argc, const char **argv)
static bool step_until_optype(RzCore *core, RzList *optypes_list)
RZ_IPI RzCmdStatus rz_cmd_debug_stop_trace_session_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_debug_drx_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_step_until_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_display_bt_oneline_handler(RzCore *core, int argc, const char **argv)
static void cmd_debug_modules(RzCore *core, RzCmdStateOutput *state)
RZ_IPI int rz_cmd_debug_trace_addr(void *data, const char *input)
RZ_IPI RzCmdStatus rz_cmd_debug_toggle_bp_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_process_profile_handler(RzCore *core, int argc, const char **argv)
static int step_until_flag(RzCore *core, const char *flagstr)
RZ_IPI RzCmdStatus rz_cmd_debug_step_until_flag_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_start_trace_session_handler(RzCore *core, int argc, const char **argv)
static RzOutputMode rad2mode(int mode)
RZ_IPI RzCmdStatus rz_cmd_debug_bp_plugin_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_trace_tag_handler(RzCore *core, int argc, const char **argv)
static const char * help_msg_de[]
RZ_IPI RzCmdStatus rz_cmd_debug_bt_enable_bp_trace_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_display_bt_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
RZ_IPI RzCmdStatus rz_cmd_debug_trace_interactive_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_map_current_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_traces_ascii_handler(RzCore *core, int argc, const char **argv)
static const char * help_msg_des[]
RZ_IPI RzCmdStatus rz_cmd_debug_list_maps_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
RZ_IPI RzCmdStatus rz_cmd_debug_continue_send_signal_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_dump_maps_handler(RzCore *core, int argc, const char **argv)
static const char * help_msg_dcu[]
static char * get_corefile_name(const char *raw_name, int pid)
RZ_IPI RzCmdStatus rz_cmd_debug_set_cond_bp_win_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_step_line_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_traces_esil_i_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_dmL_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_add_bp_noreturn_func_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_remove_bp_plugin_handler(RzCore *core, int argc, const char **argv)
static void set_profile_string(RzCore *core, const char *str)
static void dot_trace_discover_child(RTreeNode *n, RTreeVisitor *vis)
static void cmd_debug_backtrace(RzCore *core, ut64 len)
static int step_until(RzCore *core, ut64 addr)
RZ_IPI RzCmdStatus rz_cmd_debug_enable_bp_index_handler(RzCore *core, int argc, const char **argv)
static void debug_trace_calls(RzCore *core, ut64 from, ut64 to, ut64 final_addr)
RZ_IPI RzCmdStatus rz_cmd_debug_enable_bp_trace_index_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_step_frame_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_set_expr_bp_index_handler(RzCore *core, int argc, const char **argv)
static const char * help_msg_d[]
RZ_IPI int rz_cmd_debug_continue_syscall(void *data, const char *input)
RZ_IPI RzCmdStatus rz_cmd_debug_command_bp_handler(RzCore *core, int argc, const char **argv)
static RzGraphNode * get_graphtrace_node(RzGraph *g, Sdb *nodes, struct trace_node *tn)
RZ_IPI RzCmdStatus rz_cmd_debug_continue_call_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_continue_ret_handler(RzCore *core, int argc, const char **argv)
static void cmd_debug_cont_syscall(RzCore *core, const char *_str)
RZ_IPI RzCmdStatus rz_cmd_debug_step_until_instr_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_disable_bp_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_allocate_maps_handler(RzCore *core, int argc, const char **argv)
static const char * help_msg_dd[]
static void dot_trace_traverse(RzCore *core, RTree *t, int fmt)
RZ_IPI RzCmdStatus rz_cmd_debug_display_bt_ascii_handler(RzCore *core, int argc, const char **argv)
static void cmd_debug_pid(RzCore *core, const char *input)
RZ_IPI RzCmdStatus rz_cmd_debug_add_bp_module_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_deallocate_map_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_add_watchpoint_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_toggle_bp_index_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_continue_mapped_io_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_trace_calls_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_bp_set_expr_cur_offset_handler(RzCore *core, int argc, const char **argv)
static RTreeNode * add_trace_tree_child(HtUP *ht, RTree *t, RTreeNode *cur, ut64 addr)
RZ_IPI void rz_core_static_debug_stop(void *u)
RZ_IPI RzCmdStatus rz_cmd_debug_continue_exception_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_modules_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
RZ_IPI RzCmdStatus rz_cmd_debug_trace_add_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_save_trace_session_handler(RzCore *core, int argc, const char **argv)
static const char * help_msg_dmi[]
static void consumeBuffer(RzBuffer *buf, const char *cmd, const char *errmsg)
RZ_IPI RzCmdStatus rz_cmd_debug_continue_back_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_toggle_bp_trace_index_handler(RzCore *core, int argc, const char **argv)
static void trace_traverse_pre(RTreeNode *n, RTreeVisitor *vis)
static ut8 * getFileData(RzCore *core, const char *arg)
RZ_API void rz_core_dbg_follow_seek_register(RzCore *core)
Seek to PC if needed.
RZ_IPI RzCmdStatus rz_cmd_debug_list_bp_indexes_handler(RzCore *core, int argc, const char **argv)
static int step_until_esil(RzCore *core, const char *esilstr)
RZ_IPI RzCmdStatus rz_cmd_debug_handler_set_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_list_bp_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
RZ_IPI RzCmdStatus rz_cmd_debug_step_until_esil_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_show_cur_bp_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_step_back_handler(RzCore *core, int argc, const char **argv)
static const char * help_msg_dp[]
static ut64 addroflib(RzCore *core, const char *libname)
RZ_API void rz_core_debug_clear_register_flags(RzCore *core)
RZ_IPI RzCmdStatus rz_cmd_debug_process_close_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_bt_disable_bp_trace_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_dml_handler(RzCore *core, int argc, const char **argv)
RZ_IPI int rz_cmd_debug_continue_until(void *data, const char *input)
RZ_IPI RzCmdStatus rz_cmd_debug_handler_list_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
RZ_IPI RzCmdStatus rz_cmd_debug_trace_esils_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_list_trace_session_mmap_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_load_trace_session_handler(RzCore *core, int argc, const char **argv)
static const char * help_msg_dko[]
RZ_IPI RzCmdStatus rz_debug_memory_permission_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_step_over_handler(RzCore *core, int argc, const char **argv)
static void do_debug_trace_calls(RzCore *core, ut64 from, ut64 to, ut64 final_addr)
static void dot_trace_create_node(RTreeNode *n, RTreeVisitor *vis)
RZ_IPI RzCmdStatus rz_cmd_debug_enable_bp_handler(RzCore *core, int argc, const char **argv)
static bool get_bin_info(RzCore *core, const char *file, ut64 baseaddr, PJ *pj, int mode, bool symbols_only, RzCoreBinFilter *filter)
RZ_IPI RzCmdStatus rz_cmd_debug_trace_esil_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_continue_execution_handler(RzCore *core, int argc, const char **argv)
static const char * help_msg_dk[]
RZ_IPI RzCmdStatus rz_cmd_debug_remove_all_bp_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_run_command_bp_index_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_process_profile_edit_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_add_bp_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_traces_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state)
RZ_IPI RzCmdStatus rz_cmd_debug_current_modules_handler(RzCore *core, int argc, const char **argv, RzOutputMode mode)
RZ_IPI RzCmdStatus rz_cmd_debug_step_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_remove_bp_index_handler(RzCore *core, int argc, const char **argv)
RZ_IPI int rz_cmd_debug_dmi(void *data, const char *input)
RZ_IPI RzCmdStatus rz_cmd_debug_step_cond_handler(RzCore *core, int argc, const char **argv)
static void asciiart_backtrace(RzCore *core, RzList *frames)
RZ_IPI RzCmdStatus rz_cmd_debug_trace_add_addrs_handler(RzCore *core, int argc, const char **argv)
static void trace_traverse(RTree *t)
RZ_IPI int rz_cmd_debug_heap_jemalloc(void *data, const char *input)
RZ_IPI RzCmdStatus rz_cmd_debug_dump_maps_all_handler(RzCore *core, int argc, const char **argv)
static void foreach_reg_set_or_clear(RzCore *core, bool set)
#define CMD_CHECK_DEBUG_DEAD(core)
RZ_IPI RzCmdStatus rz_cmd_debug_disable_bp_trace_index_handler(RzCore *core, int argc, const char **argv)
static void backtrace_vars(RzCore *core, RzList *frames)
static bool cmd_regs_sync(RzCore *core, RzRegisterType type, bool write)
static RzDebugMap * get_closest_map(RzCore *core, ut64 addr)
RZ_IPI RzCmdStatus rz_cmd_debug_list_maps_ascii_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_display_bt_local_vars_handler(RzCore *core, int argc, const char **argv)
RZ_API void rz_core_debug_ri(RzCore *core)
static const char * help_msg_dcs[]
RZ_IPI RzCmdStatus rz_cmd_debug_trace_handler(RzCore *core, int argc, const char **argv)
static bool step_until_inst(RzCore *core, const char *instr, bool regex)
RZ_IPI RzCmdStatus rz_cmd_debug_show_bp_index_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_remove_bp_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_disable_bp_index_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_debug_drx_unset_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_continue_fork_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_step_skip_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_trace_graph_handler(RzCore *core, int argc, const char **argv, RzOutputMode mode)
static void rz_core_debug_esil(RzCore *core, const char *input)
static bool cmd_dcu(RzCore *core, const char *input)
RZ_IPI RzCmdStatus rz_cmd_debug_name_bp_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_bt_toggle_bp_trace_handler(RzCore *core, int argc, const char **argv)
static bool is_repeatable_inst(RzCore *core, ut64 addr)
RZ_IPI RzCmdStatus rz_cmd_debug_add_cond_bp_handler(RzCore *core, int argc, const char **argv)
RZ_IPI void rz_core_debug_bp_add(RzCore *core, ut64 addr, const char *arg_perm, bool hwbp, bool watch)
RZ_IPI RzCmdStatus rz_cmd_debug_step_until_instr_regex_handler(RzCore *core, int argc, const char **argv)
RZ_IPI RzCmdStatus rz_cmd_debug_dump_maps_writable_handler(RzCore *core, int argc, const char **argv)
RZ_API void rz_core_debug_set_register_flags(RzCore *core)
static int dump_maps(RzCore *core, int perm, const char *filename)
RZ_IPI RzCmdStatus rz_cmd_debug_traces_esil_delete_handler(RzCore *core, int argc, const char **argv)
static bool step_line(RzCore *core, int times)
RZ_IPI RzCmdStatus rz_cmd_debug_continue_traptrace_handler(RzCore *core, int argc, const char **argv)
static void rz_core_debug_kill(RzCore *core, const char *input)
static const char * help_msg_dx[]
RZ_IPI void rz_regs_show_valgroup(RzCore *core, RzReg *reg, RzCmdRegSync sync_cb, const RzList *list)
RZ_API RZ_OWN RzList * rz_core_get_boundaries_prot(RzCore *core, int perm, const char *mode, const char *prefix)
RZ_IPI bool rz_core_seek_to_register(RzCore *core, const char *regname, bool is_silent)
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 const char * rz_config_get(RzConfig *cfg, RZ_NONNULL const char *name)
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 bool rz_cons_is_interactive(void)
RZ_API void rz_cons_flush(void)
RZ_API bool rz_cons_is_breaked(void)
RZ_API void rz_cons_println(const char *str)
RZ_API void rz_cons_pop(void)
RZ_API void rz_cons_push(void)
static RzCmdStatus bool2status(bool val)
RZ_API void rz_core_reg_update_flags(RzCore *core)
Update or create flags for all registers where it makes sense.
RZ_API RzReg * rz_core_reg_default(RzCore *core)
Get the currently relevant RzReg.
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 tv
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 cmd
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len key
RZ_DEPRECATE RZ_API bool rz_bin_addr2line(RzBin *bin, ut64 addr, char *file, int len, int *line)
RZ_API int rz_debug_desc_seek(RzDebug *dbg, int fd, ut64 addr)
RZ_API int rz_debug_desc_list(RzDebug *dbg, int rad)
RZ_API int rz_debug_desc_dup(RzDebug *dbg, int fd, int newfd)
RZ_API int rz_debug_desc_write(RzDebug *dbg, int fd, ut64 addr, int len)
RZ_API int rz_debug_desc_read(RzDebug *dbg, int fd, ut64 addr, int len)
RZ_API ut64 rz_debug_esil_continue(RzDebug *dbg)
RZ_API ut64 rz_debug_esil_step(RzDebug *dbg, ut32 count)
RZ_API void rz_debug_esil_prestep(RzDebug *d, int p)
RZ_API void rz_debug_esil_watch_list(RzDebug *dbg)
RZ_API int rz_debug_esil_watch_empty(RzDebug *dbg)
RZ_API void rz_debug_esil_watch_reset(RzDebug *dbg)
RZ_API void rz_debug_esil_watch(RzDebug *dbg, int rwx, int dev, const char *expr)
RZ_API RZ_OWN RzDiff * rz_diff_lines_new(RZ_BORROW const char *a, RZ_BORROW const char *b, RZ_NULLABLE RzDiffIgnoreLine ignore)
Returns the structure needed to diff lines.
RZ_API void rz_diff_free(RZ_NULLABLE RzDiff *diff)
frees the diff structure
RZ_API RzDebugMap * rz_debug_map_get(RzDebug *dbg, ut64 addr)
RZ_API void rz_debug_map_free(RzDebugMap *map)
RZ_API int rz_debug_map_dealloc(RzDebug *dbg, RzDebugMap *map)
RZ_API bool rz_debug_map_sync(RzDebug *dbg)
RZ_API RzDebugMap * rz_debug_map_alloc(RzDebug *dbg, ut64 addr, int size, bool thp)
RZ_API RzList * rz_debug_modules_list(RzDebug *dbg)
RZ_API ut64 rz_debug_reg_get(RzDebug *dbg, const char *name)
RZ_API int rz_debug_reg_sync(RzDebug *dbg, int type, int write)
RZ_API void rz_debug_session_free(RzDebugSession *session)
RZ_API bool rz_debug_add_checkpoint(RzDebug *dbg)
RZ_API RzDebugSession * rz_debug_session_new(void)
RZ_API bool rz_debug_session_save(RzDebugSession *session, const char *path)
RZ_API void rz_debug_session_list_memory(RzDebug *dbg)
RZ_API bool rz_debug_session_load(RzDebug *dbg, const char *path)
RZ_API void rz_debug_signal_setup(RzDebug *dbg, int num, int opt)
RZ_API void rz_debug_signal_list(RzDebug *dbg, RzOutputMode mode)
RZ_API int rz_debug_kill_setup(RzDebug *dbg, int sig, int action)
RZ_API void rz_egg_reset(RzEgg *egg)
RZ_API int rz_egg_compile(RzEgg *egg)
RZ_API RzBuffer * rz_egg_get_bin(RzEgg *egg)
RZ_API void rz_egg_load(RzEgg *egg, const char *code, int format)
RZ_API bool rz_egg_setup(RzEgg *egg, const char *arch, int bits, int endian, const char *os)
size_t map(int syms, int left, int len)
RZ_API int rz_analysis_esil_condition(RzAnalysisEsil *esil, const char *str)
RZ_API void rz_analysis_esil_trace_list(RzAnalysisEsil *esil)
RZ_API void rz_analysis_esil_trace_op(RzAnalysisEsil *esil, RZ_NONNULL RzAnalysisOp *op)
RZ_API void rz_analysis_esil_trace_show(RzAnalysisEsil *esil, int idx)
RZ_DEPRECATE RZ_API RzAnalysisFunction * rz_analysis_get_fcn_in(RzAnalysis *analysis, ut64 addr, int type)
RZ_API const RzList * rz_flag_get_list(RzFlag *f, ut64 off)
RZ_API RzFlagItem * rz_flag_get_at(RzFlag *f, ut64 off, bool closest)
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 char * sdb_fmt(const char *fmt,...)
RZ_API void Ht_() free(HtName_(Ht) *ht)
RZ_API void rz_analysis_il_trace_instruction_free(RzILTraceInstruction *instruction)
RZ_API RzAnalysisOp * rz_core_op_analysis(RzCore *core, ut64 addr, RzAnalysisOpMask mask)
RZ_API RZ_OWN char * rz_core_editor(const RzCore *core, RZ_NULLABLE const char *file, RZ_NULLABLE const char *str)
RZ_API RzBuffer * rz_core_syscall(RzCore *core, const char *name, const char *args)
RZ_API RzBuffer * rz_core_syscallf(RzCore *core, const char *name, const char *fmt,...)
RZ_API RzFlagItem * rz_core_flag_get_by_spaces(RzFlag *f, ut64 off)
RZ_API int rz_debug_kill(RzDebug *dbg, int pid, int tid, int sig)
RZ_API int rz_debug_drx_set(RzDebug *dbg, int idx, ut64 addr, int len, int rwx, int g)
RZ_API int rz_debug_step_over(RzDebug *dbg, int steps)
RZ_API int rz_debug_step(RzDebug *dbg, int steps)
RZ_API int rz_debug_map_protect(RzDebug *dbg, ut64 addr, int size, int perms)
RZ_API RZ_BORROW RzBreakpointItem * rz_debug_bp_add(RZ_NONNULL RzDebug *dbg, ut64 addr, int hw, bool watch, int rw, RZ_NULLABLE const char *module, st64 m_delta)
RZ_API int rz_debug_continue_until_optype(RzDebug *dbg, int type, int over)
RZ_API bool rz_debug_continue_back(RzDebug *dbg)
RZ_API int rz_debug_continue_until(RzDebug *dbg, ut64 addr)
RZ_API int rz_debug_drx_unset(RzDebug *dbg, int idx)
RZ_API int rz_debug_detach(RzDebug *dbg, int pid)
RZ_API const char * rz_debug_reason_to_string(int type)
RZ_API int rz_debug_continue(RzDebug *dbg)
RZ_API int rz_debug_stop(RzDebug *dbg)
RZ_API int rz_debug_continue_syscalls(RzDebug *dbg, int *sc, int n_sc)
RZ_API int rz_debug_child_clone(RzDebug *dbg)
RZ_API int rz_debug_child_fork(RzDebug *dbg)
RZ_API RzDebugInfo * rz_debug_info(RzDebug *dbg, const char *arg)
RZ_API void rz_debug_tracenodes_reset(RzDebug *dbg)
RZ_API void rz_debug_drx_list(RzDebug *dbg)
RZ_API int rz_debug_continue_pass_exception(RzDebug *dbg)
RZ_API ut64 rz_debug_get_baddr(RzDebug *dbg, const char *file)
RZ_API ut64 rz_debug_execute(RzDebug *dbg, const ut8 *buf, int len, int restore)
RZ_API bool rz_debug_is_dead(RzDebug *dbg)
RZ_API int rz_debug_continue_kill(RzDebug *dbg, int sig)
RZ_API bool rz_debug_select(RzDebug *dbg, int pid, int tid)
RZ_API RzList * rz_debug_frames(RzDebug *dbg, ut64 at)
RZ_API RzDebugReasonType rz_debug_stop_reason(RzDebug *dbg)
RZ_API void rz_debug_info_free(RzDebugInfo *rdi)
static void list(RzEgg *egg)
RZ_API void rz_list_reverse(RZ_NONNULL RzList *list)
Reverses the list.
RZ_API RZ_OWN RzList * rz_list_new_from_array(RZ_NONNULL const void **arr, size_t arr_size)
Allocates a new RzList and adds an array elements to it.
RZ_API RZ_OWN RzList * rz_list_new(void)
Returns a new initialized RzList pointer (free method is not initialized)
RZ_API RZ_OWN char * rz_list_to_str(RZ_NONNULL RzList *list, char ch)
Casts a RzList containg strings into a concatenated string.
RZ_API RZ_BORROW void * rz_list_get_n(RZ_NONNULL const RzList *list, ut32 n)
Returns the N-th element of the list.
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)
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 pid
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 dev
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 signum
RZ_API int sdb_num_set(Sdb *s, const char *key, ut64 v, ut32 cas)
RZ_API ut64 sdb_num_get(Sdb *s, const char *key, ut32 *cas)
RZ_API void rz_analysis_op_free(void *op)
RZ_API const char * rz_analysis_optype_to_string(int type)
RZ_API int rz_analysis_op(RzAnalysis *analysis, RzAnalysisOp *op, ut64 addr, const ut8 *data, int len, RzAnalysisOpMask mask)
static bool filter(RzParse *p, ut64 addr, RzFlag *f, RzAnalysisHint *hint, char *data, char *str, int len, bool big_endian)
RZ_API int rz_debug_pid_list(RzDebug *dbg, int pid, char fmt)
RZ_API int rz_debug_thread_list(RzDebug *dbg, int pid, char fmt)
RZ_API ut64 rz_reg_getv(RzReg *reg, const char *name)
RZ_API const char * rz_reg_get_name(RzReg *reg, int role)
RZ_API ut64 rz_reg_setv(RzReg *reg, const char *name, ut64 val)
RZ_API const RzList * rz_reg_get_list(RzReg *reg, int type)
RZ_API ut64 rz_reg_get_value(RzReg *reg, RzRegItem *item)
@ RZ_ANALYSIS_OP_PREFIX_REP
@ RZ_ANALYSIS_OP_PREFIX_REPNE
@ RZ_ANALYSIS_OP_MASK_ALL
@ RZ_ANALYSIS_OP_MASK_BASIC
@ RZ_ANALYSIS_OP_MASK_ESIL
@ RZ_ANALYSIS_OP_MASK_HINT
@ RZ_ANALYSIS_OP_TYPE_ICALL
@ RZ_ANALYSIS_OP_TYPE_CALL
@ RZ_ANALYSIS_OP_TYPE_UCALL
@ RZ_ANALYSIS_OP_TYPE_RET
@ RZ_ANALYSIS_OP_TYPE_RCALL
@ RZ_ANALYSIS_OP_TYPE_IRCALL
#define rz_warn_if_reached()
#define rz_return_val_if_fail(expr, val)
RZ_API st64 rz_buf_seek(RZ_NONNULL RzBuffer *b, st64 addr, int whence)
Modify the current cursor position in the buffer.
RZ_API bool rz_buf_read8(RZ_NONNULL RzBuffer *b, RZ_NONNULL RZ_OUT ut8 *result)
Read a byte at the cursor in the buffer.
RZ_API void rz_buf_free(RzBuffer *b)
Free all internal data hold by the buffer and the buffer.
RZ_DEPRECATE RZ_API RZ_BORROW ut8 * rz_buf_data(RZ_NONNULL RzBuffer *b, RZ_NONNULL RZ_OUT ut64 *size)
Return a borrowed array of bytes representing the buffer data.
RZ_API ut64 rz_buf_size(RZ_NONNULL RzBuffer *b)
Return the size of the buffer.
RZ_API RZ_OWN RzBuffer * rz_buf_new_file(const char *file, int perm, int mode)
Creates a new buffer from a file.
enum rz_cmd_status_t RzCmdStatus
@ RZ_CMD_STATUS_OK
command handler exited in the right way
@ RZ_CMD_STATUS_WRONG_ARGS
command handler could not handle the arguments passed to it
@ RZ_CMD_STATUS_ERROR
command handler had issues while running (e.g. allocation error, etc.)
#define RZ_FLAGS_FS_REGISTERS
RZ_API const char * rz_file_basename(const char *path)
RZ_API char * rz_file_temp(const char *prefix)
RZ_API bool rz_file_exists(const char *str)
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 bool rz_file_rm(const char *file)
RZ_API bool RZ_API char * rz_file_slurp_line(const char *file, int line, int context)
RZ_API RzGraph * rz_graph_new(void)
RZ_API bool rz_graph_adjacent(const RzGraph *g, const RzGraphNode *from, const RzGraphNode *to)
RZ_API const RzList * rz_graph_get_nodes(const RzGraph *g)
RZ_API const RzList * rz_graph_get_neighbours(const RzGraph *g, const RzGraphNode *n)
RZ_API void rz_graph_add_edge(RzGraph *g, RzGraphNode *from, RzGraphNode *to)
RZ_API void rz_graph_free(RzGraph *g)
RZ_API RzGraphNode * rz_graph_add_node(RzGraph *g, void *data)
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_fd_size(RzIO *io, int fd)
RZ_API bool rz_io_read_at(RzIO *io, ut64 addr, ut8 *buf, int len)
RZ_API int rz_io_fd_get_tid(RzIO *io, int fd)
RZ_API int rz_io_fd_open(RzIO *io, const char *uri, int flags, int mode)
RZ_API RzIOMap * rz_io_map_get(RzIO *io, ut64 addr)
RZ_API bool rz_io_write_at(RzIO *io, ut64 addr, const ut8 *buf, int len)
RZ_API int rz_io_fd_get_pid(RzIO *io, int fd)
RZ_API bool rz_io_fd_close(RzIO *io, int fd)
#define RZ_LOG_INFO(fmtstr,...)
#define RZ_LOG_WARN(fmtstr,...)
#define RZ_LOG_ERROR(fmtstr,...)
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_tail(RzNum *num, ut64 addr, const char *hex)
RZ_API ut64 rz_num_math(RzNum *num, const char *str)
RZ_API int rz_num_conditional(RzNum *num, const char *str)
RZ_API PJ * pj_kb(PJ *j, const char *k, bool v)
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 PJ * pj_kn(PJ *j, const char *k, ut64 n)
RZ_API PJ * pj_kN(PJ *j, const char *k, st64 n)
RZ_API int rz_regex_match(const char *pattern, const char *flags, const char *text)
RZ_API const char * rz_signal_to_string(int code)
RZ_API int rz_signal_from_string(const char *str)
RZ_API const char * rz_str_rwx_i(int rwx)
static const char * rz_str_get(const char *str)
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
RZ_API RZ_OWN char * rz_str_escape(RZ_NONNULL const char *buf)
RZ_API int rz_str_rwx(const char *str)
RZ_API const char * rz_str_bool(int b)
RZ_API char * rz_str_trim_dup(const char *str)
#define RZ_STR_ISEMPTY(x)
RZ_API const char * rz_str_trim_head_ro(const char *str)
RZ_API int rz_str_word_set0(char *str)
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 const char * rz_str_word_get0(const char *str, int idx)
RZ_API RzList * rz_str_split_duplist_n(const char *str, const char *c, int n, bool trim)
Split the string str according to the substring c and returns a RzList with the result.
RZ_API char * rz_sys_cmd_strf(const char *cmd,...) RZ_PRINTF_CHECK(1
RZ_API char * rz_sys_pid_to_path(int pid)
RZ_API int rz_sys_usleep(int usecs)
Sleep for usecs microseconds.
RZ_API void rz_table_add_rowf(RzTable *t, const char *fmt,...)
RZ_API RZ_OWN char * rz_time_date_now_to_string(void)
Returns the timestamp in string format of the current time (now)
RZ_API RTreeNode * rz_tree_add_node(RTree *t, RTreeNode *node, void *child_data)
RZ_API void rz_tree_reset(RTree *t)
RZ_API void rz_tree_bfs(RTree *t, RTreeVisitor *vis)
void(* RTreeNodeVisitCb)(RTreeNode *n, RTreeVisitor *vis)
RZ_API void rz_tree_dfs(RTree *t, RTreeVisitor *vis)
RzOutputMode
Enum to describe the way data are printed.
@ RZ_OUTPUT_MODE_QUIETEST
@ RZ_OUTPUT_MODE_STANDARD
RZ_API RzPVector * rz_pvector_new(RzPVectorFree free)
void(* RzPVectorFree)(void *e)
RZ_API void rz_pvector_free(RzPVector *vec)
RZ_API Sdb * sdb_new0(void)
RZ_API bool sdb_free(Sdb *s)
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
#define tr(opcode, mask, lose, flags)
RzAnalysisEsilTrace * trace
struct rz_analysis_esil_t * esil
XX curplugin == o->plugin.
RZ_DEPRECATE RzBinFile * cur
never use this in new code! Get a file from the binfiles list or track it yourself.
Represent the output state of a command handler.
bool(* gcore)(RzDebug *dbg, char *path, RzBuffer *dest)
struct rz_debug_plugin_t * cur
RzNumCalc nc
division by zero happened
int size
in bits> 8,16,32,64 ... 128/256
char * name[RZ_REG_NAME_LAST]
struct rz_tree_node_t * parent
void(* pre_visit)(RTreeNode *, struct rz_tree_visitor_t *)
RZ_API int rz_syscall_get_num(RzSyscall *s, const char *str)
RZ_API void rz_debug_trace_at(RzDebug *dbg, const char *str)
RZ_API int rz_debug_trace_tag(RzDebug *dbg, int tag)
RZ_API RzDebugTracepoint * rz_debug_trace_add(RzDebug *dbg, ut64 addr, int size)
RZ_API RzDebugTracepoint * rz_debug_trace_get(RzDebug *dbg, ut64 addr)
RZ_API void rz_debug_trace_free(RzDebugTrace *trace)
RZ_API RzDebugTrace * rz_debug_trace_new(void)
RZ_API RZ_OWN char * rz_diff_unified_text(RZ_NONNULL RzDiff *diff, RZ_NULLABLE const char *from, RZ_NULLABLE const char *to, bool show_time, bool color)
Produces a diff output with A and B inputs presented immediately adjacent to each other.
if(dbg->bits==RZ_SYS_BITS_64)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
RZ_API void rz_w32_identify_window(void)
RZ_API bool rz_w32_add_winmsg_breakpoint(RzDebug *dbg, const char *msg_name, const char *window_id)
RZ_API void rz_w32_print_windows(RzDebug *dbg)
static const z80_opcode fd[]
static bool input(void *ud, zip_uint8_t *data, zip_uint64_t length)