34 && (
op[1] & 0x30) == 0x10) {
101 unsigned long steps = 0;
105 bool prev_call =
false;
106 bool prev_ret =
false;
124 frame->
addr = ret_addr;
125 frame->
size = old_sp - cur_sp;
134 }
else if (prev_ret) {
147 if (steps % 500 == 0 ||
pc ==
addr) {
187 if (asm_bits != core->
dbg->
bits * 8) {
291 if (core->
file && core->
io) {
302 switch (
state->mode) {
343 int sp = 8 - strlen(plugin->
name);
373 if (
map->name && *
map->name) {
376 if (
map->file && *
map->file) {
380 pj_kn(pj,
"addr_end",
map->addr_end);
381 pj_ks(pj,
"type",
map->user ?
"u" :
"s");
404 ?
"0x%016" PFMT64x " - 0x%016" PFMT64x " %c %s %6s %c %s %s %s%s%s\n"
405 :
"0x%08" PFMT64x " - 0x%08" PFMT64x " %c %s %6s %c %s %s %s%s%s\n";
406 const char *
type =
map->shared ?
"sys" :
"usr";
412 }
else if (
map->name) {
415 if (!strncmp(flagname,
"map.", 4) &&
416 !strcmp(flagname + 4, filtered_name)) {
425 (
addr >=
map->addr && addr < map->addr_end) ?
'*' :
'-',
428 map->user ?
'u' :
's',
430 map->name ?
map->name :
"?",
431 map->file ?
map->file :
"?",
432 *flagname ?
" ; " :
"",
478 rz_flag_space_pop(core->
flags);
496 for (
i = 0;
i < 2;
i++) {
514 if (
addr >=
map->addr && addr < map->addr_end) {
525 rz_cons_print(
"fss-\n");
530 static int cmp(
const void *
a,
const void *
b) {
561 if (
map->addr_end > *
max) {
581 if (
min != -1 &&
mul != 0) {
582 const char *color_prefix =
"";
583 const char *color_suffix =
"";
591 if ((
map->perm & 2) && (
map->perm & 1)) {
593 }
else if (
map->perm & 2) {
595 }
else if (
map->perm & 1) {
610 ?
"map %4.8s %c %s0x%016" PFMT64x "%s |"
611 :
"map %4.8s %c %s0x%08" PFMT64x "%s |";
614 addr < map->addr_end)
617 color_prefix,
map->addr, color_suffix);
619 for (col = 0; col <
width; col++) {
622 if (
map->addr < npos &&
map->addr_end >
pos) {
629 "| %s0x%016" PFMT64x "%s %s %s\n"
630 :
"| %s0x%08" PFMT64x "%s %s %s\n";
643 for (
i = 0;
i < 2;
i++) {
667 switch (
state->mode) {
747 int maxLoops = 200000;
761 if (--maxLoops < 0) {
765 }
while (
off <= now);
808 for (
int i = 0;
i < steps;
i++) {
867 char **flagdesc,
char **flagdesc2,
char **pcstr,
char **spstr) {
872 if (
f->offset !=
addr) {
876 }
else if (
delta < 0) {
884 if (!strchr(
f->name,
'.')) {
888 if (
f->offset !=
addr) {
892 }
else if (
delta < 0) {
906 if (!(pcstr && spstr)) {
938 rz_list_foreach (
list,
iter, frame) {
RZ_API bool rz_analysis_noreturn_at(RzAnalysis *analysis, ut64 addr)
RZ_API void rz_reg_arena_swap(RzReg *reg, int copy)
static RzILOpEffect * mul(cs_insn *insn, bool is_thumb)
RZ_DEPRECATE RZ_API RZ_BORROW RzList * rz_bin_get_symbols(RZ_NONNULL RzBin *bin)
static RzList * maps(RzBinFile *bf)
RzList * symbols(RzBinFile *bf)
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 RzBreakpointItem * rz_bp_enable(RzBreakpoint *bp, ut64 addr, int set, int count)
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 RZ_BORROW RzBreakpointItem * rz_bp_add_sw(RZ_NONNULL RzBreakpoint *bp, ut64 addr, int size, int perm)
Add a software breakpoint size preferred size of the breakpoint, or 0 to determine automatically.
RZ_API void rz_core_debug_bp_add_noreturn_func(RzCore *core)
Put a breakpoint into every no-return function.
RZ_API RzCmdStatus rz_core_debug_plugin_print(RzDebug *dbg, RzDebugPlugin *plugin, RzCmdStateOutput *state, int count, char *spaces)
static void print_debug_maps_ascii_art(RzDebug *dbg, RzList *maps, ut64 addr, int colors)
RZ_API void rz_core_debug_map_print(RzCore *core, ut64 addr, RzCmdStateOutput *state)
RZ_API void rz_backtrace_free(RZ_NULLABLE RzBacktrace *bt)
static void print_debug_map_line(RzDebug *dbg, RzDebugMap *map, ut64 addr, RzOutputMode mode)
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.
static bool is_x86_ret(RzDebug *dbg, ut64 addr)
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.
static bool is_x86_call(RzDebug *dbg, ut64 addr)
static int cmp(const void *a, const void *b)
RZ_IPI void rz_core_debug_print_status(RzCore *core)
RZ_IPI void rz_core_debug_continue(RzCore *core)
static void print_debug_map_json(RzDebugMap *map, PJ *pj)
RZ_API bool rz_core_debug_step_until_frame(RzCore *core)
Step until end of frame.
static void get_backtrace_info(RzCore *core, RzDebugFrame *frame, ut64 addr, char **flagdesc, char **flagdesc2, char **pcstr, char **spstr)
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)
static void apply_maps_as_flags(RzCore *core, RzList *maps, bool print_only)
RZ_API bool rz_core_is_debug(RzCore *core)
Check whether the core is in debug mode (equivalent to cfg.debug)
RZ_API bool rz_core_debug_continue_until(RzCore *core, ut64 addr, ut64 to)
RZ_IPI void rz_core_debug_single_step_in(RzCore *core)
RZ_API bool rz_core_debug_process_close(RzCore *core)
Close debug process (Kill debugee and all child processes)
RZ_API void rz_core_debug_map_update_flags(RzCore *core)
RZ_API RzCmdStatus rz_core_debug_plugins_print(RzCore *core, RzCmdStateOutput *state)
RZ_IPI void rz_core_debug_attach(RzCore *core, int pid)
static int findMinMax(RzList *maps, ut64 *min, ut64 *max, int skip, int width)
Find the min and max addresses in an RzList of maps.
RZ_IPI void rz_core_debug_single_step_over(RzCore *core)
RZ_API bool rz_core_debug_step_one(RzCore *core, int times)
RZ_API void rz_core_io_file_open(RZ_NONNULL RzCore *core, int fd)
Open file use read-only Permission.
RZ_API void rz_core_analysis_esil_step_over(RZ_NONNULL RzCore *core)
RZ_API int rz_core_esil_step_back(RzCore *core)
RZ_API int rz_core_esil_step(RzCore *core, ut64 until_addr, const char *until_expr, ut64 *prev_addr, bool stepOver)
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_array_end(RzCmdStateOutput *state)
Mark the end of an array of elements in the output.
RZ_IPI void rz_core_static_debug_stop(void *u)
RZ_API void rz_core_dbg_follow_seek_register(RzCore *core)
Seek to PC if needed.
RZ_API void rz_core_debug_clear_register_flags(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_i(RzConfig *cfg, RZ_NONNULL const char *name, const ut64 i)
RZ_API RzConfigNode * rz_config_set_b(RzConfig *cfg, RZ_NONNULL const char *name, bool value)
RZ_API int rz_cons_get_size(int *rows)
RZ_API RzCons * rz_cons_singleton(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_flush(void)
RZ_API bool rz_cons_is_breaked(void)
RZ_IPI void rz_core_reg_print_diff(RzReg *reg, RzList *items)
Print registers that have changed since the last step (drd/ard)
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 struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
RZ_API int rz_core_print_disasm_instructions(RzCore *core, int nb_bytes, int nb_opcodes)
RZ_API RZ_BORROW RzList * rz_debug_map_list(RzDebug *dbg, bool user_map)
Get RzList* of memory maps for the process currently being debugged.
RZ_API bool rz_debug_map_sync(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 int rz_debug_reg_set(struct rz_debug_t *dbg, const char *name, ut64 num)
RZ_API bool rz_debug_reg_profile_sync(RzDebug *dbg)
RZ_API void rz_debug_session_free(RzDebugSession *session)
size_t map(int syms, int left, int len)
RZ_DEPRECATE RZ_API RzAnalysisFunction * rz_analysis_get_fcn_in(RzAnalysis *analysis, ut64 addr, int type)
RZ_API void rz_flag_unset_all_in_space(RzFlag *f, const char *space_name)
Unset all flag items in the space with the given name.
RZ_API RzFlagItem * rz_flag_set_next(RzFlag *f, const char *name, ut64 off, ut32 size)
RZ_API RzFlagItem * rz_flag_get_at(RzFlag *f, ut64 off, bool closest)
void skip(file *in, unsigned n)
RZ_API void Ht_() free(HtName_(Ht) *ht)
return memset(p, 0, total)
const char * spaces(int count)
RZ_API int rz_debug_kill(RzDebug *dbg, int pid, int tid, int sig)
RZ_API int rz_debug_step_back(RzDebug *dbg, int steps)
RZ_API int rz_debug_step_over(RzDebug *dbg, int steps)
RZ_API int rz_debug_step(RzDebug *dbg, int steps)
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 int rz_debug_detach(RzDebug *dbg, int pid)
RZ_API int rz_debug_continue(RzDebug *dbg)
RZ_API int rz_debug_attach(RzDebug *dbg, int pid)
RZ_API bool rz_debug_is_dead(RzDebug *dbg)
RZ_API bool rz_debug_select(RzDebug *dbg, int pid, int tid)
RZ_API RzList * rz_debug_frames(RzDebug *dbg, ut64 at)
static void list(RzEgg *egg)
RZ_API RZ_BORROW RzListIter * rz_list_prepend(RZ_NONNULL RzList *list, void *data)
Appends at the beginning of the list a new element.
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
RZ_API RZ_BORROW void * rz_list_get_bottom(RZ_NONNULL const RzList *list)
Returns the first 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_OWN void * rz_list_pop_head(RZ_NONNULL RzList *list)
Removes and returns the first element 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.
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
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
RZ_API int rz_analysis_op(RzAnalysis *analysis, RzAnalysisOp *op, ut64 addr, const ut8 *data, int len, RzAnalysisOpMask mask)
RZ_API ut64 rz_reg_setv(RzReg *reg, const char *name, ut64 val)
RZ_API RZ_OWN RzList * rz_reg_filter_items_covered(RZ_BORROW RZ_NONNULL const RzList *regs)
Filter out all register items that are smaller than but covered entirely by some other register.
RZ_API ut64 rz_reg_get_value_by_role(RzReg *reg, RzRegisterId role)
@ RZ_ANALYSIS_OP_MASK_BASIC
@ RZ_ANALYSIS_OP_TYPE_RET
#define rz_warn_if_reached()
#define rz_return_if_fail(expr)
#define rz_return_val_if_fail(expr, val)
#define RZ_BIN_TYPE_FUNC_STR
enum rz_cmd_status_t RzCmdStatus
@ RZ_CMD_STATUS_OK
command handler exited in the right way
@ RZ_CMD_STATUS_NONEXISTINGCMD
command does not exist
@ RZ_CMD_STATUS_ERROR
command handler had issues while running (e.g. allocation error, etc.)
#define RZ_FLAGS_FS_DEBUG_MAPS
RZ_API char * rz_io_system(RzIO *io, const char *cmd)
RZ_API bool rz_io_read_at(RzIO *io, ut64 addr, ut8 *buf, int len)
RZ_API int rz_io_fd_get_pid(RzIO *io, int fd)
void(* RzListFree)(void *ptr)
#define RZ_LOG_INFO(fmtstr,...)
#define RZ_LOG_ERROR(fmtstr,...)
RZ_API bool rz_name_filter(char *name, int len, bool strict)
RZ_API char * rz_num_units(char *buf, size_t len, ut64 number)
RZ_API PJ * pj_end(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 const char * rz_str_rwx_i(int rwx)
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
static const char * rz_str_get_null(const char *str)
RZ_API int rz_str_cmp(const char *dst, const char *orig, int len)
#define rz_strf(buf,...)
Convenience macro for local temporary strings.
RZ_API void rz_table_visual_list(RzTable *table, RzList *list, ut64 seek, ut64 len, int width, bool va)
RZ_API void rz_table_free(RzTable *t)
RZ_API char * rz_table_tostring(RzTable *t)
RZ_API RzTable * rz_table_new(void)
RzOutputMode
Enum to describe the way data are printed.
@ RZ_OUTPUT_MODE_STANDARD
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 socklen_t static fromlen const void const struct sockaddr to
Represent the output state of a command handler.
RzConsPrintablePalette pal
RzList *(* pids)(RzDebug *dbg, int pid)
bool continue_all_threads
struct rz_debug_plugin_t * cur
struct rz_io_desc_t * desc
char * name[RZ_REG_NAME_LAST]
RZ_API RZ_OWN RzList * rz_debug_traces_info(RzDebug *dbg, ut64 offset)
RZ_API int rz_debug_trace_pc(RzDebug *dbg, ut64 pc)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static bool input(void *ud, zip_uint8_t *data, zip_uint64_t length)