Rizin
unix-like reverse engineering framework and cli tools
|
#include <rz_analysis.h>
#include <rz_util.h>
#include <rz_cons.h>
#include <rz_core.h>
#include <rz_list.h>
Go to the source code of this file.
Macros | |
#define | ACCESS_CMP(x, y) ((st64)((ut64)(x) - (ut64)((RzAnalysisVarAccess *)y)->offset)) |
#define | STR_EQUAL(s1, s2) (s1 && s2 && !strcmp(s1, s2)) |
Definition at line 13 of file var.c.
References NULL.
Referenced by var_type_clone_or_default_type().
Definition at line 857 of file var.c.
References arch, and STR_EQUAL.
Referenced by is_used_like_arg(), and run_basic_block_analysis().
|
static |
Definition at line 669 of file var.c.
References addr, ARGPREFIX, rz_analysis_function_t::bits, rz_analysis_t::bits, rz_analysis_function_t::bp_off, bytes, rz_analysis_function_t::cc, delta, create_tags_rz::fname, free(), from, get_stack_var(), i, rz_analysis_function_t::name, NULL, rz_analysis_t::opt, PFMT64x, reg, rz_analysis_t::reg, RZ_ABS, rz_analysis_cc_arg(), rz_analysis_cc_max_arg(), rz_analysis_function_autoname_var(), rz_analysis_function_name_guess(), rz_analysis_function_set_var(), RZ_ANALYSIS_OP_DIR_WRITE, RZ_ANALYSIS_OP_TYPE_POP, RZ_ANALYSIS_OP_TYPE_PUSH, RZ_ANALYSIS_OP_TYPE_RET, RZ_ANALYSIS_STACK_GET, RZ_ANALYSIS_STACK_SET, RZ_ANALYSIS_VAR_ACCESS_TYPE_READ, RZ_ANALYSIS_VAR_ACCESS_TYPE_WRITE, RZ_ANALYSIS_VAR_KIND_SPV, rz_analysis_var_set_access(), RZ_ARRAY_SIZE, RZ_LOG_DEBUG, rz_num_get(), rz_reg_get_name(), RZ_REG_NAME_BP, RZ_REG_NAME_SP, rz_return_if_fail, RZ_ROUND, rz_str_isnumber(), rz_str_newf(), rz_strbuf_get(), rz_type_db_get_bitsize(), rz_type_func_args_count(), rz_type_func_args_name(), rz_type_func_args_type(), sdb_fmt(), sp, ST32_MAX, st64, rz_analysis_function_t::stack, strdup(), to, type, rz_analysis_t::typedb, ut64(), rz_analysis_options_t::varname_stack, and VARPREFIX.
Referenced by rz_analysis_extract_vars().
|
static |
Definition at line 621 of file var.c.
References rz_analysis_t::bits, name, NULL, rz_analysis_t::reg, rz_reg_32_to_64(), rz_reg_get(), rz_reg_item_t::size, and value.
Referenced by is_reg_in_src(), and rz_analysis_extract_rarg().
|
static |
Definition at line 657 of file var.c.
References delta, rz_analysis_var_t::delta, rz_analysis_var_t::kind, NULL, RZ_ANALYSIS_VAR_KIND_BPV, RZ_ANALYSIS_VAR_KIND_SPV, rz_pvector_foreach, and rz_analysis_function_t::vars.
Referenced by extract_arg().
|
static |
Definition at line 902 of file var.c.
References get_regname(), NULL, regname(), and STR_EQUAL.
Referenced by is_used_like_arg(), and rz_analysis_extract_rarg().
|
static |
Definition at line 861 of file var.c.
References rz_analysis_plugin_t::arch, arch_destroys_dst(), rz_analysis_t::cur, dst, is_reg_in_src(), op_affect_dst(), regname(), RZ_ANALYSIS_OP_TYPE_CMOV, RZ_ANALYSIS_OP_TYPE_LEA, RZ_ANALYSIS_OP_TYPE_LOAD, RZ_ANALYSIS_OP_TYPE_MOV, RZ_ANALYSIS_OP_TYPE_POP, RZ_ANALYSIS_OP_TYPE_XOR, src, and STR_EQUAL.
Referenced by rz_analysis_extract_rarg().
|
inlinestatic |
Definition at line 831 of file var.c.
References RZ_ANALYSIS_OP_TYPE_ADD, RZ_ANALYSIS_OP_TYPE_AND, RZ_ANALYSIS_OP_TYPE_CAST, RZ_ANALYSIS_OP_TYPE_DIV, RZ_ANALYSIS_OP_TYPE_MUL, RZ_ANALYSIS_OP_TYPE_NOR, RZ_ANALYSIS_OP_TYPE_NOT, RZ_ANALYSIS_OP_TYPE_OR, RZ_ANALYSIS_OP_TYPE_ROL, RZ_ANALYSIS_OP_TYPE_ROR, RZ_ANALYSIS_OP_TYPE_SAL, RZ_ANALYSIS_OP_TYPE_SAR, RZ_ANALYSIS_OP_TYPE_SHL, RZ_ANALYSIS_OP_TYPE_SHR, RZ_ANALYSIS_OP_TYPE_SUB, and RZ_ANALYSIS_OP_TYPE_XOR.
Referenced by is_used_like_arg().
|
static |
RZ_API void rz_analysis_extract_rarg | ( | RzAnalysis * | analysis, |
RzAnalysisOp * | op, | ||
RzAnalysisFunction * | fcn, | ||
int * | reg_set, | ||
int * | count | ||
) |
Definition at line 909 of file var.c.
References arg(), rz_analysis_function_t::bits, rz_analysis_t::bits, rz_analysis_function_t::cc, rz_core_bind_t::core, rz_analysis_t::coreb, count, delta, f, rz_core_t::flags, create_tags_rz::fname, free(), get_regname(), i, rz_reg_item_t::index, is_reg_in_src(), is_used_like_arg(), max_count, name, rz_analysis_function_t::name, rz_analysis_var_t::name, NULL, rz_analysis_t::reg, regname(), rz_analysis_var_t::regname, rz_analysis_cc_arg(), rz_analysis_cc_error(), rz_analysis_cc_func(), rz_analysis_cc_max_arg(), rz_analysis_cc_self(), rz_analysis_function_get_var(), rz_analysis_function_name_guess(), rz_analysis_function_set_var(), rz_analysis_get_function_at(), RZ_ANALYSIS_OP_TYPE_CALL, RZ_ANALYSIS_OP_TYPE_UCALL, RZ_ANALYSIS_VAR_ACCESS_TYPE_READ, rz_analysis_var_count(), rz_analysis_var_get_argnum(), RZ_ANALYSIS_VAR_KIND_REG, rz_analysis_var_list(), rz_analysis_var_set_access(), rz_flag_get_by_spaces(), RZ_FLAGS_FS_IMPORTS, rz_list_free(), RZ_LOG_DEBUG, rz_meta_set_string(), RZ_META_TYPE_VARTYPE, RZ_MIN, rz_reg_get(), rz_return_if_fail, rz_str_newf(), rz_type_func_args_count(), rz_type_func_args_name(), rz_type_func_args_type(), STR_EQUAL, strdup(), type, rz_analysis_var_t::type, rz_analysis_t::typedb, ut64(), and UT64_MAX.
Referenced by analysis_block_cb().
RZ_API void rz_analysis_extract_vars | ( | RzAnalysis * | analysis, |
RzAnalysisFunction * | fcn, | ||
RzAnalysisOp * | op | ||
) |
Definition at line 1103 of file var.c.
References extract_arg(), rz_analysis_t::reg, RZ_ANALYSIS_VAR_KIND_BPV, RZ_ANALYSIS_VAR_KIND_SPV, rz_reg_get_name(), RZ_REG_NAME_BP, RZ_REG_NAME_SP, rz_return_if_fail, and SP.
Referenced by analysis_block_cb(), run_basic_block_analysis(), and update_varz_analysisysis().
RZ_API char* rz_analysis_fcn_format_sig | ( | RZ_NONNULL RzAnalysis * | analysis, |
RZ_NONNULL RzAnalysisFunction * | fcn, | ||
RZ_NULLABLE char * | fcn_name, | ||
RZ_NULLABLE RzAnalysisFcnVarsCache * | reuse_cache, | ||
RZ_NULLABLE const char * | fcn_name_pre, | ||
RZ_NULLABLE const char * | fcn_name_post | ||
) |
Definition at line 1232 of file var.c.
References comma, free(), i, rz_analysis_var_t::isarg, rz_type_t::kind, rz_analysis_var_t::name, NULL, rz_analysis_fcn_vars_cache_fini(), rz_analysis_fcn_vars_cache_init(), rz_analysis_function_name_guess(), RZ_FREE, RZ_LOG_ERROR, RZ_NEW0, rz_strbuf_append(), rz_strbuf_appendf(), rz_strbuf_drain(), rz_strbuf_length(), rz_strbuf_new(), rz_strbuf_slice(), rz_type_as_string(), rz_type_func_args_count(), rz_type_func_args_name(), rz_type_func_args_type(), rz_type_func_exist(), rz_type_func_ret(), RZ_TYPE_KIND_POINTER, sp, type, and rz_analysis_var_t::type.
Referenced by ds_show_functions(), and rz_core_analysis_function_signature().
RZ_API void rz_analysis_fcn_vars_add_types | ( | RzAnalysis * | analysis, |
RZ_NONNULL RzAnalysisFunction * | fcn | ||
) |
Updates the types database for function arguments.
Searches if the types database has the function with the same name. if there is a match - updates the RzCallable type of the function by adding the new function arguments' types.
analysis | RzAnalysis instance |
fcn | Function which arguments we should save into the types database |
Definition at line 1383 of file var.c.
References rz_analysis_var_t::isarg, rz_analysis_var_t::name, NULL, rz_analysis_fcn_vars_cache_fini(), rz_analysis_fcn_vars_cache_init(), rz_analysis_function_is_autonamed(), rz_list_join(), rz_return_if_fail, rz_type_callable_arg_add(), rz_type_callable_arg_new(), rz_type_clone(), rz_type_free(), rz_type_func_exist(), rz_type_func_new(), rz_type_func_save(), rz_analysis_var_t::type, and rz_analysis_t::typedb.
Referenced by rz_core_analysis_function_add(), and rz_core_analysis_types_propagation().
RZ_API void rz_analysis_fcn_vars_cache_fini | ( | RzAnalysisFcnVarsCache * | cache | ) |
Definition at line 1223 of file var.c.
References rz_list_free().
Referenced by ds_show_functions(), rz_analysis_fcn_format_sig(), rz_analysis_fcn_vars_add_types(), and rz_core_analysis_function_signature().
RZ_API void rz_analysis_fcn_vars_cache_init | ( | RzAnalysis * | analysis, |
RzAnalysisFcnVarsCache * | cache, | ||
RzAnalysisFunction * | fcn | ||
) |
Definition at line 1209 of file var.c.
References rz_analysis_var_t::argnum, regvar_comparator(), rz_analysis_var_get_argnum(), RZ_ANALYSIS_VAR_KIND_BPV, RZ_ANALYSIS_VAR_KIND_REG, RZ_ANALYSIS_VAR_KIND_SPV, rz_analysis_var_list(), rz_list_sort(), and var_comparator().
Referenced by ds_show_functions(), rz_analysis_fcn_format_sig(), rz_analysis_fcn_vars_add_types(), and rz_core_analysis_function_signature().
RZ_API RZ_OWN char* rz_analysis_function_autoname_var | ( | RzAnalysisFunction * | fcn, |
char | kind, | ||
const char * | pfx, | ||
int | ptr | ||
) |
Definition at line 633 of file var.c.
References free(), i, k, rz_analysis_var_t::kind, rz_analysis_var_t::name, RZ_ABS, rz_analysis_function_get_var_byname(), RZ_ANALYSIS_VAR_KIND_SPV, rz_pvector_foreach, rz_str_newf(), and rz_analysis_function_t::vars.
Referenced by extract_arg(), and handle_var_stack_access().
RZ_API void rz_analysis_function_delete_all_vars | ( | RzAnalysisFunction * | fcn | ) |
Definition at line 220 of file var.c.
References rz_analysis_function_t::argnum, rz_pvector_clear(), rz_pvector_foreach, var_free(), and rz_analysis_function_t::vars.
Referenced by rz_analysis_function_free(), rz_analysis_function_set_type(), and rz_analysis_function_vars_detect_handler().
RZ_API void rz_analysis_function_delete_unused_vars | ( | RzAnalysisFunction * | fcn | ) |
Definition at line 229 of file var.c.
References rz_analysis_var_t::accesses, rz_analysis_function_delete_var(), rz_pvector_foreach, rz_pvector_free(), rz_vector_clone(), rz_vector_empty(), v, and rz_analysis_function_t::vars.
Referenced by rz_analysis_update_analysis_range(), and update_analysis().
RZ_API void rz_analysis_function_delete_var | ( | RzAnalysisFunction * | fcn, |
RzAnalysisVar * | var | ||
) |
Definition at line 241 of file var.c.
References rz_pvector_remove_data(), rz_return_if_fail, var_free(), and rz_analysis_function_t::vars.
Referenced by fcn_takeover_block_recursive_followthrough_cb(), rz_analysis_function_delete_unused_vars(), and rz_analysis_function_set_type().
RZ_API void rz_analysis_function_delete_vars_by_kind | ( | RzAnalysisFunction * | fcn, |
RzAnalysisVarKind | kind | ||
) |
Definition at line 206 of file var.c.
References i, rz_analysis_var_t::kind, rz_pvector_at(), rz_pvector_len(), rz_pvector_remove_at(), rz_return_if_fail, var_free(), and rz_analysis_function_t::vars.
Referenced by __core_analysis_fcn(), and analysis_function_vars_del_all().
RZ_API RZ_BORROW RzAnalysisVar* rz_analysis_function_get_var | ( | RzAnalysisFunction * | fcn, |
char | kind, | ||
int | delta | ||
) |
Definition at line 259 of file var.c.
References delta, rz_analysis_var_t::delta, rz_analysis_var_t::kind, NULL, rz_pvector_foreach, and rz_analysis_function_t::vars.
Referenced by analysis_function_vars_getsetref(), ds_print_ptr(), fcn_takeover_block_recursive_followthrough_cb(), handle_var_stack_access(), retype_callee_arg(), rz_analysis_extract_rarg(), rz_analysis_function_set_var(), and rz_core_analysis_function_delete_var().
RZ_API RZ_BORROW RzAnalysisVar* rz_analysis_function_get_var_byname | ( | RzAnalysisFunction * | fcn, |
const char * | name | ||
) |
Definition at line 247 of file var.c.
References rz_analysis_var_t::name, NULL, rz_pvector_foreach, rz_return_val_if_fail, and rz_analysis_function_t::vars.
Referenced by analysis_function_vars_accesses(), exists_var(), list_vars(), meta_variable_comment_append(), meta_variable_comment_editor(), meta_variable_comment_remove(), rz_analysis_function_autoname_var(), rz_analysis_function_set_var(), rz_analysis_function_vars_display_handler(), rz_analysis_function_vars_type_handler(), rz_analysis_var_rename(), rz_core_analysis_function_delete_var(), rz_core_analysis_var_rename(), and type_format_print_variable().
RZ_DEPRECATE RZ_API RzList* rz_analysis_function_get_var_fields | ( | RzAnalysisFunction * | fcn, |
int | kind | ||
) |
Definition at line 1166 of file var.c.
References rz_analysis_function_t::analysis, rz_analysis_var_t::delta, rz_analysis_var_t::kind, list(), rz_analysis_var_t::name, NULL, RZ_ANALYSIS_VAR_KIND_BPV, rz_list_newf(), rz_list_push(), RZ_NEW0, rz_pvector_foreach, strdup(), var_add_structure_fields_to_list(), var_field_free(), and rz_analysis_function_t::vars.
Referenced by rz_core_init().
RZ_API const char* rz_analysis_function_get_var_reg_at | ( | RzAnalysisFunction * | fcn, |
st64 | delta, | ||
ut64 | addr | ||
) |
Definition at line 314 of file var.c.
References ACCESS_CMP, rz_analysis_var_t::accesses, addr, rz_analysis_function_t::addr, delta, rz_analysis_function_t::inst_vars, NULL, rz_analysis_var_access_t::offset, rz_analysis_var_access_t::reg, rz_pvector_foreach, rz_vector_index_ptr(), rz_vector_lower_bound, st64, and v.
Referenced by get_reg_at(), rz_core_analysis_bytes(), and rz_core_disasm_instruction().
RZ_API st64 rz_analysis_function_get_var_stackptr_at | ( | RzAnalysisFunction * | fcn, |
st64 | delta, | ||
ut64 | addr | ||
) |
Definition at line 284 of file var.c.
References ACCESS_CMP, rz_analysis_var_t::accesses, addr, rz_analysis_function_t::addr, delta, rz_analysis_function_t::inst_vars, NULL, rz_analysis_var_access_t::offset, rz_pvector_foreach, rz_vector_index_ptr(), rz_vector_lower_bound, st64, ST64_MAX, rz_analysis_var_access_t::stackptr, and v.
Referenced by get_ptr_at(), rz_core_analysis_bytes(), and rz_core_disasm_instruction().
RZ_API RZ_BORROW RzPVector* rz_analysis_function_get_vars_used_at | ( | RzAnalysisFunction * | fcn, |
ut64 | op_addr | ||
) |
Definition at line 393 of file var.c.
References rz_analysis_function_t::addr, rz_analysis_function_t::inst_vars, NULL, rz_return_val_if_fail, and st64.
Referenced by clear_bb_vars(), fcn_takeover_block_recursive_followthrough_cb(), propagate_types_among_used_variables(), rz_analysis_get_used_function_var(), and rz_analysis_var_get_dst_var().
RZ_API bool rz_analysis_function_rebase_vars | ( | RzAnalysis * | a, |
RzAnalysisFunction * | fcn | ||
) |
Definition at line 44 of file var.c.
References a, rz_analysis_var_t::delta, rz_analysis_var_t::isarg, rz_analysis_var_t::kind, reg, rz_analysis_var_t::regname, rz_analysis_var_all_list(), rz_list_free(), rz_reg_get(), and rz_return_val_if_fail.
Referenced by __rebase_everything().
RZ_API RZ_BORROW RzAnalysisVar* rz_analysis_function_set_var | ( | RzAnalysisFunction * | fcn, |
int | delta, | ||
char | kind, | ||
RZ_BORROW RZ_NULLABLE const RzType * | type, | ||
int | size, | ||
bool | isarg, | ||
RZ_NONNULL const char * | name | ||
) |
Definition at line 111 of file var.c.
References rz_analysis_var_t::accesses, rz_analysis_function_t::analysis, rz_analysis_var_t::constraints, delta, rz_analysis_var_t::delta, rz_analysis_var_t::fcn, free(), rz_analysis_var_t::isarg, rz_analysis_var_t::kind, rz_analysis_var_t::name, NULL, reg, rz_analysis_t::reg, rz_analysis_var_t::regname, RZ_ABS, rz_analysis_function_get_var(), rz_analysis_function_get_var_byname(), RZ_ANALYSIS_VAR_KIND_BPV, RZ_ANALYSIS_VAR_KIND_REG, RZ_ANALYSIS_VAR_KIND_SPV, rz_analysis_var_resolve_overlaps(), RZ_LOG_ERROR, RZ_NEW0, rz_pvector_push(), rz_reg_index_get(), rz_return_val_if_fail, rz_type_free(), rz_vector_init(), strdup(), type, rz_analysis_var_t::type, var_type_clone_or_default_type(), and rz_analysis_function_t::vars.
Referenced by extract_arg(), fcn_takeover_block_recursive_followthrough_cb(), handle_var_stack_access(), rz_analysis_dwarf_integrate_functions(), rz_analysis_extract_rarg(), rz_analysis_function_set_type(), rz_analysis_function_vars_bp_handler(), rz_analysis_function_vars_regs_handler(), and rz_analysis_function_vars_sp_handler().
RZ_DEPRECATE RZ_API RzAnalysisVar* rz_analysis_get_used_function_var | ( | RzAnalysis * | analysis, |
ut64 | addr | ||
) |
Definition at line 398 of file var.c.
References addr, NULL, rz_analysis_function_get_vars_used_at(), rz_analysis_get_functions_in(), rz_list_free(), rz_pvector_at(), and rz_pvector_empty().
Referenced by handle_stack_canary(), rz_core_analysis_name(), rz_core_analysis_rename(), rz_core_analysis_var_rename(), rz_core_link_stroff(), rz_core_visual_define(), and type_match().
RZ_API void rz_analysis_var_add_constraint | ( | RzAnalysisVar * | var, |
RZ_BORROW RzTypeConstraint * | constraint | ||
) |
Definition at line 524 of file var.c.
References rz_analysis_var_t::constraints, and rz_vector_push().
Referenced by propagate_types_among_used_variables().
RZ_API ut64 rz_analysis_var_addr | ( | RzAnalysisVar * | var | ) |
Definition at line 270 of file var.c.
References rz_analysis_function_t::analysis, rz_analysis_function_t::bp_off, rz_analysis_var_t::delta, rz_analysis_var_t::fcn, rz_analysis_var_t::kind, NULL, rz_analysis_t::reg, regname(), RZ_ANALYSIS_VAR_KIND_BPV, RZ_ANALYSIS_VAR_KIND_SPV, rz_reg_get_name(), rz_reg_getv(), RZ_REG_NAME_BP, RZ_REG_NAME_SP, rz_return_val_if_fail, and UT64_MAX.
Referenced by type_format_print_variable().
RZ_DEPRECATE RZ_API RzList* rz_analysis_var_all_list | ( | RzAnalysis * | analysis, |
RzAnalysisFunction * | fcn | ||
) |
Definition at line 1135 of file var.c.
References list(), NULL, RZ_ANALYSIS_VAR_KIND_BPV, RZ_ANALYSIS_VAR_KIND_REG, RZ_ANALYSIS_VAR_KIND_SPV, rz_analysis_var_list(), rz_list_free(), rz_list_join(), and rz_list_new().
Referenced by analysis_function_vars_accesses(), autocmplt_cmd_arg_fcn_var(), list_vars(), run_basic_block_analysis(), rz_analysis_function_rebase_vars(), rz_analysis_function_vars_dis_refs_handler(), rz_analysis_function_vars_handler(), rz_analysis_function_vars_stackframe_handler(), rz_analysis_types_from_fcn(), rz_core_analysis_all_vars_display(), var_variables_show(), variable_rename(), and variable_set_type().
RZ_API void rz_analysis_var_clear_accesses | ( | RzAnalysisVar * | var | ) |
Definition at line 492 of file var.c.
References rz_analysis_var_t::accesses, rz_analysis_var_t::fcn, rz_analysis_function_t::inst_vars, NULL, rz_analysis_var_access_t::offset, rz_pvector_remove_data(), rz_return_if_fail, rz_vector_clear(), rz_vector_foreach, and ut64().
Referenced by var_free().
RZ_API int rz_analysis_var_count | ( | RzAnalysis * | a, |
RzAnalysisFunction * | fcn, | ||
int | kind, | ||
int | type | ||
) |
Definition at line 574 of file var.c.
References a, count, rz_analysis_var_t::isarg, list(), RZ_ANALYSIS_VAR_KIND_REG, rz_analysis_var_list(), rz_list_free(), and type.
Referenced by core_analysis_graph_nodes(), draw_graph_nodes(), ds_print_esil_analysis(), fcn_print_info(), function_list_print_to_table(), function_print_to_json(), and rz_analysis_extract_rarg().
RZ_API void rz_analysis_var_delete | ( | RzAnalysisVar * | var | ) |
Definition at line 192 of file var.c.
References rz_analysis_var_t::fcn, i, rz_pvector_at(), rz_pvector_len(), rz_pvector_remove_at(), rz_return_if_fail, v, var_free(), and rz_analysis_function_t::vars.
Referenced by rz_analysis_var_resolve_overlaps(), and rz_core_analysis_function_delete_var().
RZ_API RzAnalysisVarAccess* rz_analysis_var_get_access_at | ( | RzAnalysisVar * | var, |
ut64 | addr | ||
) |
Definition at line 509 of file var.c.
References ACCESS_CMP, rz_analysis_var_t::accesses, addr, rz_analysis_function_t::addr, rz_analysis_var_t::fcn, rz_vector_t::len, NULL, rz_analysis_var_access_t::offset, rz_return_val_if_fail, rz_vector_index_ptr(), rz_vector_lower_bound, and st64.
Referenced by fcn_takeover_block_recursive_followthrough_cb(), and rz_analysis_var_get_dst_var().
RZ_API int rz_analysis_var_get_argnum | ( | RzAnalysisVar * | var | ) |
Definition at line 369 of file var.c.
References rz_analysis_function_t::analysis, rz_analysis_function_t::cc, rz_analysis_var_t::fcn, i, rz_analysis_var_t::isarg, rz_analysis_var_t::kind, reg, rz_analysis_t::reg, rz_analysis_var_t::regname, rz_analysis_cc_arg(), rz_analysis_cc_max_arg(), RZ_ANALYSIS_VAR_KIND_REG, rz_reg_get(), and rz_return_val_if_fail.
Referenced by rz_analysis_extract_rarg(), rz_analysis_fcn_vars_cache_init(), and rz_analysis_function_args().
RZ_API char* rz_analysis_var_get_constraints_readable | ( | RzAnalysisVar * | var | ) |
Definition at line 528 of file var.c.
References rz_type_constraint_t::cond, rz_analysis_var_t::constraints, i, rz_vector_t::len, n, NULL, PFMT64x, rz_strbuf_append(), rz_strbuf_appendf(), rz_strbuf_drain_nofree(), rz_strbuf_init(), RZ_TYPE_COND_GE, RZ_TYPE_COND_GT, RZ_TYPE_COND_LE, RZ_TYPE_COND_LT, rz_vector_index_ptr(), sb, and rz_type_constraint_t::val.
Referenced by ds_show_functions_argvar().
RZ_API RzAnalysisVar* rz_analysis_var_get_dst_var | ( | RzAnalysisVar * | var | ) |
Definition at line 417 of file var.c.
References rz_analysis_var_t::accesses, addr, rz_analysis_function_t::addr, rz_analysis_var_t::fcn, NULL, rz_analysis_var_access_t::offset, rz_analysis_function_get_vars_used_at(), RZ_ANALYSIS_VAR_ACCESS_TYPE_READ, RZ_ANALYSIS_VAR_ACCESS_TYPE_WRITE, rz_analysis_var_get_access_at(), rz_pvector_foreach, rz_return_val_if_fail, rz_vector_foreach, rz_analysis_var_access_t::type, and ut64().
Referenced by retype_callee_arg(), and rz_core_analysis_type_match().
RZ_API RzList* rz_analysis_var_list | ( | RzAnalysis * | a, |
RzAnalysisFunction * | fcn, | ||
int | kind | ||
) |
Definition at line 1154 of file var.c.
References a, and var_generate_list().
Referenced by core_analysis_var_list_show(), rz_analysis_extract_rarg(), rz_analysis_fcn_vars_cache_init(), rz_analysis_var_all_list(), rz_analysis_var_count(), rz_core_analysis_everything(), and rz_core_autocomplete().
RZ_API void rz_analysis_var_remove_access_at | ( | RzAnalysisVar * | var, |
ut64 | address | ||
) |
Definition at line 476 of file var.c.
References ACCESS_CMP, rz_analysis_var_t::accesses, rz_analysis_function_t::addr, rz_analysis_var_t::fcn, rz_analysis_function_t::inst_vars, rz_vector_t::len, NULL, rz_analysis_var_access_t::offset, rz_pvector_remove_data(), rz_return_if_fail, rz_vector_index_ptr(), rz_vector_lower_bound, rz_vector_remove_at(), st64, and ut64().
Referenced by clear_bb_vars(), and fcn_takeover_block_recursive_followthrough_cb().
RZ_API bool rz_analysis_var_rename | ( | RzAnalysisVar * | var, |
const char * | new_name, | ||
bool | verbose | ||
) |
Definition at line 348 of file var.c.
References rz_analysis_var_t::fcn, free(), rz_analysis_var_t::name, rz_analysis_function_get_var_byname(), rz_analysis_var_check_name(), RZ_LOG_WARN, rz_return_val_if_fail, strdup(), v1, and verbose.
Referenced by resolve_type_links(), rz_core_analysis_rename(), rz_core_analysis_var_rename(), rz_core_visual_define(), and var_rename().
RZ_API void rz_analysis_var_resolve_overlaps | ( | RzAnalysisVar * | var | ) |
Definition at line 77 of file var.c.
References rz_analysis_function_t::analysis, rz_analysis_var_t::fcn, rz_analysis_var_t::isarg, rz_analysis_var_t::kind, rz_analysis_var_t::name, rz_analysis_var_delete(), RZ_ANALYSIS_VAR_KIND_REG, rz_pvector_foreach, rz_pvector_free(), rz_type_db_get_bitsize(), rz_type_is_strictly_atomic(), rz_vector_clone(), rz_analysis_var_t::type, rz_analysis_t::typedb, ut64(), var_overlap(), and rz_analysis_function_t::vars.
Referenced by rz_analysis_function_set_var(), rz_analysis_var_set_type(), and vars_resolve_overlaps().
RZ_API void rz_analysis_var_set_access | ( | RzAnalysisVar * | var, |
const char * | reg, | ||
ut64 | access_addr, | ||
int | access_type, | ||
st64 | stackptr | ||
) |
Definition at line 441 of file var.c.
References ACCESS_CMP, rz_analysis_var_t::accesses, rz_analysis_function_t::addr, rz_analysis_function_t::analysis, rz_analysis_t::constpool, rz_analysis_var_t::fcn, rz_analysis_function_t::inst_vars, NULL, rz_analysis_var_access_t::offset, reg, rz_analysis_var_access_t::reg, rz_pvector_contains(), rz_pvector_new(), rz_pvector_push(), rz_return_if_fail, rz_str_constpool_get(), rz_vector_index_ptr(), rz_vector_insert(), rz_vector_lower_bound, st64, rz_analysis_var_access_t::stackptr, rz_analysis_var_access_t::type, ut64(), and ut8.
Referenced by analysis_function_vars_getsetref(), extract_arg(), fcn_takeover_block_recursive_followthrough_cb(), handle_var_stack_access(), and rz_analysis_extract_rarg().
RZ_API void rz_analysis_var_set_type | ( | RzAnalysisVar * | var, |
RZ_OWN RzType * | type, | ||
bool | resolve_overlaps | ||
) |
Definition at line 170 of file var.c.
References rz_analysis_var_resolve_overlaps(), type, and rz_analysis_var_t::type.
Referenced by resolve_type_links(), rz_analysis_function_vars_type_handler(), var_type_set(), and variable_set_type().
|
static |
Definition at line 593 of file var.c.
References a, rz_analysis_var_t::delta, rz_type_t::identifier, rz_base_type_t::kind, rz_type_t::kind, list(), rz_base_type_struct_t::members, rz_analysis_var_t::name, rz_type_struct_member_t::name, RZ_BASE_TYPE_KIND_STRUCT, rz_list_append(), RZ_NEW0, rz_str_newf(), rz_type_db_get_base_type(), rz_type_db_get_bitsize(), RZ_TYPE_KIND_IDENTIFIER, rz_vector_empty(), rz_vector_foreach, rz_base_type_t::struct_data, rz_analysis_var_t::type, rz_type_struct_member_t::type, and ut64().
Referenced by rz_analysis_function_get_var_fields().
|
static |
|
static |
|
static |
Definition at line 179 of file var.c.
References rz_analysis_var_t::comment, rz_analysis_var_t::constraints, free(), rz_analysis_var_t::name, rz_analysis_var_t::regname, rz_analysis_var_clear_accesses(), rz_type_free(), rz_vector_fini(), and rz_analysis_var_t::type.
Referenced by rz_analysis_function_delete_all_vars(), rz_analysis_function_delete_var(), rz_analysis_function_delete_vars_by_kind(), and rz_analysis_var_delete().
|
static |
Definition at line 1117 of file var.c.
References a, rz_analysis_var_t::kind, list(), NULL, RZ_ANALYSIS_VAR_KIND_BPV, rz_list_new(), rz_list_push(), rz_pvector_foreach, and rz_analysis_function_t::vars.
Referenced by rz_analysis_var_list().
|
inlinestatic |
Definition at line 71 of file var.c.
References a, b, and var_same_kind().
Referenced by rz_analysis_var_resolve_overlaps().
|
inlinestatic |
|
static |
Definition at line 23 of file var.c.
References __int_type_from_size(), rz_analysis_t::bits, free(), NULL, rz_type_db_t::parser, RZ_LOG_ERROR, rz_type_clone(), rz_type_parse_string_single(), type, and rz_analysis_t::typedb.
Referenced by rz_analysis_function_set_var().