12 #define IS_FI_NOTIN_SPACE(f, i) (rz_flag_space_cur(f) && (i)->space != rz_flag_space_cur(f))
13 #define IS_FI_IN_SPACE(fi, sp) (!(sp) || (fi)->space == (sp))
14 #define STRDUP_OR_NULL(s) (!RZ_STR_ISEMPTY(s) ? strdup(s) : NULL)
42 if (
a->off ==
b->off) {
45 return a->off <
b->off ? -1 : 1;
96 if (rz_list_empty(
flags->flags)) {
144 if (item->
offset != newoff || force) {
151 if (!flagsAtOffset) {
163 if (!
f || !item || !newname) {
166 if (!force && (item->
name == newname || (item->
name && !strcmp(item->
name, newname)))) {
173 bool res = (item->
name)
174 ? ht_pp_update_key(
f->ht_name, item->
name,
fname)
175 : ht_pp_insert(
f->ht_name,
fname, item);
190 int *
count = (
int *)user;
253 n->size = item->
size;
274 ht_pp_free(
f->ht_name);
299 rz_list_foreach (
list,
iter, item) {
300 if (item->
name && !strncmp(item->
name, flag_prefix, fp_size)) {
331 const char *spacename;
336 size_t n_spaces = 0,
i;
340 if (rz_list_empty(
list)) {
350 spacename = va_arg(aq,
const char *);
353 spacename = va_arg(aq,
const char *);
360 spacename = va_arg(ap,
const char *);
362 RzSpace *space = rz_flag_space_get(
f, spacename);
366 spacename = va_arg(ap,
const char *);
370 ut64 min_space_i = n_spaces + 1;
374 for (
i = 0;
i < n_spaces;
i++) {
378 if (
i >= min_space_i) {
383 if (
i < min_space_i) {
399 return (!strncmp(
n,
"sym.func.", 9) || !strncmp(
n,
"method.", 7) || !strncmp(
n,
"sym.", 4) || !strncmp(
n,
"func.", 5) || !strncmp(
n,
"fcn.0", 5));
413 if (flags_at->
off ==
off) {
415 rz_list_foreach (flags_at->
flags,
iter, item) {
435 while (!
nice && flags_at) {
437 rz_list_foreach (flags_at->
flags,
iter, item) {
442 eprintf(
"XXX Should never happend\n");
499 int i, newNameSize = strlen(
name);
500 char *newName =
malloc(newNameSize + 16);
504 strcpy(newName,
name);
506 snprintf(newName + newNameSize, 15,
".%d",
i);
545 item->
space = rz_flag_space_cur(
f);
600 ht_pp_delete(
f->ht_name, item->
name);
679 ht_pp_free(
f->ht_name);
693 rz_flag_space_push(
f, space_name);
700 rz_flag_space_pop(
f);
764 fb->
set_fs = rz_flag_space_set;
765 fb->
push_fs = rz_flag_space_push;
766 fb->
pop_fs = rz_flag_space_pop;
771 int *
count = (
int *)user;
783 #define FOREACH_BODY(condition) \
784 RzSkipListNode *it, *tmp; \
785 RzFlagsAtOffset *flags_at; \
786 RzListIter *it2, *tmp2; \
788 rz_skiplist_foreach_safe(f->by_off, it, tmp, flags_at) { \
790 rz_list_foreach_safe (flags_at->flags, it2, tmp2, fi) { \
792 if (!cb(fi, user)) { \
805 pfx_len = pfx_len < 0 ? strlen(pfx) : pfx_len;
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len key
static ut64 num_callback(RzNum *user, const char *name, int *ok)
RZ_API void rz_flag_bind(RzFlag *f, RzFlagBind *fb)
RZ_API int rz_flag_rename(RzFlag *f, RzFlagItem *item, const char *name)
RZ_API RzFlagItem * rz_flag_get_i(RzFlag *f, ut64 off)
static char * filter_item_name(const char *name)
static const char * str_callback(RzNum *user, ut64 off, int *ok)
RZ_API void rz_flag_foreach_space_glob(RzFlag *f, const char *glob, const RzSpace *space, RzFlagItemCb cb, void *user)
RZ_API RzFlagItem * rz_flag_item_clone(RzFlagItem *item)
RZ_API RzFlag * rz_flag_free(RzFlag *f)
RZ_API int rz_flag_count(RzFlag *f, const char *glob)
static bool append_to_list(RzFlagItem *fi, void *user)
RZ_API void rz_flag_item_free(RzFlagItem *item)
RZ_API void rz_flag_foreach_range(RZ_NONNULL RzFlag *f, ut64 from, ut64 to, RzFlagItemCb cb, void *user)
RZ_API const char * rz_flag_item_set_color(RzFlagItem *item, const char *color)
#define IS_FI_IN_SPACE(fi, sp)
#define FOREACH_BODY(condition)
static void count_flags_in_space(RzEvent *ev, int type, void *user, void *data)
RZ_API void rz_flag_unset_all_in_space(RzFlag *f, const char *space_name)
Unset all flag items in the space with the given name.
static bool count_flags(RzFlagItem *fi, void *user)
RZ_API void rz_flag_item_set_comment(RzFlagItem *item, const char *comment)
RZ_API RzFlagItem * rz_flag_set_next(RzFlag *f, const char *name, ut64 off, ut32 size)
RZ_API const RzList * rz_flag_get_list(RzFlag *f, ut64 off)
RZ_API void rz_flag_foreach_prefix(RzFlag *f, const char *pfx, int pfx_len, RzFlagItemCb cb, void *user)
RZ_API bool rz_flag_unset_all_off(RzFlag *f, ut64 off)
RZ_API RzList * rz_flag_all_list(RzFlag *f, bool by_space)
static RzFlagsAtOffset * rz_flag_get_nearest_list(RzFlag *f, ut64 off, int dir)
static bool update_flag_item_name(RzFlag *f, RzFlagItem *item, const char *newname, bool force)
RZ_API void rz_flag_item_set_alias(RzFlagItem *item, const char *alias)
RZ_API RzFlagItem * rz_flag_get_at(RzFlag *f, ut64 off, bool closest)
static void new_spaces(RzFlag *f)
RZ_API char * rz_flag_get_liststr(RzFlag *f, ut64 off)
static RzFlagItem * evalFlag(RzFlag *f, RzFlagItem *item)
static bool flag_relocate_foreach(RzFlagItem *fi, void *user)
RZ_API RzFlagItem * rz_flag_get(RzFlag *f, const char *name)
static bool unset_off_foreach(void *user, const void *k, const void *v)
RZ_API RzFlagItem * rz_flag_set(RzFlag *f, const char *name, ut64 off, ut32 size)
static void ht_free_flag(HtPPKv *kv)
static void free_item_name(RzFlagItem *item)
RZ_API bool rz_flag_exist_at(RzFlag *f, const char *flag_prefix, ut16 fp_size, ut64 off)
RZ_API void rz_flag_unset_all(RzFlag *f)
static void set_name(RzFlagItem *item, char *name)
static RzFlagsAtOffset * flags_at_offset(RzFlag *f, ut64 off)
static bool flag_count_foreach(RzFlagItem *fi, void *user)
RZ_API bool rz_flag_unset(RzFlag *f, RzFlagItem *item)
RZ_API bool rz_flag_unset_name(RzFlag *f, const char *name)
RZ_API bool rz_flag_move(RzFlag *f, ut64 at, ut64 to)
static void unset_flagspace(RzEvent *ev, int type, void *user, void *data)
static bool unset_foreach(RzFlagItem *fi, void *user)
static void flag_skiplist_free(void *data)
static bool unset_flags_space(RzFlagItem *fi, void *user)
RZ_API RzFlagItem * rz_flag_get_by_spaces(RzFlag *f, ut64 off,...)
static bool isFunctionFlag(const char *n)
static bool update_flag_item_offset(RzFlag *f, RzFlagItem *item, ut64 newoff, bool is_new, bool force)
static int flag_skiplist_cmp(const void *va, const void *vb)
RZ_API int rz_flag_unset_glob(RzFlag *f, const char *glob)
RZ_API void rz_flag_foreach_space(RzFlag *f, const RzSpace *space, RzFlagItemCb cb, void *user)
RZ_API int rz_flag_relocate(RzFlag *f, ut64 off, ut64 off_mask, ut64 to)
RZ_API void rz_flag_item_set_realname(RzFlagItem *item, const char *realname)
#define STRDUP_OR_NULL(s)
RZ_API RzFlag * rz_flag_new(void)
static void remove_offsetmap(RzFlag *f, RzFlagItem *item)
RZ_API void rz_flag_foreach_glob(RzFlag *f, const char *glob, RzFlagItemCb cb, void *user)
RZ_API bool rz_flag_unset_off(RzFlag *f, ut64 off)
static void free_item_realname(RzFlagItem *item)
RZ_API void rz_flag_foreach(RzFlag *f, RzFlagItemCb cb, void *user)
#define IS_FI_NOTIN_SPACE(f, i)
RZ_API void Ht_() free(HtName_(Ht) *ht)
const char * spaces(int count)
static void list(RzEgg *egg)
RZ_API bool rz_list_delete_data(RZ_NONNULL RzList *list, void *ptr)
Deletes an entry in the list by searching for a pointer.
RZ_API RZ_BORROW void * rz_list_get_top(RZ_NONNULL const RzList *list)
Returns the last element of the list.
RZ_API RZ_OWN RzList * rz_list_new(void)
Returns a new initialized RzList pointer (free method is not initialized)
RZ_API ut32 rz_list_length(RZ_NONNULL const RzList *list)
Returns the length of the list.
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
void * malloc(size_t size)
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf nice
static const char struct stat static buf struct stat static buf static idle const char static path static fd const char static len const void static prot const char struct module static image struct kernel_sym static table unsigned char static buf static fsuid unsigned struct dirent unsigned static count const struct iovec static count static pid const void static len static flags const struct sched_param static p static pid static policy struct timespec static tp static suid unsigned fn
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)
RZ_API RzEventCallbackHandle rz_event_hook(RzEvent *ev, int type, RzEventCallback cb, void *user)
bool(* RzFlagItemCb)(RzFlagItem *fi, void *user)
RZ_API bool rz_name_filter(char *name, int len, bool strict)
RZ_API RzNum * rz_num_new(RzNumCallback cb, RzNumCallback2 cb2, void *ptr)
RZ_API ut64 rz_num_math(RzNum *num, const char *str)
RZ_API void rz_num_free(RzNum *num)
RZ_API void * rz_skiplist_get_geq(RzSkipList *list, void *data)
RZ_API bool rz_skiplist_delete(RzSkipList *list, void *data)
RZ_API void rz_skiplist_purge(RzSkipList *list)
RZ_API void * rz_skiplist_get_leq(RzSkipList *list, void *data)
RZ_API RzSkipList * rz_skiplist_new(RzListFree freefn, RzListComparator comparefn)
RZ_API void rz_skiplist_free(RzSkipList *list)
RZ_API RzSkipListNode * rz_skiplist_insert(RzSkipList *list, void *data)
RZ_API void rz_spaces_fini(RzSpaces *sp)
RZ_API bool rz_spaces_init(RzSpaces *sp, const char *name)
RZ_API char * rz_str_appendf(char *ptr, const char *fmt,...) RZ_PRINTF_CHECK(2
RZ_API bool rz_str_glob(const char *str, const char *glob)
#define RZ_STR_ISEMPTY(x)
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.
#define container_of(ptr, type, member)
RZ_API Sdb * sdb_new0(void)
RZ_API bool sdb_free(Sdb *s)
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr from
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr socklen_t static fromlen const void const struct sockaddr to
static struct sockaddr static addrlen static backlog const void static flags void flags
RzFlagGetAtBySpaces get_at_by_spaces
RzFlagUnsetName unset_name
struct rz_space_event_t::@311::@313 unset
struct rz_space_event_t::@311::@312 count
union rz_space_event_t::@311 data
ut64(WINAPI *w32_GetEnabledXStateFeatures)()