Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Macros | |
#define | SYNC_READ(type, failed) |
#define | SYNC_READ_LIST(ritems, failed) |
#define | SYNC_WRITE(type, failed) |
#define SYNC_READ | ( | type, | |
failed | |||
) |
Definition at line 9 of file cmd_regs.c.
#define SYNC_READ_LIST | ( | ritems, | |
failed | |||
) |
Definition at line 17 of file cmd_regs.c.
#define SYNC_WRITE | ( | type, | |
failed | |||
) |
Definition at line 26 of file cmd_regs.c.
|
static |
(Sub)handler for register assignments like reg=0x42
arg | the full argument string, like "reg = 0x42" |
eq_pos | index of the '=' in arg |
Definition at line 159 of file cmd_regs.c.
References rz_core_t::num, reg, RZ_CMD_STATUS_ERROR, RZ_CMD_STATUS_OK, rz_core_reg_assign_sync(), rz_num_math(), rz_str_trim(), cmd_descs_generate::str, strdup(), ut64(), and val.
Referenced by rz_regs_handler().
|
static |
Definition at line 36 of file cmd_regs.c.
References bits(), test_evm::end, NULL, reg, rz_list_clone(), rz_list_new(), rz_list_new_from_array(), rz_list_push(), rz_reg_filter_items_covered(), rz_reg_get(), rz_reg_get_name(), rz_reg_role_by_name(), RZ_REG_TYPE_ANY, rz_reg_type_by_name(), RZ_REG_TYPE_GPR, rz_return_val_if_fail, RZ_STR_ISEMPTY, rz_reg_item_t::size, and type.
Referenced by rz_core_reg_filter_items_sync(), rz_reg_flags_handler(), rz_regs_references_handler(), and rz_regs_valgroup_handler().
Format the value of a register as a nice hex string.
Definition at line 87 of file cmd_regs.c.
References _ut80::High, _ut96::High, _ut128::High, _ut256::High, _ut80::Low, _ut96::Low, _ut128::Low, _ut256::Low, out, PFMT64x, reg, rz_reg_get_value(), rz_reg_get_value_big(), rz_reg_item_t::size, snprintf, ut64(), _utX::v128, _utX::v256, _utX::v80, _utX::v96, and value.
Referenced by rz_regs_columns_handler(), and show_regs_handler().
Definition at line 172 of file cmd_regs.c.
References Color_BWHITE, rz_core_t::config, rz_core_t::cons, rz_cons_t::context, rz_cons_printable_palette_t::creg, NULL, rz_cons_context_t::pal, reg, reg_has_changed(), and rz_config_get_i().
Referenced by references_handler(), rz_regs_columns_handler(), and show_regs_handler().
Definition at line 184 of file cmd_regs.c.
References i, rz_reg_item_t::name, NULL, reg, rz_reg_get_name(), rz_reg_get_role(), and RZ_REG_NAME_LAST.
Referenced by references_handler(), and show_regs_handler().
HEAPTYPE | ( | ut64 | ) |
|
static |
Definition at line 124 of file cmd_regs.c.
References RZ_LOG_ERROR, and rz_str_get().
Referenced by rz_reg_flags_handler(), rz_regs_columns_handler(), rz_regs_references_handler(), rz_regs_valgroup_handler(), and show_regs_handler().
|
static |
Definition at line 346 of file cmd_regs.c.
References color, Color_RESET, rz_core_t::config, free(), get_reg_color(), get_reg_role_name(), NULL, PFMT64x, r, reg, RZ_CMD_STATUS_ERROR, RZ_CMD_STATUS_OK, rz_config_get_i(), rz_config_set_i(), rz_core_analysis_hasrefs(), rz_core_table(), RZ_OUTPUT_MODE_JSON, rz_reg_get_value(), rz_str_get(), rz_str_newf(), rz_table_add_rowf(), rz_table_free(), rz_table_set_columnsf(), rz_table_tojson(), rz_table_tostring(), s, SYNC_READ_LIST, ut64(), and value.
Referenced by rz_regs_args_handler(), and rz_regs_references_handler().
Check whether the given item's value has changed in the last step.
Definition at line 116 of file cmd_regs.c.
References reg, rz_reg_arena_swap(), rz_reg_get_value(), ut64(), and value.
Referenced by get_reg_color().
RZ_API bool rz_core_reg_assign_sync | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzReg * | reg, | ||
RzCmdRegSync | sync_cb, | ||
RZ_NONNULL const char * | name, | ||
ut64 | val | ||
) |
Register assignment like reg=0x42
core | The RzCore instance |
reg | The RzReg instance |
sync_cb | Callback for synchronizing register state in command |
name | Register name |
val | Value |
Definition at line 138 of file cmd_regs.c.
References reg, rz_reg_get(), rz_reg_set_value(), RZ_REG_TYPE_ANY, rz_return_val_if_fail, SYNC_READ, SYNC_WRITE, rz_reg_item_t::type, and val.
Referenced by assign_reg().
RZ_API RZ_OWN RzList* rz_core_reg_filter_items_sync | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzReg * | reg, | ||
RzCmdRegSync | sync_cb, | ||
RZ_NULLABLE const char * | filter | ||
) |
Filter a list of RzRegItem and sync read
core | The RzCore instance |
reg | The RzReg instance |
sync_cb | Callback for synchronizing register state in command |
filter | Filter registers |
Definition at line 203 of file cmd_regs.c.
References filter_reg_items(), NULL, reg, rz_list_free(), rz_return_val_if_fail, and SYNC_READ_LIST.
Referenced by rz_regs_columns_handler(), and show_regs_handler().
RZ_IPI RzCmdStatus rz_reg_arenas_handler | ( | RzCore * | core, |
RzReg * | reg, | ||
int | argc, | ||
const char ** | argv | ||
) |
Definition at line 483 of file cmd_regs.c.
References a, i, reg, rs, RZ_CMD_STATUS_OK, rz_cons_printf(), rz_reg_get_type(), and RZ_REG_TYPE_LAST.
RZ_IPI RzCmdStatus rz_reg_arenas_hexdump_handler | ( | RzCore * | core, |
RzReg * | reg, | ||
RzCmdRegSync | sync_cb, | ||
int | argc, | ||
const char ** | argv | ||
) |
Definition at line 544 of file cmd_regs.c.
References argv, free(), len, reg, RZ_CMD_STATUS_ERROR, RZ_CMD_STATUS_OK, rz_core_print_hexdump(), RZ_LOG_ERROR, rz_reg_get_bytes(), rz_reg_type_by_name(), RZ_REG_TYPE_GPR, and SYNC_READ.
RZ_IPI RzCmdStatus rz_reg_arenas_pop_handler | ( | RzCore * | core, |
RzReg * | reg, | ||
RzCmdRegSync | sync_cb, | ||
int | argc, | ||
const char ** | argv | ||
) |
Definition at line 511 of file cmd_regs.c.
References reg, RZ_CMD_STATUS_ERROR, RZ_CMD_STATUS_OK, rz_reg_arena_pop(), RZ_REG_TYPE_ANY, and SYNC_WRITE.
RZ_IPI RzCmdStatus rz_reg_arenas_push_handler | ( | RzCore * | core, |
RzReg * | reg, | ||
RzCmdRegSync | sync_cb, | ||
int | argc, | ||
const char ** | argv | ||
) |
Definition at line 500 of file cmd_regs.c.
References reg, RZ_CMD_STATUS_ERROR, RZ_CMD_STATUS_OK, rz_reg_arena_push(), RZ_REG_TYPE_ANY, SYNC_READ, and SYNC_WRITE.
RZ_IPI RzCmdStatus rz_reg_arenas_stack_size_handler | ( | RzCore * | core, |
RzReg * | reg, | ||
int | argc, | ||
const char ** | argv | ||
) |
Definition at line 567 of file cmd_regs.c.
References reg, RZ_CMD_STATUS_OK, rz_cons_printf(), and rz_list_length().
RZ_IPI RzCmdStatus rz_reg_arenas_swap_handler | ( | RzCore * | core, |
RzReg * | reg, | ||
RzCmdRegSync | sync_cb, | ||
int | argc, | ||
const char ** | argv | ||
) |
Definition at line 518 of file cmd_regs.c.
References reg, RZ_CMD_STATUS_ERROR, RZ_CMD_STATUS_OK, rz_reg_arena_swap(), RZ_REG_TYPE_ANY, SYNC_READ, and SYNC_WRITE.
RZ_IPI RzCmdStatus rz_reg_arenas_write_hex_handler | ( | RzCore * | core, |
RzReg * | reg, | ||
RzCmdRegSync | sync_cb, | ||
int | argc, | ||
const char ** | argv | ||
) |
Definition at line 572 of file cmd_regs.c.
References a, argv, free(), hex, malloc(), memcpy(), reg, RZ_CMD_STATUS_ERROR, RZ_CMD_STATUS_OK, RZ_CMD_STATUS_WRONG_ARGS, rz_hex_str2bin(), RZ_LOG_ERROR, RZ_MIN, rz_reg_type_by_name(), RZ_REG_TYPE_GPR, RZ_REG_TYPE_LAST, rz_return_val_if_fail, SYNC_READ, SYNC_WRITE, and type.
RZ_IPI RzCmdStatus rz_reg_arenas_zero_handler | ( | RzCore * | core, |
RzReg * | reg, | ||
RzCmdRegSync | sync_cb, | ||
int | argc, | ||
const char ** | argv | ||
) |
Definition at line 529 of file cmd_regs.c.
References argv, reg, RZ_CMD_STATUS_ERROR, RZ_CMD_STATUS_OK, RZ_LOG_ERROR, rz_reg_arena_zero(), RZ_REG_TYPE_ANY, rz_reg_type_by_name(), and SYNC_WRITE.
Definition at line 797 of file cmd_regs.c.
References free(), reg, RZ_CMD_STATUS_OK, rz_cons_printf(), rz_reg_profile_to_cc(), and s.
RZ_IPI RzCmdStatus rz_reg_cond_handler | ( | RzCore * | core, |
RzReg * | reg, | ||
RzCmdRegSync | sync_cb, | ||
int | argc, | ||
const char ** | argv | ||
) |
Definition at line 776 of file cmd_regs.c.
References rz_reg_flags_t::c, free(), i, NULL, rz_reg_flags_t::o, rz_reg_flags_t::p, reg, RZ_CMD_STATUS_ERROR, RZ_CMD_STATUS_OK, rz_cons_printf(), rz_reg_cond_bits(), RZ_REG_COND_LAST, rz_reg_cond_retrieve(), rz_reg_cond_to_string(), RZ_REG_TYPE_ANY, rz_reg_flags_t::s, SYNC_READ, and rz_reg_flags_t::z.
RZ_IPI RzCmdStatus rz_reg_flags_handler | ( | RzCore * | core, |
RzReg * | reg, | ||
RzCmdRegSync | sync_cb, | ||
int | argc, | ||
const char ** | argv, | ||
bool | unset | ||
) |
Definition at line 658 of file cmd_regs.c.
References argv, filter_reg_items(), rz_reg_item_t::name, NULL, PFMT64x, print_reg_not_found(), reg, RZ_CMD_STATUS_ERROR, RZ_CMD_STATUS_OK, rz_cons_printf(), rz_core_reg_flags_candidates(), RZ_FLAGS_FS_REGISTERS, rz_list_free(), rz_reg_get_value(), SYNC_READ_LIST, ut64(), and v.
RZ_IPI RzCmdStatus rz_reg_profile_comments_handler | ( | RzCore * | core, |
RzReg * | reg, | ||
int | argc, | ||
const char ** | argv | ||
) |
RZ_IPI RzCmdStatus rz_reg_profile_gdb_handler | ( | RzCore * | core, |
RzReg * | reg, | ||
int | argc, | ||
const char ** | argv | ||
) |
Definition at line 762 of file cmd_regs.c.
References argv, free(), rz_core_t::num, RZ_CMD_STATUS_ERROR, RZ_CMD_STATUS_OK, RZ_CMD_STATUS_WRONG_ARGS, rz_cons_println(), RZ_LOG_ERROR, rz_reg_parse_gdb_profile(), rz_return_val_if_fail, and rz_num_t::value.
RZ_IPI RzCmdStatus rz_reg_profile_handler | ( | RzCore * | core, |
RzReg * | reg, | ||
int | argc, | ||
const char ** | argv, | ||
RzCmdStateOutput * | state | ||
) |
Definition at line 699 of file cmd_regs.c.
References eprintf, i, pj_a(), pj_end(), pj_k(), pj_kn(), pj_ks(), pj_o(), r, reg, RZ_CMD_STATUS_OK, rz_cons_println(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_STANDARD, rz_reg_get_role(), rz_reg_get_type(), RZ_REG_NAME_LAST, and RZ_REG_TYPE_LAST.
RZ_IPI RzCmdStatus rz_reg_profile_open_handler | ( | RzCore * | core, |
RzReg * | reg, | ||
int | argc, | ||
const char ** | argv | ||
) |
Definition at line 756 of file cmd_regs.c.
References argv, reg, RZ_CMD_STATUS_OK, RZ_CMD_STATUS_WRONG_ARGS, rz_reg_set_profile(), and rz_return_val_if_fail.
RZ_IPI RzCmdStatus rz_reg_roles_handler | ( | RzCore * | core, |
RzReg * | reg, | ||
int | argc, | ||
const char ** | argv | ||
) |
Definition at line 647 of file cmd_regs.c.
References i, reg, RZ_CMD_STATUS_OK, rz_cons_printf(), rz_reg_get_role(), and RZ_REG_NAME_LAST.
RZ_IPI RzCmdStatus rz_reg_types_handler | ( | RzCore * | core, |
RzReg * | reg, | ||
int | argc, | ||
const char ** | argv | ||
) |
Definition at line 640 of file cmd_regs.c.
References i, RZ_CMD_STATUS_OK, rz_cons_println(), rz_reg_get_type(), and RZ_REG_TYPE_LAST.
RZ_IPI RzCmdStatus rz_regs_args_handler | ( | RzCore * | core, |
RzReg * | reg, | ||
RzCmdRegSync | sync_cb, | ||
int | argc, | ||
const char ** | argv, | ||
RzOutputMode | mode | ||
) |
Definition at line 614 of file cmd_regs.c.
References eprintf, i, r, references_handler(), reg, RZ_CMD_STATUS_ERROR, RZ_CMD_STATUS_OK, rz_list_free(), rz_list_new(), rz_list_push(), rz_reg_get(), rz_reg_get_name(), RZ_REG_NAME_A0, RZ_REG_NAME_A9, and RZ_REG_TYPE_ANY.
RZ_IPI RzCmdStatus rz_regs_columns_handler | ( | RzCore * | core, |
RzReg * | reg, | ||
RzCmdRegSync | sync_cb, | ||
int | argc, | ||
const char ** | argv | ||
) |
Definition at line 298 of file cmd_regs.c.
References argv, color, Color_RESET, format_reg_value(), get_reg_color(), setup::idx, len, memset(), rz_reg_item_t::name, NULL, print_reg_not_found(), reg, RZ_CMD_STATUS_ERROR, RZ_CMD_STATUS_OK, rz_core_reg_filter_items_sync(), rz_list_free(), RZ_MAX, RZ_MIN, and snprintf.
RZ_IPI RzCmdStatus rz_regs_diff_handler | ( | RzCore * | core, |
RzReg * | reg, | ||
RzCmdRegSync | sync_cb, | ||
int | argc, | ||
const char ** | argv | ||
) |
Definition at line 806 of file cmd_regs.c.
References reg, RZ_CMD_STATUS_ERROR, RZ_CMD_STATUS_OK, rz_core_reg_print_diff(), RZ_REG_TYPE_ANY, and SYNC_READ.
RZ_IPI RzCmdStatus rz_regs_fpu_handler | ( | RzCore * | core, |
RzReg * | reg, | ||
RzCmdRegSync | sync_cb, | ||
int | argc, | ||
const char ** | argv | ||
) |
Definition at line 824 of file cmd_regs.c.
References argv, eprintf, eq, error(), free(), p, reg, RZ_CMD_STATUS_ERROR, RZ_CMD_STATUS_OK, rz_cons_printf(), rz_reg_get(), rz_reg_get_longdouble(), rz_reg_set_double(), RZ_REG_TYPE_FPU, RZ_REG_TYPE_GPR, rz_str_trim_dup(), SYNC_READ, SYNC_WRITE, and val.
RZ_IPI RzCmdStatus rz_regs_handler | ( | RzCore * | core, |
RzReg * | reg, | ||
RzCmdRegSync | sync_cb, | ||
int | argc, | ||
const char ** | argv, | ||
RzCmdStateOutput * | state | ||
) |
Definition at line 283 of file cmd_regs.c.
References argv, assign_reg(), eq, NULL, reg, and show_regs_handler().
RZ_IPI RzCmdStatus rz_regs_prev_handler | ( | RzCore * | core, |
RzReg * | reg, | ||
int | argc, | ||
const char ** | argv, | ||
RzCmdStateOutput * | state | ||
) |
Definition at line 816 of file cmd_regs.c.
References argv, NULL, r, reg, rz_reg_arena_swap(), and show_regs_handler().
RZ_IPI RzCmdStatus rz_regs_references_handler | ( | RzCore * | core, |
RzReg * | reg, | ||
RzCmdRegSync | sync_cb, | ||
int | argc, | ||
const char ** | argv, | ||
RzOutputMode | mode | ||
) |
Definition at line 392 of file cmd_regs.c.
References argv, filter_reg_items(), NULL, print_reg_not_found(), r, references_handler(), reg, RZ_CMD_STATUS_ERROR, and rz_list_free().
RZ_IPI void rz_regs_show_valgroup | ( | RzCore * | core, |
RzReg * | reg, | ||
RzCmdRegSync | sync_cb, | ||
const RzList * | list | ||
) |
Definition at line 423 of file cmd_regs.c.
References addr, rz_asm_t::bits, Color_RESET, Color_YELLOW, rz_core_t::config, free(), list(), NULL, PFMT64x, r, rz_core_t::rasm, reg, rz_config_get_i(), rz_cons_newline(), rz_cons_printf(), rz_cons_strcat(), rz_core_analysis_hasrefs(), rz_list_append(), rz_list_free(), rz_list_newf(), rz_reg_get_value(), ut64(), valgroup_regcb(), and value.
Referenced by rz_core_debug_ri(), and rz_regs_valgroup_handler().
RZ_IPI RzCmdStatus rz_regs_valgroup_handler | ( | RzCore * | core, |
RzReg * | reg, | ||
RzCmdRegSync | sync_cb, | ||
int | argc, | ||
const char ** | argv | ||
) |
Definition at line 471 of file cmd_regs.c.
References argv, filter_reg_items(), list(), NULL, print_reg_not_found(), reg, RZ_CMD_STATUS_ERROR, RZ_CMD_STATUS_OK, rz_list_free(), and rz_regs_show_valgroup().
|
static |
Definition at line 219 of file cmd_regs.c.
References color, Color_RESET, format_reg_value(), get_reg_color(), get_reg_role_name(), rz_reg_item_t::name, pj_end(), pj_kn(), pj_ks(), pj_o(), print_reg_not_found(), reg, RZ_CMD_STATUS_ERROR, RZ_CMD_STATUS_OK, rz_cons_printf(), rz_core_reg_filter_items_sync(), rz_list_free(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_QUIET, RZ_OUTPUT_MODE_RIZIN, RZ_OUTPUT_MODE_STANDARD, RZ_OUTPUT_MODE_TABLE, rz_reg_get_type(), rz_reg_get_value(), rz_str_get(), rz_table_add_rowf(), rz_table_set_columnsf(), rz_reg_item_t::size, rz_reg_item_t::type, and ut64().
Referenced by rz_regs_handler(), and rz_regs_prev_handler().
Definition at line 416 of file cmd_regs.c.
References k, n, rz_list_add_sorted(), ut64(), and valgroup_regcmp().
Referenced by rz_regs_show_valgroup().
Definition at line 404 of file cmd_regs.c.
References a, A, b, B, and ut64().
Referenced by valgroup_regcb().