Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Classes | |
struct | RzStrEscOptions |
Group together some common options used by string escaping functions. More... | |
struct | rz_str_stringify_opt_t |
Macros | |
#define | rz_strf(buf, ...) |
Convenience macro for local temporary strings. More... | |
#define | RZ_STR_ISEMPTY(x) (!(x) || !*(x)) |
#define | RZ_STR_ISNOTEMPTY(x) ((x) && *(x)) |
#define | RZ_STR_DUP(x) ((x) ? strdup((x)) : NULL) |
#define | rz_str_array(x, y) ((y >= 0 && y < (sizeof(x) / sizeof(*x))) ? x[y] : "") |
#define | rz_str_cpy(x, y) memmove((x), (y), strlen(y) + 1); |
#define | rz_str_cat(x, y) memmove((x) + strlen(x), (y), strlen(y) + 1); |
Typedefs | |
typedef int(* | RzStrRangeCallback) (void *, int) |
typedef void(* | str_operation) (char *c) |
typedef struct rz_str_stringify_opt_t | RzStrStringifyOpt |
Enumerations | |
enum | RzStrType { RZ_STRING_TYPE_RAW , RZ_STRING_TYPE_ZERO , RZ_STRING_TYPE_SIZED } |
enum | RzStrEnc { RZ_STRING_ENC_8BIT = 'b' , RZ_STRING_ENC_UTF8 = '8' , RZ_STRING_ENC_MUTF8 = 'm' , RZ_STRING_ENC_UTF16LE = 'u' , RZ_STRING_ENC_UTF32LE = 'U' , RZ_STRING_ENC_UTF16BE = 'n' , RZ_STRING_ENC_UTF32BE = 'N' , RZ_STRING_ENC_BASE64 = '6' , RZ_STRING_ENC_IBM037 = 'c' , RZ_STRING_ENC_IBM290 = 'd' , RZ_STRING_ENC_EBCDIC_UK = 'k' , RZ_STRING_ENC_EBCDIC_US = 's' , RZ_STRING_ENC_EBCDIC_ES = 't' , RZ_STRING_ENC_GUESS = 'g' } |
#define rz_strf | ( | buf, | |
... | |||
) |
Convenience macro for local temporary strings.
buf | Target buffer, must be an array type, not a pointer. |
This eases the common pattern where a stack-allocated string of a fixed size is created and filled with snprintf()
to be used as a temporary string.
Example:
char k[32]; char v[32]; sdb_set(db, rz_strf(k, "key.%d", 42), rz_strf(v, "val.%d", 123));
typedef struct rz_str_stringify_opt_t RzStrStringifyOpt |
enum RzStrEnc |
Definition at line 19 of file rz_str.h.
enum RzStrType |
Definition at line 13 of file rz_str.h.
Referenced by parse(), rz_big_to_hexstr(), rz_heap_fastbin_content(), and rz_test_run_asm_test().
Definition at line 2098 of file str.c.
References __str_ansi_length(), i, len, n, and cmd_descs_generate::str.
Referenced by ds_print_show_bytes(), rz_cons_strcat_at(), and rz_cons_visual_write().
RZ_API char* rz_str_ansi_crop | ( | const char * | str, |
unsigned int | x, | ||
unsigned int | y, | ||
unsigned int | x2, | ||
unsigned int | y2 | ||
) |
Definition at line 2174 of file str.c.
References Color_RESET, malloc(), memcpy(), NULL, r, rz_str_char_fullwidth(), s, cmd_descs_generate::str, strdup(), x, and x2.
Referenced by __menu_panel_print(), __update_help_contents(), __update_panel_contents(), get_word_from_canvas(), get_word_from_canvas_for_menu(), mini_RzANode_print(), normal_RzANode_print(), readline_callback(), rz_cons_strcat_at(), rz_core_visual_analysis_refresh(), rz_core_visual_analysis_refresh_column(), rz_core_visual_colors(), rz_core_visual_xrefs(), var_functions_show(), and visual_refresh().
Definition at line 2124 of file str.c.
References __str_ansi_length(), calloc(), free(), i, len, malloc(), memcpy(), out, cmd_descs_generate::str, and autogen_x86imm::tmp.
Referenced by __matchString(), __settings_colors_cb(), ds_show_flags(), get_word_from_canvas(), get_word_from_canvas_for_menu(), pager_all_matches(), pager_color_line(), rz_cons_grepbuf(), rz_cons_highlight(), rz_str_replace_thunked(), and rz_str_trim_lines().
Definition at line 1945 of file str.c.
References rz_str_ansi_nlen(), and cmd_descs_generate::str.
Referenced by __computeTotal(), __panels_refresh(), __print_prompt(), __update_help_title(), __update_panel_title(), ds_print_relocs(), ds_print_show_bytes(), real_strlen(), rz_cons_get_column(), rz_cons_strcat_at(), selection_widget_draw(), and var_functions_show().
Definition at line 1923 of file str.c.
References __str_ansi_length(), i, len, and cmd_descs_generate::str.
Referenced by is_indirect_reg(), is_reg(), rz_str_ansi_len(), and rz_str_bounds().
Definition at line 204 of file str_trim.c.
References i, len, n, rz_return_val_if_fail, and cmd_descs_generate::str.
Referenced by rz_strpool_ansi_chop().
Definition at line 1063 of file str.c.
References free(), memcpy(), NULL, realloc(), RZ_STR_ISEMPTY, and strdup().
Referenced by __print_hexdump_cb(), __print_stack_cb(), __system(), dalvik_disassemble(), ds_print_calls_hints(), ds_print_lines_left(), filterFlags(), gdbr_exec_file_read(), get_ver_flags(), preprocess_filter_expr(), rop_classify_arithmetic(), rop_classify_arithmetic_const(), rtr_dir_files(), runcmd(), rz_analysis_reflines_str(), rz_analysis_value_to_string(), rz_cf_value_dict_parse(), rz_cons_hud_path(), rz_core_agraph_add_node(), rz_core_cmd_subst_i(), rz_core_rtr_cmds_query(), rz_core_rtr_http_run(), rz_core_visual_title(), rz_core_visual_xrefs(), rz_file_root(), rz_lib_path(), rz_main_rizin(), rz_main_rz_gg(), rz_reg_set_profile(), rz_str_append_owned(), rz_str_appendch(), rz_str_appendf(), rz_str_appendlen(), rz_syscmd_join(), rz_syscmd_ls(), rz_type_db_enum_get_bitfield(), showfile(), and walk_exports().
RZ_API char* rz_str_append_owned | ( | char * | ptr, |
char * | string | ||
) |
Definition at line 1050 of file str.c.
References free(), r, and rz_str_append().
Referenced by add_cpu_info(), and myregwrite().
Definition at line 1105 of file str.c.
References b, rz_str_append(), and x.
Referenced by capture_filter_keywords(), find_e_opts(), and rz_core_visual_analysis().
Referenced by add_abi_info(), dalvik_disassemble(), ds_print_calls_hints(), ds_print_lines_left(), find_include(), format_MAKE_FUNCTION_arg_36(), hud_filter(), lang_lib_file_run(), linux_handle_signals(), myregwrite(), rop_classify_constant(), rop_classify_mov(), rtr_dir_files(), rz_analysis_value_to_string(), rz_bin_filter_name(), rz_core_asm_strsearch(), rz_core_syscall_as_string(), rz_core_visual_classes(), rz_core_visual_colors(), rz_core_visual_xrefs(), rz_egg_lang_include_path(), rz_flag_get_liststr(), rz_main_rizin(), rz_reg_parse_gdb_profile(), rz_type_db_enum_get_bitfield(), showfile(), and windbg_gcore().
Definition at line 1043 of file str.c.
References free(), msg, rz_str_append(), and rz_str_newlen().
Referenced by filterFlags(), and preprocess_filter_expr().
Definition at line 2413 of file str.c.
References c, malloc(), NULL, realloc(), and cmd_descs_generate::str.
Referenced by rz_core_file_reopen_debug(), and rz_main_rizin().
Definition at line 2509 of file str.c.
References args, argv, c, free(), IS_WHITECHAR, malloc(), NULL, realloc(), strdup(), and autogen_x86imm::tmp.
Referenced by cmd_agraph_edge(), cmd_agraph_node(), ds_build_op_str(), rz_cmd_search(), rz_sys_cmd_str_full(), and windbg_open().
RZ_API void rz_str_argv_free | ( | char ** | argv | ) |
Definition at line 2633 of file str.c.
Referenced by cmd_agraph_edge(), cmd_agraph_node(), rz_cmd_search(), rz_sys_cmd_str_full(), and windbg_open().
Definition at line 3861 of file str.c.
References a, i, n, rz_strbuf_append(), rz_strbuf_drain(), rz_strbuf_new(), and sb.
Referenced by args_preprocessing(), rz_cmd_shell_echo_handler(), rz_cmd_shell_ls_handler(), rz_hash_bang_handler(), rz_push_escaped_handler(), rz_remote_add_handler(), rz_remote_del_handler(), rz_remote_handler(), rz_remote_open_handler(), rz_remote_rap_bg_handler(), rz_remote_rap_handler(), rz_remote_send_handler(), rz_reopen_debug_handler(), rz_write_assembly_handler(), and rz_write_assembly_inside_handler().
Definition at line 3264 of file str.c.
References c0, c1, NULL, prefix, rz_str_ndup(), and suffix.
Referenced by __rotate_panel_cmds(), rz_comment_filelink_handler(), and visual_comma().
Definition at line 195 of file str.c.
References bit, i, setup::idx, len, and toupper.
Referenced by ds_print_data_type(), rax(), rz_cmd_help(), rz_print_bitstream_handler(), rz_print_byte_bitstream_handler(), rz_print_hexdump_bits_handler(), and rz_reg_get_bvalue().
Definition at line 244 of file str.c.
References bit, count, i, in, and trimbits().
Referenced by rax(), and rz_cmd_help().
Definition at line 3896 of file str.c.
References b.
Referenced by __setsegoff(), asn1_stringify_sector(), bb_info_print(), boolify_var_cb(), core_analysis_bytes_standard(), fcn_print_info(), jemalloc_print_narenas(), pj_b(), run_basic_block_analysis(), run_new_command(), rz_asn1_stringify_boolean(), rz_cmd_debug(), rz_cmd_help(), rz_config_get(), rz_config_node_value_format_i(), rz_config_set(), rz_config_set_b(), rz_core_bin_dwarf_print_aranges(), rz_core_config_init(), rz_core_visual_graph(), rzil_print_register_bool(), system_exec(), and table_add_row_bool().
Definition at line 3124 of file str.c.
References h, H, rz_str_ansi_nlen(), cmd_descs_generate::str, and W.
Referenced by __open_menu_cb(), __update_menu_contents(), and update_node_dimension().
RZ_API void rz_str_byte_escape | ( | const char * | p, |
char ** | dst, | ||
RzStrEscOptions * | opt | ||
) |
Converts unprintable characters to C-like backslash representation.
p | pointer to the original string |
dst | pointer where pointer to the resulting characters sequence is put |
opt | pointer to encoding options structure |
Definition at line 1436 of file str.c.
References RzStrEscOptions::dot_nl, dst, RzStrEscOptions::esc_bslash, RzStrEscOptions::esc_double_quotes, IS_PRINTABLE, p, and RzStrEscOptions::show_asciidot.
Referenced by rz_str_escape_(), rz_str_escape_utf(), and rz_type_byte_escape().
Definition at line 341 of file str.c.
References cmd_descs_generate::str, tolower, toupper, and ut8.
Referenced by bin_pe_parse_imports(), cb_binstrenc(), ds_disassemble(), ds_print_comments_right(), ds_show_comments_describe(), iflag(), itmask(), load_buffer(), mount_oldstr(), opmask(), rz_asm_assemble(), rz_bin_pe_get_libs(), rz_cons_grep_line(), rz_core_disasm_pdi_with_buf(), set_bin_relocs(), subs_var_string(), subvar(), thumb_assemble(), and thumb_getshift().
Definition at line 121 of file str.c.
Referenced by __get_cpu_model_recursive(), __is_true_or_false(), assemble(), avr_assembler(), cd_sort(), disassemble(), get_cpu_model(), get_mem_option(), getshift(), is_c5000(), mnem_add(), mnem_addc(), mnem_anl(), mnem_cjne(), mnem_clr(), mnem_cpl(), mnem_dec(), mnem_div(), mnem_inc(), mnem_mov(), mnem_movc(), mnem_movx(), mnem_orl(), mnem_setb(), mnem_subb(), mnem_xch(), mnem_xchd(), mnem_xrl(), oprep(), rz_lang_define(), rz_lang_get_by_extension(), rz_lang_get_by_name(), rz_lang_undef(), rz_reg_32_to_64(), rz_reg_64_to_32(), rz_str_is_false(), rz_str_is_true(), set_cpu_model(), single_a_arg_instr(), tms320_disassemble(), tms320_op(), xtensa_format_lookup(), and xtensa_isa_name_compare().
Definition at line 2757 of file str.c.
References a, b, NULL, and rz_str_ncasecmp().
Referenced by __matchString(), filter(), rz_str_replace_icase(), show_class(), showfile(), socket_http_answer(), and subvar().
Definition at line 941 of file str.c.
References dst, i, rz_return_val_if_fail, and src.
Referenced by rz_core_visual_config().
Definition at line 2277 of file str.c.
References RZ_BETWEEN, rz_str_utf8_codepoint(), and s.
Referenced by __getUtf8Length(), __getUtf8Length2(), rz_cons_canvas_to_string(), rz_str_ansi_crop(), rz_str_len_utf8(), and rz_str_len_utf8_ansi().
Definition at line 974 of file str.c.
Referenced by __computeTotal(), detect_constructor_destructor(), get_backtrace_info(), run_basic_block_analysis(), rz_analysis_cc_get(), rz_bin_list_plugin(), and rz_core_theme_load().
RZ_API char* rz_str_crop | ( | const char * | str, |
unsigned int | x, | ||
unsigned int | y, | ||
unsigned int | x2, | ||
unsigned int | y2 | ||
) |
RZ_API int rz_str_do_until_token | ( | str_operation | op, |
char * | str, | ||
const char | tok | ||
) |
Definition at line 3219 of file str.c.
References op, and cmd_descs_generate::str.
Referenced by gb_parse_arith1(), gb_parse_cb1(), gb_parse_ld1(), and gbAsm().
Definition at line 1021 of file str.c.
References free(), rz_str_new(), and cmd_descs_generate::str.
Referenced by __check_func_diff(), __init_panel_param(), __replace_cmd(), __rotate_panel_cmds(), __update_help(), config_visual_hit(), disassemble(), entitlements(), info(), rz_cmd_print_gadget_add_handler(), rz_core_theme_load(), rz_core_visual_view_rop(), rz_load_panels_layout(), rz_reg_set_name(), rz_syscmd_mkdir(), and signature().
Definition at line 44 of file str.c.
References RZ_STRING_ENC_8BIT, RZ_STRING_ENC_BASE64, RZ_STRING_ENC_EBCDIC_ES, RZ_STRING_ENC_EBCDIC_UK, RZ_STRING_ENC_EBCDIC_US, RZ_STRING_ENC_GUESS, RZ_STRING_ENC_IBM037, RZ_STRING_ENC_IBM290, RZ_STRING_ENC_MUTF8, RZ_STRING_ENC_UTF16BE, RZ_STRING_ENC_UTF16LE, RZ_STRING_ENC_UTF32BE, RZ_STRING_ENC_UTF32LE, RZ_STRING_ENC_UTF8, and rz_warn_if_reached.
Referenced by print_bin_string(), print_json_string(), print_string(), rz_core_meta_print(), rz_scan_strings(), and strings_print().
RZ_API RzStrEnc rz_str_enc_string_as_type | ( | RZ_NULLABLE const char * | encoding | ) |
converts an encoding name to RzStrEnc
[in] | encoding | Encoding name |
Definition at line 86 of file str.c.
References cmd_descs_generate::encoding, RZ_LOG_ERROR, RZ_STRING_ENC_8BIT, RZ_STRING_ENC_BASE64, RZ_STRING_ENC_EBCDIC_ES, RZ_STRING_ENC_EBCDIC_UK, RZ_STRING_ENC_EBCDIC_US, RZ_STRING_ENC_GUESS, RZ_STRING_ENC_IBM037, RZ_STRING_ENC_IBM290, RZ_STRING_ENC_MUTF8, RZ_STRING_ENC_UTF16BE, RZ_STRING_ENC_UTF16LE, RZ_STRING_ENC_UTF32BE, RZ_STRING_ENC_UTF32LE, and RZ_STRING_ENC_UTF8.
Referenced by create_string_search_thread(), and ds_init().
RZ_API bool rz_str_endswith | ( | RZ_NONNULL const char * | str, |
RZ_NONNULL const char * | needle | ||
) |
Checks if a string ends with a specifc sequence of characters (case sensitive)
str | C-string to be scanned |
needle | C-string containing the sequence of characters to match |
needle
is found at the end of str
and false otherwise Definition at line 3329 of file str.c.
References cmd_descs_generate::str, and str_endswith().
Referenced by __lib_dl_check_filename(), __toggle_help(), __update_help(), can_section_contain_rtti_vpointer(), cmd_print_format(), database_load(), DEFINE_HANDLE_TS_FCN_AND_SYMBOL(), ds_show_functions(), ds_show_functions_argvar(), find_apk_binary(), getnumbang(), getnummemend(), getnummemendbang(), getreglist(), getregmembang(), getregmemend(), getregmemstartend(), getshiftmemend(), is_arg_identifier_in_tmp_stmt(), lang_lib_file_run(), map_multi_dex(), preprocess_filter_expr(), rax(), run_basic_block_analysis(), rz_core_rtr_add(), rz_core_run_script(), rz_debug_dmp_init(), rz_egg_load_file(), rz_eval_getset_handler(), rz_file_path(), rz_load_panels_layout(), rz_sign_sigdb_load_database(), rz_sys_perror_str(), rz_test_run_fuzz_test(), section_can_contain_rtti(), set_color_default(), sh_op_get_addr_mode(), sigdb_signature_resolve_details(), skip_archos(), v1_v2_types_foreach_cb(), vtable_section_can_contain_vtables(), and winkd_wait_packet().
RZ_API bool rz_str_endswith_icase | ( | RZ_NONNULL const char * | str, |
RZ_NONNULL const char * | needle | ||
) |
Checks if a string ends with a specifc sequence of characters (case insensitive)
str | C-string to be scanned |
needle | C-string containing the sequence of characters to match |
needle
is found at the end of str
and false otherwise Definition at line 3340 of file str.c.
References cmd_descs_generate::str, and str_endswith().
Referenced by check_filename().
RZ_API RZ_OWN char* rz_str_escape | ( | RZ_NONNULL const char * | buf | ) |
Definition at line 1550 of file str.c.
References RzStrEscOptions::dot_nl, RzStrEscOptions::esc_bslash, NULL, rz_return_val_if_fail, rz_str_escape_(), and RzStrEscOptions::show_asciidot.
Referenced by __update_prompt_color(), cmd_debug_current_modules(), cmd_debug_modules(), cmd_pxr(), config_print_node(), emit_set_string(), print_space_stack(), rz_bin_elf_get_compiler(), rz_cmd_debug_dmS_handler(), rz_core_meta_print(), and rz_main_rz_agent().
RZ_API char* rz_str_escape_8bit | ( | const char * | buf, |
bool | colors, | ||
RzStrEscOptions * | opt | ||
) |
Definition at line 1595 of file str.c.
References colors, and rz_str_escape_().
Referenced by ds_esc_str(), ds_print_meta_infos(), meta_string_escape(), and rz_run_get_environ_profile().
Definition at line 1587 of file str.c.
References RzStrEscOptions::dot_nl, RzStrEscOptions::esc_bslash, rz_str_escape_(), and RzStrEscOptions::show_asciidot.
Referenced by core_analysis_graph_label().
Definition at line 1838 of file str.c.
References buf_size, and escape_utf8_for_json().
Referenced by java_constant_pool_stringify().
Definition at line 1560 of file str.c.
References malloc(), NULL, p, and rz_return_val_if_fail.
Referenced by rz_core_editor(), rzfind_open_file(), and socket_http_get_recursive().
RZ_API char* rz_str_escape_utf16be | ( | const char * | buf, |
int | buf_size, | ||
RzStrEscOptions * | opt | ||
) |
Definition at line 1715 of file str.c.
References buf_size, RzStrEscOptions::esc_bslash, RzStrEscOptions::esc_double_quotes, rz_str_escape_utf(), RZ_STRING_ENC_UTF16BE, and RzStrEscOptions::show_asciidot.
Referenced by ds_esc_str().
RZ_API char* rz_str_escape_utf16le | ( | const char * | buf, |
int | buf_size, | ||
RzStrEscOptions * | opt | ||
) |
Definition at line 1707 of file str.c.
References buf_size, RzStrEscOptions::esc_bslash, RzStrEscOptions::esc_double_quotes, rz_str_escape_utf(), RZ_STRING_ENC_UTF16LE, and RzStrEscOptions::show_asciidot.
Referenced by ds_esc_str().
RZ_API char* rz_str_escape_utf32be | ( | const char * | buf, |
int | buf_size, | ||
RzStrEscOptions * | opt | ||
) |
Definition at line 1719 of file str.c.
References buf_size, RzStrEscOptions::esc_bslash, RzStrEscOptions::esc_double_quotes, rz_str_escape_utf(), RZ_STRING_ENC_UTF32BE, and RzStrEscOptions::show_asciidot.
Referenced by ds_esc_str().
RZ_API char* rz_str_escape_utf32le | ( | const char * | buf, |
int | buf_size, | ||
RzStrEscOptions * | opt | ||
) |
Definition at line 1711 of file str.c.
References buf_size, RzStrEscOptions::esc_bslash, RzStrEscOptions::esc_double_quotes, rz_str_escape_utf(), RZ_STRING_ENC_UTF32LE, and RzStrEscOptions::show_asciidot.
Referenced by ds_esc_str().
RZ_API char* rz_str_escape_utf8 | ( | const char * | buf, |
RzStrEscOptions * | opt | ||
) |
Definition at line 1699 of file str.c.
References RzStrEscOptions::esc_bslash, RzStrEscOptions::esc_double_quotes, rz_str_escape_utf(), RZ_STRING_ENC_UTF8, and RzStrEscOptions::show_asciidot.
Referenced by ds_esc_str(), ds_print_meta_infos(), meta_string_escape(), and rz_core_sym_name_init().
Definition at line 1834 of file str.c.
References buf_size, and escape_utf8_for_json().
Referenced by core_analysis_graph_nodes(), draw_graph_nodes(), pj_s(), pj_S(), and rz_type_format_nulltermstring().
RZ_API char* rz_str_escape_utf8_keep_printable | ( | const char * | buf, |
RzStrEscOptions * | opt | ||
) |
Definition at line 1703 of file str.c.
References RzStrEscOptions::esc_bslash, RzStrEscOptions::esc_double_quotes, rz_str_escape_utf(), RZ_STRING_ENC_UTF8, and RzStrEscOptions::show_asciidot.
Referenced by rz_core_file_info_print(), and strings_print().
RZ_API void rz_str_filter | ( | char * | str | ) |
Convert all non-printable characters in str
with '.'.
str | String to make printable. |
Definition at line 2359 of file str.c.
References i, IS_PRINTABLE, and cmd_descs_generate::str.
Referenced by cb_binprefix(), ds_print_ptr(), get_maps_unpatched(), get_name(), get_sections(), get_segments(), maps(), rz_asn1_stringify_string(), rz_core_syscall_as_string(), and sections().
Definition at line 2341 of file str.c.
References i, IS_PRINTABLE, len, and cmd_descs_generate::str.
Definition at line 2644 of file str.c.
References b, eprintf, setup::idx, int, NULL, p, RZ_BIT_TOGGLE, and s.
Referenced by find_next_intgrep(), and rz_core_cmd_subst_i().
Definition at line 1844 of file str.c.
References arg(), argv, i, NULL, rz_strbuf_append(), rz_strbuf_append_n(), rz_strbuf_drain_nofree(), rz_strbuf_init(), and sb.
Referenced by windbg_open().
Definition at line 3791 of file str.c.
References calloc(), i, NULL, cmd_descs_generate::str, v, and val.
Referenced by ds_print_ptr().
Definition at line 187 of file rz_str.h.
References cmd_descs_generate::str.
Referenced by callable_as_string(), callable_name_or_ptr(), core_cmd_raw(), open_maps_show(), print_flag_rizin(), print_reg_not_found(), references_handler(), rz_cmd_debug_bp_set_expr_cur_offset_handler(), rz_cmd_debug_display_bt_handler(), rz_cmd_debug_list_bp_handler(), rz_core_bin_apply_config(), rz_core_bin_relocs_print(), rz_core_meta_print(), show_regs_handler(), symbols_print(), and system_exec().
Definition at line 190 of file rz_str.h.
References cmd_descs_generate::str.
Referenced by anop32(), arg(), core_analysis_graph_nodes(), draw_graph_nodes(), ds_print_esil_analysis(), get_category_t(), node_malformed_error(), pid_to_task(), rz_core_analysis_function_signature(), rz_core_debug_backtraces(), rz_core_types_function_print(), symbols_print(), VALIDATOR_EFFECT(), and VALIDATOR_PURE().
Definition at line 2368 of file str.c.
References cmd_descs_generate::str.
Referenced by DEFINE_HANDLE_TS_FCN_AND_SYMBOL(), duplicate_flag(), iter_glob_flag(), recursive_search_glob(), rz_core_autocomplete_remove(), rz_core_cmd_foreach3(), rz_flag_foreach_glob(), rz_flag_foreach_space_glob(), and rz_syscmd_ls().
Tries to guess the string encoding method from the buffer.
buffer | The string buffer to use for guessing the encoding |
length | The string buffer length |
Definition at line 4089 of file str.c.
References i, IS_PRINTABLE, length, rz_return_val_if_fail, RZ_STRING_ENC_8BIT, RZ_STRING_ENC_GUESS, RZ_STRING_ENC_UTF16BE, RZ_STRING_ENC_UTF16LE, RZ_STRING_ENC_UTF32BE, RZ_STRING_ENC_UTF32LE, RZ_STRING_ENC_UTF8, and rz_utf_bom_encoding().
Referenced by rz_cmd_print().
RZ_API char* rz_str_highlight | ( | char * | str, |
const char * | word, | ||
const char * | color, | ||
const char * | color_reset | ||
) |
Definition at line 3657 of file str.c.
References color, i, NULL, rz_str_newf(), start, cmd_descs_generate::str, strchr_skip_color_codes(), strdup(), strncmp_skip_color_codes(), and strncpy_with_color_codes().
Referenced by ds_highlight_word().
Definition at line 354 of file str.c.
References dst, fail, free(), length, malloc(), memcpy(), NULL, rz_file_tmpdir(), RZ_SYS_DIR, rz_sys_getenv(), RZ_SYS_HOME, and cmd_descs_generate::str.
Referenced by autocomplete_process_path(), rz_file_globsearch(), and rz_syscmd_ls().
RZ_API char* rz_str_ichr | ( | char * | str, |
char | chr | ||
) |
Definition at line 660 of file str.c.
References cmd_descs_generate::str.
Referenced by find_e_opts(), getargpos(), and run_ioctl_command().
RZ_API bool rz_str_is2utf8 | ( | RZ_NONNULL const char * | c | ) |
Checks if the given character string is a two byte UTF-8 character.
c | The character string to test. |
Definition at line 703 of file str.c.
References c, and rz_return_val_if_fail.
Referenced by rz_str_isXutf8(), and rz_str_strchr().
RZ_API bool rz_str_is3utf8 | ( | RZ_NONNULL const char * | c | ) |
Checks if the given character string is a three byte UTF-8 character.
c | The character string to test. |
Definition at line 717 of file str.c.
References c, and rz_return_val_if_fail.
Referenced by rz_str_isXutf8(), and rz_str_strchr().
RZ_API bool rz_str_is4utf8 | ( | RZ_NONNULL const char * | c | ) |
Checks if the given character string is a four byte UTF-8 character.
c | The character string to test. |
Definition at line 731 of file str.c.
References c, and rz_return_val_if_fail.
Referenced by rz_str_isXutf8(), and rz_str_strchr().
Definition at line 1988 of file str.c.
References cmd_descs_generate::str.
Referenced by rz_core_meta_print().
Definition at line 3908 of file str.c.
References rz_str_is_false(), rz_str_is_true(), and val.
Referenced by config_print_node().
Definition at line 3904 of file str.c.
References rz_str_casecmp(), and s.
Referenced by boolify_var_cb(), and rz_str_is_bool().
Definition at line 2038 of file str.c.
References IS_PRINTABLE, NULL, rz_utf8_decode(), and cmd_descs_generate::str.
Referenced by rz_bin_string_decode_base64().
Definition at line 2069 of file str.c.
References IS_PRINTABLE, NULL, rz_utf8_decode(), and cmd_descs_generate::str.
Referenced by ds_print_ptr(), and myregwrite().
Definition at line 2053 of file str.c.
References IS_PRINTABLE, NULL, rz_utf8_decode(), and cmd_descs_generate::str.
Referenced by rz_asn1_to_string().
Definition at line 3900 of file str.c.
References rz_str_casecmp(), and s.
Referenced by rz_config_get(), rz_config_get_b(), rz_config_set(), and rz_str_is_bool().
RZ_API bool rz_str_is_utf8 | ( | RZ_NONNULL const char * | str | ) |
Returns true if the input string is correctly UTF-8-encoded.
Goes through a null-terminated string and returns false if there is a byte sequence that does not encode a valid UTF-8 code point (as determined by rz_utf8_decode()). If there are no such sequences, it returns true.
str | Input string to check for UTF-8 validity. |
Definition at line 2023 of file str.c.
References bytes, len, NULL, rz_return_val_if_fail, rz_utf8_decode(), and cmd_descs_generate::str.
Referenced by rz_core_file_info_print().
Checks if the whole string is composed of whitespace.
str | input string |
Definition at line 2004 of file str.c.
References isspace, rz_return_val_if_fail, and cmd_descs_generate::str.
Referenced by sh_assembler().
Definition at line 3550 of file str.c.
References IS_DIGIT, and cmd_descs_generate::str.
Referenced by __computeTotal(), ar_parse_header(), clean_function_name(), cmd_print_format(), config_print_node(), extract_arg(), rz_convert_mne_handler(), and windbg_open().
RZ_API bool rz_str_isXutf8 | ( | RZ_NONNULL const char * | c, |
ut8 | x | ||
) |
Checks if the byte string matches the criteria of a UTF-8 character of length x
.
c | The byte string to test. |
x
. False otherwise. Definition at line 745 of file str.c.
References c, rz_return_val_if_fail, rz_str_is2utf8(), rz_str_is3utf8(), rz_str_is4utf8(), and x.
Definition at line 3565 of file str.c.
References test_evm::end, NULL, and cmd_descs_generate::str.
Referenced by autocomplete_process_path(), and rz_file_globsearch().
Definition at line 2670 of file str.c.
References b, eprintf, setup::idx, int, NULL, p, RZ_BIT_TOGGLE, rz_str_lchr(), and s.
Referenced by rz_core_cmd_subst_i(), and rz_line_hist_save().
Definition at line 669 of file str.c.
References len, NULL, and cmd_descs_generate::str.
Referenced by __isScriptFilename(), address_bit(), clean_function_name(), objc_name_toc(), pal_seek(), parse(), rz_core_analysis_function_set_signature(), rz_core_analysis_hasrefs_to_depth(), rz_core_bin_print_source_line_sample(), rz_core_flirt_convert_file(), rz_core_flirt_create_file(), rz_core_flirt_dump_file(), rz_core_get_section_name(), rz_core_run_script(), rz_core_visual_define(), rz_file_is_c(), rz_lang_get_by_extension(), rz_sign_flirt_apply(), rz_str_lastbut(), rz_test_chdir_fromtest(), and xnu_dbg_maps().
Definition at line 2709 of file str.c.
References i, rz_str_char_fullwidth(), and s.
Referenced by __strbuf_append_col_aligned(), __strbuf_append_col_aligned_fancy(), real_strlen(), rz_core_clippy(), and rz_core_print_disasm().
Definition at line 2723 of file str.c.
References __str_ansi_length(), i, len, rz_str_char_fullwidth(), and cmd_descs_generate::str.
Referenced by __addRow(), __strbuf_append_col_aligned(), __table_adjust(), core_recover_golang_functions_go_1_16(), core_recover_golang_functions_go_1_18(), core_recover_golang_functions_go_1_2(), ds_align_comment(), recover_string_at(), rz_table_add_column(), rz_table_tofancystring(), and rz_table_tosimplestring().
Definition at line 3849 of file str.c.
References p, rz_list_pop_head(), rz_strbuf_append(), rz_strbuf_drain(), rz_strbuf_length(), rz_strbuf_new(), sb, and cmd_descs_generate::str.
Referenced by cmd_print_gadget(), rz_str_scale(), and sections_print_table().
Definition at line 129 of file str.c.
Referenced by avr_il_in(), avr_il_out(), construct_rop_gadget(), decode_regis(), get_q_bits(), get_token_decoded(), is_mm_register(), is_st_register(), is_xmm_register(), java_assembler(), mnem_mul(), parseOpcode(), parseOperand(), parseOperands(), parseReg(), rz_bin_demangle(), rz_core_asm_strsearch(), rz_search_get_encoding(), rz_str_casestr(), rz_str_startswith_icase(), and str_endswith().
Secure string copy with null terminator.
This API behaves like strlcpy or strscpy.
Definition at line 923 of file str.c.
References dst, rz_return_val_if_fail, and src.
Referenced by address_bit(), bgets(), build(), cr16_decode_slpr(), ds_atabs_option(), ds_show_flags(), get_imports(), getlistmask(), maps(), meta_string_guess_add(), parse(), parse_format(), parse_grep_expression(), parse_relocation_info(), printCol(), rz_analysis_class_add_attr_unique_raw(), rz_asm_massemble(), rz_bin_addr2line(), rz_config_node_value_format_i(), rz_cons_html_filter(), rz_cons_hud(), rz_core_fgets(), rz_core_get_section_name(), rz_core_visual_title(), rz_file_mkstemp(), rz_rebase_info_new_from_mach0(), rz_regex_get_match_list(), rz_sys_pid_to_path(), rz_th_get_name(), sections(), str_dup_safe_fixed(), and visual_search().
RZ_API char* rz_str_ndup | ( | RZ_NULLABLE const char * | ptr, |
int | len | ||
) |
Create new copy of string ptr
limited to size len
.
[in] | ptr | String to create new copy from |
[in] | len | Upper limit for new string size |
ptr
with size limited by len
or NULL if ptr
is NULL Definition at line 1006 of file str.c.
References len, malloc(), memcpy(), NULL, out, and rz_str_nlen().
Referenced by _6502_tokenize(), __childrenFlagsOf(), __input_cb(), __open(), arm_tokenize(), autocmplt_cmd_arg_env(), autocmplt_cmd_arg_eval_full(), autocmplt_cmd_arg_file(), autocomplete_sdb(), avr_tokenize(), backward_kill_word(), bin_section_from_section(), bin_section_from_segment(), bootimg_header_load(), dalvik_tokenize(), demangle_classname(), dex_resolve_string_id(), disasm_strings(), do_ref_search(), ds_sub_jumps(), esil_split_flg(), get_cd_from_cmdid(), get_maps_unpatched(), get_max_common_pfx(), get_name(), get_segments(), getnumbang(), getnummemend(), getnummemendbang(), getreglist(), getregmembang(), getregmemend(), getregmemstartend(), getshiftmemend(), info(), is_cpu_valid(), kill_word(), m68k_tokenize(), meta_set(), mips_tokenize(), pager_color_line(), parse_attr_value(), parse_line_header_source(), parse_signature(), parseOpcode(), process_one_string(), readString(), rz_analysis_xrefs_to_list_handler(), rz_asn1_stringify_string(), rz_bin_dex_strings(), rz_cmd_kuery(), rz_coff_symbol_name(), rz_cons_filter(), rz_cons_flush(), rz_cons_grepbuf(), rz_cons_highlight(), rz_core_file_open(), rz_core_rtr_add(), rz_core_visual_esil(), rz_hex_from_c_array(), rz_hex_from_js(), rz_hex_from_py_array(), rz_print_json_path(), rz_remote_tcp_handler(), rz_str_between(), rz_str_replace_icase(), sh_tokenize(), showstr(), socket_http_answer(), str_dup_safe(), str_split_list_common_regex(), tms320_tokenize(), tokenize_asm_generic(), tokenize_lines(), unix_word_rubout(), v850_tokenize(), and z80_tokenize().
Definition at line 865 of file str.c.
References NULL, cmd_descs_generate::str, and strdup().
Referenced by __add_menu(), __check_panel_type(), __core_visual_print_command(), __handle_tab_new_with_cur_panel(), __init_almighty_db(), __set_read_only(), _luac_build_info(), add_single_addr_xrefs(), analysis_class_print(), autocomplete_process_path(), autocomplete_sdb(), autocompleteFilename(), capture_filter_keywords(), disassemble(), ds_print_ptr(), flagname_method(), format_CALL_FUNCTION_EX_36(), format_MAKE_FUNCTION_arg_36(), format_value_flags_36(), get_class(), lang_lib_file_run(), lua53_disasm(), lua_parse_header_53(), lua_parse_header_54(), luac_add_section(), luac_add_string(), luac_add_symbol(), parse_arg(), rax(), recovery_apply_vtable(), resource_value(), rz_8051_disas(), rz_analysis_class_method_get(), rz_analysis_class_method_get_by_addr(), rz_analysis_class_method_recover(), rz_analysis_class_method_rename(), rz_analysis_value_to_string(), rz_bin_elf_section_type_to_string(), rz_bin_num_to_type(), rz_cf_value_dict_parse(), rz_cmd_heap_chunks_print_handler(), rz_cmd_kuery(), rz_core_asm_strsearch(), rz_core_disasm_instruction(), rz_core_visual_analysis(), rz_heap_arenas_list(), rz_heap_bin_content(), rz_heap_chunks_list(), rz_heap_fastbin_content(), rz_heap_tcache_content(), rz_main_rz_sign(), rz_str_dup(), rz_syscmd_join(), section_type_to_string(), set_elf_symbol_name(), and type_match().
Referenced by __add_visual_mark(), __clear_layout_cb(), __cons_pal_update_event(), __core_analysis_fcn(), __core_visual_view_graph_update(), __create_iter_sections(), __create_panels_config_path(), __func_name_from_ord(), __get_panels_config_file_from_dir(), __handle_console(), __hashify(), __load_cmdf(), __ne_get_resources(), __open(), __print_disassembly_cb(), __print_hexdump_cb(), __print_stack_cb(), __read(), __resource_type_str(), __rtr_shell(), __search_strings(), __show_status_input(), __system(), __update_prompt_color(), __write(), _cb_hit(), _CbInRangeAav(), _fill_bin_symbol(), _luac_build_info(), _parse_resource_directory(), _resource_type_str(), add_class_name_to_name(), add_map(), add_single_addr_xrefs(), add_window_to_table(), addrom(), addVar(), agraph_print_node(), agraph_update_title(), analop(), analysis_class_print(), analysis_op(), annotated_hexdump(), anop32(), apply_maps_as_flags(), asciiart_backtrace(), assemble(), autocmplt_cmd_arg_file(), autocomplete_breakpoints(), autocomplete_macro(), autocomplete_process_path(), autocomplete_sdb(), autocompleteFilename(), autoname_imp_trampoline(), bin_pe_parse_imports(), bin_pe_versioninfo(), binutils_assemble(), bochs_send_cmd(), c_parser_new_anonymous_callable_name(), c_parser_new_anonymous_enum_name(), c_parser_new_anonymous_structure_name(), c_parser_new_anonymous_union_name(), callable_name_or_ptr(), classes(), cmd_analysis_esil(), cmd_analysis_graph(), cmd_foreach_cmdname_modes(), cmd_pCd(), cmd_pCD(), cmd_pCx(), cmd_prc(), construct_symbol_flagname(), convert_dot_to_image(), core_cmp_bits(), core_recover_golang_functions_go_1_16(), core_recover_golang_functions_go_1_18(), core_recover_golang_functions_go_1_2(), cpu_memory_map(), create_child_env(), create_initterm_syms(), create_type_name_from_offset(), DEFINE_HANDLE_TS_FCN_AND_SYMBOL(), demangle_classname(), describe_xbe_lib_at(), disassemble(), do_ref_search(), do_syscall_search(), download(), download_and_write(), ds_print_calls_hints(), ds_print_lines_left(), ds_print_ptr(), ds_print_show_bytes(), ds_show_comments_right(), ds_sub_jumps(), dump_maps(), emit_syscall(), enrich_asm(), env(), esil_eq(), extract_arg(), extract_binobj(), extract_sections_symbols(), fill_argv_modes_help_strbuf(), fill_hist_offset(), filter(), find_apk_binary(), find_ipa_binary(), flagname_attr(), format_CALL_FUNCTION_KW_36(), format_CALL_FUNCTION_pos_name_encoded(), format_collect_cb(), format_extended_arg(), format_extended_arg_36(), format_MAKE_FUNCTION_arg_3x(), function_list_print(), function_print_calls(), function_rename(), gdbr_parse_processes_xml(), generic_array_obj_to_string(), get_backtrace_info(), get_binary_complex_object(), get_binary_float_object(), get_category_t(), get_complex_object(), get_constant_symbol_name(), get_corefile_name(), get_enum_type(), get_esil_stack_name(), get_help_wrong_cmd(), get_int64_object(), get_int_object(), get_ivar_list_t(), get_objc_property_list(), get_protocol_list_t(), get_reg_profile(), get_segments(), get_struct_type(), get_symbols(), get_symbols_list(), get_title(), get_type(), get_type_data(), get_union_type(), get_upvalue_symbol_name(), get_versym_entry_sdb_from_verdef(), get_versym_entry_sdb_from_verneed(), getcommapath(), getFunctionName(), getFunctionNamePrefix(), GetHeapGlobalsOffset(), getNameDelta(), getvalue(), handle_ts_stmt(), handle_var_stack_access(), hash_context_create_desc_io_stdin(), hash_context_create_desc_io_string(), hud_filter(), hudstuff_append(), info(), inSymtab(), interact_commands(), io_create_mem_map(), java_constant_pool_stringify(), key_attr_content(), key_attr_content_specific(), key_attr_type_attrs(), key_attr_types(), lang_pipe_run(), le_get_entries(), libs(), load_sdb(), lua54_disasm(), lua_parse_header_53(), lua_parse_header_54(), luaop_new_str_1arg(), luaop_new_str_1arg_ex(), luaop_new_str_2arg(), luaop_new_str_2arg_ex(), luaop_new_str_3arg(), luaop_new_str_3arg_ex(), map_cpu_memory(), maps(), mem(), meta_variable_comment_append(), mnemonics(), mode_cmd_desc_help(), module_match_buffer(), mount_oldstr(), myregwrite(), new_pyc_opcodes(), objc_type_toc(), parse_arg(), parse_classes(), parse_function(), parse_function_args_and_vars(), parse_parameter_list(), parse_tmp_evals(), parse_type_arglist(), pdb_set_symbols(), print_debug_map_line(), print_flag_rizin(), print_graph_dot(), print_item(), print_rop(), print_stats(), printPadded(), proc_mem_img(), process_constructors(), procfs_pid_slurp(), rax(), readline_callback(), recovery_apply_vtable(), references_handler(), rename_flag_ordinal(), reopen_in_malloc_cb(), replace_asm_test(), resolve_mig_subsystem(), resolve_syscalls(), resource_value(), rm_op(), rop_classify(), rop_classify_arithmetic(), rop_classify_arithmetic_const(), rtrcmd(), run_new_command(), rz_8051_disas(), rz_agraph_add_node_with_color(), rz_analysis_appcall_handler(), rz_analysis_basic_block_list_handler(), rz_analysis_class_base_set_raw(), rz_analysis_class_method_set(), rz_analysis_class_vtable_set(), rz_analysis_create_function(), rz_analysis_dwarf_integrate_functions(), rz_analysis_extract_rarg(), rz_analysis_function_all_opcode_stat_handler(), rz_analysis_function_autoname_var(), rz_analysis_function_get_signature(), rz_analysis_noreturn_functions(), rz_analysis_rtti_itanium_demangle_class_name(), rz_analysis_xrefs_to_list_handler(), rz_asm_massemble(), rz_asm_use(), rz_big_to_hexstr(), rz_bin_addr2text(), rz_bin_demangle(), rz_bin_dex_libraries(), rz_bin_dex_resolve_field_by_idx(), rz_bin_dex_resolve_method_by_idx(), rz_bin_dwarf_line_header_get_full_file_path(), rz_bin_elf_get_e_ehsize_as_string(), rz_bin_elf_get_e_entry_as_string(), rz_bin_elf_get_e_flags_as_string(), rz_bin_elf_get_e_indent_as_string(), rz_bin_elf_get_e_machine_as_string(), rz_bin_elf_get_e_phentsize_as_string(), rz_bin_elf_get_e_phnum_as_string(), rz_bin_elf_get_e_phoff_as_string(), rz_bin_elf_get_e_shentsize_as_string(), rz_bin_elf_get_e_shnum_as_string(), rz_bin_elf_get_e_shoff_as_string(), rz_bin_elf_get_e_shstrndx_as_string(), rz_bin_elf_get_e_type_as_string(), rz_bin_elf_get_e_version_as_string(), rz_bin_elf_get_elf_class(), rz_bin_elf_get_file_type(), rz_bin_elf_get_machine_name(), rz_bin_elf_section_type_to_string(), rz_bin_file_golang_compiler(), rz_bin_filter_name(), rz_bin_java_class_as_source_code(), rz_bin_java_class_const_pool_as_symbols(), rz_bin_java_class_const_pool_resolve_index(), rz_bin_java_class_methods_as_symbols(), rz_bin_java_class_name(), rz_bin_le_get_relocs(), rz_bin_le_get_sections(), rz_bin_mz_get_segments(), rz_bin_ne_get_relocs(), rz_bin_ne_get_segments(), rz_bin_ne_get_symbols(), rz_bin_object_new(), rz_bin_omf_send_sections(), rz_bin_pe_get_clr_symbols(), rz_bin_pe_get_sections(), rz_bv_as_hex_string(), rz_cmd_alias(), rz_cmd_call(), rz_cmd_debug_continue_until(), rz_cmd_eval_color_highlight_current_instruction_handler(), rz_cmd_eval_color_highlight_instruction_word_handler(), rz_cmd_heap_chunks_print_handler(), rz_cmd_info_hashes_handler(), rz_cmd_kuery(), rz_cmd_print(), rz_cmd_shell_mv_handler(), rz_comment_filelink_handler(), rz_cons_grepbuf(), rz_cons_rainbow_get(), rz_cons_rgb_tostring(), rz_cons_swap_ground(), rz_core_analysis_callgraph(), rz_core_analysis_function_autoname(), rz_core_analysis_function_set_signature(), rz_core_analysis_get_comments(), rz_core_bin_apply_classes(), rz_core_bin_apply_sections(), rz_core_bin_apply_strings(), rz_core_bin_apply_symbols(), rz_core_bin_class_build_flag_name(), rz_core_bin_export_info(), rz_core_bin_imports_print(), rz_core_bin_load(), rz_core_bin_pdb_get_filename(), rz_core_bin_super_build_flag_name(), rz_core_cmd_foreach3(), rz_core_cmd_subst_i(), rz_core_debug_backtraces(), rz_core_debug_bp_add(), rz_core_debug_bp_add_noreturn_func(), rz_core_disassemble_bytes(), rz_core_disassemble_instr(), rz_core_file_loadlib(), rz_core_file_reopen_debug(), rz_core_hack_x86(), rz_core_loadlibs(), rz_core_meta_append(), rz_core_parse_rizinrc(), rz_core_print_bb_gml(), rz_core_print_disasm_all(), rz_core_print_hexdump_byline_str(), rz_core_print_scrollbar(), rz_core_print_scrollbar_bottom(), rz_core_rtr_add(), rz_core_rtr_cmd(), rz_core_rtr_http_run(), rz_core_rtr_rap_run(), rz_core_run_script(), rz_core_search_rop(), rz_core_sym_name_init(), rz_core_syscall_as_string(), rz_core_types_link_print(), rz_core_visual(), rz_core_visual_analysis_refresh_column(), rz_core_visual_classes(), rz_core_visual_config_hud(), rz_core_visual_define(), rz_core_visual_hudclasses(), rz_core_visual_hudstuff(), rz_core_visual_title(), rz_core_visual_view_rop(), rz_core_visual_xrefs(), rz_debug_bp_add(), rz_debug_dmp_init(), rz_debug_traces_info(), rz_dyldcache_symbols_from_locsym(), rz_egg_Cfile_parseCompiled(), rz_egg_Cfile_parser(), rz_egg_Cfile_set_cEnv(), rz_egg_lang_include_init(), rz_egg_lang_parsechar(), rz_file_abspath_rel(), rz_file_globsearch(), rz_file_mkstemp(), rz_file_path(), rz_file_path_join(), rz_file_temp(), rz_hash_bang_details_cb(), rz_hash_cfg_calculate_small_block_string(), rz_hash_cfg_get_result_string(), rz_il_sort_pure_stringify(), rz_io_ar_open_many(), rz_io_open_buffer(), rz_io_zip_open(), rz_lib_path(), rz_load_panels_layout(), rz_main_rizin(), rz_main_rz_run(), rz_path_home_prefix(), rz_project_migrate(), rz_reg_profile_to_cc(), rz_reopen_debug_handler(), rz_resolve_jemalloc(), rz_run_config_env(), rz_seek_history_list_handler(), rz_socket_spawn(), rz_socket_to_string(), rz_sys_info(), rz_sys_pid_to_path(), rz_syscall_setup(), rz_syscmd_mkdir(), rz_table_tofancystring(), rz_table_tostring(), rz_test_main(), rz_test_test_name(), rz_time_stamp_to_str(), rz_type_db_enum_get_bitfield(), rz_type_db_find_enums_by_val(), rz_type_format_data_internal(), rz_type_parse_string_single(), rz_type_path_by_offset(), rz_types_define(), rz_uleb128(), rz_w32_add_winmsg_breakpoint(), rz_x509_certificate_dump(), rz_x509_crl_to_string(), rz_x509_signedinfo_dump(), rz_x509_tbscertificate_dump(), rzfind_open(), rzfind_open_file(), save_callable(), save_enum(), save_struct(), save_typelink(), save_union(), sdb_load_arch_profile(), sdb_load_platform_profile(), sdb_load_sysregs(), sdb_save_dwarf_function(), section_type_to_string(), sections(), sections_from_bin(), sections_from_mach0(), sections_print_table(), seek_to_node(), session_sdb_save(), set_bin_relocs(), set_elf_section_name(), set_new_xref(), simple_build_upvalue_symbol(), socket_http_get_recursive(), ssa_get(), string_scan_range_cfstring(), structured_member_walker(), subs_var_string(), subvar(), symbols(), symbols_from_stubs(), ts_node_sub_parent_string(), ts_node_sub_string(), unique_class_name(), update_asmbits_options(), v2_v3_types_foreach_cb(), var_add_structure_fields_to_list(), var_functions_show(), visual_comma(), visual_flagzone(), w32_info_user(), w32_list_heaps_blocks(), walk_exports(), windbg_open(), and winkd_download_module_and_pdb().
Definition at line 871 of file str.c.
References len, malloc(), memcpy(), NULL, and cmd_descs_generate::str.
Referenced by core_cmd_raw(), core_cmd_raw_node(), ds_build_op_str(), filterFlags(), get_word_from_canvas_for_menu(), name_from_table(), print_main_arena_bins(), rz_file_globsearch(), rz_str_appendlen(), rz_str_trunc_ellipsis(), rz_subprocess_err(), and rz_subprocess_out().
RZ_API char* rz_str_nextword | ( | char * | s, |
char | ch | ||
) |
Definition at line 1949 of file str.c.
References len, n, rz_return_val_if_fail, cmd_descs_generate::str, and strnlen().
Referenced by parse_ext_opcode(), parse_line_header_source(), rax(), rz_arm_it_update_block(), rz_buf_get_nstring(), rz_cons_canvas_write(), rz_core_yank_print_string(), rz_core_yank_string(), rz_file_is_deflated(), rz_log_set_file(), rz_print_hexdump_hexpair_bytes_handler(), rz_str_ndup(), rz_type_format_nulltermstring(), str_dup_safe(), and type_as_pretty_string().
Definition at line 1966 of file str.c.
References len, n, and cmd_descs_generate::str.
Referenced by rz_core_visual_define().
Definition at line 842 of file str.c.
References c, find(), len, NULL, s, and sc.
Referenced by rz_strstr_ansi().
Definition at line 3236 of file str.c.
References memset(), pad(), and RZ_MIN.
Referenced by __printRecursive(), __update_help_contents(), __update_panel_contents(), add_spaces(), core_cmp_bits(), ds_print_optype(), fill_level(), flirt_pat_write_line(), flirt_print_indentation(), print_addr(), rz_analysis_function_vars_stackframe_handler(), rz_asn1_print_hex(), rz_asn1_print_hexdump_padded(), rz_asn1_print_padded(), rz_core_clippy(), rz_core_help_vars_print(), rz_core_visual_esil(), rz_list_mne_handler(), rz_print_offset_sg(), rz_str_scale(), selection_widget_draw(), ut64_to_hex(), and visual_flagzone().
Definition at line 2463 of file str.c.
References c, malloc(), NULL, path, realloc(), and cmd_descs_generate::str.
Referenced by rz_core_io_file_open().
Definition at line 1027 of file str.c.
References NULL, realloc(), and strdup().
Referenced by annotated_hexdump(), core_analysis_graph_construct_nodes(), gdbr_parse_target_xml(), lang_lib_file_run(), parse_reg_profile_str(), parse_tmp_evals(), rz_analysis_reflines_str(), rz_core_cmd_subst_i(), rz_core_print_bb_custom(), rz_main_rizin(), rz_remote_rap_bg_handler(), and rz_remote_rap_handler().
Definition at line 2807 of file str.c.
References addr, from, NULL, p, r, rz_num_get(), to, and ut64().
Referenced by internal_esil_mem_read(), and internal_esil_mem_write().
Definition at line 829 of file str.c.
References NULL, p, and rz_return_val_if_fail.
Referenced by classdump_java(), disasm_strings(), find_ipa_binary(), riscv_op(), rz_bin_dex_imports(), rz_bin_java_class_const_pool_as_imports(), rz_file_basename(), rz_file_dirname(), rz_file_dos_basename(), rz_type_format_data_internal(), rz_type_format_struct_size(), and winkd_download_module_and_pdb().
RZ_API void rz_str_remove_char | ( | char * | str, |
char | c | ||
) |
Definition at line 3249 of file str.c.
References i, rz_strbuf_append(), rz_strbuf_drain(), rz_strbuf_new(), and strdup().
Referenced by __strbuf_append_col_aligned(), rz_core_clippy(), rz_table_tofancystring(), and rz_table_tosimplestring().
Definition at line 1110 of file str.c.
References eprintf, g, i, int, key, memcpy(), newstr(), NULL, off, p, realloc(), RZ_FREE, rz_return_val_if_fail, rz_str_replace_char(), rz_str_replace_icase(), cmd_descs_generate::str, and val.
Referenced by __replaceImports(), __rotate_panel_cmds(), _replace_register(), apply_edits(), arm_tokenize(), classdump_java(), core_analysis_graph_construct_nodes(), dalvik_tokenize(), ds_build_op_str(), ds_sub_jumps(), get_body(), graph_construct_nodes(), parse(), parse_go_build_info(), pdb_set_symbols(), run_basic_block_analysis(), rz_asm_code_equ_replace(), rz_asm_massemble(), rz_cf_value_string_print(), rz_cons_grepbuf(), rz_core_agraph_add_node(), rz_core_cmd_subst_i(), rz_core_search_rop(), rz_debug_dmp_init(), rz_egg_Cfile_parseCompiled(), rz_file_copy(), rz_file_path_local_to_unix(), rz_file_path_unix_to_local(), rz_file_root(), rz_parse_immtrim(), rz_pseudo_convert(), rz_socket_spawn(), rz_str_replace_in(), sh_tokenize(), subs_var_string(), subvar(), system_apply_env_var(), vernum(), and z80_tokenize().
Definition at line 139 of file str.c.
Referenced by autocmplt_cmd_arg_file(), autocomplete_process_path(), demangle_class(), dex_resolve_library(), disassemble(), rz_bin_dex_imports(), rz_bin_java_class_const_pool_as_imports(), rz_bin_java_class_const_pool_as_symbols(), rz_cons_hud_string(), rz_core_bin_class_build_flag_name(), rz_core_bin_field_build_flag_name(), rz_core_bin_method_build_flag_name(), rz_core_bin_super_build_flag_name(), rz_str_replace_char(), rz_str_replace_char_once(), types_xrefs_graph(), windbg_open(), and xrefs_list_print().
Definition at line 169 of file str.c.
References a, b, rz_str_replace_ch(), and s.
Referenced by bin_pe_compute_authentihash(), disassemble(), ds_print_dwarf(), ds_show_functions(), ds_show_functions_argvar(), graph_construct_nodes(), mips_assemble(), num_callback(), parse(), rasm_disasm(), replace(), rz_asm_massemble(), rz_asm_pseudo_byte(), rz_asm_pseudo_incbin(), rz_bin_dex_imports(), rz_bin_java_class_as_source_code(), rz_bin_java_class_interfaces_as_json(), rz_bin_java_class_interfaces_as_text(), rz_cons_pal_list(), rz_core_analysis_esil(), rz_core_visual_view_rop(), rz_eval_editor_handler(), rz_num_conditional(), rz_num_get(), rz_reopen_debug_rzrun_handler(), rz_run_parse(), rz_str_replace(), and sigdb_signature_resolve_details().
RZ_API char* rz_str_replace_icase | ( | char * | str, |
const char * | key, | ||
const char * | val, | ||
int | g, | ||
int | keep_case | ||
) |
Definition at line 1160 of file str.c.
References eprintf, free(), g, i, int, key, memcpy(), newstr(), NULL, off, p, realloc(), rz_return_val_if_fail, rz_str_casestr(), rz_str_ndup(), rz_str_replace_icase(), cmd_descs_generate::str, strdup(), and val.
Referenced by rz_cons_grepbuf(), rz_str_replace(), rz_str_replace_icase(), and subvar().
Definition at line 1288 of file str.c.
References free(), g, key, NULL, rz_str_replace(), cmd_descs_generate::str, strdup(), and val.
Referenced by gb_parse_arith1(), gb_parse_cb1(), gb_parse_cb2(), gb_parse_ld1(), and gbAsm().
RZ_API char* rz_str_replace_thunked | ( | char * | str, |
char * | clean, | ||
int * | thunk, | ||
int | clen, | ||
const char * | key, | ||
const char * | val, | ||
int | g | ||
) |
Definition at line 1233 of file str.c.
References delta, eprintf, free(), g, i, int, key, memcpy(), newstr(), NULL, p, realloc(), RZ_FREE, rz_mem_mem(), rz_str_ansi_filter(), cmd_descs_generate::str, strdup(), and val.
Referenced by rz_cons_highlight().
RZ_API void rz_str_reverse | ( | char * | str | ) |
Definition at line 183 of file str.c.
References i, len, and cmd_descs_generate::str.
Referenced by rax(), rz_num_to_trits(), and rz_str_rstr().
Definition at line 318 of file str.c.
References rwxstr, RZ_ARRAY_SIZE, and cmd_descs_generate::str.
Referenced by __io_maps(), mem(), rz_bin_mz_get_segments(), rz_core_debug_bp_add(), rz_core_get_boundaries_prot(), rz_debug_drx_handler(), rz_debug_memory_permission_handler(), rz_open_handler(), rz_open_maps_flags_global_handler(), rz_open_maps_flags_handler(), rz_open_maps_map_handler(), rz_open_nobin_handler(), rz_open_nobin_write_handler(), rz_open_write_handler(), and sections().
Definition at line 332 of file str.c.
References rwxstr, and RZ_ARRAY_SIZE.
Referenced by apply_maps_as_flags(), bin_memory_print_rec(), cmd_print_blocks(), desc_list_cb(), desc_list_table_cb(), desc_list_visual_cb(), ds_print_lines_left(), dump_maps(), open_maps_show(), print_debug_map_json(), print_debug_map_line(), print_debug_maps_ascii_art(), rz_cmd_debug_list_bp_handler(), rz_cmd_debug_show_cur_bp_handler(), rz_core_file_info_print(), rz_debug_esil_watch_list(), rz_table_visual_list(), showfile(), and xnu_dbg_maps().
RZ_API void rz_str_sanitize | ( | char * | c | ) |
Definition at line 1381 of file str.c.
Referenced by rz_core_meta_print(), rz_egg_Cfile_parser(), and rz_egg_load_file().
Definition at line 1405 of file str.c.
References c, len, malloc(), NULL, and s.
Referenced by flagname_attr(), rz_analysis_class_add_attr_unique(), rz_analysis_class_base_get(), rz_analysis_class_base_get_all(), rz_analysis_class_base_list_handler(), rz_analysis_class_base_set(), rz_analysis_class_create(), rz_analysis_class_delete(), rz_analysis_class_delete_attr(), rz_analysis_class_exists(), rz_analysis_class_get_attr(), rz_analysis_class_method_delete(), rz_analysis_class_method_get(), rz_analysis_class_method_get_all(), rz_analysis_class_rename(), rz_analysis_class_rename_attr(), rz_analysis_class_set_attr(), rz_analysis_class_vtable_delete(), rz_analysis_class_vtable_get(), rz_analysis_class_vtable_get_all(), rz_analysis_class_vtable_list_handler(), save_callable(), save_enum(), save_struct(), save_union(), and sdb_save_dwarf_function().
Definition at line 3921 of file str.c.
References test-lz4-speed::float, free(), h, i, int, setup::line, lines(), memset(), out, rz_list_append(), rz_list_free(), rz_list_get_n(), rz_list_length(), rz_list_newf(), RZ_MAX, rz_str_list_join(), rz_str_pad(), rz_str_split_list(), s, cmd_descs_generate::str, strdup(), and w.
Referenced by rz_cons_grepbuf().
Split string str
in place by using ch
as a delimiter.
Replaces all instances of ch
in str
with a NULL byte and it returns the number of split strings.
Definition at line 406 of file str.c.
References i, p, rz_return_val_if_fail, and cmd_descs_generate::str.
Referenced by __check_panel_type(), __config_toggle_cb(), __config_value_cb(), __init_menu_color_settings_layout(), __print_hexdump_cb(), __print_stack_cb(), core_analysis_bytes_desc(), disasm_strings(), parse_tmp_evals(), rz_analysis_class_method_recover(), rz_bin_strpurge(), rz_core_asm_plugins_print(), rz_core_cmd_foreach(), rz_core_rtr_http_run(), rz_syscall_item_new_from_string(), rz_write_from_socket_handler(), update_asmcpu_options(), update_asmfeatures_options(), and update_asmplatforms_options().
Split the string str
according to the substring c
and returns a RzList
with the result.
Split a string str
according to the delimiter specified in c
. It can optionally trim (aka remove spaces) the tokens. The result is a RzList
with newly allocated strings for each token.
str | Input string to split |
c | Delimiter string used to split str |
trim | If true each token is considered without trailing/leading whitespaces. |
Definition at line 3464 of file str.c.
References c, free(), NULL, rz_return_val_if_fail, cmd_descs_generate::str, str_split_list_common(), strdup(), and trim().
Referenced by _6502_tokenize(), ar_parse_header(), arm_tokenize(), avr_tokenize(), cb_analysis_roregs(), dalvik_tokenize(), m68k_tokenize(), mips_tokenize(), parse_asm_path(), parse_list(), rz_core_flirt_app_from_option_list(), rz_core_flirt_file_from_option_list(), rz_core_flirt_os_from_option_list(), rz_test_run_cmd_test(), sh_assembler(), sh_tokenize(), tms320_tokenize(), v850_tokenize(), and z80_tokenize().
Split the string str
according to the substring c
and returns a RzList
with the result.
Split a string str
according to the delimiter specified in c
. It can optionally trim (aka remove spaces) the tokens and/or consider at most n
delimiters. The result is a RzList
with newly allocated strings for each token.
str | Input string to split |
c | Delimiter string used to split str |
n | If > 0 at most this number of delimiters are considered. |
trim | If true each token is considered without trailing/leading whitespaces. |
Definition at line 3485 of file str.c.
References c, free(), n, NULL, rz_return_val_if_fail, cmd_descs_generate::str, str_split_list_common(), strdup(), and trim().
Referenced by parse_reg_profile_str(), rz_cmd_debug_process_profile_handler(), rz_egg_config_handler(), rz_eval_getset_handler(), and rz_main_rz_bin().
RZ_API RZ_OWN RzList* rz_str_split_duplist_n_regex | ( | RZ_NONNULL const char * | _str, |
RZ_NONNULL const char * | r, | ||
int | n, | ||
bool | trim | ||
) |
Split the string str
according to the regex r
and returns a RzList
with the result.
Split a string str
according to the regex specified in r
. It can optionally trim (aka remove spaces) the tokens and/or consider at most n
delimiters. The result is a RzList
with newly allocated strings for each token.
str | Input string to split |
r | Delimiter regex string used to split str |
n | If > 0 at most this number of delimiters are considered. |
trim | If true each token is considered without trailing/leading whitespaces. |
Definition at line 3506 of file str.c.
References free(), n, NULL, r, rz_regex_free(), rz_regex_new(), rz_return_val_if_fail, cmd_descs_generate::str, str_split_list_common_regex(), strdup(), and trim().
Referenced by parse_reg_profile_str().
Split the string str
in lines and returns the result in an array.
Split a string str
in lines. The number of lines is optionally stored in count
, if not NULL. The result is an array of count
entries, with the i-th entry containing the index of the first character of the i-th line.
str | Input string to split |
count | Pointer to a size_t variable that can hold the number of lines. |
Definition at line 3526 of file str.c.
References count, i, NULL, rz_list_free(), rz_list_length(), RZ_NEWS, rz_return_val_if_fail, s, cmd_descs_generate::str, and str_split_list_common().
Referenced by ds_print_comments_right().
Split the string str
according to the substring c
and returns a RzList
with the result.
Split a string str
according to the delimiter specified in c
and it considers at most n
delimiters. The result is a RzList
with pointers to the input string str
. Each token is trimmed as well.
str | Input string to split. It will be modified by this function. |
c | Delimiter string used to split str |
n | If > 0 at most this number of delimiters are considered. |
Definition at line 3429 of file str.c.
References c, n, NULL, rz_return_val_if_fail, cmd_descs_generate::str, and str_split_list_common().
Referenced by cmd_print_gadget(), create_cache_bins(), flirt_pat_parse_line(), parse_hash_algorithms(), rax(), rz_analysis_cc_set(), rz_core_io_plugin_print(), rz_core_rtr_http_run(), rz_core_visual_view_rop(), rz_flag_tags_get(), rz_main_rz_agent(), rz_str_scale(), rz_str_trim_lines(), rz_syscmd_join(), rz_syscmd_sort(), rz_syscmd_uniq(), rz_table_query(), and test_type_for_path().
RZ_API RZ_OWN RzList* rz_str_split_list_regex | ( | RZ_NONNULL char * | str, |
RZ_NONNULL const char * | r, | ||
int | n | ||
) |
Split the string str
according to the regex r
and returns a RzList
with the result.
Split a string str
according to the regex specified in r
and it considers at most n
delimiters. The result is a RzList
with pointers to the input string str
.
str | Input string to split. It will be modified by this function. |
r | Delimiter regex used to split str |
n | If > 0 at most this number of delimiters are considered. |
Definition at line 3445 of file str.c.
References n, NULL, r, rz_regex_free(), rz_regex_new(), rz_return_val_if_fail, cmd_descs_generate::str, and str_split_list_common_regex().
RZ_API bool rz_str_startswith | ( | RZ_NONNULL const char * | str, |
RZ_NONNULL const char * | needle | ||
) |
Checks if a string starts with a specifc sequence of characters (case sensitive)
str | C-string to be scanned |
needle | C-string containing the sequence of characters to match |
needle
is found at the beginning of str
and false otherwise Definition at line 3286 of file str.c.
References rz_return_val_if_fail, and cmd_descs_generate::str.
Referenced by __open(), __plugin_open(), __rap_plugin_open(), __system(), _extract_regs(), _resolve_arch(), autocmplt_cmd_arg_file(), autoname_imp_trampoline(), cb_searchin(), cqcheck(), detect_constructor_destructor(), disasm_strings(), do_analysis_search(), download_and_write(), ds_print_data_type(), ds_print_esil_analysis(), ds_print_fcn_name(), ds_print_str(), ds_show_xrefs(), fill_children_chars(), flagname_method(), gdb_to_rz_profile(), gdbr_get_baddr(), gdbr_parse_processes_xml(), gdbr_server_serve(), get_category_t(), get_class_t(), get_dispatchmessage_offset(), getcoprocreg(), handle_qSupported(), handle_stop_reason(), interpret_msrbank(), is_arg_identifier_in_tmp_stmt(), is_auto_named(), is_entry_flag(), isArm(), isSkippable(), itmask(), lang_lib_file_run(), linux_handle_signals(), match_hist_line(), myregwrite(), objc_type_toc(), opmask(), rax(), read_thread_id(), run_basic_block_analysis(), run_new_command(), rz_analysis_noreturn_at_name(), rz_analysis_vtable_begin(), rz_asm_massemble(), rz_big_from_hexstr(), rz_cmd_search(), rz_core_agraph_add_node(), rz_core_analysis_everything(), rz_core_bin_load(), rz_core_cmd_subst(), rz_core_config_print_all(), rz_core_get_boundaries_prot(), rz_io_def_mmap_check_default(), rz_io_def_mmap_create_new_file(), rz_num_base_of_string(), rz_pointer_handler(), rz_socket_http_post(), rz_syscmd_join(), rz_syscmd_ls(), rz_test_main(), set_bin_relocs(), set_jump_realname(), sh_op_get_addr_mode(), show_class(), skip_archos(), socket_http_get_recursive(), start_a_sequence_of_data(), start_a_sequence_of_instruction(), start_a_sequence_of_thumb_instruction(), step_until_inst(), strip_common_prefixes_stdlib(), type_match(), v1_v2_types_foreach_cb(), v2_v3_types_foreach_cb(), var_rename(), and windbg_open().
RZ_API bool rz_str_startswith_icase | ( | RZ_NONNULL const char * | str, |
RZ_NONNULL const char * | needle | ||
) |
Checks if a string starts with a specifc sequence of characters (case insensitive)
str | C-string to be scanned |
needle | C-string containing the sequence of characters to match |
needle
is found at the beginning of str
and false otherwise Definition at line 3301 of file str.c.
References rz_return_val_if_fail, rz_str_ncasecmp(), and cmd_descs_generate::str.
Referenced by is_lea().
RZ_API const char* rz_str_str_xy | ( | const char * | s, |
const char * | word, | ||
const char * | prev, | ||
int * | x, | ||
int * | y | ||
) |
Definition at line 3964 of file str.c.
References d, NULL, rz_return_val_if_fail, s, src, and x.
Referenced by nextword().
RZ_API const char* rz_str_strchr | ( | RZ_NONNULL const char * | str, |
RZ_NONNULL const char * | c | ||
) |
Returns a pointer to the first occurrence of UTF-8 character c
in the string s
.
str | The string to search. |
c | The UTF-8 character to search for. |
c
in the string (first from the left) or NULL if c
was not found. Definition at line 768 of file str.c.
References c, i, NULL, rz_mem_eq(), rz_return_val_if_fail, rz_str_is2utf8(), rz_str_is3utf8(), rz_str_is4utf8(), cmd_descs_generate::str, and ut64().
Referenced by parse_reg_profile_str().
RZ_API RZ_OWN char* rz_str_stringify_raw_buffer | ( | RzStrStringifyOpt * | option, |
RZ_NULLABLE RZ_OUT ut32 * | length | ||
) |
Converts a raw buffer to a printable string based on the selected options.
option | Pointer to RzStrStringifyOpt. |
length | The real string length. |
Definition at line 4141 of file str.c.
References buflen, i, IS_DIGIT, IS_LOWER, IS_PRINTABLE, IS_UPPER, length, NULL, RZ_MIN, rz_return_val_if_fail, rz_rune_is_printable(), rz_str_ebcdic_es_to_unicode(), rz_str_ebcdic_uk_to_unicode(), rz_str_ebcdic_us_to_unicode(), rz_str_ibm037_to_unicode(), rz_str_ibm290_to_unicode(), rz_strbuf_append(), rz_strbuf_appendf(), rz_strbuf_drain_nofree(), rz_strbuf_init(), RZ_STRING_ENC_8BIT, RZ_STRING_ENC_EBCDIC_ES, RZ_STRING_ENC_EBCDIC_UK, RZ_STRING_ENC_EBCDIC_US, RZ_STRING_ENC_GUESS, RZ_STRING_ENC_IBM037, RZ_STRING_ENC_IBM290, RZ_STRING_ENC_UTF16BE, RZ_STRING_ENC_UTF16LE, RZ_STRING_ENC_UTF32BE, RZ_STRING_ENC_UTF32LE, rz_utf16be_decode(), rz_utf16le_decode(), rz_utf32be_decode(), rz_utf32le_decode(), rz_utf8_decode(), rz_utf8_encode(), sb, and autogen_x86imm::tmp.
Referenced by core_print_raw_buffer(), and print_json_string().
Definition at line 3814 of file str.c.
References i, key, off, rz_mem_mem(), and cmd_descs_generate::str.
Referenced by rz_egg_Cfile_parseCompiled().
Definition at line 217 of file str.c.
References RZ_SYS_BITS_16, RZ_SYS_BITS_32, RZ_SYS_BITS_64, RZ_SYS_BITS_8, and v.
RZ_API void rz_str_trim | ( | RZ_NONNULL RZ_INOUT char * | str | ) |
Removes whitespace characters (space, tab, newline etc.) from the beginning and end of a string.
str | The string to trim. |
Definition at line 190 of file str_trim.c.
References rz_str_trim_head(), rz_str_trim_tail(), and cmd_descs_generate::str.
Referenced by __op_refs(), __refs(), __reg_read(), addVar(), assign_reg(), cmd_print_pv(), disasm_strings(), do_handle_substitution_cmd(), ds_print_comments_right(), ds_print_dwarf(), exprmatchreg(), filter_item_name(), function_print_to_json(), get_body(), get_long_object(), getpcfromstack(), handleHints(), interact_commands(), parse(), prim(), print_fcn_arg(), rz_analysis_cc_set(), rz_asm_massemble(), rz_bin_addr2text(), rz_bin_elf_get_compiler(), rz_cons_grep_parsecmd(), rz_cons_grep_strip(), rz_core_asm_strsearch(), rz_core_cmd_subst_i(), rz_core_rtr_add(), rz_core_visual_cmd(), rz_name_filter(), rz_str_trim_dup(), rz_str_trim_lines(), rz_str_version(), rz_syscmd_cat(), rz_syscmd_head(), rz_syscmd_join(), rz_syscmd_mkdir(), rz_syscmd_sort(), rz_syscmd_tail(), rz_syscmd_uniq(), rz_test_load_asm_test_file(), rz_test_load_json_test_file(), rz_test_run_asm_test(), rz_time_stamp_to_str(), rz_w32_add_winmsg_breakpoint(), socket_http_answer(), str_split_list_common(), and str_split_list_common_regex().
RZ_API void rz_str_trim_char | ( | RZ_NONNULL RZ_INOUT char * | str, |
const char | c | ||
) |
Removes the character c
from the beginning and end of a string.
str | The string to trim. |
c | The character to remove. |
Definition at line 179 of file str_trim.c.
References c, rz_str_trim_head_char(), rz_str_trim_tail_char(), and cmd_descs_generate::str.
Referenced by ds_build_op_str().
Definition at line 78 of file str_trim.c.
References a, rz_str_trim(), cmd_descs_generate::str, and strdup().
Referenced by capture_filter_keywords(), get_corefile_name(), rz_cmd_remote(), rz_cmd_search(), rz_config_eval(), rz_core_asm_strsearch(), rz_core_cmd_foreach3(), rz_regs_fpu_handler(), and rz_remote_mode_enable_handler().
RZ_API void rz_str_trim_head | ( | RZ_NONNULL char * | str | ) |
Removes whitespace characters (space, tab, newline etc.) from the end of a string. The string is changed in place.
str | The string to trim. |
Definition at line 110 of file str_trim.c.
References p, rz_str_trim_head_ro(), and cmd_descs_generate::str.
Referenced by parse(), rz_core_cmd_pipe_old(), rz_core_cmd_subst_i(), and rz_str_trim().
RZ_API void rz_str_trim_head_char | ( | RZ_NONNULL RZ_INOUT char * | str, |
const char | c | ||
) |
Removes the the character c
from the beginning of a string.
str | The string. |
c | The character to be removed. |
Definition at line 144 of file str_trim.c.
References c, p, rz_return_if_fail, and cmd_descs_generate::str.
Referenced by rz_str_trim_char().
Definition at line 86 of file str_trim.c.
References IS_WHITECHAR, NULL, rz_return_val_if_fail, and cmd_descs_generate::str.
Referenced by __system(), autocomplete_file(), autocomplete_sdb(), autocompleteFilename(), cmd_analysis_esil(), cmd_debug_pid(), cmd_print_format(), cmd_print_pv(), cmd_pxr(), cmp(), core_cmd_tsrzcmd(), do_analysis_search(), encode_const_pool16_ut8(), encode_ut8x2(), find_autocomplete(), flag_to_flag(), gdb_to_rz_profile(), get_section_name(), is_macro_command(), java_assembler(), lua53_assembly(), lua54_assembly(), lua_load_next_arg_start(), old_transform_op(), prompt_offset_and_seek(), prompt_offset_and_seek_file(), rz_analysis_noreturn_drop(), rz_asn1_print_padded(), rz_cmd_analysis(), rz_cmd_debug(), rz_cmd_debug_dmi(), rz_cmd_help(), rz_cmd_print(), rz_cmd_search(), rz_cons_hud_path(), rz_cons_pal_list(), rz_core_agraph_print(), rz_core_analysis_function_rename(), rz_core_autocomplete(), rz_core_cmd_subst(), rz_core_cmd_subst_i(), rz_core_graph_print(), rz_core_rtr_add(), rz_core_rtr_cmd(), rz_core_rtr_gdb_run(), rz_core_visual_view_rop(), rz_core_visual_xrefs(), rz_equal_H_handler_old(), rz_plugins_load_handler(), rz_plugins_unload_handler(), rz_print_json_indent(), rz_reg_arena_set_bytes(), rz_str_trim_head(), rz_str_trim_nc(), rz_str_version(), rz_str_wrap(), rz_syscmd_ls(), rz_syscmd_mkdir(), rz_table_query(), step_until_inst(), subvar(), tokens_new(), and types_cc_print().
Definition at line 95 of file str_trim.c.
References IS_WHITESPACE, NULL, rz_return_val_if_fail, and cmd_descs_generate::str.
Referenced by find_autocomplete(), and tokens_new().
RZ_API char* rz_str_trim_lines | ( | char * | str | ) |
Definition at line 60 of file str_trim.c.
References free(), list(), NULL, rz_list_free(), rz_str_ansi_filter(), rz_str_split_list(), rz_str_trim(), rz_strbuf_appendf(), rz_strbuf_drain(), rz_strbuf_new(), s, sb, and cmd_descs_generate::str.
Referenced by get_body().
RZ_API char* rz_str_trim_nc | ( | char * | str | ) |
Definition at line 197 of file str_trim.c.
References rz_str_trim_head_ro(), rz_str_trim_tail(), s, and cmd_descs_generate::str.
Referenced by rz_core_cmd_subst_i().
RZ_API void rz_str_trim_path | ( | char * | s | ) |
Definition at line 15 of file str_trim.c.
RZ_API RZ_BORROW char* rz_str_trim_tail | ( | RZ_NONNULL char * | str | ) |
Removes whitespace characters (space, tab, newline etc.) from the end of a string and replaces them with '\0' characters. The string is changed in place.
str | The string to trim. |
Definition at line 125 of file str_trim.c.
References IS_WHITECHAR, length, rz_return_val_if_fail, and cmd_descs_generate::str.
Referenced by ar_parse_header(), arm_opcode_parse(), get_section_name(), getstr(), rz_analysis_xrefs_to_graph_cmd_handler(), rz_base_type_as_format(), rz_cons_canvas_print_region(), rz_cons_fgets(), rz_core_analysis_function_set_signature(), rz_core_analysis_hasrefs_to_depth(), rz_core_bin_fields_print(), rz_core_cmd_subst(), rz_core_cmd_subst_i(), rz_il_validate_effect(), rz_il_validate_pure(), rz_line_hist_load(), rz_str_trim(), rz_str_trim_nc(), and rz_type_as_format_pair().
RZ_API void rz_str_trim_tail_char | ( | RZ_NONNULL RZ_INOUT char * | str, |
const char | c | ||
) |
Removes the the character c
from the end of a string.
str | The string. |
c | The character to be removed. |
Definition at line 161 of file str_trim.c.
References c, length, rz_return_if_fail, and cmd_descs_generate::str.
Referenced by rz_str_trim_char().
Definition at line 883 of file str.c.
References len, NULL, rz_str_newlen(), cmd_descs_generate::str, and strdup().
Referenced by rz_agraph_add_node_with_color(), rz_agraph_del_node(), and rz_agraph_get_node().
RZ_API void rz_str_truncate_cmd | ( | char * | string | ) |
Definition at line 1300 of file str.c.
References eprintf, err, i, IS_OCTAL, rz_hex_to_byte(), and ut8.
Referenced by DEFINE_HANDLE_TS_FCN_AND_SYMBOL(), getstr(), hash_parse_string(), run_old_command(), rz_asm_pseudo_string(), rz_cmd_cmp_string_handler(), rz_cmd_help(), rz_cmd_search(), rz_core_meta_append(), rz_core_write_length_string_at(), rz_core_write_string_at(), rz_core_write_string_wide_at(), rz_core_write_string_zero_at(), rz_main_rz_ax(), and rz_push_escaped_handler().
RZ_API void rz_str_uri_decode | ( | char * | buf | ) |
Definition at line 2860 of file str.c.
References d, malloc(), NULL, realloc(), s, and snprintf.
Referenced by __rtr_shell(), __system(), rtrcmd(), and rz_core_rtr_http_run().
Definition at line 2993 of file str.c.
References d, free(), i, len, malloc(), NULL, realloc(), s, snprintf, and autogen_x86imm::tmp.
Referenced by _cb_hit(), rz_cmd_print(), and rz_type_format_string().
RZ_API int rz_str_utf16_to_utf8 | ( | ut8 * | dst, |
int | len_dst, | ||
const ut8 * | src, | ||
int | len_src, | ||
bool | little_endian | ||
) |
Definition at line 2884 of file str.c.
References bits(), c, d, dst, in, src, and autogen_x86imm::tmp.
Referenced by bin_pe_versioninfo(), rz_bin_dmp64_init_triage_drivers(), sections(), and winkd_list_modules().
Returns size in bytes of the utf8 char Returns 1 in case of ASCII str - Pointer to buffer
Definition at line 2298 of file str.c.
References length, rz_return_val_if_fail, and cmd_descs_generate::str.
Referenced by __delete_next_char(), and __move_cursor_right().
Returns size in bytes of the last utf8 char of the string Returns 1 in case of ASCII str - Pointer to buffer
Definition at line 2335 of file str.c.
References len, rz_return_val_if_fail, rz_str_utf8_charsize_prev(), and cmd_descs_generate::str.
Referenced by __delete_prev_char().
Returns size in bytes of the utf8 char previous to str Returns 1 in case of ASCII str - Pointer to leading utf8 char prev_len - Length in bytes of the buffer until str
Definition at line 2317 of file str.c.
References pos, RZ_MIN, rz_return_val_if_fail, and cmd_descs_generate::str.
Referenced by __delete_prev_char(), __move_cursor_left(), and rz_str_utf8_charsize_last().
Definition at line 4051 of file str.c.
References done, free(), NULL, rz_file_slurp(), rz_path_bindir(), RZ_STR_ISNOTEMPTY, rz_str_newf(), RZ_STR_PKG_VERSION_STRING, rz_str_trim(), rz_str_trim_head_ro(), rz_strbuf_append(), rz_strbuf_appendf(), rz_strbuf_drain(), rz_strbuf_new(), RZ_SYS_ARCH, RZ_SYS_BITS, RZ_SYS_DIR, RZ_SYS_OS, RZ_VERSION, and sb.
Referenced by __version_cb(), rz_cmd_help(), rz_main_version_print(), and rz_test_main().
Definition at line 643 of file str.c.
References separator_get_first(), create_tags_rz::text, and word_get_first().
Referenced by rz_asm_pseudo_byte().
Definition at line 598 of file str.c.
References i, setup::idx, rz_str_word_get_next0(), and cmd_descs_generate::str.
Referenced by __check_panel_type(), __print_hexdump_cb(), __print_stack_cb(), autocompleteFilename(), cmd_debug_cont_syscall(), cmp(), macro_call(), parse_tmp_evals(), rz_asm_pseudo_byte(), rz_asm_pseudo_incbin(), rz_cmd_debug_dmi(), rz_cmd_macro_cmd_args(), rz_core_asm_plugins_print(), rz_core_cmd_foreach(), rz_core_rtr_http_run(), rz_str_word_get0set(), rz_syscall_item_new_from_string(), rz_type_format_data_internal(), rz_type_format_struct_size(), update_asmcpu_options(), update_asmfeatures_options(), and update_asmplatforms_options().
RZ_API char* rz_str_word_get0set | ( | char * | stra, |
int | stralen, | ||
int | idx, | ||
const char * | newstr, | ||
int * | newlen | ||
) |
Definition at line 548 of file str.c.
References setup::idx, malloc(), memcpy(), newstr(), NULL, out, p, and rz_str_word_get0().
Definition at line 637 of file str.c.
References strdup(), create_tags_rz::text, and word_get_first().
Definition at line 154 of file rz_str.h.
References cmd_descs_generate::str.
Referenced by rz_str_word_get0().
Definition at line 423 of file str.c.
References i, len, p, and cmd_descs_generate::str.
Referenced by autocompleteFilename(), cmd_debug_cont_syscall(), cmp(), macro_call(), rz_asm_pseudo_byte(), rz_asm_pseudo_incbin(), rz_cmd_debug_dmi(), and rz_cmd_macro_add().
Definition at line 471 of file str.c.
References i, p, rz_stack_free(), rz_stack_is_empty(), rz_stack_new(), rz_stack_pop(), rz_stack_push(), s, and cmd_descs_generate::str.
Referenced by rz_type_format_data_internal(), and rz_type_format_struct_size().
Wrap the input string according to the provided width, so that (if possible), each line fits in width
characters. Words will not be split across multiple lines. Words are consecutive characters separated by one or more space. Spaces at the beginning of string
will be maintained, trailing whitespaces at the end of each split line is removed.
string | a writable string, it will be modified by the function |
width | the maximum size of each line. It will be respected only if possible, as the function won't split words. |
Definition at line 3996 of file str.c.
References isspace, NULL, p, rz_list_append(), rz_list_new(), rz_return_val_if_fail, rz_str_trim_head_ro(), cmd_descs_generate::str, and width.
Referenced by fill_wrapped_comment().
Definition at line 2742 of file str.c.
References __str_ansi_length(), a, b, p, rz_str_nstr(), and v.
Referenced by rz_cons_grep_line().
Definition at line 682 of file str.c.
References test_evm::end, NULL, start, and cmd_descs_generate::str.
Referenced by rz_core_autocomplete(), and rz_line_autocomplete().
Definition at line 690 of file str.c.
References test_evm::end, NULL, start, and cmd_descs_generate::str.
Referenced by autocmplt_arch(), autocmplt_cmd_arg_eval_full(), rz_core_autocomplete(), and rz_line_autocomplete().