68 pj_ks(j,
"type",
"m");
71 pj_ks(j,
"type",
"u");
75 pj_kn(j,
"addr", diff->addr);
77 if (diff->dist != 0.0) {
78 pj_kd(j,
"dist", diff->dist);
81 pj_ks(j,
"name", diff->name);
127 if (strcmp(child->str_value,
"m") == 0) {
128 diff->type = RZ_ANALYSIS_DIFF_TYPE_MATCH;
129 }
else if (strcmp(child->str_value,
"u") == 0) {
130 diff->type = RZ_ANALYSIS_DIFF_TYPE_UNMATCH;
137 diff->
addr = child->num.u_value;
141 diff->dist = child->num.u_value;
143 diff->dist = child->num.dbl_value;
157 diff->
size = child->num.u_value;
183 rz_list_foreach (
op->cases, it, cop) {
199 for (child = json->
children.first; child; child = child->
next) {
201 if (strcmp(child->
key,
"addr") == 0) {
202 sop->addr = child->
num.u_value;
203 }
else if (strcmp(child->
key,
"min") == 0) {
204 sop->min_val = child->
num.u_value;
205 }
else if (strcmp(child->
key,
"max") == 0) {
206 sop->max_val = child->
num.u_value;
207 }
else if (strcmp(child->
key,
"def") == 0) {
208 sop->def_val = child->
num.u_value;
212 for (obj = child->
children.first; obj; obj = obj->
next) {
220 for (cases = obj->
children.first; cases; cases = cases->
next) {
224 if (strcmp(cases->
key,
"addr") == 0) {
226 }
else if (strcmp(cases->
key,
"jump") == 0) {
228 }
else if (strcmp(cases->
key,
"value") == 0) {
254 pj_kb(j,
"traced",
true);
262 pj_ks(j,
"fingerprint", b64);
274 pj_k(j,
"switch_op");
285 for (
i = 0;
i < block->
ninstr - 1;
i++) {
367 case BLOCK_FIELD_SIZE:
368 if (child->type != RZ_JSON_INTEGER) {
371 proto.
size = child->num.u_value;
377 proto.
jump = child->num.u_value;
383 proto.
fail = child->num.u_value;
389 proto.
traced = child->num.u_value;
398 if (child->type != RZ_JSON_STRING) {
402 free(proto.fingerprint);
403 proto.fingerprint = NULL;
405 fingerprint_size = strlen(child->str_value);
406 if (!fingerprint_size) {
417 fingerprint_size = 0;
418 }
else if (decsz < fingerprint_size) {
422 fingerprint_size = decsz;
439 proto.ninstr = (
int)child->num.s_value;
449 proto.op_pos =
calloc(child->children.count,
sizeof(
ut16));
450 proto.op_pos_size = 0;
452 for (baby = child->children.first; baby; baby = baby->
next) {
456 proto.op_pos_size = 0;
459 proto.op_pos[proto.op_pos_size++] = (
ut16)baby->
num.u_value;
467 proto.stackptr = (
int)child->num.s_value;
473 proto.parent_stackptr = (
int)child->num.s_value;
479 proto.cmpval = child->num.u_value;
495 if (errno || proto.size ==
UT64_MAX || (fingerprint_size !=
SIZE_MAX && fingerprint_size != proto.size) || (proto.op_pos && proto.op_pos_size != proto.ninstr - 1)) {
503 block->
jump = proto.jump;
504 block->
fail = proto.fail;
505 block->
traced = proto.traced;
508 block->
diff = proto.diff;
510 block->
ninstr = proto.ninstr;
513 block->
op_pos = proto.op_pos;
518 block->
cmpval = proto.cmpval;
519 block->
cmpreg = proto.cmpreg;
523 free(proto.fingerprint);
562 RZ_LOG_ERROR(
"Variable \"%s\" has undefined type\n", var->name);
566 pj_ks(j,
"name", var->name);
568 pj_ks(j,
"type", vartype);
572 pj_ks(j,
"kind",
"r");
575 pj_ks(j,
"kind",
"s");
578 pj_ks(j,
"kind",
"b");
582 pj_kN(j,
"delta", var->delta);
585 pj_ks(j,
"reg", var->regname);
588 pj_kb(j,
"arg",
true);
591 pj_ks(j,
"cmt", var->comment);
601 pj_ks(j,
"type",
"r");
604 pj_ks(j,
"type",
"w");
607 pj_ks(j,
"type",
"rw");
677 const char *comment =
NULL;
690 name = child->str_value;
696 type = child->str_value;
699 if (child->type !=
RZ_JSON_STRING || !*child->str_value || child->str_value[1]) {
703 switch (*child->str_value) {
705 kind = RZ_ANALYSIS_VAR_KIND_REG;
708 kind = RZ_ANALYSIS_VAR_KIND_SPV;
711 kind = RZ_ANALYSIS_VAR_KIND_BPV;
721 arg = child->num.u_value ?
true :
false;
727 delta = child->num.s_value;
739 comment = child->str_value;
742 if (child->type != RZ_JSON_ARRAY) {
746 for (baby = child->
children.first; baby; baby = baby->
next) {
747 if (baby->type != RZ_JSON_OBJECT) {
759 const char *acctype_str = typev->
str_value;
771 if (acctype_str[0] ==
'r') {
772 if (acctype_str[1] ==
'w') {
774 }
else if (!acctype_str[1]) {
779 }
else if (acctype_str[0] ==
'w' && !acctype_str[1]) {
786 acc->
offset = offv->num.s_value;
788 acc->
stackptr = spv ? spv->num.s_value : 0;
789 acc->
reg = regv->str_value;
798 for (baby = child->children.first; baby; baby = baby->
next) {
808 constr.
val = sibling->
num.u_value;
835 char *error_msg =
NULL;
849 ret->comment =
strdup(comment);
889 pj_ks(j,
"type", vartype);
951 const char *addr_s =
NULL;
959 case GLOBAL_VAR_FIELD_NAME:
960 if (child->type != RZ_JSON_STRING) {
963 name = child->str_value;
969 addr_s = child->str_value;
975 type = child->str_value;
978 if (child->type != RZ_JSON_ARRAY) {
982 for (baby = child->
children.first; baby; baby = baby->
next) {
983 if (baby->type != RZ_JSON_INTEGER) {
992 constr.val = sibling->num.u_value;
1009 char *error_msg =
NULL;
1037 .analysis = analysis,
1067 pj_ks(j,
"name", function->name);
1068 if (function->bits) {
1069 pj_ki(j,
"bits", function->bits);
1071 pj_ki(j,
"type", function->type);
1073 pj_ks(j,
"cc", function->cc);
1075 pj_ki(j,
"stack", function->stack);
1076 pj_ki(j,
"maxstack", function->maxstack);
1077 pj_ki(j,
"ninstr", function->ninstr);
1078 if (function->bp_frame) {
1079 pj_kb(j,
"bp_frame",
true);
1081 if (function->bp_off) {
1082 pj_kN(j,
"bp_off", function->bp_off);
1084 if (function->is_pure) {
1085 pj_kb(j,
"pure",
true);
1087 if (function->is_noreturn) {
1088 pj_kb(j,
"noreturn",
true);
1090 if (function->fingerprint) {
1093 pj_ks(j,
"fingerprint", b64);
1097 if (function->diff) {
1105 rz_list_foreach (function->bbs, it, block) {
1110 if (!rz_list_empty(function->imports)) {
1111 pj_ka(j,
"imports");
1113 rz_list_foreach (function->imports, it,
import) {
1129 if (function->labels->count) {
1145 rz_list_foreach (analysis->fcns, it,
function) {
1194 function->bp_frame =
false;
1195 function->bp_off = 0;
1196 bool noreturn =
false;
1199 case FUNCTION_FIELD_NAME:
1200 if (child->type != RZ_JSON_STRING) {
1203 if (function->name) {
1204 free(function->name);
1206 function->name =
strdup(child->str_value);
1212 function->bits = (
int)child->num.s_value;
1218 function->type = (
int)child->num.s_value;
1230 function->stack = (
int)child->num.s_value;
1236 function->maxstack = (
int)child->num.s_value;
1242 function->ninstr = (
int)child->num.s_value;
1248 function->is_pure = child->num.u_value ?
true :
false;
1254 function->bp_frame = child->num.u_value ?
true :
false;
1260 function->bp_off = child->num.s_value;
1266 noreturn = child->num.u_value ?
true :
false;
1272 if (function->fingerprint) {
1273 free(function->fingerprint);
1274 function->fingerprint = NULL;
1276 function->fingerprint_size = strlen(child->str_value);
1277 if (!function->fingerprint_size) {
1280 function->fingerprint =
malloc(function->fingerprint_size);
1281 if (!function->fingerprint) {
1282 function->fingerprint_size = 0;
1285 int decsz =
rz_base64_decode(function->fingerprint, child->str_value, function->fingerprint_size);
1287 free(function->fingerprint);
1288 function->fingerprint =
NULL;
1289 function->fingerprint_size = 0;
1290 }
else if (decsz < function->fingerprint_size) {
1291 ut8 *
n =
realloc(function->fingerprint, (
size_t)decsz);
1293 free(function->fingerprint);
1294 function->fingerprint =
NULL;
1295 function->fingerprint_size = 0;
1297 function->fingerprint =
n;
1298 function->fingerprint_size = (
size_t)decsz;
1310 for (baby = child->
children.first; baby; baby = baby->
next) {
1327 for (baby = child->
children.first; baby; baby = baby->
next) {
1335 if (!function->imports) {
1337 if (!function->imports) {
1358 for (baby = child->
children.first; baby; baby = baby->
next) {
1372 function->addr = strtoull(
k,
NULL, 0);
1378 function->is_noreturn = noreturn;
1382 for (baby = vars_json->children.first; baby; baby = baby->
next) {
1395 .analysis = analysis,
1397 .diff_parser = diff_parser,
1401 if (!
ctx.parser || !
ctx.var_parser) {
1448 char type[2] = { xref->
type,
'\0' };
1465 HtUP *ht = (HtUP *)
v;
1497 for (child = json->
children.first; child; child = child->
next) {
1566 if (snprintf(key, sizeof(key), "0x%" PFMT64x, addr) >= 0) { \
1567 sdb_set(db, key, pj_string(j), 0); \
1578 }
else if (!
count) {
1585 ut64 size = rz_meta_node_size(node);
1589 char type_str[2] = { 0 };
1590 switch (meta->
type) {
1621 pj_ks(j,
"type", type_str);
1660 for (child = json->
children.first; child; child = child->
next) {
1669 const char *space_name =
NULL;
1672 for (baby = child->
children.first; baby; baby = baby->
next) {
1673 if (!strcmp(baby->
key,
"size")) {
1679 if (!strcmp(baby->
key,
"type")) {
1716 if (!strcmp(baby->
key,
"str")) {
1722 if (!strcmp(baby->
key,
"subtype")) {
1724 subtype = (
int)baby->
num.s_value;
1728 if (!strcmp(baby->
key,
"space")) {
1770 Sdb *spaces_db =
sdb_ns(db,
"spaces",
false);
1806 ht_up_insert(acc,
addr,
h);
1815 h->addr_hints = records;
1860 pj_ki(j,
"bits",
h->bits);
1862 if (
h->addr_hints) {
1909 pj_kb(j,
"high",
true);
1979 case HINTS_FIELD_ARCH:
1980 rz_analysis_hint_set_arch(analysis, addr, child->type == RZ_JSON_STRING ? child->str_value : NULL);
1982 case HINTS_FIELD_BITS:
1983 rz_analysis_hint_set_bits(analysis, addr, child->type == RZ_JSON_INTEGER ? (int)child->num.s_value : 0);
1985 case HINTS_FIELD_IMMBASE:
1986 if (child->type != RZ_JSON_INTEGER) {
2093 .analysis = analysis,
2130 sdb_copy(analysis->sdb_classes, db);
2134 if (!
sdb_ns(db,
"attrs",
false)) {
2140 sdb_copy(db, analysis->sdb_classes);
2171 rz_list_foreach (analysis->imports, it, imp) {
2220 #define SUB(ns, call) RZ_SERIALIZE_SUB_DO(db, subdb, res, ns, call, goto beach;)
2242 if (block->
ref <= 1) {
RZ_API void rz_analysis_diff_free(RzAnalysisDiff *diff)
RZ_API RZ_OWN RzAnalysisDiff * rz_analysis_diff_new(void)
RZ_API void rz_analysis_function_add_block(RzAnalysisFunction *fcn, RzAnalysisBlock *bb)
RZ_API bool rz_analysis_add_function(RzAnalysis *analysis, RzAnalysisFunction *fcn)
RZ_API RzAnalysisFunction * rz_analysis_function_new(RzAnalysis *analysis)
RZ_API void rz_analysis_function_free(void *_fcn)
RZ_API void rz_analysis_add_import(RzAnalysis *analysis, const char *imp)
RZ_API void rz_analysis_purge(RzAnalysis *analysis)
int bits(struct state *s, int need)
RZ_API RzAnalysisBlock * rz_analysis_get_block_at(RzAnalysis *analysis, ut64 addr)
RZ_API void rz_analysis_block_unref(RzAnalysisBlock *bb)
RZ_API RzAnalysisBlock * rz_analysis_create_block(RzAnalysis *analysis, ut64 addr, ut64 size)
RZ_API RZ_OWN RzType * rz_type_parse_string_single(RzTypeParser *parser, const char *code, char **error_msg)
Parses the single C type definition.
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
RZ_API void rz_analysis_hint_set_val(RzAnalysis *a, ut64 addr, ut64 v)
RZ_API void rz_analysis_hint_set_nword(RzAnalysis *a, ut64 addr, int nword)
RZ_API void rz_analysis_hint_set_newbits(RzAnalysis *a, ut64 addr, int bits)
RZ_API void rz_analysis_hint_set_high(RzAnalysis *a, ut64 addr)
RZ_API void rz_analysis_addr_hints_foreach(RzAnalysis *analysis, RzAnalysisAddrHintRecordsCb cb, void *user)
RZ_API void rz_analysis_hint_set_stackframe(RzAnalysis *a, ut64 addr, ut64 size)
RZ_API void rz_analysis_hint_set_ret(RzAnalysis *a, ut64 addr, ut64 val)
RZ_API void rz_analysis_hint_set_jump(RzAnalysis *a, ut64 addr, ut64 jump)
RZ_API void rz_analysis_hint_set_opcode(RzAnalysis *a, ut64 addr, const char *opcode)
RZ_API void rz_analysis_arch_hints_foreach(RzAnalysis *analysis, RzAnalysisArchHintCb cb, void *user)
RZ_API void rz_analysis_hint_set_syntax(RzAnalysis *a, ut64 addr, const char *syn)
RZ_API void rz_analysis_bits_hints_foreach(RzAnalysis *analysis, RzAnalysisBitsHintCb cb, void *user)
RZ_API void rz_analysis_hint_set_fail(RzAnalysis *a, ut64 addr, ut64 fail)
RZ_API void rz_analysis_hint_set_esil(RzAnalysis *a, ut64 addr, const char *esil)
RZ_API void rz_analysis_hint_set_offset(RzAnalysis *a, ut64 addr, const char *typeoff)
RZ_API void rz_analysis_hint_set_immbase(RzAnalysis *a, ut64 addr, int base)
RZ_API void rz_analysis_hint_set_type(RzAnalysis *a, ut64 addr, int type)
RZ_API void rz_analysis_hint_set_pointer(RzAnalysis *a, ut64 addr, ut64 ptr)
RZ_API void rz_analysis_hint_set_size(RzAnalysis *a, ut64 addr, ut64 size)
RZ_API void Ht_() free(HtName_(Ht) *ht)
RZ_API bool rz_analysis_function_set_label(RzAnalysisFunction *fcn, const char *name, ut64 addr)
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
RZ_API RZ_BORROW RzListIter * rz_list_push(RZ_NONNULL RzList *list, void *item)
Alias for rz_list_append.
void * realloc(void *ptr, size_t size)
void * malloc(size_t size)
void * calloc(size_t number, size_t size)
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")
RZ_API Sdb * sdb_ns(Sdb *s, const char *name, int create)
RZ_API RzRegItem * rz_reg_get(RzReg *reg, const char *name, int type)
@ RZ_ANALYSIS_DIFF_TYPE_MATCH
@ RZ_ANALYSIS_DIFF_TYPE_UNMATCH
@ RZ_ANALYSIS_XREF_TYPE_CODE
@ RZ_ANALYSIS_XREF_TYPE_NULL
@ RZ_ANALYSIS_XREF_TYPE_STRING
@ RZ_ANALYSIS_XREF_TYPE_CALL
@ RZ_ANALYSIS_XREF_TYPE_DATA
@ RZ_ANALYSIS_ADDR_HINT_TYPE_SYNTAX
@ RZ_ANALYSIS_ADDR_HINT_TYPE_PTR
@ RZ_ANALYSIS_ADDR_HINT_TYPE_SIZE
@ RZ_ANALYSIS_ADDR_HINT_TYPE_STACKFRAME
@ RZ_ANALYSIS_ADDR_HINT_TYPE_HIGH
@ RZ_ANALYSIS_ADDR_HINT_TYPE_ESIL
@ RZ_ANALYSIS_ADDR_HINT_TYPE_NEW_BITS
@ RZ_ANALYSIS_ADDR_HINT_TYPE_TYPE_OFFSET
@ RZ_ANALYSIS_ADDR_HINT_TYPE_JUMP
@ RZ_ANALYSIS_ADDR_HINT_TYPE_OPTYPE
@ RZ_ANALYSIS_ADDR_HINT_TYPE_RET
@ RZ_ANALYSIS_ADDR_HINT_TYPE_IMMBASE
@ RZ_ANALYSIS_ADDR_HINT_TYPE_NWORD
@ RZ_ANALYSIS_ADDR_HINT_TYPE_FAIL
@ RZ_ANALYSIS_ADDR_HINT_TYPE_OPCODE
@ RZ_ANALYSIS_ADDR_HINT_TYPE_VAL
@ RZ_ANALYSIS_VAR_ACCESS_TYPE_READ
@ RZ_ANALYSIS_VAR_ACCESS_TYPE_WRITE
@ RZ_ANALYSIS_VAR_KIND_REG
@ RZ_ANALYSIS_VAR_KIND_SPV
@ RZ_ANALYSIS_VAR_KIND_BPV
#define rz_warn_if_reached()
#define rz_return_if_fail(expr)
RZ_API char * rz_base64_encode_dyn(const ut8 *bin, size_t sz)
RZ_API int rz_base64_decode(ut8 *bout, const char *bin, int len)
static bool rz_interval_tree_empty(RzIntervalTree *tree)
static RzIntervalNode * rz_interval_tree_iter_get(RzIntervalTreeIter *it)
RZ_API bool rz_interval_tree_insert(RzIntervalTree *tree, ut64 start, ut64 end, void *data)
#define rz_interval_tree_foreach(tree, it, dat)
RZ_API const RzJson * rz_json_get(const RzJson *json, const char *key)
RZ_API RzJson * rz_json_parse(char *text)
RZ_API void rz_json_free(RzJson *js)
void(* RzListFree)(void *ptr)
#define RZ_LOG_ERROR(fmtstr,...)
RZ_API ut64 rz_num_math(RzNum *num, const char *str)
RZ_API PJ * pj_ko(PJ *j, const char *k)
RZ_API PJ * pj_ka(PJ *j, const char *k)
RZ_API PJ * pj_kb(PJ *j, const char *k, bool v)
RZ_API PJ * pj_ki(PJ *j, const char *k, int d)
RZ_API PJ * pj_k(PJ *j, const char *k)
RZ_API PJ * pj_end(PJ *j)
RZ_API const char * pj_string(PJ *pj)
RZ_API PJ * pj_i(PJ *j, int d)
RZ_API void pj_free(PJ *j)
RZ_API PJ * pj_null(PJ *j)
RZ_API PJ * pj_s(PJ *j, const char *k)
RZ_API PJ * pj_ks(PJ *j, const char *k, const char *v)
RZ_API PJ * pj_n(PJ *j, ut64 n)
RZ_API PJ * pj_kn(PJ *j, const char *k, ut64 n)
RZ_API PJ * pj_kd(PJ *j, const char *k, double d)
RZ_API void pj_reset(PJ *j)
RZ_API PJ * pj_kN(PJ *j, const char *k, st64 n)
#define rz_rbtree_foreach(root, it, data, struc, rb)
static void rz_key_parser_add(RzKeyParser *parser, const char *key, int val)
HtPP RzKeyParser
Hashtable-based key parser to prevent strcmp chains.
static RzKeyParser * rz_key_parser_new(void)
#define RZ_SERIALIZE_ERR(res,...)
Push an error to the local RzSerializeResultInfo \res RzSerializeInfoResult *.
#define RZ_KEY_PARSER_JSON(parser, json, child, body)
Iterate over all keys in a json object and call RZ_KEY_PARSER_SWITCH on each.
static void rz_key_parser_free(RzKeyParser *parser)
RZ_API RzSpace * rz_spaces_get(RzSpaces *sp, const char *name)
RZ_API bool rz_serialize_spaces_load(RZ_NONNULL Sdb *db, RZ_NONNULL RzSpaces *spaces, bool load_name, RZ_NULLABLE RzSerializeResultInfo *res)
RZ_API void rz_serialize_spaces_save(RZ_NONNULL Sdb *db, RZ_NONNULL RzSpaces *spaces)
#define rz_strf(buf,...)
Convenience macro for local temporary strings.
RZ_API const char * rz_str_constpool_get(RzStrConstPool *pool, const char *str)
RZ_API char * rz_strbuf_get(RzStrBuf *sb)
RZ_API const char * rz_strbuf_setf(RzStrBuf *sb, const char *fmt,...) RZ_PRINTF_CHECK(2
RZ_API void rz_strbuf_fini(RzStrBuf *sb)
RZ_API void rz_strbuf_init(RzStrBuf *sb)
RzTypeCond
Type Conditions.
@ RZ_TYPE_COND_LS
Unsigned lower or same Less than or equal.
@ RZ_TYPE_COND_AL
Always executed (no condition)
RZ_API void rz_pvector_init(RzPVector *vec, RzPVectorFree free)
RZ_API void * rz_vector_push(RzVector *vec, void *x)
void(* RzPVectorFree)(void *e)
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_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)
RZ_API int sdb_set(Sdb *s, const char *key, const char *val, ut32 cas)
RZ_API void sdb_reset(Sdb *s)
RZ_API void sdb_copy(Sdb *src, Sdb *dst)
RZ_API bool sdb_foreach(Sdb *s, SdbForeachCallback cb, void *user)
RZ_API bool rz_serialize_analysis_load(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis, RZ_NULLABLE RzSerializeResultInfo *res)
RZ_API RZ_NULLABLE RzAnalysisVar * rz_serialize_analysis_var_load(RZ_NONNULL RzAnalysisFunction *fcn, RZ_NONNULL RzSerializeAnalVarParser parser, RZ_NONNULL const RzJson *json)
RZ_API void rz_serialize_analysis_case_op_save(RZ_NONNULL PJ *j, RZ_NONNULL RzAnalysisCaseOp *op)
static void function_store(RZ_NONNULL Sdb *db, const char *key, RzAnalysisFunction *function)
RZ_API bool rz_serialize_analysis_hints_load(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis, RZ_NULLABLE RzSerializeResultInfo *res)
static void block_store(RZ_NONNULL Sdb *db, const char *key, RzAnalysisBlock *block)
RZ_API bool rz_serialize_analysis_cc_load(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis, RZ_NULLABLE RzSerializeResultInfo *res)
static bool hints_load_cb(void *user, const char *k, const char *v)
RZ_API void rz_serialize_analysis_imports_save(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis)
RZ_API RzAnalysisSwitchOp * rz_serialize_analysis_switch_op_load(RZ_NONNULL const RzJson *json)
RZ_API bool rz_serialize_analysis_blocks_load(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis, RzSerializeAnalDiffParser diff_parser, RZ_NULLABLE RzSerializeResultInfo *res)
RZ_API bool rz_serialize_analysis_imports_load(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis, RZ_NULLABLE RzSerializeResultInfo *res)
RZ_API void rz_serialize_analysis_diff_save(RZ_NONNULL PJ *j, RZ_NONNULL RzAnalysisDiff *diff)
RZ_API void rz_serialize_analysis_hints_save(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis)
static bool store_xrefs_list_cb(void *db, const ut64 k, const void *v)
static bool global_var_load_cb(void *user, const char *k, const char *v)
RZ_API bool rz_serialize_analysis_global_var_load(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis, RZ_NULLABLE RzSerializeResultInfo *res)
RZ_API void rz_serialize_analysis_global_var_save(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *anal)
@ HINTS_FIELD_TYPE_OFFSET
static bool function_load_cb(void *user, const char *k, const char *v)
static bool bits_hint_acc_cb(ut64 addr, int bits, void *user)
RZ_API void rz_serialize_analysis_typelinks_save(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis)
RZ_API void rz_serialize_analysis_switch_op_save(RZ_NONNULL PJ *j, RZ_NONNULL RzAnalysisSwitchOp *op)
RZ_API void rz_serialize_analysis_classes_save(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis)
RZ_API void rz_serialize_analysis_function_noreturn_save(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis)
RZ_API RzSerializeAnalDiffParser rz_serialize_analysis_diff_parser_new(void)
RZ_API RZ_NULLABLE RzAnalysisDiff * rz_serialize_analysis_diff_load(RZ_NONNULL RzSerializeAnalDiffParser parser, RZ_NONNULL const RzJson *json)
static HintsAtAddr * hints_at_addr(HtUP *acc, ut64 addr)
RZ_API RzSerializeAnalVarParser rz_serialize_analysis_var_parser_new(void)
static bool block_load_cb(void *user, const char *k, const char *v)
RZ_API void rz_serialize_analysis_functions_save(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis)
RZ_API void rz_serialize_analysis_save(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis)
RZ_API void rz_serialize_analysis_var_parser_free(RzSerializeAnalVarParser parser)
@ GLOBAL_VAR_FIELD_CONSTRS
RZ_API RzSerializeAnalGlobalVarParser rz_serialize_analysis_global_var_parser_new(void)
RZ_API void rz_serialize_analysis_var_save(RZ_NONNULL PJ *j, RZ_NONNULL RzAnalysisVar *var)
RZ_API void rz_serialize_analysis_callables_save(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis)
static bool addr_hint_acc_cb(ut64 addr, const RzVector *records, void *user)
RZ_API bool rz_serialize_analysis_classes_load(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis, RZ_NULLABLE RzSerializeResultInfo *res)
static bool arch_hint_acc_cb(ut64 addr, RZ_NULLABLE const char *arch, void *user)
@ BLOCK_FIELD_PARENT_STACKPTR
@ BLOCK_FIELD_FINGERPRINT
RZ_API bool rz_serialize_analysis_types_load(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis, RZ_NULLABLE RzSerializeResultInfo *res)
RZ_API void rz_serialize_analysis_diff_parser_free(RzSerializeAnalDiffParser parser)
RZ_API bool rz_serialize_analysis_callables_load(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis, RZ_NULLABLE RzSerializeResultInfo *res)
RZ_API void rz_serialize_analysis_types_save(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis)
RZ_API bool rz_serialize_analysis_typelinks_load(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis, RZ_NULLABLE RzSerializeResultInfo *res)
RZ_API bool rz_serialize_analysis_xrefs_load(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis, RZ_NULLABLE RzSerializeResultInfo *res)
static bool store_label_cb(void *j, const ut64 k, const void *v)
RZ_API void rz_serialize_analysis_global_var_parser_free(RzSerializeAnalGlobalVarParser parser)
@ FUNCTION_FIELD_MAXSTACK
@ FUNCTION_FIELD_NORETURN
@ FUNCTION_FIELD_BP_FRAME
@ FUNCTION_FIELD_FINGERPRINT
static bool import_load_cb(void *user, const char *k, const char *v)
RZ_API bool rz_serialize_analysis_functions_load(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis, RzSerializeAnalDiffParser diff_parser, RZ_NULLABLE RzSerializeResultInfo *res)
static void hints_at_addr_kv_free(HtUPKv *kv)
static bool xrefs_load_cb(void *user, const char *k, const char *v)
RZ_API void rz_serialize_analysis_cc_save(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis)
static bool hints_acc_store_cb(void *user, const ut64 addr, const void *v)
RZ_API bool rz_serialize_analysis_meta_load(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis, RZ_NULLABLE RzSerializeResultInfo *res)
static bool meta_load_cb(void *user, const char *k, const char *v)
RZ_API bool rz_serialize_analysis_function_noreturn_load(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis, RZ_NULLABLE RzSerializeResultInfo *res)
static bool store_xref_cb(void *j, const ut64 k, const void *v)
RZ_API void rz_serialize_analysis_xrefs_save(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis)
RZ_API void rz_serialize_analysis_blocks_save(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis)
RZ_API void rz_serialize_analysis_meta_save(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis)
RZ_API bool rz_serialize_callables_load(RZ_NONNULL Sdb *db, RZ_NONNULL RzTypeDB *typedb, RZ_NULLABLE RzSerializeResultInfo *res)
Loads the callable types from SDB.
RZ_API void rz_serialize_callables_save(RZ_NONNULL Sdb *db, RZ_NONNULL RzTypeDB *typedb)
Saves the callable types into SDB.
RZ_API bool rz_serialize_typelinks_load(RZ_NONNULL Sdb *db, RZ_NONNULL RzAnalysis *analysis, RZ_NULLABLE RzSerializeResultInfo *res)
Loads the type links from SDB.
RZ_API void rz_serialize_typelinks_save(RZ_NONNULL Sdb *db, RZ_NONNULL const RzAnalysis *analysis)
Saves the type links into SDB.
RZ_API void rz_serialize_types_save(RZ_NONNULL Sdb *db, RZ_NONNULL const RzTypeDB *typedb)
Saves the types into SDB.
RZ_API bool rz_serialize_types_load(RZ_NONNULL Sdb *db, RZ_NONNULL RzTypeDB *typedb, RZ_NULLABLE RzSerializeResultInfo *res)
Loads the types from SDB.
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
RzSerializeAnalDiffParser diff_parser
RzSerializeAnalDiffParser diff_parser
RzSerializeAnalVarParser var_parser
const RzVector * addr_hints
RzAnalysisSwitchOp * switch_op
RzType * type
type of the variable
ut64 addr
address of the global variable
char * name
name of the variable
struct rz_json_t::@304::@307 children
struct rz_json_t::@304::@306 num
type constrained by the type conditions
RZ_API void rz_analysis_switch_op_free(RzAnalysisSwitchOp *swop)
RZ_API RzAnalysisSwitchOp * rz_analysis_switch_op_new(ut64 addr, ut64 min_val, ut64 max_val, ut64 def_val)
RZ_API RzAnalysisCaseOp * rz_analysis_switch_op_add_case(RzAnalysisSwitchOp *swop, ut64 addr, ut64 value, ut64 jump)
RZ_API void rz_type_free(RZ_NULLABLE RzType *type)
Frees the RzType.
RZ_API RZ_OWN char * rz_type_as_string(const RzTypeDB *typedb, RZ_NONNULL const RzType *type)
Returns the type C representation.
void error(const char *msg)
RZ_API void rz_analysis_var_set_access(RzAnalysisVar *var, const char *reg, ut64 access_addr, int access_type, st64 stackptr)
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_API void rz_analysis_var_add_constraint(RzAnalysisVar *var, RZ_BORROW RzTypeConstraint *constraint)
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_OWN RzAnalysisVarGlobal * rz_analysis_var_global_new(RZ_NONNULL const char *name, ut64 addr)
Create a new instance of global variable.
RZ_API RZ_OWN bool rz_analysis_var_global_add(RzAnalysis *analysis, RZ_NONNULL RzAnalysisVarGlobal *global_var)
Add the global variable into hashtable.
RZ_API void rz_analysis_var_global_add_constraint(RzAnalysisVarGlobal *glob, RzTypeConstraint *constraint)
Add a constaint to global variable.
if(dbg->bits==RZ_SYS_BITS_64)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static char * regname(int reg)
RZ_API bool rz_analysis_xrefs_set(RzAnalysis *analysis, ut64 from, ut64 to, RzAnalysisXRefType type)