20#define ERROR(str) printf(COLOR_RED "[x] " COLOR_RESET "%s",str);
25#define INFO(str) printf(COLOR_BLUE "[*] " COLOR_RESET "%s",str);
Binary parser abstraction supporting memory and streaming files.
bool step_over(context *ctx, void *args)
Step over a function call instruction.
Definition debugger.c:338
bool listBP(context *ctx, void *args)
List all active breakpoints.
Definition debugger.c:486
bool handle_action(context *ctx, void *args)
Handle actions that correspond directly to simple commands (e.g., quit, help, continue,...
Definition debugger.c:88
bool setBP(context *ctx, void *args)
Set a breakpoint at a given address or symbol name.
Definition debugger.c:404
bool examin_mem(context *ctx, void *args)
Examine memory at a specific address.
Definition debugger.c:228
bool set_mem_reg(context *ctx, void *args)
Modify the value of a register or memory location.
Definition debugger.c:163
bool delBP(context *ctx, void *args)
Delete a breakpoint by ID.
Definition debugger.c:284
bool step_over(context *ctx, void *args)
Step over a function call.
Definition debugger.c:338
bool listBP(context *ctx, void *args)
List all breakpoints.
Definition debugger.c:486
bool handle_action(context *ctx, void *args)
Execute a user command.
Definition debugger.c:88
bool b_debugger(bparser *target, void *arg)
Launch and manage the debugger main loop.
Definition debugger.c:757
void init_values(bparser *target, context *ctx)
Initialize context values from target binary.
Definition debugger.c:613
void parse_cmd(context *ctx)
Parse and dispatch a command from the user.
Definition debugger.c:37
bool setBP(context *ctx, void *args)
Set a breakpoint at an address or symbol.
Definition debugger.c:404
void print_helpCMD()
Print available debugger commands.
Definition debugger.c:138
void restore_all_BP(context *ctx, int opt)
Restore all breakpoints (enable or disable).
Definition debugger.c:510
bool examin_mem(context *ctx, void *args)
Examine memory at a given address.
Definition debugger.c:228
bool set_mem_reg(context *ctx, void *args)
Modify memory or registers.
Definition debugger.c:163
bool delBP(context *ctx, void *args)
Delete a breakpoint by ID.
Definition debugger.c:284
void dis_ctx(context *ctx)
Display current registers, flags, disassembly, and stack.
Definition debugger.c:540
bool(* func_callback_t)(context *ctx, void *args)
Callback type for command handler functions.
Definition debugger.h:43
void destroy_bp_sym(context *ctx)
Free all breakpoints and symbols in the context.
Definition debugger.c:713
void handle_bpoint(context *ctx)
Handle breakpoint hit logic.
Definition debugger.c:457
void destroy_all(context *ctx)
Destroy all context-related memory.
Definition debugger.c:737
Represents a parsed user command.
Definition debugger.h:48
uint64_t addr
Definition debugger.h:50
char * op
Definition debugger.h:49
A linked list of breakpoints.
Definition debugger.h:65
bp * last
Definition debugger.h:67
uint32_t counter
Definition debugger.h:68
bp * first
Definition debugger.h:66
Represents a single breakpoint.
Definition debugger.h:74
uint64_t addr
Definition debugger.h:76
unsigned int id
Definition debugger.h:78
bp * next
Definition debugger.h:77
uint64_t orig
Definition debugger.h:75
Parser object.
Definition bparser.h:19
Holds debugger state and process information.
Definition debugger.h:100
char * mmaps
Definition debugger.h:101
bool do_wait
Definition debugger.h:110
Cmd cmd
Definition debugger.h:107
unsigned int pid
Definition debugger.h:108
sym_list * sym
Definition debugger.h:106
uint64_t base
Definition debugger.h:102
uint64_t entry
Definition debugger.h:103
bool do_exit
Definition debugger.h:112
bool pie
Definition debugger.h:111
struct user_regs_struct regs
Definition debugger.h:104
uint32_t arch
Definition debugger.h:109
bp_list * list
Definition debugger.h:105
Represents a debugger command and its associated function.
Definition debugger.h:84
char * cmd
Definition debugger.h:85
func_callback_t func
Definition debugger.h:86
Maps a register/flag name to its position.
Definition debugger.h:92
char * name
Definition debugger.h:93
int pos
Definition debugger.h:94
Represents a symbol entry (function name and address).
Definition debugger.h:56
char * name
Definition debugger.h:57
sym_list * next
Definition debugger.h:59
uint64_t addr
Definition debugger.h:58