65 #define il_op_unimplemented(name) \
68 rz_strbuf_append(sb, name "(unimplemented)"); \
71 pj_ks(pj, "opcode", name); \
72 pj_kb(pj, "unimplemented", true); \
77 #define il_op_param_0(name) \
80 rz_strbuf_append(sb, name); \
83 pj_ks(pj, "opcode", name); \
88 #define il_op_param_1(name, opx, v0) \
91 rz_strbuf_append(sb, "(" name " "); \
92 il_op_pure_resolve(opx.v0, sb, pj); \
93 rz_strbuf_append(sb, ")"); \
96 pj_ks(pj, "opcode", name); \
98 il_op_pure_resolve(opx.v0, sb, pj); \
103 #define il_op_param_2(name, opx, sort0, v0, sort1, v1) \
106 rz_strbuf_append(sb, "(" name " "); \
107 il_op_##sort0##_resolve(opx.v0, sb, pj); \
108 rz_strbuf_append(sb, " "); \
109 il_op_##sort1##_resolve(opx.v1, sb, pj); \
110 rz_strbuf_append(sb, ")"); \
113 pj_ks(pj, "opcode", name); \
115 il_op_##sort0##_resolve(opx.v0, sb, pj); \
117 il_op_##sort1##_resolve(opx.v1, sb, pj); \
122 #define il_op_param_3(name, opx, sort0, v0, sort1, v1, sort2, v2) \
125 rz_strbuf_append(sb, "(" name " "); \
126 il_op_##sort0##_resolve(opx.v0, sb, pj); \
127 rz_strbuf_append(sb, " "); \
128 il_op_##sort1##_resolve(opx.v1, sb, pj); \
129 rz_strbuf_append(sb, " "); \
130 il_op_##sort2##_resolve(opx.v2, sb, pj); \
131 rz_strbuf_append(sb, ")"); \
134 pj_ks(pj, "opcode", name); \
136 il_op_##sort0##_resolve(opx.v0, sb, pj); \
138 il_op_##sort1##_resolve(opx.v1, sb, pj); \
140 il_op_##sort2##_resolve(opx.v2, sb, pj); \
151 pj_ks(pj,
"opcode",
"var");
152 pj_ks(pj,
"value", opx->
v);
171 pj_ks(pj,
"opcode",
"let");
186 pj_ks(pj,
"opcode",
"bool");
187 pj_kb(pj,
"value",
false);
197 pj_ks(pj,
"opcode",
"bool");
198 pj_kb(pj,
"value",
true);
226 pj_ks(pj,
"opcode",
"bitv");
324 pj_ks(pj,
"opcode",
"cast");
346 pj_ks(pj,
"opcode",
"load");
362 pj_ks(pj,
"opcode",
"loadw");
382 pj_ks(pj,
"opcode",
"store");
403 pj_ks(pj,
"opcode",
"storew");
429 pj_ks(pj,
"opcode",
"set");
447 pj_ks(pj,
"opcode",
"goto");
502 il_op_param_2(
"repeat",
op->op.repeat, pure, condition, effect, data_eff);
506 il_op_param_3(
"branch",
op->op.branch, pure, condition, effect, true_eff, effect, false_eff);
513 }
else if (!
op && pj) {
641 }
else if (!
op && pj) {
643 pj_ks(pj,
"opcode",
"nop");
769 rz_strbuf_appendf(
sb,
"mem_read(addr: %s, value: %s)", tmp0, tmp1 ? tmp1 :
"uninitialized memory");
773 rz_strbuf_appendf(
sb,
"var_read(name: %s, value: %s)", evt->data.var_write.variable, tmp1 ? tmp1 :
"uninitialized variable");
779 rz_strbuf_appendf(
sb,
"mem_write(addr: %s, old: %s, new: %s)", tmp0, tmp1 ? tmp1 :
"uninitialized memory", tmp2);
784 rz_strbuf_appendf(
sb,
"var_write(name: %s, old: %s, new: %s)", evt->data.var_write.variable, tmp1 ? tmp1 :
"uninitialized variable", tmp2);
804 pj_ks(pj,
"type",
"exception");
805 pj_ks(pj,
"exception", evt->data.exception);
812 pj_ks(pj,
"type",
"pc_write");
813 pj_ks(pj,
"old", tmp0);
814 pj_ks(pj,
"new", tmp1);
821 pj_ks(pj,
"type",
"mem_read");
822 pj_ks(pj,
"address", tmp0);
823 pj_ks(pj,
"value", tmp1);
829 pj_ks(pj,
"type",
"var_read");
830 pj_ks(pj,
"name", evt->data.var_read.variable);
831 pj_ks(pj,
"value", tmp1 ? tmp1 :
"uninitialized variable");
839 pj_ks(pj,
"type",
"mem_write");
840 pj_ks(pj,
"address", tmp0);
841 pj_ks(pj,
"old", tmp1 ? tmp1 :
"uninitialized memory");
842 pj_ks(pj,
"new", tmp2);
849 pj_ks(pj,
"type",
"var_write");
850 pj_ks(pj,
"name", evt->data.var_write.variable);
851 pj_ks(pj,
"old", tmp1 ? tmp1 :
"uninitialized variable");
852 pj_ks(pj,
"new", tmp2);
858 pj_ks(pj,
"type",
"unknown");
RZ_API void Ht_() free(HtName_(Ht) *ht)
RZ_API RZ_OWN RzBitVector * rz_il_value_to_bv(RZ_NONNULL const RzILVal *val)
static void il_opdmp_store(RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_cast(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_bool_false(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_shiftl(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_jmp(RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
RZ_API RZ_NONNULL const char * rz_il_op_pure_code_stringify(RzILOpPureCode code)
RZ_API void rz_il_event_json(RZ_NONNULL RzILEvent *evt, RZ_NONNULL PJ *pj)
static void il_opdmp_append(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
RZ_API char * rz_il_value_stringify(RZ_NONNULL const RzILVal *val)
static void il_opdmp_bool_inv(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_bool_or(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
#define il_op_param_0(name)
static void il_opdmp_loadw(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_lognot(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_logxor(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_blk(RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
#define il_op_param_3(name, opx, sort0, v0, sort1, v1, sort2, v2)
static void il_opdmp_ite(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_msb(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_bitv(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_bool_xor(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_storew(RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_add(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_ule(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
RZ_API void rz_il_op_effect_json(RZ_NONNULL RzILOpEffect *op, RZ_NONNULL PJ *pj)
#define il_op_param_2(name, opx, sort0, v0, sort1, v1)
RZ_API void rz_il_op_pure_json(RZ_NONNULL RzILOpPure *op, RZ_NONNULL PJ *pj)
static void il_opdmp_seq_inner(RzILOpEffect *op, RzStrBuf *sb)
static void il_opdmp_logand(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_logor(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_sle(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_smod(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_load(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_bool_true(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_let(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_repeat(RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_lsb(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_neg(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_op_effect_resolve(RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
RZ_API RZ_OWN char * rz_il_sort_pure_stringify(RzILSortPure sort)
static void il_opdmp_goto(RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_set(RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_sub(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_empty(RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_bool_and(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_branch(RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_nop(RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
RZ_API void rz_il_op_effect_stringify(RZ_NONNULL RzILOpEffect *op, RZ_NONNULL RzStrBuf *sb)
RZ_API void rz_il_op_pure_stringify(RZ_NONNULL RzILOpPure *op, RZ_NONNULL RzStrBuf *sb)
static void il_opdmp_is_zero(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_shiftr(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_mod(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_var(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
#define il_op_param_1(name, opx, v0)
static void il_opdmp_div(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
RZ_API void rz_il_event_stringify(RZ_NONNULL const RzILEvent *evt, RZ_NONNULL RzStrBuf *sb)
static void il_opdmp_eq(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_op_pure_resolve(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_sdiv(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_seq(RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
static void il_opdmp_mul(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
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 static sig const char static mode static oldfd struct tms static buf static getgid static geteuid const char static filename static arg static mask struct ustat static ubuf static getppid static setsid static egid sigset_t static set struct timeval struct timezone static tz fd_set fd_set fd_set struct timeval static timeout const char char static bufsiz const char static swapflags void static offset const char static length static mode static who const char struct statfs static buf unsigned unsigned num
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_warn_if_reached()
#define rz_return_if_fail(expr)
#define rz_return_val_if_fail(expr, val)
RZ_API void rz_bv_free(RZ_NULLABLE RzBitVector *bv)
RZ_API RZ_OWN char * rz_bv_as_hex_string(RZ_NONNULL RzBitVector *bv, bool pad)
RZ_API PJ * pj_kb(PJ *j, const char *k, bool v)
RZ_API PJ * pj_k(PJ *j, const char *k)
RZ_API PJ * pj_end(PJ *j)
RZ_API PJ * pj_knull(PJ *j, const char *k)
RZ_API PJ * pj_ks(PJ *j, const char *k, const char *v)
RZ_API PJ * pj_kn(PJ *j, const char *k, ut64 n)
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
#define rz_strf(buf,...)
Convenience macro for local temporary strings.
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_IL_TYPE_PURE_BITVECTOR
ut32 len
number of bits – virtual / logical
value is a bitvector constant.
RzBitVector * value
value of bitvector
op structure for casting bitv
RzILOpBool * fill
If m = size val - length > 0 then m fill-bits are prepended to the most significant part of the vecto...
RzILOpBitVector * val
value to cast
ut32 length
new bits length
op structure for goto (label -> ctrl eff)
const char * lbl
name of the label, const one
op structure for let_ : 'a var -> 'a pure -> 'b pure -> 'b pure
const char * name
name of variable
RzILOpPure * exp
value/expression to bind the variable to
RzILOpPure * body
body in which the variable will be bound and that produces the result
op structure for load (('a, 'b) mem -> 'a bitv -> 'b bitv)
RzILMemIndex mem
index of the mem inside the vm to use
RzILOpBitVector * key
index of the cell (address) in mem, must have exactly the size of a key in the memory
Load an entire word of arbitrary bit size from a memory.
RzILOpBitVector * key
memory index of the RzBitVector key (address)
RzILMemIndex mem
index of the mem inside the vm to use
ut32 n_bits
n of bits to read, and of the resulting bitvector
op structure for Seq ('a eff -> 'a eff -> 'a eff)
RzILOpEffect * y
perform this second
RzILOpEffect * x
perform this first
op structure for set ('a var -> 'a pure -> data eff)
const char * v
name of variable, const one
RzILOpPure * x
value to set the variable to
op structure for store (('a, 'b) mem -> 'a bitv -> 'b bitv -> ('a, 'b) mem)
RzILOpBitVector * value
value to store, must have exactly the size of a memory cell
RzILOpBitVector * key
address where to store to, must have exactly the size of a key in the memory
RzILMemIndex mem
index of memory in the vm to use
op structure for var ('a var -> 'a pure)
const char * v
name of variable, const one
An IL op performing a pure computation, 'a pure.
struct rz_il_sort_pure_t::@283::@284 bv
union rz_il_sort_pure_t::@283 props
op structure for blk (label -> data eff -> ctrl eff -> unit eff)
RzILOpEffect * data_eff
index of data_eff
const char * label
name of the label, const one
RzILOpEffect * ctrl_eff
index of ctrl_eff