9 #define mid_down_refline(a, r) ((r)->from > (r)->to && (a) < (r)->from && (a) > (r)->to)
10 #define mid_up_refline(a, r) ((r)->from < (r)->to && (a) > (r)->from && (a) < (r)->to)
11 #define mid_refline(a, r) (mid_down_refline(a, r) || mid_up_refline(a, r))
12 #define in_refline(a, r) (mid_refline(a, r) || (a) == (r)->from || (a) == (r)->to)
21 return (
a->val >
b->val) - (
a->val <
b->val);
25 return (
a->level <
b->level) - (
a->level >
b->level);
90 int sz = 0,
count = 0;
134 switch (meta->
type) {
140 skip = rz_meta_node_size(node);
180 if ((!linesout && (
op.jump >
opc +
len ||
op.jump <
opc)) || !
op.jump) {
203 rz_list_foreach (
op.switch_op->cases,
iter, caseop) {
227 rz_list_foreach (sten,
iter, el) {
230 free_levels[
min] = 1;
234 while (free_levels[++
min] == 1) {
238 free_levels[el->
r->
level - 1] = 0;
280 if (ref->
from == ref->
to) {
284 if (is_middle_before) {
285 return (ref->
from > ref->
to) ?
" " :
"|";
287 return (ref->
from > ref->
to) ?
"." :
"`";
290 if (is_middle_before) {
291 return (ref->
from > ref->
to) ?
"|" :
" ";
293 return (ref->
from > ref->
to) ?
"`" :
",";
320 int pdlen = strlen(pd);
354 int dir = 0,
pos = -1, max_level = -1;
358 char *col_str =
NULL;
379 rz_list_foreach (lvls,
iter, ref) {
388 const char ch = ref->
from ==
addr ?
'=' :
'-';
389 const char ch_col = ref->
from >= ref->
to ?
't' :
'd';
390 const char *col = (ref->
from >= ref->
to) ?
"t" :
"d";
392 int ch_pos = max_level + 1 - ref->
level;
394 ch_pos = ch_pos * 2 - 1;
405 if (!middle_before) {
410 if (!middle_before) {
411 dir = ref->
to ==
addr ? 1 : 2;
413 pos = middle_before ? ref->
level : 0;
420 if (ref->
from >= ref->
to) {
429 if (max_level == -1) {
430 max_level = ref->
level;
441 if (!
str || !col_str) {
459 memset(pfx,
' ',
sizeof(pfx));
460 if (lw >=
sizeof(pfx)) {
461 lw =
sizeof(pfx) - 1;
470 const char prev_col = col_str[strlen(col_str) - 1];
471 const char *arr_col = prev_col ==
't' ?
"tt " :
"dd ";
const lzma_allocator const uint8_t size_t uint8_t * out
RZ_API void rz_cons_break_pop(void)
RZ_API void rz_cons_break_push(RzConsBreak cb, void *user)
RZ_API bool rz_cons_is_breaked(void)
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
void skip(file *in, unsigned n)
RZ_API void Ht_() free(HtName_(Ht) *ht)
return memset(p, 0, total)
static void list(RzEgg *egg)
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
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 RZ_BORROW RzListIter * rz_list_add_sorted(RZ_NONNULL RzList *list, void *data, RZ_NONNULL RzListComparator cmp)
Adds an element to a sorted list via the RzListComparator.
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
RZ_API bool rz_analysis_op_fini(RzAnalysisOp *op)
RZ_API int rz_analysis_op(RzAnalysis *analysis, RzAnalysisOp *op, ut64 addr, const ut8 *data, int len, RzAnalysisOpMask mask)
static const char * get_corner_char(RzAnalysisRefline *ref, ut64 addr, bool is_middle_before)
static void add_spaces(RzBuffer *b, int level, int pos, bool wide)
static ReflineEnd * refline_end_new(ut64 val, bool is_from, RzAnalysisRefline *ref)
static void fill_level(RzBuffer *b, int pos, char ch, RzAnalysisRefline *r, bool wide)
RZ_API void rz_analysis_reflines_str_free(RzAnalysisRefStr *refstr)
static bool refline_kept(RzAnalysisRefline *ref, bool middle_after, ut64 addr)
RZ_API void rz_analysis_reflines_free(RzAnalysisRefline *rl)
struct refline_end ReflineEnd
RZ_API RzList * rz_analysis_reflines_get(RzAnalysis *analysis, ut64 addr, const ut8 *buf, ut64 len, int nlines, int linesout, int linescall)
static int cmp_asc(const struct refline_end *a, const struct refline_end *b)
RZ_API RzAnalysisRefStr * rz_analysis_reflines_str(void *_core, ut64 addr, int opts)
static int cmp_by_ref_lvl(const RzAnalysisRefline *a, const RzAnalysisRefline *b)
static bool add_refline(RzList *list, RzList *sten, ut64 addr, ut64 to, int *idx)
RZ_API int rz_analysis_reflines_middle(RzAnalysis *a, RzList *list, ut64 addr, int len)
@ RZ_ANALYSIS_OP_MASK_BASIC
@ RZ_ANALYSIS_OP_MASK_HINT
@ RZ_ANALYSIS_REFLINE_TYPE_MIDDLE_BEFORE
@ RZ_ANALYSIS_REFLINE_TYPE_MIDDLE_AFTER
@ RZ_ANALYSIS_REFLINE_TYPE_WIDE
@ RZ_ANALYSIS_OP_TYPE_JMP
@ RZ_ANALYSIS_OP_TYPE_CALL
@ RZ_ANALYSIS_OP_TYPE_SWITCH
@ RZ_ANALYSIS_OP_TYPE_CJMP
#define rz_return_val_if_fail(expr, val)
RZ_API st64 rz_buf_write_at(RZ_NONNULL RzBuffer *b, ut64 addr, RZ_NONNULL const ut8 *buf, ut64 len)
Write len bytes of the buffer at the specified address.
RZ_API st64 rz_buf_append_string(RZ_NONNULL RzBuffer *b, RZ_NONNULL const char *str)
Append a string to the buffer.
RZ_API void rz_buf_free(RzBuffer *b)
Free all internal data hold by the buffer and the buffer.
RZ_API RZ_OWN RzBuffer * rz_buf_new_with_bytes(RZ_NULLABLE RZ_BORROW const ut8 *bytes, ut64 len)
Creates a new buffer with a bytes array.
RZ_API RZ_OWN char * rz_buf_to_string(RZ_NONNULL RzBuffer *b)
Stringify the buffer.
void(* RzListFree)(void *ptr)
int(* RzListComparator)(const void *value, const void *list_data)
RZ_API char * rz_str_append(char *ptr, const char *string)
RZ_API char * rz_str_prepend(char *ptr, const char *string)
RZ_API const char * rz_str_pad(const char ch, int len)
RZ_API void rz_pvector_free(RzPVector *vec)
#define rz_pvector_foreach(vec, it)
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr socklen_t static fromlen const void const struct sockaddr to
RzIOIsValidOff is_valid_offset
static struct Type metas[]
ut64(WINAPI *w32_GetEnabledXStateFeatures)()