Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Classes | |
struct | unset_off_foreach_t |
struct | unset_foreach_t |
struct | flag_relocate_t |
Macros | |
#define | IS_FI_NOTIN_SPACE(f, i) (rz_flag_space_cur(f) && (i)->space != rz_flag_space_cur(f)) |
#define | IS_FI_IN_SPACE(fi, sp) (!(sp) || (fi)->space == (sp)) |
#define | STRDUP_OR_NULL(s) (!RZ_STR_ISEMPTY(s) ? strdup(s) : NULL) |
#define | FOREACH_BODY(condition) |
#define FOREACH_BODY | ( | condition | ) |
|
static |
Definition at line 457 of file flag.c.
References rz_list_append().
Referenced by rz_flag_all_list().
|
static |
Definition at line 189 of file flag.c.
References count.
Referenced by count_flags_in_space().
Definition at line 200 of file flag.c.
References container_of, rz_space_event_t::count, count_flags(), rz_space_event_t::data, f, rz_space_event_t::res, rz_flag_foreach_space(), sp, spaces(), and rz_event_t::user.
Referenced by new_spaces().
|
static |
Definition at line 283 of file flag.c.
References rz_flag_item_t::alias, f, NULL, rz_flag_item_t::offset, rz_num_math(), and rz_return_val_if_fail.
Referenced by rz_flag_get(), rz_flag_get_at(), rz_flag_get_by_spaces(), and rz_flag_get_i().
|
static |
Definition at line 125 of file flag.c.
References NULL, rz_name_filter(), rz_str_trim(), and strdup().
Referenced by rz_flag_set(), and update_flag_item_name().
|
static |
|
static |
Definition at line 713 of file flag.c.
References flag_relocate_t::f, fn, flag_relocate_t::n, flag_relocate_t::neg_mask, flag_relocate_t::off, flag_relocate_t::off_mask, rz_flag_item_t::offset, flag_relocate_t::to, update_flag_item_offset(), and ut64().
Referenced by rz_flag_relocate().
Definition at line 40 of file flag.c.
References a, b, and patch_major_os_version::vb.
Referenced by rz_flag_new().
|
static |
Definition at line 34 of file flag.c.
References rz_flags_at_offset_t::flags, free(), and rz_list_free().
Referenced by rz_flag_new().
|
static |
Definition at line 102 of file flag.c.
References f, rz_flags_at_offset_t::flags, free(), NULL, off, rz_flags_at_offset_t::off, rz_flag_get_nearest_list(), rz_list_new(), RZ_NEW, and rz_skiplist_insert().
Referenced by update_flag_item_offset().
|
static |
Definition at line 73 of file flag.c.
References free(), rz_flag_item_t::name, and rz_flag_item_t::realname.
Referenced by rz_flag_item_free(), and set_name().
|
static |
Definition at line 67 of file flag.c.
References free(), rz_flag_item_t::name, and rz_flag_item_t::realname.
Referenced by rz_flag_item_set_realname(), and set_name().
|
static |
Definition at line 184 of file flag.c.
References free(), and rz_flag_item_free().
Referenced by rz_flag_new(), and rz_flag_unset_all().
|
static |
Definition at line 214 of file flag.c.
References count_flags_in_space(), f, NULL, rz_event_hook(), RZ_SPACE_EVENT_COUNT, RZ_SPACE_EVENT_UNSET, rz_spaces_init(), and unset_flagspace().
Referenced by rz_flag_new(), and rz_flag_unset_all().
Definition at line 48 of file flag.c.
References rz_flag_item_t::alias, f, NULL, rz_flag_item_t::offset, and ok.
Referenced by rz_flag_new().
|
static |
Definition at line 91 of file flag.c.
References f, flags, rz_flag_item_t::offset, rz_flag_get_nearest_list(), rz_list_delete_data(), rz_return_if_fail, and rz_skiplist_delete().
Referenced by rz_flag_unset(), and update_flag_item_offset().
Definition at line 463 of file flag.c.
References append_to_list(), f, NULL, rz_flag_foreach_space(), and rz_list_new().
Referenced by autocmplt_cmd_arg_flag(), rz_core_visual_trackflags(), rz_flag_describe_closest_handler(), and rz_flag_unset_all_in_space().
RZ_API void rz_flag_bind | ( | RzFlag * | f, |
RzFlagBind * | fb | ||
) |
Definition at line 752 of file flag.c.
References rz_flag_bind_t::exist_at, rz_flag_bind_t::f, f, rz_flag_bind_t::get, rz_flag_bind_t::get_at, rz_flag_bind_t::get_at_by_spaces, rz_flag_bind_t::get_list, rz_flag_bind_t::pop_fs, rz_flag_bind_t::push_fs, rz_flag_bind_t::rename, rz_flag_exist_at(), rz_flag_get(), rz_flag_get_at(), rz_flag_get_by_spaces(), rz_flag_get_list(), rz_flag_rename(), rz_flag_set(), rz_flag_unset(), rz_flag_unset_name(), rz_flag_unset_off(), rz_return_if_fail, rz_flag_bind_t::set, rz_flag_bind_t::set_fs, rz_flag_bind_t::unset, rz_flag_bind_t::unset_name, and rz_flag_bind_t::unset_off.
Referenced by rz_core_init().
Definition at line 776 of file flag.c.
References count, f, flag_count_foreach(), rz_flag_foreach_glob(), and rz_return_val_if_fail.
Referenced by rz_core_analysis_sigdb_apply(), rz_flirt_scan_handler(), and rz_print_analysis_details_handler().
Definition at line 293 of file flag.c.
References f, list(), rz_flag_item_t::name, NULL, off, rz_flag_get_list(), and rz_return_val_if_fail.
Referenced by propagate_types_among_used_variables(), and rz_flag_bind().
RZ_API void rz_flag_foreach | ( | RzFlag * | f, |
RzFlagItemCb | cb, | ||
void * | user | ||
) |
Definition at line 800 of file flag.c.
References FOREACH_BODY.
Referenced by __rebase_everything(), rz_core_seek_next(), rz_core_seek_prev(), rz_core_visual_hudstuff(), rz_flag_relocate(), rz_flag_tags_get(), and rz_serialize_flag_save().
RZ_API void rz_flag_foreach_glob | ( | RzFlag * | f, |
const char * | glob, | ||
RzFlagItemCb | cb, | ||
void * | user | ||
) |
Definition at line 818 of file flag.c.
References FOREACH_BODY, and rz_str_glob().
Referenced by flag_ordinals(), flag_to_flag(), rz_analyze_symbols_entries_flags_handler(), rz_analyze_symbols_entries_handler(), rz_core_cmd_foreach3(), rz_flag_base_handler(), rz_flag_count(), and rz_flag_unset_glob().
RZ_API void rz_flag_foreach_prefix | ( | RzFlag * | f, |
const char * | pfx, | ||
int | pfx_len, | ||
RzFlagItemCb | cb, | ||
void * | user | ||
) |
Definition at line 804 of file flag.c.
References FOREACH_BODY.
Referenced by autocmplt_cmd_arg_rznum(), autocomplete_flags(), rz_core_autocomplete(), rz_core_seek_next(), and rz_core_seek_prev().
RZ_API void rz_flag_foreach_range | ( | RZ_NONNULL RzFlag * | f, |
ut64 | from, | ||
ut64 | to, | ||
RzFlagItemCb | cb, | ||
void * | user | ||
) |
from | inclusive |
to | inclusive |
Definition at line 813 of file flag.c.
References f, FOREACH_BODY, from, rz_return_if_fail, and to.
Referenced by rz_core_analysis_get_stats().
RZ_API void rz_flag_foreach_space | ( | RzFlag * | f, |
const RzSpace * | space, | ||
RzFlagItemCb | cb, | ||
void * | user | ||
) |
Definition at line 826 of file flag.c.
References FOREACH_BODY, and IS_FI_IN_SPACE.
Referenced by count_flags_in_space(), DEFINE_HANDLE_TS_FCN_AND_SYMBOL(), flag_print(), rz_core_cmd_foreach(), rz_core_flag_real_name_print(), rz_flag_all_list(), rz_flag_graph_handler(), and unset_flagspace().
RZ_API void rz_flag_foreach_space_glob | ( | RzFlag * | f, |
const char * | glob, | ||
const RzSpace * | space, | ||
RzFlagItemCb | cb, | ||
void * | user | ||
) |
Definition at line 822 of file flag.c.
References FOREACH_BODY, IS_FI_IN_SPACE, and rz_str_glob().
Referenced by flagbars().
Definition at line 271 of file flag.c.
References f, free(), NULL, rz_list_free(), rz_num_free(), rz_return_val_if_fail, rz_skiplist_free(), rz_spaces_fini(), and sdb_free().
Referenced by rz_core_fini(), and rz_flag_new().
RZ_API RzFlagItem* rz_flag_get | ( | RzFlag * | f, |
const char * | name | ||
) |
Definition at line 310 of file flag.c.
References evalFlag(), f, NULL, r, and rz_return_val_if_fail.
Referenced by __printRecursive(), convert_offset_from_input(), core_flg_class_get(), DEFINE_HANDLE_TS_FCN_AND_SYMBOL(), ds_show_functions(), num_callback(), parseOperand(), reloc_set_flag(), rz_analysis_var_global_get_flag_item(), rz_block_flag_handler(), rz_core_analysis_all(), rz_core_analysis_autoname_all_fcns(), rz_core_analysis_esil_init_mem_p(), rz_core_analysis_function_autoname(), rz_core_analysis_function_rename(), rz_core_bin_apply_symbols(), rz_core_bin_export_info(), rz_core_bin_load(), rz_core_cmd_subst_i(), rz_flag_alias_handler(), rz_flag_bind(), rz_flag_color_handler(), rz_flag_comment_handler(), rz_flag_exists_handler(), rz_flag_realname_handler(), rz_flag_rename_handler(), rz_flag_set(), rz_flag_set_next(), and rz_main_rizin().
RZ_API RzFlagItem* rz_flag_get_at | ( | RzFlag * | f, |
ut64 | off, | ||
bool | closest | ||
) |
Definition at line 404 of file flag.c.
References eprintf, evalFlag(), f, rz_flags_at_offset_t::flags, IS_FI_NOTIN_SPACE, isFunctionFlag(), nice, NULL, off, rz_flags_at_offset_t::off, rz_flag_item_t::offset, rz_flag_get_nearest_list(), and rz_return_val_if_fail.
Referenced by __refs(), __xrefs(), _CbInRangeAav(), add_single_addr_xrefs(), backtrace_vars(), cmd_print_bars(), core_flag_get_at_as_ref_type(), ds_pre_emulation(), ds_print_esil_analysis(), ds_print_lines_left(), ds_print_offset(), ds_show_xrefs(), fill_hist_offset(), get_backtrace_info(), getNameDelta(), prompt_add_offset(), rz_analysis_xrefs_from_list_handler(), rz_core_flag_describe(), rz_core_print_hexdump_byline_str(), rz_core_visual_title(), rz_core_visual_xrefs(), rz_flag_add_handler(), rz_flag_bind(), rz_seek_history_list_handler(), and trace_traverse_pre().
RZ_API RzFlagItem* rz_flag_get_by_spaces | ( | RzFlag * | f, |
ut64 | off, | ||
... | |||
) |
Definition at line 326 of file flag.c.
References evalFlag(), f, free(), i, list(), NULL, off, rz_flag_get_list(), rz_list_get_top(), rz_list_length(), RZ_NEWS, rz_return_val_if_fail, rz_flag_item_t::space, spaces(), and ut64().
Referenced by core_flag_get_at_as_ref_type(), ds_print_demangled(), ds_print_fcn_name(), ds_show_xrefs(), propagate_types_among_used_variables(), rz_analysis_extract_rarg(), rz_core_analysis_function_strings_print(), rz_core_flag_get_by_spaces(), rz_flag_bind(), set_jump_realname(), and type_match().
RZ_API RzFlagItem* rz_flag_get_i | ( | RzFlag * | f, |
ut64 | off | ||
) |
Definition at line 317 of file flag.c.
References evalFlag(), f, list(), NULL, off, rz_flag_get_list(), rz_list_get_top(), and rz_return_val_if_fail.
Referenced by _analysis_calls(), add_single_addr_xrefs(), annotated_hexdump(), autoname_imp_trampoline(), cmd_prc(), disassembly_as_table(), ds_build_op_str(), ds_control_flow_comments(), ds_print_calls_hints(), ds_print_esil_analysis(), ds_print_offset(), ds_print_ptr(), ds_show_comments_right(), filter(), function_print_calls(), function_rename(), getName(), handleMidFlags(), meta_get_flag(), myregwrite(), num_callback(), rz_core_analysis_address(), rz_core_analysis_callgraph(), rz_core_analysis_coderefs(), rz_core_analysis_datarefs(), rz_core_analysis_function_autoname(), rz_core_analysis_hasrefs(), rz_core_analysis_name(), rz_core_analysis_rename(), rz_core_disasm_pdi_with_buf(), rz_core_print_bb_gml(), rz_core_print_func_args(), rz_core_print_offname(), rz_core_print_offsize(), rz_core_visual_define(), rz_flag_comment_handler(), rz_flag_hexdump_handler(), rz_flag_length_handler(), rz_flag_move(), rz_flag_realname_handler(), rz_flag_space_move_handler(), rz_flag_unset_off(), and str_callback().
Definition at line 475 of file flag.c.
References f, rz_flags_at_offset_t::flags, NULL, off, and rz_flag_get_nearest_list().
Referenced by __flagsGet(), ds_print_data_type(), ds_show_flags(), ds_show_refs(), is_skippable_addr(), rz_core_analysis_hasrefs_to_depth(), rz_core_print_disasm_json(), rz_flag_bind(), rz_flag_describe_at_handler(), rz_flag_exist_at(), rz_flag_get_by_spaces(), rz_flag_get_i(), rz_flag_get_liststr(), step_until_flag(), and str_callback().
Definition at line 480 of file flag.c.
References f, list(), NULL, off, p, rz_flag_item_t::realname, rz_flag_get_list(), and rz_str_appendf().
Referenced by ds_print_show_bytes(), and rz_core_analysis_hasrefs_to_depth().
|
static |
Definition at line 83 of file flag.c.
References f, flags, key, NULL, off, rz_skiplist_get_geq(), and rz_skiplist_get_leq().
Referenced by flags_at_offset(), remove_offsetmap(), rz_flag_get_at(), and rz_flag_get_list().
RZ_API RzFlagItem* rz_flag_item_clone | ( | RzFlagItem * | item | ) |
Definition at line 240 of file flag.c.
References rz_flag_item_t::alias, rz_flag_item_t::color, rz_flag_item_t::comment, n, rz_flag_item_t::name, NULL, rz_flag_item_t::offset, rz_flag_item_t::realname, RZ_NEW0, rz_return_val_if_fail, rz_flag_item_t::size, rz_flag_item_t::space, and STRDUP_OR_NULL.
Referenced by duplicate_flag().
RZ_API void rz_flag_item_free | ( | RzFlagItem * | item | ) |
Definition at line 258 of file flag.c.
References rz_flag_item_t::alias, rz_flag_item_t::color, rz_flag_item_t::comment, free(), free_item_name(), and rz_flag_item_t::realname.
Referenced by DEFINE_HANDLE_TS_FCN_AND_SYMBOL(), ht_free_flag(), rz_core_cmd_foreach(), and rz_flag_set().
RZ_API void rz_flag_item_set_alias | ( | RzFlagItem * | item, |
const char * | alias | ||
) |
Definition at line 557 of file flag.c.
References rz_flag_item_t::alias, free(), NULL, rz_return_if_fail, RZ_STR_ISEMPTY, and strdup().
Referenced by rz_flag_alias_handler().
RZ_API const char* rz_flag_item_set_color | ( | RzFlagItem * | item, |
const char * | color | ||
) |
Definition at line 578 of file flag.c.
References color, rz_flag_item_t::color, free(), NULL, rz_return_val_if_fail, and strdup().
Referenced by rz_core_visual_define(), and rz_flag_color_handler().
RZ_API void rz_flag_item_set_comment | ( | RzFlagItem * | item, |
const char * | comment | ||
) |
Definition at line 564 of file flag.c.
References rz_flag_item_t::comment, free(), NULL, rz_return_if_fail, RZ_STR_ISEMPTY, and strdup().
Referenced by flag_set_comment(), and rz_core_bin_apply_symbols().
RZ_API void rz_flag_item_set_realname | ( | RzFlagItem * | item, |
const char * | realname | ||
) |
Definition at line 571 of file flag.c.
References free_item_realname(), NULL, rz_flag_item_t::realname, rz_return_if_fail, RZ_STR_ISEMPTY, and strdup().
Referenced by pdb_set_symbols(), reloc_set_flag(), rz_core_bin_apply_symbols(), and rz_flag_realname_handler().
Definition at line 741 of file flag.c.
References f, rz_flag_item_t::name, rz_flag_get_i(), rz_flag_set(), rz_return_val_if_fail, rz_flag_item_t::size, and to.
Referenced by rebase_helper(), and rz_flag_move_handler().
Definition at line 220 of file flag.c.
References f, flag_skiplist_cmp(), flag_skiplist_free(), ht_free_flag(), new_spaces(), NULL, num_callback(), rz_flag_free(), rz_list_free(), RZ_NEW0, rz_num_new(), rz_skiplist_new(), sdb_new0(), and str_callback().
Referenced by rz_core_init().
Definition at line 726 of file flag.c.
References flag_relocate_t::f, f, flag_relocate_foreach(), n, flag_relocate_t::n, off, flag_relocate_t::off_mask, rz_flag_foreach(), rz_return_val_if_fail, and to.
Referenced by rz_flag_relocate_handler().
RZ_API int rz_flag_rename | ( | RzFlag * | f, |
RzFlagItem * | item, | ||
const char * | name | ||
) |
Definition at line 587 of file flag.c.
References f, rz_return_val_if_fail, and update_flag_item_name().
Referenced by function_rename(), rename_flag_ordinal(), rz_analysis_var_global_rename(), rz_core_analysis_autoname_all_fcns(), rz_core_analysis_function_rename(), rz_core_analysis_rename(), rz_core_visual_define(), rz_flag_bind(), and rz_flag_rename_handler().
Definition at line 521 of file flag.c.
References err, f, filter_item_name(), free(), NULL, off, rz_flag_item_t::offset, rz_flag_get(), rz_flag_item_free(), RZ_NEW0, rz_return_val_if_fail, rz_flag_item_t::size, rz_flag_item_t::space, update_flag_item_name(), and update_flag_item_offset().
Referenced by __core_analysis_fcn(), __handle_mouse_on_panel(), __rebase_flags(), _cb_hit(), _CbInRangeAav(), add_arch_platform_flag_comment_cb(), add_mmio_extended_flag_cb(), add_mmio_flag_cb(), add_new_func_symbol(), add_string_ref(), core_flg_class_set(), core_flg_fcn_set(), core_recover_golang_functions_go_1_16(), core_recover_golang_functions_go_1_18(), core_recover_golang_functions_go_1_2(), do_analysis_search(), do_asm_search(), do_syscall_search(), foreach_reg_set_or_clear(), function_rename(), pdb_set_symbols(), recover_string_at(), regs_to_flags(), rz_analysis_var_global_add(), rz_cmd_alias(), rz_core_analysis_flag_every_function(), rz_core_analysis_function_rename(), rz_core_analysis_rename(), rz_core_bin_apply_classes(), rz_core_bin_apply_entry(), rz_core_bin_apply_main(), rz_core_bin_apply_resources(), rz_core_bin_apply_sections(), rz_core_bin_apply_strings(), rz_core_bin_apply_symbols(), rz_core_bin_export_info(), rz_core_magic_at(), rz_core_visual_cmd(), rz_core_visual_define(), rz_flag_add_handler(), rz_flag_alias_handler(), rz_flag_append_handler(), rz_flag_bind(), rz_flag_move(), rz_flag_set_next(), set_new_xref(), and w32_list_heaps_blocks().
Definition at line 494 of file flag.c.
References f, free(), i, malloc(), NULL, off, rz_flag_get(), rz_flag_set(), rz_return_val_if_fail, and snprintf.
Referenced by apply_maps_as_flags(), reloc_set_flag(), rz_analysis_dwarf_integrate_functions(), and rz_core_analysis_esil().
RZ_API bool rz_flag_unset | ( | RzFlag * | f, |
RzFlagItem * | item | ||
) |
Definition at line 597 of file flag.c.
References f, rz_flag_item_t::name, remove_offsetmap(), and rz_return_val_if_fail.
Referenced by rz_analysis_var_global_free(), rz_core_bin_apply_symbols(), rz_flag_bind(), rz_flag_unset_all_in_space(), rz_flag_unset_name(), rz_flag_unset_off(), unset_foreach(), and unset_off_foreach().
Definition at line 677 of file flag.c.
References f, ht_free_flag(), new_spaces(), NULL, rz_return_if_fail, rz_skiplist_purge(), and rz_spaces_fini().
Referenced by rz_flag_remove_all_handler(), rz_open_close_all_handler(), and rz_serialize_flag_load().
Unset all flag items in the space with the given name.
f | an RzFlag |
space_name | name of the space |
Definition at line 692 of file flag.c.
References f, flags, rz_flag_all_list(), rz_flag_unset(), and rz_list_free().
Referenced by rz_analysis_all_esil_functions_handler(), rz_analysis_all_esil_handler(), rz_core_debug_map_update_flags(), rz_platform_index_add_flags_comments(), and rz_platform_profile_add_flag_every_io().
Definition at line 635 of file flag.c.
References f, off, rz_return_val_if_fail, and unset_off_foreach().
Referenced by recover_string_at(), and rz_flag_remove_handler().
Definition at line 660 of file flag.c.
References unset_foreach_t::f, f, unset_foreach_t::n, rz_flag_foreach_glob(), rz_return_val_if_fail, and unset_foreach().
Referenced by rz_flag_remove_handler().
Definition at line 670 of file flag.c.
References f, NULL, rz_flag_unset(), and rz_return_val_if_fail.
Referenced by foreach_reg_set_or_clear(), function_rename(), rz_core_analysis_esil_init_mem_del(), rz_core_analysis_undefine(), rz_core_visual_cmd(), rz_core_visual_trackflags(), and rz_flag_bind().
Definition at line 608 of file flag.c.
References f, off, rz_flag_get_i(), rz_flag_unset(), and rz_return_val_if_fail.
Referenced by rz_analysis_dwarf_integrate_functions(), rz_core_visual_cmd(), and rz_flag_bind().
RZ_LIB_VERSION | ( | rz_flag | ) |
|
static |
Definition at line 136 of file flag.c.
References free_item_name(), free_item_realname(), name, rz_flag_item_t::name, and rz_flag_item_t::realname.
Referenced by update_flag_item_name().
Definition at line 16 of file flag.c.
References f, list(), rz_flag_item_t::name, NULL, off, ok, rz_flag_get_list(), and rz_list_get_top().
Referenced by rz_flag_new().
|
static |
Definition at line 195 of file flag.c.
References NULL, and rz_flag_item_t::space.
Referenced by unset_flagspace().
Definition at line 207 of file flag.c.
References container_of, rz_space_event_t::data, f, NULL, rz_flag_foreach_space(), sp, spaces(), rz_space_event_t::unset, unset_flags_space(), and rz_event_t::user.
Referenced by new_spaces().
|
static |
Definition at line 647 of file flag.c.
References unset_foreach_t::f, IS_FI_NOTIN_SPACE, unset_foreach_t::n, and rz_flag_unset().
Referenced by rz_flag_unset_glob().
Definition at line 622 of file flag.c.
References unset_off_foreach_t::f, unset_off_foreach_t::offset, rz_flag_item_t::offset, rz_flag_unset(), and v.
Referenced by rz_flag_unset_all_off().
|
static |
Definition at line 162 of file flag.c.
References f, filter_item_name(), create_tags_rz::fname, free(), rz_flag_item_t::name, and set_name().
Referenced by rz_flag_rename(), and rz_flag_set().
|
static |
Definition at line 143 of file flag.c.
References f, rz_flags_at_offset_t::flags, flags_at_offset(), rz_flag_item_t::offset, remove_offsetmap(), and rz_list_append().
Referenced by flag_relocate_foreach(), and rz_flag_set().