12 #define SDB_KEY_BB "bb.0x%" PFMT64x ".0x%" PFMT64x
14 #define JMPTBL_LEA_SEARCH_SZ 64
16 #define MAX_SCAN_SIZE 0x7ffffff
19 #define MAX_FLG_NAME_SIZE 64
23 #define MAX_FCN_SIZE (1024 * 256)
25 #define DB a->sdb_fcns
26 #define EXISTS(x, ...) snprintf(key, sizeof(key) - 1, x, ##__VA_ARGS__), sdb_exists(DB, key)
27 #define SETKEY(x, ...) snprintf(key, sizeof(key) - 1, x, ##__VA_ARGS__);
53 static ut8 cache[1024];
54 const int cache_len =
sizeof(cache);
59 if (
len > cache_len) {
108 rz_list_foreach_safe (fcn->
bbs,
iter, iter2, bb) {
109 if (bb->
addr >= eof) {
139 #define gotoBeach(x) \
156 return !memcmp(
buf,
"\xff\xff\xff\xff",
RZ_MIN(
len, 4));
163 return (fi && fi->
name && (strstr(fi->
name,
"imp.") || strstr(fi->
name,
"sym.") || strstr(fi->
name,
"entry") || strstr(fi->
name,
"main")));
169 st32 jmptbl[64] = { 0 };
196 o_reg_dst = cur_dst.
reg;
198 cur_dst = *mov_aop.
dst;
200 if (mov_aop.
src[0]) {
201 cur_scr = *mov_aop.
src[0];
222 *jmptbl_addr += mov_aop.
disp;
230 *casetbl_addr += omov_aop.
disp;
235 if (mov_aop.
type && mov_aop.
ptr) {
236 *jmptbl_addr += mov_aop.
ptr;
238 lea_ptr = mov_aop.
ptr;
243 for (
i = 0;
i < 3;
i++) {
267 rz_list_foreach (fcn->
bbs,
iter, tmp_bb) {
269 if (tmp_bb->
cmpreg == cmp_reg) {
272 return tmp_bb->
cmpval + 1;
284 return src->reg &&
dst->reg &&
src->reg->name &&
dst->reg->name;
289 char *tmp_buf,
int oplen,
int un_idx,
int *
idx) {
291 if ((
addr + un_idx - oplen) == fcn->
addr) {
308 ht_up_find(ht, fcn->
addr, &checked);
325 rz_list_foreach (xrefs,
iter, xref) {
365 rz_list_foreach (intersecting,
iter, bb) {
368 rz_analysis_block_contains(bb,
addr)) &&
373 const int last_instr_idx = bb->
ninstr - 1;
374 bool in_delay_slot =
false;
375 for (
int i = last_instr_idx;
i >= 0;
i--) {
378 if (addr <= at || off >= bb->
size) {
383 if (
size > 0 &&
op.delay) {
384 if (
op.delay >= last_instr_idx -
i) {
385 in_delay_slot =
true;
416 while (!rz_list_empty(block->
fcns)) {
418 if (other_fcn->
addr == block->
addr) {
434 int actual_delta = 0;
435 switch (other_var->
kind) {
437 actual_delta = other_var->
delta +
ctx->stack_diff;
443 actual_delta = other_var->
delta;
482 const char *token =
"x86_indirect_thunk_";
483 const char *thunk = strstr(flag->
name, token);
485 return thunk + strlen(token);
495 0x00000a65 sym.__x86_indirect_thunk_rax:
496 0x00000a65 .------- e807000000
call 0xa71
497 0x00000a6a | f390 pause
498 0x00000a6c | 0faee8 lfence
499 0x00000a6f | ebf9
jmp 0xa6a
500 0x00000a71 `----> 48890424
mov qword [rsp],
rax
517 bool has_dst_reg =
op->dst &&
op->dst->reg &&
op->dst->reg->name;
518 bool has_src_reg =
op->src[0] &&
op->src[0]->reg &&
op->src[0]->reg->name;
519 if (has_dst_reg && has_src_reg) {
520 return !strcmp(bp_reg,
op->dst->reg->name) && !strcmp(sp_reg,
op->src[0]->reg->name);
526 return arch && (!strncmp(
arch,
"arm", 3) || !strcmp(
arch,
"riscv") || !strcmp(
arch,
"ppc"));
535 int saved_stack = fcn->
stack;
538 fcn->
stack = saved_stack;
566 const int continue_after_jump = analysis->
opt.
afterjmp;
568 char *last_reg_mov_lea_name =
NULL;
569 char *movbasereg =
NULL;
573 bool overlapped =
false;
591 bool is_arm =
false, is_x86 =
false, is_amd64 =
false, is_dalvik =
false, is_hexagon =
false;
594 is_x86 = !strncmp(analysis->
cur->
arch,
"x86", 3);
595 is_dalvik = !strncmp(analysis->
cur->
arch,
"dalvik", 6);
596 is_hexagon = !strncmp(analysis->
cur->
arch,
"hexagon", 7);
598 is_amd64 = is_x86 ? fcn->
cc && !strcmp(fcn->
cc,
"amd64") :
false;
599 bool can_jmpmid = analysis->
opt.
jmpmid && (is_dalvik || is_x86);
605 bool has_variadic_reg = !!variadic_reg;
611 if (analysis->
sleep) {
624 if (fcn_at_addr && fcn_at_addr != fcn) {
633 if (!existing_in_fcn && existing_bb) {
634 if (existing_bb->
addr == fcn->
addr) {
657 RZ_LOG_ERROR(
"Cannot allocate list of pairs<reg, addr> values.\n");
663 bool last_is_reg_mov_lea =
false;
664 bool last_is_push =
false;
665 bool last_is_mov_lr_pc =
false;
674 if (!rz_list_empty(
list)) {
684 bool skipAnalysis =
false;
685 if (!strncmp(fcn->
name,
"sym.", 4)) {
686 if (!strncmp(fcn->
name + 4,
"imp.", 4)) {
688 }
else if (strstr(fcn->
name,
"field")) {
697 RZ_LOG_DEBUG(
"Skipping large memory region during basic block analysis.\n");
704 if (!last_is_reg_mov_lea) {
705 free(last_reg_mov_lea_name);
706 last_reg_mov_lea_name =
NULL;
712 at_delta = addrbytes *
idx;
713 at =
addr + at_delta;
739 bool has_stack_regs = bp_reg && sp_reg;
743 if (!fi || strncmp(fi->
name,
"sym.", 4)) {
744 if ((
addr + delay.un_idx - oplen) == fcn->
addr) {
764 if (
op.hint.new_bits) {
767 if (
idx > 0 && !overlapped) {
768 bbg =
bbget(analysis, at, can_jmpmid);
769 if (bbg && bbg != bb) {
805 bb->
jump = at + oplen;
806 if (from_addr != bb->
addr) {
807 bb->
fail = handle_addr;
824 if (analysis->
opt.
delay &&
op.delay > 0 && !delay.pending) {
831 delay.idx =
idx - oplen;
832 delay.cnt =
op.delay;
834 delay.adjust = !overlapped;
852 }
else if (
op.delay > 0 && delay.pending) {
866 delay.pending = delay.after = delay.idx = delay.adjust = 0;
870 if (analysis->
opt.
vars && !varset) {
885 switch (
op.stackop) {
910 last_is_reg_mov_lea =
false;
914 last_is_mov_lr_pc =
true;
922 free(last_reg_mov_lea_name);
923 if ((last_reg_mov_lea_name =
strdup(
op.dst->reg->name))) {
924 last_reg_mov_lea_val =
op.val;
925 last_is_reg_mov_lea =
true;
932 if (
op.src[0] &&
op.src[0]->reg) {
934 movbasereg =
strdup(
op.src[0]->reg->name);
940 skip_ret =
skip_hp(analysis, fcn, &
op, bb,
addr, tmp_buf, oplen, delay.un_idx, &
idx);
950 last_is_reg_mov_lea =
false;
955 RZ_LOG_ERROR(
"Cannot allocate pair<reg, addr> structure\n");
962 :
op.dst &&
op.dst->reg
972 free(last_reg_mov_lea_name);
973 if ((last_reg_mov_lea_name =
strdup(
op.dst->reg->name))) {
974 last_reg_mov_lea_val =
op.ptr;
975 last_is_reg_mov_lea =
true;
980 skip_ret =
skip_hp(analysis, fcn, &
op, bb, at, tmp_buf, oplen, delay.un_idx, &
idx);
990 ut64 jmptbl_addr =
op.ptr;
991 ut64 casetbl_addr =
op.ptr;
999 RzAnalysisJmpTableParams params = {
1000 .jmp_address = jmp_aop.
addr,
1001 .jmptbl_loc = jmptbl_addr,
1002 .casetbl_loc = casetbl_addr,
1004 .jmptbl_off =
op.ptr,
1008 ret = casetbl_addr ==
op.ptr
1012 lea_jmptbl_ip = jmp_aop.
addr;
1029 if ((
op.size + 4 <= bytes_read) && !memcmp(
buf +
op.size,
"\x00\x00\x00\x00", 4)) {
1052 if (fi && strstr(fi->
name,
"imp.")) {
1066 if (continue_after_jump && is_hexagon) {
1077 bool must_eob =
true;
1080 must_eob = (
op.jump <
map->itv.addr ||
op.jump >=
map->itv.addr +
map->itv.size);
1083 if (continue_after_jump && is_hexagon) {
1105 int diff =
op.jump -
op.addr;
1112 }
else if (
RZ_ABS(diff) > tc) {
1129 if (val < analysis->opt.jmptbl_maxcount) {
1149 if (continue_after_jump) {
1173 RzAnalysisJmpTableParams params = {
1174 .jmp_address =
op.addr,
1176 .jmptbl_loc =
op.ptr,
1178 .entry_size = analysis->
bits >> 3,
1179 .table_count = cmpval + 1,
1180 .jmptbl_off =
op.ptr,
1181 .default_case =
op.fail,
1191 if (
op.jump ==
op.ptr) {
1193 }
else if (
op.fail ==
op.ptr) {
1202 if (continue_after_jump && is_hexagon) {
1209 if (!continue_after_jump) {
1210 if (
op.jump < fcn->
addr) {
1240 f->is_noreturn =
true;
1253 f->is_noreturn =
true;
1261 if (
op.analysis_vals[0].plugin_specific == 31) {
1270 if (
is_arm && last_is_mov_lr_pc) {
1282 if (analysis->
opt.
jmptbl && lea_jmptbl_ip !=
op.addr) {
1283 RzAnalysisJmpTableParams params = {
1284 .jmp_address =
op.addr,
1285 .entry_size = analysis->
bits >> 3,
1286 .jmptbl_loc =
op.ptr,
1287 .jmptbl_off =
op.ptr,
1294 bool case_table =
false;
1299 bool op_has_src_name =
op.src[0] &&
op.src[0]->reg &&
op.src[0]->reg->name;
1300 bool same_reg = (
op.ireg && prev_op_has_dst_name && !strcmp(
op.ireg, prev_op.
dst->
reg->
name)) || (op_has_src_name && prev_op_has_dst_name && !strcmp(
op.src[0]->reg->name, prev_op.
dst->
reg->
name));
1304 params.casetbl_loc = prev_op.
disp;
1306 ret = case_table =
true;
1323 params.jmptbl_off = 0;
1326 rz_list_foreach_prev(analysis->
leaddrs,
iter, pair) {
1330 if ((lea_op_off ==
UT64_MAX || lea_op_off >
op.addr - pair->
op_addr) && pair->
reg && !strcmp(movbasereg, pair->
reg)) {
1332 params.jmptbl_off = pair->
leaddr;
1337 params.table_count = cmpval + 1;
1338 params.default_case = -1;
1340 params.jmptbl_loc = params.jmptbl_off + movdisp;
1341 params.entry_size = movscale;
1345 params.jmptbl_loc =
op.addr +
op.size;
1346 params.jmptbl_off =
op.addr + 4;
1348 if (
op.ptrsize == 1) {
1350 params.table_count = 0;
1352 params.table_count += pred_cmpval;
1354 params.table_count += cmpval;
1356 params.entry_size = 1;
1359 idx += params.table_count;
1360 }
else if (
op.ptrsize == 2) {
1362 params.table_count = 1;
1364 params.table_count += pred_cmpval;
1366 params.table_count += cmpval;
1368 params.entry_size = 2;
1371 idx += (params.table_count * 2);
1375 if (lea_jmptbl_ip ==
op.addr) {
1379 if (continue_after_jump) {
1399 last_is_push =
true;
1400 last_push_addr =
op.val;
1406 if ((
op.type &
RZ_ANALYSIS_OP_TYPE_REG) && last_is_reg_mov_lea &&
op.src[0] &&
op.src[0]->reg &&
op.src[0]->reg->name && !strcmp(
op.src[0]->reg->name, last_reg_mov_lea_name)) {
1407 last_is_push =
true;
1408 last_push_addr = last_reg_mov_lea_val;
1420 op.jump = last_push_addr;
1433 if (continue_after_jump && is_hexagon) {
1440 last_is_reg_mov_lea =
false;
1443 last_is_push =
false;
1446 last_is_mov_lr_pc =
false;
1450 bool dst_is_variadic =
op.dst &&
op.dst->reg && variadic_reg &&
op.dst->reg->offset == variadic_reg->
offset;
1452 if (dst_is_variadic && !op_is_cmp) {
1453 has_variadic_reg =
false;
1454 }
else if (op_is_cmp) {
1455 if (
op.src[0] &&
op.src[0]->reg && (
op.dst->reg ==
op.src[0]->reg) && dst_is_variadic) {
1463 RZ_FREE(last_reg_mov_lea_name);
1542 int i, oplen, opcnt = 0, pushcnt = 0, movcnt = 0, brcnt = 0;
1546 for (
i = 0;
i < bufsz && opcnt < 10;
i += oplen, opcnt++) {
1564 if (
op.jump < low ||
op.jump >= high) {
1575 return (pushcnt + movcnt + brcnt > 5);
1582 const bool is_x86 = analysis->
cur->
arch && !strcmp(analysis->
cur->
arch,
"x86");
1584 rz_list_foreach (xrefs,
iter, xref) {
1597 rz_list_foreach (xrefs,
iter, xref) {
1611 switch (meta->
type) {
1643 if (fcn->
cc && !strcmp(fcn->
cc,
"ms")) {
1645 const int shadow_store = 0x28;
1663 rz_list_foreach_safe (analysis->
fcns,
iter, iter2, fcn) {
1678 rz_list_foreach_safe (
a->fcns,
iter, iter_tmp, fcn) {
1690 if (
list && !rz_list_empty(
list)) {
1694 rz_list_foreach (
list,
iter, fcn) {
1712 rz_list_foreach (analysis->
fcns,
iter, fcn) {
1719 rz_list_foreach (analysis->
fcns,
iter, fcn) {
1745 if (
size >
a->opt.bb_max_size) {
1788 rz_list_foreach (fcn->
bbs,
iter, bb) {
1807 int E = 0,
N = 0,
P = 0;
1811 rz_list_foreach (fcn->
bbs,
iter, bb) {
1829 int result =
E -
N + (2 *
P);
1830 if (result < 1 && !analysis) {
1858 char *ret_type_str =
NULL;
1866 pj_ks(pj,
"name", function->name);
1868 pj_kb(pj,
"noreturn", no_return);
1869 pj_ks(pj,
"ret", ret_type_str ? ret_type_str :
"void");
1871 pj_ks(pj,
"cc", function->cc);
1875 for (
int i = 0;
i < argc;
i++) {
1880 pj_ks(pj,
"name", arg_name);
1881 pj_ks(pj,
"type", arg_type_str);
1884 pj_ks(pj,
"cc", cc_arg);
1937 if (index < args_count) {
1955 for (; index < args_count; index++) {
1964 if (callable->noret) {
1965 f->is_noreturn =
true;
1967 f->ret_type = callable->ret;
1987 char *error_msg =
NULL;
2005 RZ_LOG_ERROR(
"Parsed function signature should be RzCallable\n");
2009 RZ_LOG_ERROR(
"Parsed function signature should not be NULL\n");
2019 rz_list_foreach (analysis->
fcns,
iter, fcni) {
2032 rz_list_foreach (analysis->
fcns,
iter, fcni) {
2047 bool can_jmpmid =
false;
2049 bool is_x86 = !strncmp(analysis->
cur->
arch,
"x86", 3);
2050 bool is_dalvik = !strncmp(analysis->
cur->
arch,
"dalvik", 6);
2051 can_jmpmid = analysis->
opt.
jmpmid && (is_dalvik || is_x86);
2055 rz_list_foreach (fcn->
bbs,
iter, bb) {
2071 rz_list_foreach (fcn->
bbs,
iter, bb) {
2083 ut32 totalCycles = 0;
2088 rz_list_foreach (fcn->
bbs,
iter, bb) {
2097 for (at = bb->
addr; at <
end;) {
2105 totalCycles +=
op.cycles;
2121 rz_list_foreach (fcn->
bbs,
iter, bb) {
2150 const char *opdreg = (
dst &&
dst->reg) ?
dst->reg->name :
NULL;
2151 const char *opsreg = (
src &&
src->reg) ?
src->reg->name :
NULL;
2153 bool is_bp_dst = opdreg && !
dst->memref && !strcmp(opdreg, bp_name);
2154 bool is_bp_src = opsreg && !
src->memref && !strcmp(opsreg, bp_name);
2156 return is_bp_src || is_bp_dst;
2168 char str_to_find[40] =
"\"type\":\"reg\",\"value\":\"";
2174 rz_list_foreach (fcn->
bbs,
iter, bb) {
2183 for (at = bb->
addr; at <
end;) {
2212 pos =
op.opex.ptr ? strstr(
op.opex.ptr, str_to_find) :
NULL;
2213 if (
pos &&
pos -
op.opex.ptr < 60) {
2221 if (
op.opex.ptr && strstr(
op.opex.ptr, str_to_find)) {
2277 ht_up_free((HtUP *)kv->value);
2297 for (cur_addr =
from; cur_addr <
to; cur_addr += opsz,
len -= opsz) {
2300 if (ret < 1 ||
op.size < 1) {
2343 rz_list_foreach (fcns, it, fcn) {
2354 HtUP *ht = ht_up_new0();
2360 rz_list_foreach_safe (fcn->
bbs, it2,
tmp, bb) {
2361 if (ht_up_find_kv(ht, bb->
addr,
NULL)) {
2364 HtUP *o_visited = ht_up_find(reachable, fcn->
addr,
NULL);
2365 if (!ht_up_find_kv(o_visited, bb->
addr,
NULL)) {
2387 HtUP *ht = ht_up_new0();
2390 ht_up_insert(reachable, fcn->
addr, ht);
2402 if (rz_list_empty(
blocks)) {
2411 rz_list_foreach (
blocks, it, bb) {
2415 rz_list_foreach_safe (bb->
fcns, it2,
tmp, fcn) {
2431 ht_up_free(reachable);
2442 rz_list_foreach_safe (fcn->
bbs, it,
tmp, bb) {
2444 rz_list_foreach_safe (bb->
fcns, it2, tmp2,
f) {
2450 ht_up_free(reachable);
2550 rz_list_foreach (
list,
iter, var) {
2649 RZ_LOG_ERROR(
"Cannot parse function's argument type\n");
RZ_API RZ_OWN RzAnalysisDiff * rz_analysis_diff_new(void)
RZ_API RZ_OWN char * rz_analysis_function_name_guess(RzTypeDB *typedb, RZ_NONNULL char *name)
Checks if varions function name variations present in the database.
RZ_API void rz_analysis_function_add_block(RzAnalysisFunction *fcn, RzAnalysisBlock *bb)
RZ_API RzAnalysisFunction * rz_analysis_get_function_at(RzAnalysis *analysis, ut64 addr)
RZ_API RzList * rz_analysis_get_functions_in(RzAnalysis *analysis, ut64 addr)
RZ_API ut64 rz_analysis_function_linear_size(RzAnalysisFunction *fcn)
RZ_API void rz_analysis_function_remove_block(RzAnalysisFunction *fcn, RzAnalysisBlock *bb)
RZ_API bool rz_analysis_function_delete(RzAnalysisFunction *fcn)
RZ_API bool rz_analysis_function_contains(RzAnalysisFunction *fcn, ut64 addr)
RZ_API bool rz_analysis_noreturn_at_addr(RzAnalysis *analysis, ut64 addr)
RZ_API bool rz_analysis_is_prelude(RzAnalysis *analysis, const ut8 *data, int len)
RZ_API int rz_analysis_archinfo(RzAnalysis *analysis, int query)
RZ_API bool rz_analysis_noreturn_at(RzAnalysis *analysis, ut64 addr)
static bool isValid(ut64 addr)
static RzILOpEffect * mov(cs_insn *insn, bool is_thumb)
static mcore_handle handle
lsl lsr asr ror lsl lsr asr ror lsl lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror c3
static char * signature(RzBinFile *bf, bool json)
RZ_API void rz_analysis_block_set_size(RzAnalysisBlock *block, ut64 size)
RZ_API bool rz_analysis_block_was_modified(RzAnalysisBlock *block)
RZ_API void rz_analysis_delete_block(RzAnalysisBlock *bb)
RZ_API bool rz_analysis_block_relocate(RzAnalysisBlock *block, ut64 addr, ut64 size)
RZ_API bool rz_analysis_block_set_op_offset(RzAnalysisBlock *block, size_t i, ut16 v)
RZ_API void rz_analysis_block_ref(RzAnalysisBlock *bb)
RZ_API void rz_analysis_block_update_hash(RzAnalysisBlock *block)
RZ_API RzAnalysisBlock * rz_analysis_get_block_at(RzAnalysis *analysis, ut64 addr)
RZ_API bool rz_analysis_block_recurse_followthrough(RzAnalysisBlock *block, RzAnalysisBlockCb cb, void *user)
RZ_API ut64 rz_analysis_block_get_op_addr(RzAnalysisBlock *block, size_t i)
RZ_API void rz_analysis_block_unref(RzAnalysisBlock *bb)
RZ_API RzList * rz_analysis_get_blocks_in(RzAnalysis *analysis, ut64 addr)
RZ_API RzAnalysisBlock * rz_analysis_create_block(RzAnalysis *analysis, ut64 addr, ut64 size)
RZ_API RzList * rz_analysis_get_blocks_intersect(RzAnalysis *analysis, ut64 addr, ut64 size)
RZ_API RzAnalysisBlock * rz_analysis_block_split(RzAnalysisBlock *bbi, ut64 addr)
RZ_API bool rz_analysis_block_recurse(RzAnalysisBlock *block, RzAnalysisBlockCb cb, void *user)
RZ_API bool rz_analysis_block_successor_addrs_foreach(RzAnalysisBlock *block, RzAnalysisAddrCb cb, void *user)
RZ_API ut16 rz_analysis_block_get_op_offset(RzAnalysisBlock *block, size_t i)
RZ_API void rz_analysis_block_analyze_ops(RzAnalysisBlock *block)
RZ_API bool rz_analysis_block_op_starts_at(RzAnalysisBlock *bb, ut64 addr)
RZ_API void rz_analysis_block_automerge(RzList *blocks)
RZ_API RZ_OWN RzType * rz_type_parse_string_declaration_single(RzTypeParser *parser, const char *code, char **error_msg)
Parses the single C type declaration.
RZ_API RzAnalysisCond * rz_analysis_cond_new_from_op(RzAnalysisOp *op)
RZ_API void rz_analysis_cond_free(RzAnalysisCond *c)
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
size_t map(int syms, int left, int len)
#define MAX_FLG_NAME_SIZE
RZ_API RzAnalysisBlock * rz_analysis_fcn_bbget_at(RzAnalysis *analysis, RzAnalysisFunction *fcn, ut64 addr)
#define JMPTBL_LEA_SEARCH_SZ
RZ_API RZ_OWN RzPVector * rz_analysis_function_args(RzAnalysis *a, RzAnalysisFunction *fcn)
Returns vector of all function arguments.
static void free_leaddr_pair(void *pair)
static ut64 try_get_cmpval_from_parents(RzAnalysis *analysis, RzAnalysisFunction *fcn, RzAnalysisBlock *my_bb, const char *cmp_reg)
RZ_API bool rz_analysis_function_derive_args(RzAnalysis *analysis, RzAnalysisFunction *f, RzCallable **callable)
Sets the RzCallable args for the given function.
RZ_API void rz_analysis_fcn_invalidate_read_ahead_cache(void)
static void check_purity(HtUP *ht, RzAnalysisFunction *fcn)
RZ_API RzAnalysisFunction * rz_analysis_fcn_next(RzAnalysis *analysis, ut64 addr)
RZ_API RZ_OWN RzCallable * rz_analysis_function_clone_type(RzAnalysis *analysis, const RzAnalysisFunction *f)
Clones the RzCallable type for the given function.
static RzAnalysisBlock * fcn_append_basic_block(RzAnalysis *analysis, RzAnalysisFunction *fcn, ut64 addr)
static void fcn_takeover_block_recursive(RzAnalysisFunction *fcn, RzAnalysisBlock *start_block)
static void set_bb_branches(RZ_OUT RzAnalysisBlock *bb, const ut64 jump, const ut64 fail)
RZ_API RZ_OWN RzCallable * rz_analysis_function_create_type(RzAnalysis *analysis, RzAnalysisFunction *f)
Creates the RzCallable type for the given function.
RZ_API int rz_analysis_function_resize(RzAnalysisFunction *fcn, int newsize)
static RzAnalysisBBEndCause run_basic_block_analysis(RzAnalysisTaskItem *item, RzVector *tasks)
Analyses the given task item item for branches.
static int analyze_function_locally(RzAnalysis *analysis, RzAnalysisFunction *fcn, ut64 address)
RZ_API int rz_analysis_run_tasks(RZ_NONNULL RzVector *tasks)
Runs analysis on the task items.
static void update_varz_analysisysis(RzAnalysisFunction *fcn, int align, ut64 from, ut64 to)
static bool analize_addr_cb(ut64 addr, void *user)
RZ_API int rz_analysis_fcn_del(RzAnalysis *a, ut64 addr)
static void __analysis_fcn_check_bp_use(RzAnalysis *analysis, RzAnalysisFunction *fcn)
static void calc_reachable_and_remove_block(RzList *fcns, RzAnalysisFunction *fcn, RzAnalysisBlock *bb, HtUP *reachable)
static bool purity_checked(HtUP *ht, RzAnalysisFunction *fcn)
static bool mark_as_visited(RzAnalysisBlock *bb, void *user)
RZ_API ut32 rz_analysis_function_cost(RzAnalysisFunction *fcn)
RZ_API int rz_analysis_function_loops(RzAnalysisFunction *fcn)
RZ_DEPRECATE RZ_API RzAnalysisFunction * rz_analysis_get_fcn_in(RzAnalysis *analysis, ut64 addr, int type)
RZ_API bool rz_analysis_function_purity(RzAnalysisFunction *fcn)
static bool isInvalidMemory(RzAnalysis *analysis, const ut8 *buf, int len)
RZ_API char * rz_analysis_function_get_json(RzAnalysisFunction *function)
RZ_API void rz_analysis_function_derive_return_type(RzAnalysisFunction *f, RzCallable **callable)
Sets the RzCallable return type for the given function.
RZ_API RzAnalysisFunction * rz_analysis_get_function_byname(RzAnalysis *a, const char *name)
static bool op_is_set_bp(RzAnalysisOp *op, const char *bp_reg, const char *sp_reg)
static bool is_delta_pointer_table(RzAnalysis *analysis, ut64 addr, ut64 lea_ptr, ut64 *jmptbl_addr, ut64 *casetbl_addr, RzAnalysisOp *jmp_aop)
RZ_API bool rz_analysis_task_item_new(RZ_NONNULL RzAnalysis *analysis, RZ_NONNULL RzVector *tasks, RZ_NONNULL RzAnalysisFunction *fcn, RZ_NULLABLE RzAnalysisBlock *block, ut64 address)
Adds a new task item to the tasks parameter.
RZ_API bool rz_analysis_fcn_add_bb(RzAnalysis *a, RzAnalysisFunction *fcn, ut64 addr, ut64 size, ut64 jump, ut64 fail, RZ_BORROW RzAnalysisDiff *diff)
static bool isSymbolNextInstruction(RzAnalysis *analysis, RzAnalysisOp *op)
RZ_DEPRECATE RZ_API RzAnalysisFunction * rz_analysis_get_fcn_in_bounds(RzAnalysis *analysis, ut64 addr, int type)
RZ_API int rz_analysis_function_count_edges(const RzAnalysisFunction *fcn, RZ_NULLABLE int *ebbs)
static RzAnalysisBlock * bbget(RzAnalysis *analysis, ut64 addr, bool jumpmid)
RZ_API bool rz_analysis_function_set_type_str(RzAnalysis *a, RZ_NONNULL RzAnalysisFunction *f, RZ_NONNULL const char *sig)
Parses the function type and sets it for the given function.
static bool analize_descendents(RzAnalysisBlock *bb, void *user)
static void analyze_retpoline(RzAnalysis *analysis, RzAnalysisOp *op)
static void free_ht_up(HtUPKv *kv)
RZ_API int rz_analysis_fcn_count(RzAnalysis *analysis, ut64 from, ut64 to)
static bool fcn_takeover_block_recursive_followthrough_cb(RzAnalysisBlock *block, void *user)
static void clear_bb_vars(RzAnalysisFunction *fcn, RzAnalysisBlock *bb, ut64 from, ut64 to)
RZ_API int rz_analysis_function_get_arg_count(RzAnalysis *analysis, RzAnalysisFunction *f)
Gets the RzCallable's arg count for the given function.
static int skip_hp(RzAnalysis *analysis, RzAnalysisFunction *fcn, RzAnalysisOp *op, RzAnalysisBlock *bb, ut64 addr, char *tmp_buf, int oplen, int un_idx, int *idx)
RZ_API size_t rz_analysis_function_arg_count(RzAnalysis *a, RzAnalysisFunction *fcn)
Returns the argument count of a function.
static int typecmp(const void *a, const void *b)
struct fcn_tree_iter_t FcnTreeIter
RZ_API void rz_analysis_function_update_analysis(RzAnalysisFunction *fcn)
static int read_ahead(RzAnalysis *analysis, ut64 addr, ut8 *buf, int len)
RZ_API void rz_analysis_del_jmprefs(RzAnalysis *analysis, RzAnalysisFunction *fcn)
RZ_API void rz_analysis_update_analysis_range(RzAnalysis *analysis, ut64 addr, int size)
RZ_API const char * rz_analysis_fcntype_tostring(int type)
static bool does_arch_destroys_dst(const char *arch)
RZ_API int rz_analysis_fcn(RzAnalysis *analysis, RzAnalysisFunction *fcn, ut64 addr, ut64 len, int reftype)
RZ_API bool rz_analysis_check_fcn(RzAnalysis *analysis, ut8 *buf, ut16 bufsz, ut64 addr, ut64 low, ut64 high)
RZ_API void rz_analysis_function_check_bp_use(RzAnalysisFunction *fcn)
RZ_API void rz_analysis_trim_jmprefs(RzAnalysis *analysis, RzAnalysisFunction *fcn)
static bool can_affect_bp(RzAnalysis *analysis, RzAnalysisOp *op)
RZ_API RZ_OWN RzCallable * rz_analysis_function_derive_type(RzAnalysis *analysis, RzAnalysisFunction *f)
Derives the RzCallable type for the given function.
RZ_API RzAnalysisBlock * rz_analysis_fcn_bbget_in(const RzAnalysis *analysis, RzAnalysisFunction *fcn, ut64 addr)
RZ_API RZ_OWN RzList * rz_analysis_types_from_fcn(RzAnalysis *analysis, RzAnalysisFunction *fcn)
static const char * retpoline_reg(RzAnalysis *analysis, ut64 addr)
static void update_analysis(RzAnalysis *analysis, RzList *fcns, HtUP *reachable)
static bool regs_exist(RzAnalysisValue *src, RzAnalysisValue *dst)
RZ_API bool rz_analysis_function_set_type(RzAnalysis *a, RZ_NONNULL RzAnalysisFunction *f, RZ_NONNULL RzCallable *callable)
Sets the RzCallable type for the given function.
RZ_API int rz_analysis_fcn_del_locs(RzAnalysis *analysis, ut64 addr)
RZ_API int rz_analysis_function_complexity(RzAnalysisFunction *fcn)
RZ_API RZ_OWN char * rz_analysis_function_get_signature(RZ_NONNULL RzAnalysisFunction *function)
RZ_API char * sdb_fmt(const char *fmt,...)
RZ_API void rz_analysis_hint_set_bits(RzAnalysis *a, ut64 addr, int bits)
RZ_API void Ht_() free(HtName_(Ht) *ht)
RZ_API const KEY_TYPE bool * found
RZ_API bool rz_analysis_walkthrough_arm_jmptbl_style(RZ_NONNULL RzAnalysis *analysis, RZ_NONNULL RzAnalysisFunction *fcn, RZ_NONNULL RzAnalysisBlock *block, RZ_NONNULL RzAnalysisJmpTableParams *params)
Marks for analysis ARM specific jump table cases.
RZ_API bool rz_analysis_get_jmptbl_info(RZ_NONNULL RzAnalysis *analysis, RZ_NONNULL RzAnalysisFunction *fcn, RZ_NONNULL RzAnalysisBlock *block, ut64 jmp_address, RZ_NONNULL RzAnalysisJmpTableParams *params)
Gets some necessary information about a jump table to perform analysis on.
RZ_API bool rz_analysis_walkthrough_jmptbl(RZ_NONNULL RzAnalysis *analysis, RZ_NONNULL RzAnalysisFunction *fcn, RZ_NONNULL RzAnalysisBlock *block, RZ_NONNULL RzAnalysisJmpTableParams *params)
Marks the jump table cases for analysis.
RZ_API bool rz_analysis_get_delta_jmptbl_info(RZ_NONNULL RzAnalysis *analysis, RZ_NONNULL RzAnalysisFunction *fcn, ut64 jmp_address, ut64 lea_address, RZ_NONNULL RzAnalysisJmpTableParams *params)
Gets some necessary information about a jump table to perform analysis on.
RZ_API bool rz_analysis_walkthrough_casetbl(RZ_NONNULL RzAnalysis *analysis, RZ_NONNULL RzAnalysisFunction *fcn, RZ_NONNULL RzAnalysisBlock *block, RZ_NONNULL RzAnalysisJmpTableParams *params)
Marks for analysis jump table cases with a space optimization for multiple cases corresponding to the...
return memset(p, 0, total)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
static void list(RzEgg *egg)
RZ_API RZ_BORROW RzListIter * rz_list_contains(RZ_NONNULL const RzList *list, RZ_NONNULL const void *ptr)
Returns the RzListIter of the given pointer, if found.
RZ_API RZ_OWN RzList * rz_list_uniq(RZ_NONNULL const RzList *list, RZ_NONNULL RzListComparator cmp)
Returns a new RzList which contains only unique values.
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_clone(RZ_NONNULL const RzList *list)
Shallow copies of the list (but doesn't free its elements)
RZ_API RZ_OWN RzList * rz_list_new(void)
Returns a new initialized RzList pointer (free method is not initialized)
RZ_API RZ_BORROW void * rz_list_first(RZ_NONNULL const RzList *list)
Returns the first element of the list.
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 static inc pid
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")
static uint32_t const uint8_t uint32_t uint32_t limit
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 int is_arm(RzBinPEObj *bin)
RZ_API RzRegItem * rz_reg_get(RzReg *reg, const char *name, int type)
RZ_API const char * rz_reg_get_name(RzReg *reg, int role)
RZ_API int rz_reg_get_name_idx(const char *type)
static void repeat(struct parse *, sopno, int, int)
#define RZ_ANALYSIS_ARCHINFO_ALIGN
@ RZ_ANALYSIS_FCN_TYPE_INT
@ RZ_ANALYSIS_FCN_TYPE_SYM
@ RZ_ANALYSIS_FCN_TYPE_IMP
@ RZ_ANALYSIS_FCN_TYPE_LOC
@ RZ_ANALYSIS_FCN_TYPE_NULL
@ RZ_ANALYSIS_FCN_TYPE_ROOT
@ RZ_ANALYSIS_FCN_TYPE_FCN
@ RZ_ANALYSIS_STACK_RESET
@ RZ_ANALYSIS_XREF_TYPE_CODE
@ RZ_ANALYSIS_XREF_TYPE_CALL
@ RZ_ANALYSIS_XREF_TYPE_DATA
@ RZ_ANALYSIS_OP_FAMILY_PRIV
@ RZ_ANALYSIS_OP_PREFIX_HWLOOP_END
@ RZ_ANALYSIS_OP_MASK_BASIC
@ RZ_ANALYSIS_OP_MASK_VAL
@ RZ_ANALYSIS_OP_MASK_OPEX
@ RZ_ANALYSIS_OP_MASK_ESIL
@ RZ_ANALYSIS_OP_MASK_HINT
#define RZ_ANALYSIS_OP_TYPE_MASK
@ RZ_ANALYSIS_VAR_KIND_REG
@ RZ_ANALYSIS_VAR_KIND_SPV
@ RZ_ANALYSIS_VAR_KIND_BPV
@ RZ_ANALYSIS_OP_TYPE_CMP
@ RZ_ANALYSIS_OP_TYPE_SUB
@ RZ_ANALYSIS_OP_TYPE_ICALL
@ RZ_ANALYSIS_OP_TYPE_LOAD
@ RZ_ANALYSIS_OP_TYPE_UNK
@ RZ_ANALYSIS_OP_TYPE_ROL
@ RZ_ANALYSIS_OP_TYPE_JMP
@ RZ_ANALYSIS_OP_TYPE_AND
@ RZ_ANALYSIS_OP_TYPE_SAL
@ RZ_ANALYSIS_OP_TYPE_UPUSH
@ RZ_ANALYSIS_OP_TYPE_RPUSH
@ RZ_ANALYSIS_OP_TYPE_UJMP
@ RZ_ANALYSIS_OP_TYPE_IJMP
@ RZ_ANALYSIS_OP_TYPE_MJMP
@ RZ_ANALYSIS_OP_TYPE_ROR
@ RZ_ANALYSIS_OP_TYPE_SAR
@ RZ_ANALYSIS_OP_TYPE_CMOV
@ RZ_ANALYSIS_OP_TYPE_TRAP
@ RZ_ANALYSIS_OP_TYPE_XCHG
@ RZ_ANALYSIS_OP_TYPE_CCALL
@ RZ_ANALYSIS_OP_TYPE_CALL
@ RZ_ANALYSIS_OP_TYPE_ADD
@ RZ_ANALYSIS_OP_TYPE_REG
@ RZ_ANALYSIS_OP_TYPE_RCJMP
@ RZ_ANALYSIS_OP_TYPE_CRET
@ RZ_ANALYSIS_OP_TYPE_PUSH
@ RZ_ANALYSIS_OP_TYPE_SHR
@ RZ_ANALYSIS_OP_TYPE_IRJMP
@ RZ_ANALYSIS_OP_TYPE_POP
@ RZ_ANALYSIS_OP_TYPE_RJMP
@ RZ_ANALYSIS_OP_TYPE_CJMP
@ RZ_ANALYSIS_OP_TYPE_UCJMP
@ RZ_ANALYSIS_OP_TYPE_MOV
@ RZ_ANALYSIS_OP_TYPE_SHL
@ RZ_ANALYSIS_OP_TYPE_ILL
@ RZ_ANALYSIS_OP_TYPE_UCALL
@ RZ_ANALYSIS_OP_TYPE_NOT
@ RZ_ANALYSIS_OP_TYPE_RET
@ RZ_ANALYSIS_OP_TYPE_NOP
@ RZ_ANALYSIS_OP_TYPE_ACMP
@ RZ_ANALYSIS_OP_TYPE_LEA
@ RZ_ANALYSIS_OP_TYPE_RCALL
@ RZ_ANALYSIS_OP_TYPE_XOR
@ RZ_ANALYSIS_OP_TYPE_MCJMP
@ RZ_ANALYSIS_OP_TYPE_IRCALL
#define rz_warn_if_reached()
#define rz_return_if_fail(expr)
#define rz_return_val_if_fail(expr, val)
static ut32 rz_read_le32(const void *src)
#define RZ_LOG_VERBOSE(fmtstr,...)
#define RZ_LOG_INFO(fmtstr,...)
#define RZ_LOG_DEBUG(fmtstr,...)
#define RZ_LOG_ERROR(fmtstr,...)
RZ_API PJ * pj_kb(PJ *j, const char *k, bool v)
RZ_API char * pj_drain(PJ *j)
RZ_API PJ * pj_k(PJ *j, const char *k)
RZ_API PJ * pj_end(PJ *j)
RZ_API PJ * pj_ks(PJ *j, const char *k, const char *v)
#define RZ_RBTREE_MAX_HEIGHT
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
RZ_API const char * rz_str_bool(int b)
RZ_API char * rz_str_replace(char *str, const char *key, const char *val, int g)
RZ_API bool rz_str_startswith(RZ_NONNULL const char *str, RZ_NONNULL const char *needle)
Checks if a string starts with a specifc sequence of characters (case sensitive)
RZ_API int rz_str_cmp(const char *dst, const char *orig, int len)
RZ_API bool rz_str_endswith(RZ_NONNULL const char *str, RZ_NONNULL const char *needle)
Checks if a string ends with a specifc sequence of characters (case sensitive)
RZ_API char * rz_strbuf_get(RzStrBuf *sb)
RZ_API int rz_sys_usleep(int usecs)
Sleep for usecs microseconds.
@ RZ_TYPE_COND_HI
Unsigned higher Greater than, or unordered.
@ RZ_TYPE_COND_GT
Greater than.
#define UT64_SUB_OVFCHK(a, b)
#define UT64_ADD_OVFCHK(x, y)
RZ_API void rz_vector_pop(RzVector *vec, void *into)
static void ** rz_pvector_reserve(RzPVector *vec, size_t capacity)
static void rz_pvector_set(RzPVector *vec, size_t index, void *e)
static void ** rz_pvector_index_ptr(RzPVector *vec, size_t index)
static size_t rz_pvector_len(const RzPVector *vec)
RZ_API void * rz_vector_push(RzVector *vec, void *x)
RZ_API RzPVector * rz_pvector_new(RzPVectorFree free)
static bool rz_pvector_empty(RzPVector *vec)
#define rz_vector_foreach(vec, it)
static void ** rz_pvector_push(RzPVector *vec, void *x)
RZ_API void rz_vector_fini(RzVector *vec)
RZ_API void rz_pvector_free(RzPVector *vec)
RZ_API RzVector * rz_vector_clone(RzVector *vec)
RZ_API void rz_vector_init(RzVector *vec, size_t elem_size, RzVectorFree free, void *free_user)
static bool rz_vector_empty(const RzVector *vec)
RZ_API void rz_pvector_clear(RzPVector *vec)
#define rz_pvector_foreach(vec, it)
static void ** rz_pvector_insert(RzPVector *vec, size_t index, void *x)
RZ_API SetU * set_u_new(void)
RZ_API void set_u_free(SetU *s)
RZ_API void set_u_add(SetU *s, ut64 u)
RZ_API bool set_u_contains(SetU *s, ut64 u)
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
RBNode * path[RZ_RBTREE_MAX_HEIGHT]
RzAnalysisSwitchOp * switch_op
struct rz_analysis_t * analysis
struct rz_analysis_plugin_t * cur
RzPVector * args
optional for the time being
RzIOIsValidOff is_valid_offset
int offset
Offset into register profile in bits.
char * name[RZ_REG_NAME_LAST]
void after(uv_work_t *req, int status)
static struct Type metas[]
RZ_API RZ_OWN RzCallable * rz_type_callable_clone(RZ_BORROW RZ_NONNULL const RzCallable *callable)
Creates an exact clone of the RzCallable type.
RZ_API RZ_BORROW RzCallable * rz_type_func_get(RzTypeDB *typedb, RZ_NONNULL const char *name)
Returns the RzCallable from the database by name.
RZ_API bool rz_type_callable_arg_add(RZ_NONNULL RzCallable *callable, RZ_OWN RZ_NONNULL RzCallableArg *arg)
Adds a new argument to the RzCallable.
RZ_API RZ_BORROW const char * rz_type_func_args_name(RzTypeDB *typedb, RZ_NONNULL const char *name, int i)
Searches for the RzCallable type in types database and returns argument name.
RZ_API RZ_OWN RzCallable * rz_type_func_new(RzTypeDB *typedb, RZ_NONNULL const char *name, RZ_OWN RZ_NULLABLE RzType *type)
Creates a new RzCallable type.
RZ_API RZ_BORROW RzType * rz_type_func_ret(RzTypeDB *typedb, RZ_NONNULL const char *name)
Searches for the RzCallable type in types database and returns return type.
RZ_API bool rz_type_func_exist(RzTypeDB *typedb, RZ_NONNULL const char *name)
Checks if the RzCallable type exists in the database given the name.
RZ_API RZ_BORROW RzType * rz_type_func_args_type(RzTypeDB *typedb, RZ_NONNULL const char *name, int i)
Searches for the RzCallable type in types database and returns argument type.
RZ_API RZ_OWN RzCallableArg * rz_type_callable_arg_new(RzTypeDB *typedb, RZ_NONNULL const char *name, RZ_OWN RZ_NONNULL RzType *type)
Creates a new RzCallableArg given the name and type.
RZ_API void rz_type_callable_free(RZ_NONNULL RzCallable *callable)
Frees the RzCallable.
RZ_API bool rz_type_func_delete(RzTypeDB *typedb, RZ_NONNULL const char *name)
Removes RzCallable type from the types database.
RZ_API RZ_OWN char * rz_type_callable_as_string(const RzTypeDB *typedb, RZ_NONNULL const RzCallable *callable)
Returns the callable C representation.
RZ_API bool rz_type_func_save(RzTypeDB *typedb, RZ_NONNULL RzCallable *callable)
Stores RzCallable type in the types database.
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 bool rz_types_equal(RZ_NONNULL const RzType *type1, RZ_NONNULL const RzType *type2)
Checks if two types are identical.
RZ_API void rz_type_free(RZ_NULLABLE RzType *type)
Frees the RzType.
RZ_API RZ_OWN RzType * rz_type_clone(RZ_BORROW RZ_NONNULL const RzType *type)
Creates an exact clone of the RzType.
RZ_API RZ_OWN char * rz_type_as_string(const RzTypeDB *typedb, RZ_NONNULL const RzType *type)
Returns the type C representation.
static bool arch_destroys_dst(const char *arch)
RZ_API void rz_analysis_function_delete_unused_vars(RzAnalysisFunction *fcn)
RZ_API RZ_BORROW RzAnalysisVar * rz_analysis_function_get_var(RzAnalysisFunction *fcn, char kind, int delta)
RZ_API void rz_analysis_function_delete_all_vars(RzAnalysisFunction *fcn)
RZ_API void rz_analysis_extract_vars(RzAnalysis *analysis, RzAnalysisFunction *fcn, RzAnalysisOp *op)
RZ_API void rz_analysis_var_set_access(RzAnalysisVar *var, const char *reg, ut64 access_addr, int access_type, st64 stackptr)
RZ_API void rz_analysis_var_remove_access_at(RzAnalysisVar *var, ut64 address)
RZ_API RZ_BORROW RzPVector * rz_analysis_function_get_vars_used_at(RzAnalysisFunction *fcn, ut64 op_addr)
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)
RZ_DEPRECATE RZ_API RzList * rz_analysis_var_all_list(RzAnalysis *analysis, RzAnalysisFunction *fcn)
RZ_API int rz_analysis_var_get_argnum(RzAnalysisVar *var)
RZ_API RzAnalysisVarAccess * rz_analysis_var_get_access_at(RzAnalysisVar *var, ut64 addr)
RZ_API void rz_analysis_function_delete_var(RzAnalysisFunction *fcn, RzAnalysisVar *var)
if(dbg->bits==RZ_SYS_BITS_64)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
RZ_API bool rz_analysis_xrefs_set(RzAnalysis *analysis, ut64 from, ut64 to, RzAnalysisXRefType type)
RZ_API bool rz_analysis_xrefs_deln(RzAnalysis *analysis, ut64 from, ut64 to, RzAnalysisXRefType type)
RZ_API RzList * rz_analysis_function_get_xrefs_from(RzAnalysisFunction *fcn)