58 if (!ht_pp_insert(analysis->
ht_global_var, global_var->name, global_var)) {
65 global_var->analysis = analysis;
66 rz_flag_space_push(global_var->analysis->flb.f,
"globals");
68 rz_flag_space_pop(global_var->analysis->flb.f);
108 if (
r &&
r->offset != glob->
addr) {
126 return deleted ? ht_pp_delete(analysis->ht_global_var, glob->name) : deleted;
281 RZ_LOG_ERROR(
"Global variable '%s' does not exist!\n", old_name);
292 return ht_pp_update_key(analysis->
ht_global_var, old_name, newname);
336 bool low =
false, high =
false;
340 for (
i = 0;
i <
n;
i += 1) {
342 switch (constr->
cond) {
368 if (low && high &&
i !=
n - 1) {
RZ_API int rz_flag_rename(RzFlag *f, RzFlagItem *item, const char *name)
RZ_API RzFlagItem * rz_flag_get(RzFlag *f, const char *name)
RZ_API RzFlagItem * rz_flag_set(RzFlag *f, const char *name, ut64 off, ut32 size)
RZ_API bool rz_flag_unset(RzFlag *f, RzFlagItem *item)
RZ_API RZ_OWN RzList * rz_list_new(void)
Returns a new initialized RzList pointer (free method is not initialized)
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
#define rz_return_if_fail(expr)
#define rz_return_val_if_fail(expr, val)
#define RZ_LOG_ERROR(fmtstr,...)
RZ_API RBNode * rz_rbtree_find(RBNode *root, void *data, RBComparator cmp, void *user)
RZ_API bool rz_rbtree_delete(RBNode **root, void *data, RBComparator cmp, void *cmp_user, RBNodeFree freefn, void *free_user)
Returns true if a node with an equal key is deleted.
RZ_API bool rz_rbtree_aug_insert(RBNode **root, void *data, RBNode *node, RBComparator cmp, void *cmp_user, RBNodeSum sum)
Returns true if the node was inserted successfully.
RZ_API RBNode * rz_rbtree_upper_bound(RBNode *root, void *data, RBComparator cmp, void *user)
RZ_API RZ_OWN char * rz_strbuf_drain_nofree(RzStrBuf *sb)
RZ_API bool rz_strbuf_append(RzStrBuf *sb, const char *s)
RZ_API bool rz_strbuf_appendf(RzStrBuf *sb, const char *fmt,...) RZ_PRINTF_CHECK(2
RZ_API void rz_strbuf_init(RzStrBuf *sb)
@ RZ_TYPE_COND_LE
Less or equal.
@ RZ_TYPE_COND_GE
Greater or equal.
@ RZ_TYPE_COND_GT
Greater than.
@ RZ_TYPE_COND_LT
Less than.
#define container_of(ptr, type, member)
static void * rz_vector_index_ptr(RzVector *vec, size_t index)
RZ_API void * rz_vector_push(RzVector *vec, void *x)
RZ_API void rz_vector_fini(RzVector *vec)
RZ_BORROW RzAnalysis * analysis
analysis pertaining to this global variable
RzType * type
type of the variable
ut64 addr
address of the global variable
char * name
name of the variable
type constrained by the type conditions
RZ_API ut64 rz_type_db_get_bitsize(const RzTypeDB *typedb, RZ_NONNULL RzType *type)
Returns the type size in bits (target dependent)
RZ_API void rz_type_free(RZ_NULLABLE RzType *type)
Frees the RzType.
RZ_API RZ_OWN char * rz_analysis_var_global_get_constraints_readable(RzAnalysisVarGlobal *glob)
Get the pritable string of global variable constraints.
RZ_API void rz_analysis_var_global_set_type(RzAnalysisVarGlobal *glob, RZ_NONNULL RZ_BORROW RzType *type)
Set the type of the global variable.
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.
RZ_API RZ_OWN RzAnalysisVarGlobal * rz_analysis_var_global_new(RZ_NONNULL const char *name, ut64 addr)
Create a new instance of global variable.
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.
RZ_API bool rz_analysis_var_global_delete(RZ_NONNULL RzAnalysis *analysis, RZ_NONNULL RzAnalysisVarGlobal *glob)
Delete and free the global variable.
RZ_API RZ_OWN RzList * rz_analysis_var_global_get_all(RzAnalysis *analysis)
Get all of the added global variables.
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.
RZ_API void rz_analysis_var_global_free(RzAnalysisVarGlobal *glob)
Free the global variable instance.
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.
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.
RZ_API RZ_OWN bool rz_analysis_var_global_add(RzAnalysis *analysis, RZ_NONNULL RzAnalysisVarGlobal *global_var)
Add the global variable into hashtable.
int global_var_node_cmp(const void *incoming, const RBNode *in_tree, void *user)
RZ_API RZ_NULLABLE RzFlagItem * rz_analysis_var_global_get_flag_item(RzAnalysisVarGlobal *glob)
Get the flag item corresponding to the given variable.
static bool global_var_collect_cb(void *user, const void *k, const void *v)
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.
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.
RZ_API void rz_analysis_var_global_add_constraint(RzAnalysisVarGlobal *glob, RzTypeConstraint *constraint)
Add a constaint to global variable.
ut64(WINAPI *w32_GetEnabledXStateFeatures)()