Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Classes | |
struct | list_addr |
Definition at line 246 of file var_global.c.
References rz_list_append(), and v.
Referenced by rz_analysis_var_global_get_all().
Definition at line 28 of file var_global.c.
References container_of, and ut64().
Referenced by rz_analysis_var_global_add(), rz_analysis_var_global_delete(), rz_analysis_var_global_get_byaddr_at(), and rz_analysis_var_global_get_byaddr_in().
RZ_API RZ_OWN bool rz_analysis_var_global_add | ( | RzAnalysis * | analysis, |
RZ_NONNULL RzAnalysisVarGlobal * | global_var | ||
) |
Add the global variable into hashtable.
analysis | RzAnalysis |
global_var | Global variable instance |
Definition at line 46 of file var_global.c.
References rz_analysis_var_global_t::addr, global_var_node_cmp(), rz_analysis_t::global_var_tree, rz_analysis_t::ht_global_var, rz_analysis_var_global_t::name, NULL, PFMT64x, rz_analysis_var_global_get_byaddr_in(), rz_analysis_var_global_get_byname(), rz_flag_set(), RZ_LOG_ERROR, rz_rbtree_aug_insert(), rz_return_val_if_fail, and rz_type_db_get_bitsize().
Referenced by rz_analysis_global_variable_add_handler().
RZ_API void rz_analysis_var_global_add_constraint | ( | RzAnalysisVarGlobal * | glob, |
RzTypeConstraint * | constraint | ||
) |
Add a constaint to global variable.
glob | Global variable instance |
constraint | RzTypeConstraint |
Definition at line 320 of file var_global.c.
References rz_analysis_var_global_t::constraints, rz_return_if_fail, and rz_vector_push().
RZ_API bool rz_analysis_var_global_delete | ( | RZ_NONNULL RzAnalysis * | analysis, |
RZ_NONNULL RzAnalysisVarGlobal * | glob | ||
) |
Delete and free the global variable.
analysis | RzAnalysis |
glob | global variable to be deleted |
Definition at line 121 of file var_global.c.
References global_var_node_cmp(), NULL, rz_rbtree_delete(), and rz_return_val_if_fail.
Referenced by rz_analysis_var_global_delete_byaddr_at(), rz_analysis_var_global_delete_byaddr_in(), and rz_analysis_var_global_delete_byname().
RZ_API bool rz_analysis_var_global_delete_byaddr_at | ( | RzAnalysis * | analysis, |
ut64 | addr | ||
) |
Same as rz_analysis_var_global_delete_byname at the address.
analysis | RzAnalysis |
addr | Global Variable address |
Definition at line 154 of file var_global.c.
References addr, PFMT64x, rz_analysis_var_global_delete(), rz_analysis_var_global_get_byaddr_at(), RZ_LOG_ERROR, and rz_return_val_if_fail.
RZ_API bool rz_analysis_var_global_delete_byaddr_in | ( | RzAnalysis * | analysis, |
ut64 | addr | ||
) |
Same as rz_analysis_var_global_delete_byname in the address.
analysis | RzAnalysis |
addr | Global Variable address |
Definition at line 172 of file var_global.c.
References addr, PFMT64x, rz_analysis_var_global_delete(), rz_analysis_var_global_get_byaddr_in(), RZ_LOG_ERROR, and rz_return_val_if_fail.
Referenced by rz_analysis_global_variable_delete_byaddr_handler().
RZ_API bool rz_analysis_var_global_delete_byname | ( | RzAnalysis * | analysis, |
RZ_NONNULL const char * | name | ||
) |
Delete and free the global variable by its name.
analysis | RzAnalysis |
name | Global Variable name |
Definition at line 136 of file var_global.c.
References rz_analysis_var_global_delete(), rz_analysis_var_global_get_byname(), RZ_LOG_ERROR, and rz_return_val_if_fail.
Referenced by rz_analysis_global_variable_delete_byname_handler().
RZ_API void rz_analysis_var_global_free | ( | RzAnalysisVarGlobal * | glob | ) |
Free the global variable instance.
glob | Global variable instance |
Definition at line 79 of file var_global.c.
References rz_analysis_var_global_t::analysis, rz_analysis_var_global_t::constraints, rz_flag_bind_t::f, rz_analysis_t::flb, rz_analysis_var_global_t::name, rz_analysis_var_global_get_flag_item(), rz_flag_unset(), RZ_FREE, rz_type_free(), rz_vector_fini(), and rz_analysis_var_global_t::type.
Referenced by global_kv_free(), and rz_analysis_global_variable_add_handler().
RZ_API RZ_OWN RzList* rz_analysis_var_global_get_all | ( | RzAnalysis * | analysis | ) |
Get all of the added global variables.
analysis | RzAnalysis |
Definition at line 259 of file var_global.c.
References global_var_collect_cb(), rz_analysis_t::ht_global_var, NULL, rz_list_new(), and rz_return_val_if_fail.
Referenced by autocmplt_cmd_arg_global_var(), and rz_analysis_var_global_list_show().
RZ_API RZ_BORROW RzAnalysisVarGlobal* rz_analysis_var_global_get_byaddr_at | ( | RzAnalysis * | analysis, |
ut64 | addr | ||
) |
Get the instance of global variable at the address.
analysis | RzAnalysis |
addr | Global variable address |
Definition at line 207 of file var_global.c.
References addr, container_of, global_var_node_cmp(), rz_analysis_t::global_var_tree, NULL, rz_rbtree_find(), and rz_return_val_if_fail.
Referenced by rz_analysis_var_global_delete_byaddr_at().
RZ_API RZ_BORROW RzAnalysisVarGlobal* rz_analysis_var_global_get_byaddr_in | ( | RzAnalysis * | analysis, |
ut64 | addr | ||
) |
Get the instance of global variable contains the address.
analysis | RzAnalysis |
addr | Global variable address |
Definition at line 228 of file var_global.c.
References addr, rz_analysis_var_global_t::addr, container_of, global_var_node_cmp(), rz_analysis_t::global_var_tree, NULL, rz_rbtree_upper_bound(), rz_return_val_if_fail, rz_type_db_get_bitsize(), rz_analysis_var_global_t::type, rz_analysis_t::typedb, and ut64().
Referenced by rz_analysis_var_global_add(), and rz_analysis_var_global_delete_byaddr_in().
RZ_API RZ_BORROW RzAnalysisVarGlobal* rz_analysis_var_global_get_byname | ( | RzAnalysis * | analysis, |
RZ_NONNULL const char * | name | ||
) |
Get the instance of global variable by its name.
analysis | RzAnalysis |
name | Global variable name |
Definition at line 190 of file var_global.c.
References rz_analysis_t::ht_global_var, NULL, and rz_return_val_if_fail.
Referenced by rz_analysis_global_variable_retype_handler(), rz_analysis_var_global_add(), rz_analysis_var_global_delete_byname(), rz_analysis_var_global_list_show(), and rz_analysis_var_global_rename().
RZ_API RZ_OWN char* rz_analysis_var_global_get_constraints_readable | ( | RzAnalysisVarGlobal * | glob | ) |
Get the pritable string of global variable constraints.
glob | Global variable instance |
Definition at line 331 of file var_global.c.
References rz_type_constraint_t::cond, rz_analysis_var_global_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.
RZ_API RZ_NULLABLE RzFlagItem* rz_analysis_var_global_get_flag_item | ( | RzAnalysisVarGlobal * | glob | ) |
Get the flag item corresponding to the given variable.
This will search for the matching flag that has been created along with the global variable. It can happen that the flag has manually been deleted, in which case this returns NULL.
Definition at line 101 of file var_global.c.
References a, rz_analysis_var_global_t::addr, rz_analysis_var_global_t::analysis, rz_analysis_var_global_t::name, NULL, r, rz_flag_get(), and rz_return_val_if_fail.
Referenced by rz_analysis_var_global_free(), rz_analysis_var_global_rename(), and rz_analysis_var_global_set_type().
RZ_API RZ_OWN RzAnalysisVarGlobal* rz_analysis_var_global_new | ( | RZ_NONNULL const char * | name, |
ut64 | addr | ||
) |
Create a new instance of global variable.
name | variable name |
addr | variable address |
comment | variable comment |
Definition at line 15 of file var_global.c.
References addr, rz_analysis_var_global_t::addr, rz_analysis_var_global_t::analysis, rz_analysis_var_global_t::name, NULL, RZ_NEW0, rz_return_val_if_fail, and strdup().
Referenced by rz_analysis_global_variable_add_handler().
RZ_API bool rz_analysis_var_global_rename | ( | RzAnalysis * | analysis, |
RZ_NONNULL const char * | old_name, | ||
RZ_NONNULL const char * | newname | ||
) |
Rename the global variable.
analysis | RzAnalysis |
old_name | The old name of the global variable |
newname | The new name of the global variable |
Definition at line 277 of file var_global.c.
References rz_flag_bind_t::f, rz_analysis_t::flb, rz_analysis_t::ht_global_var, rz_analysis_var_global_t::name, rz_analysis_var_global_get_byname(), rz_analysis_var_global_get_flag_item(), rz_flag_rename(), RZ_FREE, RZ_LOG_ERROR, rz_return_val_if_fail, and strdup().
Referenced by rz_analysis_global_variable_rename_handler().
RZ_API void rz_analysis_var_global_set_type | ( | RzAnalysisVarGlobal * | glob, |
RZ_NONNULL RZ_BORROW RzType * | type | ||
) |
Set the type of the global variable.
glob | Global variable instance |
type | The type to set. RzType* |
Definition at line 302 of file var_global.c.
References rz_analysis_var_global_t::analysis, rz_analysis_var_global_get_flag_item(), rz_return_if_fail, rz_type_db_get_bitsize(), rz_type_free(), rz_flag_item_t::size, type, rz_analysis_var_global_t::type, and rz_analysis_t::typedb.
Referenced by rz_analysis_global_variable_add_handler(), and rz_analysis_global_variable_retype_handler().