12 #include <sys/types.h>
25 #if !defined(__HAIKU__) && !defined(__sun)
26 #include <sys/ptrace.h>
37 #define RZ_DEBUG_REG_T CONTEXT
50 #include <sys/resource.h>
55 #define RZ_DEBUG_REG_T gregset_t
58 #warning No debugger support for SunOS yet
67 #define WIFCONTINUED(s) ((s) == 0xffff)
70 #if (__x86_64__ || __i386__ || __arm__ || __arm64__) && !defined(__ANDROID__)
75 #warning Unsupported debugging platform
81 #define WAITPID_FLAGS __WALL
83 #define WAITPID_FLAGS 0
89 #if !__WINDOWS__ && !(__linux__ && !defined(WAIT_ON_ALL_CHILDREN)) && !__APPLE__
90 static int rz_debug_handle_signals(
RzDebug *
dbg) {
91 #if __KFBSD__ || __NetBSD__
94 eprintf(
"Warning: signal handling is not supported on this platform\n");
101 #if __APPLE__ || __linux__
115 static int rz_debug_native_step(
RzDebug *
dbg) {
123 perror(
"native-singlestep");
143 #elif __linux__ || __ANDROID__
147 perror(
"ptrace (PT_ATTACH)");
154 perror(
"ptrace (PT_ATTACH)");
173 static int rz_debug_native_select(
RzDebug *
dbg,
int pid,
int tid) {
177 static int rz_debug_native_select(
RzDebug *
dbg,
int pid,
int tid) {
182 static int rz_debug_native_continue_syscall(
RzDebug *
dbg,
int pid,
int num) {
192 eprintf(
"TODO: continue syscall not implemented yet\n");
197 #if !__WINDOWS__ && !__APPLE__ && !__BSD__
205 static int rz_debug_native_stop(
RzDebug *
dbg) {
247 eprintf(
"Error: (%d) is running or dead.\n", th->
pid);
251 ret = rz_debug_ptrace(
dbg,
PTRACE_CONT, tid,
NULL, (rz_ptrace_data_t)(
size_t)contsig);
268 #elif __KFBSD__ || __OpenBSD__ || __NetBSD__
277 const char *needle =
NULL;
288 if (needle && strlen(needle)) {
291 return !
mode || !needle ||
tmp;
306 bool restore_thread =
false;
310 RZ_LOG_ERROR(
"rz_debug_native_wait called with pid -1\n");
318 if (tracelib(
dbg,
"load",
r->lib)) {
327 RzBinOptions opts = { 0 };
345 restore_thread =
true;
349 if (tracelib(
dbg,
"unload",
r->lib)) {
355 restore_thread =
true;
357 if (
r &&
r->thread) {
362 if (
r &&
r->thread) {
366 restore_thread =
true;
369 if (
r &&
r->thread) {
372 if (
dbg->
tid != orig_tid && item->
tid != orig_tid) {
373 restore_thread =
true;
376 if (
r &&
r->thread) {
383 if (
r &&
r->thread) {
390 restore_thread =
true;
394 restore_thread =
true;
398 if (restore_thread) {
405 if (
dbg->
tid != orig_tid) {
416 #elif __linux__ && !defined(WAIT_ON_ALL_CHILDREN)
421 eprintf(
"ERROR: rz_debug_native_wait called with pid -1\n");
434 eprintf(
"ERROR: rz_debug_native_wait called with pid -1\n");
460 #ifdef WAIT_ON_ALL_CHILDREN
463 int ret = waitpid(-1, &
status, 0);
475 #ifdef WAIT_ON_ALL_CHILDREN
478 eprintf(
"switching to pid %d\n", ret);
485 #if __linux__ && defined(PT_GETEVENTMSG)
501 eprintf(
"child exited with status %d\n", WEXITSTATUS(
status));
503 }
else if (WIFSIGNALED(
status)) {
506 }
else if (WIFSTOPPED(
status)) {
507 if (WSTOPSIG(
status) != SIGTRAP &&
508 WSTOPSIG(
status) != SIGSTOP) {
520 if (rz_debug_handle_signals(
dbg) != 0) {
526 }
else if (WIFCONTINUED(
status)) {
527 eprintf(
"child continued...\n");
532 eprintf(
"debugger is dead with status 1!\n");
536 eprintf(
"debugger is dead with status 0\n");
543 eprintf(
"returning from wait without knowing why...\n");
550 eprintf(
"%s: no idea what happened...\n", __func__);
564 printf(
"TODO: Threads: \n");
616 #if __sun || __NetBSD__ || __KFBSD__ || __OpenBSD__ || __DragonFly__
629 #if __i386__ || __x86_64__
653 #if __NetBSD__ || __OpenBSD__
658 #warning not implemented for this platform
689 #elif __sun || __NetBSD__ || __KFBSD__ || __OpenBSD__ || __DragonFly__
692 #warning dbg-native not supported for this platform
700 #if __i386__ || __x86_64__
760 static int sys_thp_mode(
void) {
762 const char *thp[] = {
763 "/sys/kernel/mm/transparent_hugepage/enabled",
764 "/sys/kernel/mm/redhat_transparent_hugepage/enabled",
771 if (strstr(
val,
"[madvise]")) {
773 }
else if (strstr(
val,
"[always]")) {
786 #if !defined(__ANDROID__) && defined(MADV_HUGEPAGE)
796 const size_t thpsize = 1 << 21;
798 if ((
size % thpsize)) {
799 eprintf(
"size not a power of huge pages size\n");
807 if (sys_thp_mode() != 1) {
808 eprintf(
"transparent huge page mode is not in madvise mode\n");
816 "sc_madvise@syscall(%d);\n"
817 "main@naked(0) { .rarg0 = sc_madvise(0x%08" PFMT64x ",%d, %d);break;\n"
825 goto err_linux_map_thp;
828 eprintf(
"rz_egg_assemble: invalid assembly\n");
829 goto err_linux_map_thp;
849 char code[1024], *sc_name;
867 #ifndef MAP_ANONYMOUS
868 #define MAP_ANONYMOUS 0x20
871 "sc_mmap@syscall(%d);\n"
872 "main@naked(0) { .rarg0 = sc_mmap(0x%08" PFMT64x ",%d,%d,%d,%d,%d);break;\n"
880 goto err_linux_map_alloc;
883 eprintf(
"rz_egg_assemble: invalid assembly\n");
884 goto err_linux_map_alloc;
895 if (map_addr != (
ut64)-1) {
897 if (!linux_map_thp(
dbg, map_addr,
size)) {
899 eprintf(
"map promotion to huge page failed\n");
922 "sc_munmap@syscall(%d);\n"
923 "main@naked(0) { .rarg0 = sc_munmap(0x%08" PFMT64x ",%d);break;\n"
931 goto err_linux_map_dealloc;
934 eprintf(
"rz_egg_assemble: invalid assembly\n");
935 goto err_linux_map_dealloc;
945 err_linux_map_dealloc:
978 #if !__WINDOWS__ && !__APPLE__
1007 int i, perm, unk = 0;
1010 char region[100], region2[100], perms[5];
1017 region[0] = region2[0] =
'0';
1018 region[1] = region2[1] =
'x';
1048 bool map_is_shared =
false;
1049 ut64 map_start, map_end;
1055 line_len = strlen(
line);
1056 if (
line[line_len - 1] ==
'\n') {
1057 line[line_len - 1] =
'\0';
1061 if (line_len == 0) {
1066 if (sscanf(
line,
"%s %s %d %d 0x%s %3s %d %d",
1067 ®ion[2], ®ion2[2], &ign, &ign,
1068 unkstr, perms, &ign, &ign) != 8) {
1069 eprintf(
"%s: Unable to parse \"%s\"\n", __func__,
path);
1075 pos_c = strchr(
line,
'/');
1077 strncpy(
name, pos_c,
sizeof(
name) - 1);
1088 }
else if (
i != 4) {
1089 eprintf(
"%s: Unable to parse \"%s\"\n", __func__,
path);
1090 eprintf(
"%s: problematic line: %s\n", __func__,
line);
1096 pos_c = strchr(®ion[2],
'-');
1100 strncpy(®ion2[2], pos_c + 1,
sizeof(region2) - 2 - 1);
1106 for (
i = 0;
i < 5 && perms[
i];
i++) {
1111 case 'p': map_is_shared =
false;
break;
1112 case 's': map_is_shared =
true;
break;
1118 if (map_start == map_end || map_end == 0) {
1119 eprintf(
"%s: ignoring invalid map size: %s - %s\n", __func__, region, region2);
1128 map->shared = map_is_shared;
1140 char *lastname =
NULL;
1147 if (
list && !rz_list_empty(
list)) {
1152 if (
list && !rz_list_empty(
list)) {
1170 if (!lastname || strcmp(lastname,
file)) {
1171 must_delete =
false;
1188 static bool rz_debug_native_kill(
RzDebug *
dbg,
int pid,
int tid,
int sig) {
1223 static bool rz_debug_native_init(
RzDebug *
dbg,
void **user) {
1224 dbg->
cur->
desc = rz_debug_desc_plugin_native;
1232 #if __i386__ || __x86_64__
1235 if (num_regs != NUM_DRX_REGISTERS) {
1236 eprintf(
"drx: Unsupported number of registers for get_debug_regs\n");
1256 #if __i386__ || __x86_64__
1259 if (num_regs != NUM_DRX_REGISTERS) {
1260 eprintf(
"drx: Unsupported number of registers for get_debug_regs\n");
1274 static int rz_debug_native_drx(
RzDebug *
dbg,
int n,
ut64 addr,
int sz,
int rwx,
int g,
int api_type) {
1275 #if __i386__ || __x86_64__
1277 drxt regs[NUM_DRX_REGISTERS] = { 0 };
1279 sync_drx_regs(
dbg,
regs, NUM_DRX_REGISTERS);
1302 eprintf(
"drx: Unsupported api type in rz_debug_native_drx\n");
1306 set_drx_regs(
dbg,
regs, NUM_DRX_REGISTERS);
1310 eprintf(
"drx: Unsupported platform\n");
1317 #if __arm__ || __arm64__ || __aarch64__
1318 #include <sys/prctl.h>
1319 #include <sys/uio.h>
1321 #define NT_ARM_VFP 0x400
1322 #define NT_ARM_TLS 0x401
1323 #define NT_ARM_HW_BREAK 0x402
1324 #define NT_ARM_HW_WATCH 0x403
1325 #define NT_ARM_SYSTEM_CALL 0x404
1327 #ifndef PTRACE_GETHBPREGS
1328 #define PTRACE_GETHBPREGS 29
1329 #define PTRACE_SETHBPREGS 30
1335 const unsigned byte_mask = (1 <<
size) - 1;
1337 const unsigned enable = 1;
1338 const unsigned control = byte_mask << 5 |
type << 3 | enable;
1344 return ll_arm32_hwbp_set(
dbg->
pid,
b->addr,
b->size, 0, 1 | 2 | 4);
1353 #if (__arm64__ || __aarch64__) && defined(PTRACE_GETREGSET)
1358 const volatile uint8_t *
addr = (
void *)(
size_t)_addr;
1361 const ut32 enable = 1;
1364 struct user_hwdebug_state dreg_state = { 0 };
1366 iov.iov_base = &dreg_state;
1367 iov.iov_len =
sizeof(dreg_state);
1372 memcpy(&dreg_state,
iov.iov_base,
sizeof(dreg_state));
1375 dreg_state.dbg_regs[0].ctrl =
control;
1376 iov.iov_base = &dreg_state;
1378 sizeof(dreg_state.dbg_regs[0]);
1384 eprintf(
"ptrace(PTRACE_SETREGSET, NT_ARM_HW_WATCH) not supported on this hardware: %s\n",
1388 eprintf(
"ptrace(PTRACE_SETREGSET, NT_ARM_HW_WATCH) failed: %s\n", strerror(errno));
1395 struct user_hwdebug_state dreg_state = { 0 };
1397 iov.iov_base = &dreg_state;
1400 sizeof(dreg_state.dbg_regs[0]);
1405 eprintf(
"ptrace(PTRACE_SETREGSET, NT_ARM_HW_WATCH) not supported on this hardware: %s\n",
1409 eprintf(
"ptrace(PTRACE_SETREGSET, NT_ARM_HW_WATCH) failed: %s\n", strerror(errno));
1414 return ll_arm64_hwbp_set(
dbg->
pid,
b->addr,
b->size, 0, 1 | 2 | 4);
1418 return ll_arm64_hwbp_del(
dbg->
pid,
b->addr,
b->size, 0, 1 | 2 | 4);
1433 #if __i386__ || __x86_64__
1437 #elif (__arm64__ || __aarch64__) && __linux__
1439 ? arm64_hwbp_add(
dbg, bp,
b)
1440 : arm64_hwbp_del(
dbg, bp,
b);
1445 #elif __arm__ && __linux__
1447 ? arm32_hwbp_add(
dbg, bp,
b)
1448 : arm32_hwbp_del(
dbg, bp,
b);
1459 static int getMaxFiles(
void) {
1460 struct rlimit
limit;
1461 if (getrlimit(RLIMIT_NOFILE, &
limit) != 0) {
1464 return limit.rlim_cur;
1468 #if TARGET_OS_IPHONE || __POWERPC__
1471 #define xwrz_testwx(x) ((x & 1) << 2) | (x & 2) | ((x & 4) >> 2)
1474 struct vnode_fdinfowithpath vi;
1475 int i, nb,
type = 0;
1476 int maxfd = getMaxFiles();
1478 for (
i = 0;
i < maxfd;
i++) {
1479 nb = proc_pidfdinfo(
pid,
i, PROC_PIDFDVNODEPATHINFO, &vi,
sizeof(vi));
1483 if (nb <
sizeof(vi)) {
1484 perror(
"too few bytes");
1500 static RzList *rz_debug_desc_native_list(
int pid) {
1502 return xnu_desc_list(
pid);
1505 #elif __KFBSD__ || __NetBSD__
1510 #warning list filedescriptors not supported for this platform
1528 "main@global(0) { sc(%p,%d,%d);\n"
1541 eprintf(
"rz_egg_assemble: invalid assembly\n");
1561 static int rz_debug_desc_native_open(
const char *
path) {
1566 static int rz_debug_setup_ownership (
int fd,
RzDebug *
dbg) {
1570 eprintf (
"Error while getting debug info.\n");
1583 #elif __linux__ && (__x86_64__ || __i386__ || __arm__ || __arm64__)
1590 #elif __KFBSD__ || __NetBSD__
1598 .
open = rz_debug_desc_native_open,
1599 .list = rz_debug_desc_native_list,
1613 #elif __aarch64__ || __arm64__
1642 #pragma message("Unsupported architecture")
1644 #warning Unsupported architecture
1647 .init = &rz_debug_native_init,
1648 .step = &rz_debug_native_step,
1650 .stop = &rz_debug_native_stop,
1651 .contsc = &rz_debug_native_continue_syscall,
1652 .attach = &rz_debug_native_attach,
1653 .detach = &rz_debug_native_detach,
1655 #if __WINDOWS__ || __linux__
1656 .select = &rz_debug_native_select,
1658 .pids = &rz_debug_native_pids,
1659 .tids = &rz_debug_native_tids,
1660 .threads = &rz_debug_native_threads,
1661 .wait = &rz_debug_native_wait,
1662 .kill = &rz_debug_native_kill,
1666 .info = rz_debug_native_info,
1668 .map_alloc = rz_debug_native_map_alloc,
1669 .map_dealloc = rz_debug_native_map_dealloc,
1671 .modules_get = rz_debug_native_modules_get,
1672 .map_protect = rz_debug_native_map_protect,
1673 .breakpoint = rz_debug_native_bp,
1674 .drx = rz_debug_native_drx,
1675 .gcore = rz_debug_gcore,
1678 #ifndef RZ_PLUGIN_INCORE
RZ_API RzLibStruct rizin_plugin
RZ_API int rz_reg_arena_push(RzReg *reg)
RZ_API void rz_reg_arena_pop(RzReg *reg)
RZ_API bool rz_bin_file_set_cur_binfile(RzBin *bin, RzBinFile *bf)
RZ_API RzBinFile * rz_bin_open(RzBin *bin, const char *file, RzBinOptions *opt)
RZ_API RzBinFile * rz_bin_cur(RzBin *bin)
RzBinInfo * info(RzBinFile *bf)
RZ_API const RzBinInfo * rz_bin_object_get_info(RZ_NONNULL RzBinObject *obj)
Get the RzBinInfo of the binary object.
RzList * bsd_desc_list(int pid)
int bsd_handle_signals(RzDebug *dbg)
RzList * bsd_pid_list(RzDebug *dbg, int pid, RzList *list)
RzList * bsd_native_sysctl_map(RzDebug *dbg)
int bsd_reg_write(RzDebug *dbg, int type, const ut8 *buf, int size)
RzList * bsd_thread_list(RzDebug *dbg, int pid, RzList *list)
bool bsd_generate_corefile(RzDebug *dbg, char *path, RzBuffer *dest)
RzDebugInfo * bsd_info(RzDebug *dbg, const char *arg)
static RzList * rz_debug_native_frames(RzDebug *dbg, ut64 at)
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_flush(void)
RZ_API bool rz_cons_is_breaked(void)
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
static static fork const void static count static fd const char const char static newpath const char static path const char path
RZ_API RzDebugDesc * rz_debug_desc_new(int fd, char *path, int perm, int type, int off)
static char * rz_debug_native_reg_profile(RzDebug *dbg)
static RzList * rz_debug_native_map_get(RzDebug *dbg)
RzDebugPlugin rz_debug_plugin_native
static int rz_debug_native_continue(RzDebug *dbg, int pid, int tid, int sig)
static int rz_debug_native_reg_read(RzDebug *dbg, int type, ut8 *buf, int size)
static int rz_debug_native_reg_write(RzDebug *dbg, int type, const ut8 *buf, int size)
RZ_API RzDebugMap * rz_debug_map_get(RzDebug *dbg, ut64 addr)
RZ_API void rz_debug_map_free(RzDebugMap *map)
RZ_API bool rz_debug_map_sync(RzDebug *dbg)
RZ_API RzDebugMap * rz_debug_map_new(char *name, ut64 addr, ut64 addr_end, int perm, int user)
RZ_API ut64 rz_debug_reg_get(RzDebug *dbg, const char *name)
int drx_get_at(drxt *drx, ut64 at_addr)
bool drx_add(RzDebug *dbg, RzBreakpoint *bp, RzBreakpointItem *b)
bool drx_del(RzDebug *dbg, RzBreakpoint *bp, RzBreakpointItem *b)
int drx_set(drxt *drx, int n, ut64 addr, int len, int rwx, int global)
RZ_API void rz_egg_reset(RzEgg *egg)
RZ_API bool rz_egg_assemble_asm(RzEgg *egg, char **asm_list)
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_assemble(RzEgg *egg)
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 char * sdb_fmt(const char *fmt,...)
RZ_API void Ht_() free(HtName_(Ht) *ht)
return memset(p, 0, total)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
RZ_API int rz_debug_kill(RzDebug *dbg, int pid, int tid, int sig)
RZ_API RzDebugInfo * rz_debug_info(RzDebug *dbg, const char *arg)
RZ_API ut64 rz_debug_execute(RzDebug *dbg, const ut8 *buf, int len, int restore)
RZ_API bool rz_debug_select(RzDebug *dbg, int pid, int tid)
RZ_API void rz_debug_info_free(RzDebugInfo *rdi)
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 void rz_list_delete(RZ_NONNULL RzList *list, RZ_NONNULL RzListIter *iter)
Removes an entry in the list by using the RzListIter pointer.
RZ_API RZ_OWN RzList * rz_list_new(void)
Returns a new initialized RzList pointer (free method is not initialized)
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
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
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
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 const char struct stat static buf struct stat static buf static vhangup int status
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 ptrace
int linux_reg_read(RzDebug *dbg, int type, ut8 *buf, int size)
bool linux_generate_corefile(RzDebug *dbg, RzBuffer *dest)
char * linux_reg_profile(RzDebug *dbg)
int linux_attach(RzDebug *dbg, int pid)
RzList * linux_pid_list(int pid, RzList *list)
bool linux_stop_threads(RzDebug *dbg, int except)
RzDebugReasonType linux_dbg_wait(RzDebug *dbg, int pid)
RzList * linux_thread_list(RzDebug *dbg, int pid, RzList *list)
bool linux_set_options(RzDebug *dbg, int pid)
RzList * linux_desc_list(int pid)
RzDebugInfo * linux_info(RzDebug *dbg, const char *arg)
int linux_step(RzDebug *dbg)
int linux_reg_write(RzDebug *dbg, int type, const ut8 *buf, int size)
bool linux_select(RzDebug *dbg, int pid, int tid)
RzDebugReasonType linux_ptrace_event(RzDebug *dbg, int pid, int status, bool dowait)
static uint32_t const uint8_t uint32_t uint32_t limit
RZ_API ut64 rz_reg_getv(RzReg *reg, const char *name)
RZ_API ut64 rz_reg_setv(RzReg *reg, const char *name, ut64 val)
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_DEBUG_REASON_NEW_TID
@ RZ_DEBUG_REASON_UNKNOWN
@ RZ_DEBUG_REASON_BREAKPOINT
@ RZ_DEBUG_REASON_USERSUSP
@ RZ_DEBUG_REASON_NEW_LIB
@ RZ_DEBUG_REASON_EXIT_LIB
@ RZ_DEBUG_REASON_NEW_PID
@ RZ_DEBUG_REASON_EXIT_TID
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)
void(* RzListFree)(void *ptr)
#define RZ_LOG_INFO(fmtstr,...)
#define RZ_LOG_WARN(fmtstr,...)
#define RZ_LOG_ERROR(fmtstr,...)
RZ_API ut64 rz_num_get(RzNum *num, const char *str)
#define RZ_STR_ISNOTEMPTY(x)
RZ_API bool rz_str_glob(const char *str, const char *glob)
#define rz_sys_xsystem(cmd)
RZ_API int rz_sys_kill(int pid, int sig)
Send signal sig to process with pid pid.
RZ_API FILE * rz_sys_fopen(const char *path, const char *mode)
#define rz_offsetof(type, member)
_W64 unsigned int uintptr_t
XX curplugin == o->plugin.
int(* open)(const char *path)
bool continue_all_threads
struct rz_debug_plugin_t * cur
RZ_API int rz_syscall_get_num(RzSyscall *s, const char *str)
RzDebugInfo * w32_info(RzDebug *dbg, const char *arg)
int w32_hwbp_arm_del(RzDebug *dbg, RzBreakpoint *bp, RzBreakpointItem *b)
int w32_attach(RzDebug *dbg, int pid)
int w32_step(RzDebug *dbg)
int w32_map_protect(RzDebug *dbg, ut64 addr, int size, int perms)
RzList * w32_thread_list(RzDebug *dbg, int pid, RzList *list)
int w32_map_dealloc(RzDebug *dbg, ut64 addr, int size)
int w32_init(RzDebug *dbg)
int w32_dbg_wait(RzDebug *dbg, int pid)
RzList * w32_pid_list(RzDebug *dbg, int pid, RzList *list)
int w32_kill(RzDebug *dbg, int pid, int tid, int sig)
int w32_reg_read(RzDebug *dbg, int type, ut8 *buf, int size)
static int io_perms_to_prot(int io_perms)
int w32_hwbp_arm_add(RzDebug *dbg, RzBreakpoint *bp, RzBreakpointItem *b)
int w32_continue(RzDebug *dbg, int pid, int tid, int sig)
int w32_detach(RzDebug *dbg, int pid)
int w32_select(RzDebug *dbg, int pid, int tid)
int w32_reg_write(RzDebug *dbg, int type, const ut8 *buf, int size)
RzList * w32_desc_list(int pid)
RzDebugMap * w32_map_alloc(RzDebug *dbg, ut64 addr, int size)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
RZ_API RzList * rz_w32_dbg_maps(RzDebug *dbg)
RZ_API RzList * rz_w32_dbg_modules(RzDebug *dbg)
char * xnu_reg_profile(RzDebug *dbg)
bool xnu_step(RzDebug *dbg)
int xnu_map_dealloc(RzDebug *dbg, ut64 addr, int size)
int xnu_continue(RzDebug *dbg, int pid, int tid, int sig)
RzDebugMap * xnu_map_alloc(RzDebug *dbg, ut64 addr, int size)
bool xnu_generate_corefile(RzDebug *dbg, RzBuffer *dest)
int xnu_map_protect(RzDebug *dbg, ut64 addr, int size, int perms)
RzList * xnu_dbg_maps(RzDebug *dbg, int only_modules)
RzDebugPid * xnu_get_pid(int pid)
int xnu_reg_write(RzDebug *dbg, int type, const ut8 *buf, int size)
int xnu_detach(RzDebug *dbg, int pid)
int xnu_stop(RzDebug *dbg, int pid)
int xnu_reg_read(RzDebug *dbg, int type, ut8 *buf, int size)
int xnu_wait(RzDebug *dbg, int pid)
int xnu_attach(RzDebug *dbg, int pid)
RzList * xnu_thread_list(RzDebug *dbg, int pid, RzList *list)
RzDebugInfo * xnu_info(RzDebug *dbg, const char *arg)
#define RZ_DEBUG_REASON_MACH_RCV_INTERRUPTED
static const z80_opcode fd[]