Rizin
unix-like reverse engineering framework and cli tools
il_export.c File Reference
#include <rz_il/rz_il_vm.h>

Go to the source code of this file.

Macros

#define il_op_unimplemented(name)
 
#define il_op_param_0(name)
 
#define il_op_param_1(name, opx, v0)
 
#define il_op_param_2(name, opx, sort0, v0, sort1, v1)
 
#define il_op_param_3(name, opx, sort0, v0, sort1, v1, sort2, v2)
 

Functions

static void il_op_pure_resolve (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_op_effect_resolve (RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_var (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_ite (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_let (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_bool_false (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_bool_true (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_bool_inv (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_bool_and (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_bool_or (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_bool_xor (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_bitv (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_msb (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_lsb (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_is_zero (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_neg (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_lognot (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_add (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_sub (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_mul (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_div (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_sdiv (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_mod (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_smod (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
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_logxor (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_shiftr (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_shiftl (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_eq (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_sle (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_ule (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_cast (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_append (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_load (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_loadw (RzILOpPure *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_store (RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_storew (RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_nop (RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_empty (RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_set (RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_jmp (RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_goto (RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_seq_inner (RzILOpEffect *op, RzStrBuf *sb)
 
static void il_opdmp_seq (RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_blk (RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_repeat (RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
 
static void il_opdmp_branch (RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
 
RZ_API void rz_il_op_pure_stringify (RZ_NONNULL RzILOpPure *op, RZ_NONNULL RzStrBuf *sb)
 
RZ_API void rz_il_op_effect_stringify (RZ_NONNULL RzILOpEffect *op, RZ_NONNULL RzStrBuf *sb)
 
RZ_API void rz_il_op_pure_json (RZ_NONNULL RzILOpPure *op, RZ_NONNULL PJ *pj)
 
RZ_API void rz_il_op_effect_json (RZ_NONNULL RzILOpEffect *op, RZ_NONNULL PJ *pj)
 
RZ_API char * rz_il_value_stringify (RZ_NONNULL const RzILVal *val)
 
RZ_API void rz_il_event_stringify (RZ_NONNULL const RzILEvent *evt, RZ_NONNULL RzStrBuf *sb)
 
RZ_API void rz_il_event_json (RZ_NONNULL RzILEvent *evt, RZ_NONNULL PJ *pj)
 
RZ_API RZ_NONNULL const char * rz_il_op_pure_code_stringify (RzILOpPureCode code)
 
RZ_API RZ_OWN char * rz_il_sort_pure_stringify (RzILSortPure sort)
 

Detailed Description

Outputs the IL statements & events in JSON or string format. The string format of a statement is composed simply of s-expressions and looks like below: (store 0 (var ptr) (+ (load 0 (var ptr)) (bv 8 0x1))) which can be deconstructed like below (store 0 (var ptr) (+ (load 0 (var ptr) ) (bv 8 0x1) ) )

The json format of a statement looks like below: [ { "opcode": "store", "key": { "opcode": "var", "value": "ptr" }, "value": { "opcode": "add", "x": { "opcode": "load", "key": { "opcode": "var", "value": "ptr" }, "mem": 0 }, "y": { "opcode": "int", "length": 8, "value": 1 } }, "mem": 0 } ] The string format of an event looks like below: mem_write(addr: 0x0000000000000000, old: 0x00, new: 0x01)

The json format of an event looks like below: { "event": "mem_write", "old": "0x00", "new": "0x01" }

Definition in file il_export.c.

Macro Definition Documentation

◆ il_op_param_0

#define il_op_param_0 (   name)
Value:
do { \
if (sb) { \
rz_strbuf_append(sb, name); \
} else { \
pj_o(pj); \
pj_ks(pj, "opcode", name); \
pj_end(pj); \
} \
} while (0)
static SblHeader sb
Definition: bin_mbn.c:26
Definition: z80asm.h:102

Definition at line 77 of file il_export.c.

◆ il_op_param_1

#define il_op_param_1 (   name,
  opx,
  v0 
)
Value:
do { \
if (sb) { \
rz_strbuf_append(sb, "(" name " "); \
il_op_pure_resolve(opx.v0, sb, pj); \
rz_strbuf_append(sb, ")"); \
} else { \
pj_o(pj); \
pj_ks(pj, "opcode", name); \
pj_k(pj, #v0); \
il_op_pure_resolve(opx.v0, sb, pj); \
pj_end(pj); \
} \
} while (0)
@ v0
Definition: lanai.h:84

Definition at line 88 of file il_export.c.

◆ il_op_param_2

#define il_op_param_2 (   name,
  opx,
  sort0,
  v0,
  sort1,
  v1 
)
Value:
do { \
if (sb) { \
rz_strbuf_append(sb, "(" name " "); \
il_op_##sort0##_resolve(opx.v0, sb, pj); \
rz_strbuf_append(sb, " "); \
il_op_##sort1##_resolve(opx.v1, sb, pj); \
rz_strbuf_append(sb, ")"); \
} else { \
pj_o(pj); \
pj_ks(pj, "opcode", name); \
pj_k(pj, #v0); \
il_op_##sort0##_resolve(opx.v0, sb, pj); \
pj_k(pj, #v1); \
il_op_##sort1##_resolve(opx.v1, sb, pj); \
pj_end(pj); \
} \
} while (0)
@ v1
Definition: lanai.h:85

Definition at line 103 of file il_export.c.

◆ il_op_param_3

#define il_op_param_3 (   name,
  opx,
  sort0,
  v0,
  sort1,
  v1,
  sort2,
  v2 
)
Value:
do { \
if (sb) { \
rz_strbuf_append(sb, "(" name " "); \
il_op_##sort0##_resolve(opx.v0, sb, pj); \
rz_strbuf_append(sb, " "); \
il_op_##sort1##_resolve(opx.v1, sb, pj); \
rz_strbuf_append(sb, " "); \
il_op_##sort2##_resolve(opx.v2, sb, pj); \
rz_strbuf_append(sb, ")"); \
} else { \
pj_o(pj); \
pj_ks(pj, "opcode", name); \
pj_k(pj, #v0); \
il_op_##sort0##_resolve(opx.v0, sb, pj); \
pj_k(pj, #v1); \
il_op_##sort1##_resolve(opx.v1, sb, pj); \
pj_k(pj, #v2); \
il_op_##sort2##_resolve(opx.v2, sb, pj); \
pj_end(pj); \
} \
} while (0)

Definition at line 122 of file il_export.c.

◆ il_op_unimplemented

#define il_op_unimplemented (   name)
Value:
do { \
if (sb) { \
rz_strbuf_append(sb, name "(unimplemented)"); \
} else { \
pj_o(pj); \
pj_ks(pj, "opcode", name); \
pj_kb(pj, "unimplemented", true); \
pj_end(pj); \
} \
} while (0)

Definition at line 65 of file il_export.c.

Function Documentation

◆ il_op_effect_resolve()

static void il_op_effect_resolve ( RzILOpEffect op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 637 of file il_export.c.

637  {
638  if (!op && sb) {
639  rz_strbuf_append(sb, "nop");
640  return;
641  } else if (!op && pj) {
642  pj_o(pj);
643  pj_ks(pj, "opcode", "nop");
644  pj_end(pj);
645  return;
646  }
647  switch (op->code) {
648  case RZ_IL_OP_EMPTY:
649  il_opdmp_empty(op, sb, pj);
650  break;
651  case RZ_IL_OP_STORE:
652  il_opdmp_store(op, sb, pj);
653  return;
654  case RZ_IL_OP_STOREW:
655  il_opdmp_storew(op, sb, pj);
656  return;
657  case RZ_IL_OP_NOP:
658  il_opdmp_nop(op, sb, pj);
659  return;
660  case RZ_IL_OP_SET:
661  il_opdmp_set(op, sb, pj);
662  return;
663  case RZ_IL_OP_JMP:
664  il_opdmp_jmp(op, sb, pj);
665  return;
666  case RZ_IL_OP_GOTO:
667  il_opdmp_goto(op, sb, pj);
668  return;
669  case RZ_IL_OP_SEQ:
670  il_opdmp_seq(op, sb, pj);
671  return;
672  case RZ_IL_OP_BLK:
673  il_opdmp_blk(op, sb, pj);
674  return;
675  case RZ_IL_OP_REPEAT:
676  il_opdmp_repeat(op, sb, pj);
677  return;
678  case RZ_IL_OP_BRANCH:
679  il_opdmp_branch(op, sb, pj);
680  return;
681  default:
683  if (sb) {
684  rz_strbuf_appendf(sb, "unk_%u", op->code);
685  } else {
686  char tmp[64];
687  rz_strf(tmp, "unk_%u", op->code);
688  pj_o(pj);
689  pj_ks(pj, "opcode", tmp);
690  pj_end(pj);
691  }
692  return;
693  }
694 }
static void il_opdmp_store(RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:371
static void il_opdmp_jmp(RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:437
static void il_opdmp_blk(RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:482
static void il_opdmp_storew(RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:392
static void il_opdmp_repeat(RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:501
static void il_opdmp_goto(RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:441
static void il_opdmp_set(RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:421
static void il_opdmp_empty(RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:417
static void il_opdmp_branch(RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:505
static void il_opdmp_nop(RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:413
static void il_opdmp_seq(RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:468
#define rz_warn_if_reached()
Definition: rz_assert.h:29
@ RZ_IL_OP_BLK
@ RZ_IL_OP_GOTO
@ RZ_IL_OP_SEQ
@ RZ_IL_OP_NOP
@ RZ_IL_OP_JMP
@ RZ_IL_OP_EMPTY
@ RZ_IL_OP_STORE
@ RZ_IL_OP_STOREW
@ RZ_IL_OP_REPEAT
@ RZ_IL_OP_BRANCH
@ RZ_IL_OP_SET
RZ_API PJ * pj_end(PJ *j)
Definition: pj.c:87
RZ_API PJ * pj_o(PJ *j)
Definition: pj.c:75
RZ_API PJ * pj_ks(PJ *j, const char *k, const char *v)
Definition: pj.c:170
#define rz_strf(buf,...)
Convenience macro for local temporary strings.
Definition: rz_str.h:59
RZ_API bool rz_strbuf_append(RzStrBuf *sb, const char *s)
Definition: strbuf.c:222
RZ_API bool rz_strbuf_appendf(RzStrBuf *sb, const char *fmt,...) RZ_PRINTF_CHECK(2
Definition: dis.c:32
struct op_code code
Definition: dis.c:33

References op::code, il_opdmp_blk(), il_opdmp_branch(), il_opdmp_empty(), il_opdmp_goto(), il_opdmp_jmp(), il_opdmp_nop(), il_opdmp_repeat(), il_opdmp_seq(), il_opdmp_set(), il_opdmp_store(), il_opdmp_storew(), pj_end(), pj_ks(), pj_o(), RZ_IL_OP_BLK, RZ_IL_OP_BRANCH, RZ_IL_OP_EMPTY, RZ_IL_OP_GOTO, RZ_IL_OP_JMP, RZ_IL_OP_NOP, RZ_IL_OP_REPEAT, RZ_IL_OP_SEQ, RZ_IL_OP_SET, RZ_IL_OP_STORE, RZ_IL_OP_STOREW, rz_strbuf_append(), rz_strbuf_appendf(), rz_strf, rz_warn_if_reached, sb, and autogen_x86imm::tmp.

Referenced by il_opdmp_blk(), il_opdmp_seq_inner(), rz_il_op_effect_json(), and rz_il_op_effect_stringify().

◆ il_op_pure_resolve()

static void il_op_pure_resolve ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 509 of file il_export.c.

509  {
510  if (!op && sb) {
511  rz_strbuf_append(sb, "(null)");
512  return;
513  } else if (!op && pj) {
514  pj_o(pj);
515  pj_knull(pj, "opcode");
516  pj_end(pj);
517  return;
518  }
519  switch (op->code) {
520  case RZ_IL_OP_VAR:
521  il_opdmp_var(op, sb, pj);
522  return;
523  case RZ_IL_OP_ITE:
524  il_opdmp_ite(op, sb, pj);
525  return;
526  case RZ_IL_OP_LET:
527  il_opdmp_let(op, sb, pj);
528  return;
529  case RZ_IL_OP_B0:
530  il_opdmp_bool_false(op, sb, pj);
531  return;
532  case RZ_IL_OP_B1:
533  il_opdmp_bool_true(op, sb, pj);
534  return;
535  case RZ_IL_OP_INV:
536  il_opdmp_bool_inv(op, sb, pj);
537  return;
538  case RZ_IL_OP_AND:
539  il_opdmp_bool_and(op, sb, pj);
540  return;
541  case RZ_IL_OP_OR:
542  il_opdmp_bool_or(op, sb, pj);
543  return;
544  case RZ_IL_OP_XOR:
545  il_opdmp_bool_xor(op, sb, pj);
546  return;
547  case RZ_IL_OP_BITV:
548  il_opdmp_bitv(op, sb, pj);
549  return;
550  case RZ_IL_OP_MSB:
551  il_opdmp_msb(op, sb, pj);
552  return;
553  case RZ_IL_OP_LSB:
554  il_opdmp_lsb(op, sb, pj);
555  return;
556  case RZ_IL_OP_IS_ZERO:
557  il_opdmp_is_zero(op, sb, pj);
558  return;
559  case RZ_IL_OP_NEG:
560  il_opdmp_neg(op, sb, pj);
561  return;
562  case RZ_IL_OP_LOGNOT:
563  il_opdmp_lognot(op, sb, pj);
564  return;
565  case RZ_IL_OP_ADD:
566  il_opdmp_add(op, sb, pj);
567  return;
568  case RZ_IL_OP_SUB:
569  il_opdmp_sub(op, sb, pj);
570  return;
571  case RZ_IL_OP_MUL:
572  il_opdmp_mul(op, sb, pj);
573  return;
574  case RZ_IL_OP_DIV:
575  il_opdmp_div(op, sb, pj);
576  return;
577  case RZ_IL_OP_SDIV:
578  il_opdmp_sdiv(op, sb, pj);
579  return;
580  case RZ_IL_OP_MOD:
581  il_opdmp_mod(op, sb, pj);
582  return;
583  case RZ_IL_OP_SMOD:
584  il_opdmp_smod(op, sb, pj);
585  return;
586  case RZ_IL_OP_LOGAND:
587  il_opdmp_logand(op, sb, pj);
588  return;
589  case RZ_IL_OP_LOGOR:
590  il_opdmp_logor(op, sb, pj);
591  return;
592  case RZ_IL_OP_LOGXOR:
593  il_opdmp_logxor(op, sb, pj);
594  return;
595  case RZ_IL_OP_SHIFTR:
596  il_opdmp_shiftr(op, sb, pj);
597  return;
598  case RZ_IL_OP_SHIFTL:
599  il_opdmp_shiftl(op, sb, pj);
600  return;
601  case RZ_IL_OP_EQ:
602  il_opdmp_eq(op, sb, pj);
603  return;
604  case RZ_IL_OP_SLE:
605  il_opdmp_sle(op, sb, pj);
606  return;
607  case RZ_IL_OP_ULE:
608  il_opdmp_ule(op, sb, pj);
609  return;
610  case RZ_IL_OP_CAST:
611  il_opdmp_cast(op, sb, pj);
612  return;
613  case RZ_IL_OP_APPEND:
614  il_opdmp_append(op, sb, pj);
615  return;
616  case RZ_IL_OP_LOAD:
617  il_opdmp_load(op, sb, pj);
618  return;
619  case RZ_IL_OP_LOADW:
620  il_opdmp_loadw(op, sb, pj);
621  return;
622  default:
624  if (sb) {
625  rz_strbuf_appendf(sb, "unk_%u", op->code);
626  } else {
627  char tmp[64];
628  rz_strf(tmp, "unk_%u", op->code);
629  pj_o(pj);
630  pj_ks(pj, "opcode", tmp);
631  pj_end(pj);
632  }
633  return;
634  }
635 }
static void il_opdmp_cast(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:314
static void il_opdmp_bool_false(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:181
static void il_opdmp_shiftl(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:298
static void il_opdmp_append(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:334
static void il_opdmp_bool_inv(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:203
static void il_opdmp_bool_or(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:211
static void il_opdmp_loadw(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:354
static void il_opdmp_lognot(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:250
static void il_opdmp_logxor(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:290
static void il_opdmp_ite(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:157
static void il_opdmp_msb(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:234
static void il_opdmp_bitv(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:219
static void il_opdmp_bool_xor(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:215
static void il_opdmp_add(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:254
static void il_opdmp_ule(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:310
static void il_opdmp_logand(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:282
static void il_opdmp_logor(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:286
static void il_opdmp_sle(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:306
static void il_opdmp_smod(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:278
static void il_opdmp_load(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:338
static void il_opdmp_bool_true(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:192
static void il_opdmp_let(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:161
static void il_opdmp_lsb(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:238
static void il_opdmp_neg(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:246
static void il_opdmp_sub(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:258
static void il_opdmp_bool_and(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:207
static void il_opdmp_is_zero(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:242
static void il_opdmp_shiftr(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:294
static void il_opdmp_mod(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:274
static void il_opdmp_var(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:145
static void il_opdmp_div(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:266
static void il_opdmp_eq(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:302
static void il_opdmp_sdiv(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:270
static void il_opdmp_mul(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:262
@ RZ_IL_OP_SHIFTR
@ RZ_IL_OP_ULE
@ RZ_IL_OP_SUB
@ RZ_IL_OP_LOGNOT
@ RZ_IL_OP_MSB
@ RZ_IL_OP_ITE
@ RZ_IL_OP_SLE
@ RZ_IL_OP_LSB
@ RZ_IL_OP_OR
@ RZ_IL_OP_IS_ZERO
@ RZ_IL_OP_NEG
@ RZ_IL_OP_ADD
@ RZ_IL_OP_B0
@ RZ_IL_OP_LET
@ RZ_IL_OP_CAST
@ RZ_IL_OP_MOD
@ RZ_IL_OP_LOGOR
@ RZ_IL_OP_VAR
@ RZ_IL_OP_INV
@ RZ_IL_OP_APPEND
@ RZ_IL_OP_DIV
@ RZ_IL_OP_SHIFTL
@ RZ_IL_OP_EQ
@ RZ_IL_OP_MUL
@ RZ_IL_OP_BITV
@ RZ_IL_OP_B1
@ RZ_IL_OP_XOR
@ RZ_IL_OP_LOAD
@ RZ_IL_OP_AND
@ RZ_IL_OP_SMOD
@ RZ_IL_OP_LOGXOR
@ RZ_IL_OP_SDIV
@ RZ_IL_OP_LOADW
@ RZ_IL_OP_LOGAND
RZ_API PJ * pj_knull(PJ *j, const char *k)
Definition: pj.c:114

References op::code, il_opdmp_add(), il_opdmp_append(), il_opdmp_bitv(), il_opdmp_bool_and(), il_opdmp_bool_false(), il_opdmp_bool_inv(), il_opdmp_bool_or(), il_opdmp_bool_true(), il_opdmp_bool_xor(), il_opdmp_cast(), il_opdmp_div(), il_opdmp_eq(), il_opdmp_is_zero(), il_opdmp_ite(), il_opdmp_let(), il_opdmp_load(), il_opdmp_loadw(), il_opdmp_logand(), il_opdmp_lognot(), il_opdmp_logor(), il_opdmp_logxor(), il_opdmp_lsb(), il_opdmp_mod(), il_opdmp_msb(), il_opdmp_mul(), il_opdmp_neg(), il_opdmp_sdiv(), il_opdmp_shiftl(), il_opdmp_shiftr(), il_opdmp_sle(), il_opdmp_smod(), il_opdmp_sub(), il_opdmp_ule(), il_opdmp_var(), pj_end(), pj_knull(), pj_ks(), pj_o(), RZ_IL_OP_ADD, RZ_IL_OP_AND, RZ_IL_OP_APPEND, RZ_IL_OP_B0, RZ_IL_OP_B1, RZ_IL_OP_BITV, RZ_IL_OP_CAST, RZ_IL_OP_DIV, RZ_IL_OP_EQ, RZ_IL_OP_INV, RZ_IL_OP_IS_ZERO, RZ_IL_OP_ITE, RZ_IL_OP_LET, RZ_IL_OP_LOAD, RZ_IL_OP_LOADW, RZ_IL_OP_LOGAND, RZ_IL_OP_LOGNOT, RZ_IL_OP_LOGOR, RZ_IL_OP_LOGXOR, RZ_IL_OP_LSB, RZ_IL_OP_MOD, RZ_IL_OP_MSB, RZ_IL_OP_MUL, RZ_IL_OP_NEG, RZ_IL_OP_OR, RZ_IL_OP_SDIV, RZ_IL_OP_SHIFTL, RZ_IL_OP_SHIFTR, RZ_IL_OP_SLE, RZ_IL_OP_SMOD, RZ_IL_OP_SUB, RZ_IL_OP_ULE, RZ_IL_OP_VAR, RZ_IL_OP_XOR, rz_strbuf_append(), rz_strbuf_appendf(), rz_strf, rz_warn_if_reached, sb, and autogen_x86imm::tmp.

Referenced by il_opdmp_cast(), il_opdmp_let(), il_opdmp_load(), il_opdmp_loadw(), il_opdmp_set(), il_opdmp_store(), il_opdmp_storew(), rz_il_op_pure_json(), and rz_il_op_pure_stringify().

◆ il_opdmp_add()

static void il_opdmp_add ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 254 of file il_export.c.

254  {
255  il_op_param_2("+", op->op.add, pure, x, pure, y);
256 }
#define il_op_param_2(name, opx, sort0, v0, sort1, v1)
Definition: il_export.c:103
int x
Definition: mipsasm.c:20

References il_op_param_2, and x.

Referenced by il_op_pure_resolve().

◆ il_opdmp_append()

static void il_opdmp_append ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 334 of file il_export.c.

334  {
335  il_op_param_2("append", op->op.append, pure, high, pure, low);
336 }

References il_op_param_2.

Referenced by il_op_pure_resolve().

◆ il_opdmp_bitv()

static void il_opdmp_bitv ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 219 of file il_export.c.

219  {
220  RzILOpArgsBv *opx = &op->op.bitv;
221  char *num = rz_bv_as_hex_string(opx->value, false);
222  if (sb) {
223  rz_strbuf_appendf(sb, "(bv %u %s)", opx->value->len, num);
224  } else {
225  pj_o(pj);
226  pj_ks(pj, "opcode", "bitv");
227  pj_ks(pj, "bits", num);
228  pj_kn(pj, "len", opx->value->len);
229  pj_end(pj);
230  }
231  free(num);
232 }
RZ_API void Ht_() free(HtName_(Ht) *ht)
Definition: ht_inc.c:130
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
Definition: sflib.h:126
RZ_API RZ_OWN char * rz_bv_as_hex_string(RZ_NONNULL RzBitVector *bv, bool pad)
Definition: bitvector.c:121
RZ_API PJ * pj_kn(PJ *j, const char *k, ut64 n)
Definition: pj.c:121
ut32 len
number of bits – virtual / logical
Definition: rz_bitvector.h:25
value is a bitvector constant.
Definition: rz_il_opcodes.h:51
RzBitVector * value
value of bitvector
Definition: rz_il_opcodes.h:52

References free(), bitvector_t::len, num, pj_end(), pj_kn(), pj_ks(), pj_o(), rz_bv_as_hex_string(), rz_strbuf_appendf(), sb, and rz_il_op_args_bv_t::value.

Referenced by il_op_pure_resolve().

◆ il_opdmp_blk()

static void il_opdmp_blk ( RzILOpEffect op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 482 of file il_export.c.

482  {
483  RzILOpArgsBlk *opx = &op->op.blk;
484  if (sb) {
485  rz_strbuf_appendf(sb, "(blk %s ", opx->label);
486  il_op_effect_resolve(opx->data_eff, sb, pj);
487  rz_strbuf_append(sb, " ");
488  il_op_effect_resolve(opx->ctrl_eff, sb, pj);
489  rz_strbuf_append(sb, ")");
490  } else {
491  pj_o(pj);
492  pj_ks(pj, "label", opx->label);
493  pj_k(pj, "data");
494  il_op_effect_resolve(opx->data_eff, sb, pj);
495  pj_k(pj, "ctrl");
496  il_op_effect_resolve(opx->ctrl_eff, sb, pj);
497  pj_end(pj);
498  }
499 }
static void il_op_effect_resolve(RzILOpEffect *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:637
RZ_API PJ * pj_k(PJ *j, const char *k)
Definition: pj.c:104
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

References rzil_op_blk_t::ctrl_eff, rzil_op_blk_t::data_eff, il_op_effect_resolve(), rzil_op_blk_t::label, pj_end(), pj_k(), pj_ks(), pj_o(), rz_strbuf_append(), rz_strbuf_appendf(), and sb.

Referenced by il_op_effect_resolve().

◆ il_opdmp_bool_and()

static void il_opdmp_bool_and ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 207 of file il_export.c.

207  {
208  il_op_param_2("&&", op->op.booland, pure, x, pure, y);
209 }

References il_op_param_2, and x.

Referenced by il_op_pure_resolve().

◆ il_opdmp_bool_false()

static void il_opdmp_bool_false ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 181 of file il_export.c.

181  {
182  if (sb) {
183  rz_strbuf_append(sb, "false");
184  } else {
185  pj_o(pj);
186  pj_ks(pj, "opcode", "bool");
187  pj_kb(pj, "value", false);
188  pj_end(pj);
189  }
190 }
RZ_API PJ * pj_kb(PJ *j, const char *k, bool v)
Definition: pj.c:177

References pj_end(), pj_kb(), pj_ks(), pj_o(), rz_strbuf_append(), and sb.

Referenced by il_op_pure_resolve().

◆ il_opdmp_bool_inv()

static void il_opdmp_bool_inv ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 203 of file il_export.c.

203  {
204  il_op_param_1("!", op->op.boolinv, x);
205 }
#define il_op_param_1(name, opx, v0)
Definition: il_export.c:88

References il_op_param_1, and x.

Referenced by il_op_pure_resolve().

◆ il_opdmp_bool_or()

static void il_opdmp_bool_or ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 211 of file il_export.c.

211  {
212  il_op_param_2("||", op->op.boolor, pure, x, pure, y);
213 }

References il_op_param_2, and x.

Referenced by il_op_pure_resolve().

◆ il_opdmp_bool_true()

static void il_opdmp_bool_true ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 192 of file il_export.c.

192  {
193  if (sb) {
194  rz_strbuf_append(sb, "true");
195  } else {
196  pj_o(pj);
197  pj_ks(pj, "opcode", "bool");
198  pj_kb(pj, "value", true);
199  pj_end(pj);
200  }
201 }

References pj_end(), pj_kb(), pj_ks(), pj_o(), rz_strbuf_append(), and sb.

Referenced by il_op_pure_resolve().

◆ il_opdmp_bool_xor()

static void il_opdmp_bool_xor ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 215 of file il_export.c.

215  {
216  il_op_param_2("^^", op->op.boolxor, pure, x, pure, y);
217 }

References il_op_param_2, and x.

Referenced by il_op_pure_resolve().

◆ il_opdmp_branch()

static void il_opdmp_branch ( RzILOpEffect op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 505 of file il_export.c.

505  {
506  il_op_param_3("branch", op->op.branch, pure, condition, effect, true_eff, effect, false_eff);
507 }
#define il_op_param_3(name, opx, sort0, v0, sort1, v1, sort2, v2)
Definition: il_export.c:122

References il_op_param_3.

Referenced by il_op_effect_resolve().

◆ il_opdmp_cast()

static void il_opdmp_cast ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 314 of file il_export.c.

314  {
315  RzILOpArgsCast *opx = &op->op.cast;
316  if (sb) {
317  rz_strbuf_appendf(sb, "(cast %u ", opx->length);
318  il_op_pure_resolve(opx->fill, sb, pj);
319  rz_strbuf_append(sb, " ");
320  il_op_pure_resolve(opx->val, sb, pj);
321  rz_strbuf_append(sb, ")");
322  } else {
323  pj_o(pj);
324  pj_ks(pj, "opcode", "cast");
325  pj_k(pj, "value");
326  il_op_pure_resolve(opx->val, sb, pj);
327  pj_kn(pj, "length", opx->length);
328  pj_k(pj, "fill");
329  il_op_pure_resolve(opx->fill, sb, pj);
330  pj_end(pj);
331  }
332 }
static void il_op_pure_resolve(RzILOpPure *op, RzStrBuf *sb, PJ *pj)
Definition: il_export.c:509
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

References rz_il_op_args_cast_t::fill, il_op_pure_resolve(), rz_il_op_args_cast_t::length, pj_end(), pj_k(), pj_kn(), pj_ks(), pj_o(), rz_strbuf_append(), rz_strbuf_appendf(), sb, and rz_il_op_args_cast_t::val.

Referenced by il_op_pure_resolve().

◆ il_opdmp_div()

static void il_opdmp_div ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 266 of file il_export.c.

266  {
267  il_op_param_2("div", op->op.div, pure, x, pure, y);
268 }

References il_op_param_2, and x.

Referenced by il_op_pure_resolve().

◆ il_opdmp_empty()

static void il_opdmp_empty ( RzILOpEffect op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 417 of file il_export.c.

417  {
418  il_op_param_0("empty");
419 }
#define il_op_param_0(name)
Definition: il_export.c:77

References il_op_param_0.

Referenced by il_op_effect_resolve().

◆ il_opdmp_eq()

static void il_opdmp_eq ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 302 of file il_export.c.

302  {
303  il_op_param_2("==", op->op.ule, pure, x, pure, y);
304 }

References il_op_param_2, and x.

Referenced by il_op_pure_resolve().

◆ il_opdmp_goto()

static void il_opdmp_goto ( RzILOpEffect op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 441 of file il_export.c.

441  {
442  RzILOpArgsGoto *opx = &op->op.goto_;
443  if (sb) {
444  rz_strbuf_appendf(sb, "(goto %s)", opx->lbl);
445  } else {
446  pj_o(pj);
447  pj_ks(pj, "opcode", "goto");
448  pj_ks(pj, "label", opx->lbl);
449  pj_end(pj);
450  }
451 }
op structure for goto (label -> ctrl eff)
const char * lbl
name of the label, const one

References rz_il_op_args_goto_t::lbl, pj_end(), pj_ks(), pj_o(), rz_strbuf_appendf(), and sb.

Referenced by il_op_effect_resolve().

◆ il_opdmp_is_zero()

static void il_opdmp_is_zero ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 242 of file il_export.c.

242  {
243  il_op_param_1("is_zero", op->op.lsb, bv);
244 }

References il_op_param_1.

Referenced by il_op_pure_resolve().

◆ il_opdmp_ite()

static void il_opdmp_ite ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 157 of file il_export.c.

157  {
158  il_op_param_3("ite", op->op.ite, pure, condition, pure, x, pure, y);
159 }

References il_op_param_3, and x.

Referenced by il_op_pure_resolve().

◆ il_opdmp_jmp()

static void il_opdmp_jmp ( RzILOpEffect op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 437 of file il_export.c.

437  {
438  il_op_param_1("jmp", op->op.jmp, dst);
439 }
char * dst
Definition: lz4.h:724

References dst, and il_op_param_1.

Referenced by il_op_effect_resolve().

◆ il_opdmp_let()

static void il_opdmp_let ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 161 of file il_export.c.

161  {
162  RzILOpArgsLet *opx = &op->op.let;
163  if (sb) {
164  rz_strbuf_appendf(sb, "(let %s ", opx->name);
165  il_op_pure_resolve(opx->exp, sb, pj);
166  rz_strbuf_append(sb, " ");
167  il_op_pure_resolve(opx->body, sb, pj);
168  rz_strbuf_append(sb, ")");
169  } else {
170  pj_o(pj);
171  pj_ks(pj, "opcode", "let");
172  pj_ks(pj, "dst", opx->name);
173  pj_k(pj, "exp");
174  il_op_pure_resolve(opx->exp, sb, pj);
175  pj_k(pj, "body");
176  il_op_pure_resolve(opx->body, sb, pj);
177  pj_end(pj);
178  }
179 }
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

References rz_il_op_args_let_t::body, rz_il_op_args_let_t::exp, il_op_pure_resolve(), rz_il_op_args_let_t::name, pj_end(), pj_k(), pj_ks(), pj_o(), rz_strbuf_append(), rz_strbuf_appendf(), and sb.

Referenced by il_op_pure_resolve().

◆ il_opdmp_load()

static void il_opdmp_load ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 338 of file il_export.c.

338  {
339  RzILOpArgsLoad *opx = &op->op.load;
340  if (sb) {
341  rz_strbuf_appendf(sb, "(load %u ", (ut32)opx->mem);
342  il_op_pure_resolve(opx->key, sb, pj);
343  rz_strbuf_append(sb, ")");
344  } else {
345  pj_o(pj);
346  pj_ks(pj, "opcode", "load");
347  pj_kn(pj, "mem", opx->mem);
348  pj_k(pj, "key");
349  il_op_pure_resolve(opx->key, sb, pj);
350  pj_end(pj);
351  }
352 }
uint32_t ut32
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

References il_op_pure_resolve(), rz_il_op_args_load_t::key, rz_il_op_args_load_t::mem, pj_end(), pj_k(), pj_kn(), pj_ks(), pj_o(), rz_strbuf_append(), rz_strbuf_appendf(), and sb.

Referenced by il_op_pure_resolve().

◆ il_opdmp_loadw()

static void il_opdmp_loadw ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 354 of file il_export.c.

354  {
355  RzILOpArgsLoadW *opx = &op->op.loadw;
356  if (sb) {
357  rz_strbuf_appendf(sb, "(loadw %u %u ", (ut32)opx->mem, (ut32)opx->n_bits);
358  il_op_pure_resolve(opx->key, sb, pj);
359  rz_strbuf_append(sb, ")");
360  } else {
361  pj_o(pj);
362  pj_ks(pj, "opcode", "loadw");
363  pj_kn(pj, "mem", opx->mem);
364  pj_k(pj, "key");
365  il_op_pure_resolve(opx->key, sb, pj);
366  pj_kn(pj, "bits", opx->n_bits);
367  pj_end(pj);
368  }
369 }
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

References il_op_pure_resolve(), rz_il_op_args_loadw_t::key, rz_il_op_args_loadw_t::mem, rz_il_op_args_loadw_t::n_bits, pj_end(), pj_k(), pj_kn(), pj_ks(), pj_o(), rz_strbuf_append(), rz_strbuf_appendf(), and sb.

Referenced by il_op_pure_resolve().

◆ il_opdmp_logand()

static void il_opdmp_logand ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 282 of file il_export.c.

282  {
283  il_op_param_2("&", op->op.logand, pure, x, pure, y);
284 }

References il_op_param_2, and x.

Referenced by il_op_pure_resolve().

◆ il_opdmp_lognot()

static void il_opdmp_lognot ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 250 of file il_export.c.

250  {
251  il_op_param_1("~", op->op.lognot, bv);
252 }

References il_op_param_1.

Referenced by il_op_pure_resolve().

◆ il_opdmp_logor()

static void il_opdmp_logor ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 286 of file il_export.c.

286  {
287  il_op_param_2("|", op->op.logor, pure, x, pure, y);
288 }

References il_op_param_2, and x.

Referenced by il_op_pure_resolve().

◆ il_opdmp_logxor()

static void il_opdmp_logxor ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 290 of file il_export.c.

290  {
291  il_op_param_2("^", op->op.logxor, pure, x, pure, y);
292 }

References il_op_param_2, and x.

Referenced by il_op_pure_resolve().

◆ il_opdmp_lsb()

static void il_opdmp_lsb ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 238 of file il_export.c.

238  {
239  il_op_param_1("lsb", op->op.lsb, bv);
240 }

References il_op_param_1.

Referenced by il_op_pure_resolve().

◆ il_opdmp_mod()

static void il_opdmp_mod ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 274 of file il_export.c.

274  {
275  il_op_param_2("mod", op->op.mod, pure, x, pure, y);
276 }

References il_op_param_2, and x.

Referenced by il_op_pure_resolve().

◆ il_opdmp_msb()

static void il_opdmp_msb ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 234 of file il_export.c.

234  {
235  il_op_param_1("msb", op->op.msb, bv);
236 }

References il_op_param_1.

Referenced by il_op_pure_resolve().

◆ il_opdmp_mul()

static void il_opdmp_mul ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 262 of file il_export.c.

262  {
263  il_op_param_2("*", op->op.mul, pure, x, pure, y);
264 }

References il_op_param_2, and x.

Referenced by il_op_pure_resolve().

◆ il_opdmp_neg()

static void il_opdmp_neg ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 246 of file il_export.c.

246  {
247  il_op_param_1("~-", op->op.neg, bv);
248 }

References il_op_param_1.

Referenced by il_op_pure_resolve().

◆ il_opdmp_nop()

static void il_opdmp_nop ( RzILOpEffect op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 413 of file il_export.c.

413  {
414  il_op_param_0("nop");
415 }

References il_op_param_0.

Referenced by il_op_effect_resolve().

◆ il_opdmp_repeat()

static void il_opdmp_repeat ( RzILOpEffect op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 501 of file il_export.c.

501  {
502  il_op_param_2("repeat", op->op.repeat, pure, condition, effect, data_eff);
503 }

References il_op_param_2.

Referenced by il_op_effect_resolve().

◆ il_opdmp_sdiv()

static void il_opdmp_sdiv ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 270 of file il_export.c.

270  {
271  il_op_param_2("sdiv", op->op.sdiv, pure, x, pure, y);
272 }

References il_op_param_2, and x.

Referenced by il_op_pure_resolve().

◆ il_opdmp_seq()

static void il_opdmp_seq ( RzILOpEffect op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 468 of file il_export.c.

468  {
469  if (sb) {
470  // print things like
471  // (seq (...) (seq (...) (...)))
472  // as just
473  // (seq (...) (...) (...))
474  rz_strbuf_append(sb, "(seq ");
476  rz_strbuf_append(sb, ")");
477  } else {
478  il_op_param_2("seq", op->op.seq, effect, x, effect, y);
479  }
480 }
static void il_opdmp_seq_inner(RzILOpEffect *op, RzStrBuf *sb)
Definition: il_export.c:453

References il_op_param_2, il_opdmp_seq_inner(), rz_strbuf_append(), sb, and x.

Referenced by il_op_effect_resolve().

◆ il_opdmp_seq_inner()

static void il_opdmp_seq_inner ( RzILOpEffect op,
RzStrBuf sb 
)
static

Definition at line 453 of file il_export.c.

453  {
454  RzILOpArgsSeq *seq = &op->op.seq;
455  if (seq->x->code == RZ_IL_OP_SEQ) {
456  il_opdmp_seq_inner(seq->x, sb);
457  } else {
458  il_op_effect_resolve(seq->x, sb, NULL);
459  }
460  rz_strbuf_append(sb, " ");
461  if (seq->y->code == RZ_IL_OP_SEQ) {
462  il_opdmp_seq_inner(seq->y, sb);
463  } else {
464  il_op_effect_resolve(seq->y, sb, NULL);
465  }
466 }
#define NULL
Definition: cris-opc.c:27
op structure for Seq ('a eff -> 'a eff -> 'a eff)
RzILOpEffect * y
perform this second
RzILOpEffect * x
perform this first
RzILOpEffectCode code

References rz_il_op_effect_t::code, il_op_effect_resolve(), NULL, RZ_IL_OP_SEQ, rz_strbuf_append(), sb, rz_il_op_args_seq_t::x, and rz_il_op_args_seq_t::y.

Referenced by il_opdmp_seq().

◆ il_opdmp_set()

static void il_opdmp_set ( RzILOpEffect op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 421 of file il_export.c.

421  {
422  RzILOpArgsSet *opx = &op->op.set;
423  if (sb) {
424  rz_strbuf_appendf(sb, "(set %s ", opx->v);
425  il_op_pure_resolve(opx->x, sb, pj);
426  rz_strbuf_append(sb, ")");
427  } else {
428  pj_o(pj);
429  pj_ks(pj, "opcode", "set");
430  pj_ks(pj, "dst", opx->v);
431  pj_k(pj, "src");
432  il_op_pure_resolve(opx->x, sb, pj);
433  pj_end(pj);
434  }
435 }
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

References il_op_pure_resolve(), pj_end(), pj_k(), pj_ks(), pj_o(), rz_strbuf_append(), rz_strbuf_appendf(), sb, rz_il_op_args_set_t::v, and rz_il_op_args_set_t::x.

Referenced by il_op_effect_resolve().

◆ il_opdmp_shiftl()

static void il_opdmp_shiftl ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 298 of file il_export.c.

298  {
299  il_op_param_3("<<", op->op.shiftl, pure, x, pure, y, pure, fill_bit);
300 }

References il_op_param_3, and x.

Referenced by il_op_pure_resolve().

◆ il_opdmp_shiftr()

static void il_opdmp_shiftr ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 294 of file il_export.c.

294  {
295  il_op_param_3(">>", op->op.shiftr, pure, x, pure, y, pure, fill_bit);
296 }

References il_op_param_3, and x.

Referenced by il_op_pure_resolve().

◆ il_opdmp_sle()

static void il_opdmp_sle ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 306 of file il_export.c.

306  {
307  il_op_param_2("sle", op->op.sle, pure, x, pure, y);
308 }

References il_op_param_2, and x.

Referenced by il_op_pure_resolve().

◆ il_opdmp_smod()

static void il_opdmp_smod ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 278 of file il_export.c.

278  {
279  il_op_param_2("smod", op->op.smod, pure, x, pure, y);
280 }

References il_op_param_2, and x.

Referenced by il_op_pure_resolve().

◆ il_opdmp_store()

static void il_opdmp_store ( RzILOpEffect op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 371 of file il_export.c.

371  {
372  RzILOpArgsStore *opx = &op->op.store;
373 
374  if (sb) {
375  rz_strbuf_appendf(sb, "(store %u ", (ut32)opx->mem);
376  il_op_pure_resolve(opx->key, sb, pj);
377  rz_strbuf_append(sb, " ");
378  il_op_pure_resolve(opx->value, sb, pj);
379  rz_strbuf_append(sb, ")");
380  } else {
381  pj_o(pj);
382  pj_ks(pj, "opcode", "store");
383  pj_kn(pj, "mem", opx->mem);
384  pj_k(pj, "key");
385  il_op_pure_resolve(opx->key, sb, pj);
386  pj_k(pj, "value");
387  il_op_pure_resolve(opx->value, sb, pj);
388  pj_end(pj);
389  }
390 }
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

References il_op_pure_resolve(), rz_il_op_args_store_t::key, rz_il_op_args_store_t::mem, pj_end(), pj_k(), pj_kn(), pj_ks(), pj_o(), rz_strbuf_append(), rz_strbuf_appendf(), sb, and rz_il_op_args_store_t::value.

Referenced by il_op_effect_resolve().

◆ il_opdmp_storew()

static void il_opdmp_storew ( RzILOpEffect op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 392 of file il_export.c.

392  {
393  RzILOpArgsStore *opx = &op->op.store;
394 
395  if (sb) {
396  rz_strbuf_appendf(sb, "(storew %u ", (ut32)opx->mem);
397  il_op_pure_resolve(opx->key, sb, pj);
398  rz_strbuf_append(sb, " ");
399  il_op_pure_resolve(opx->value, sb, pj);
400  rz_strbuf_append(sb, ")");
401  } else {
402  pj_o(pj);
403  pj_ks(pj, "opcode", "storew");
404  pj_kn(pj, "mem", opx->mem);
405  pj_k(pj, "key");
406  il_op_pure_resolve(opx->key, sb, pj);
407  pj_k(pj, "value");
408  il_op_pure_resolve(opx->value, sb, pj);
409  pj_end(pj);
410  }
411 }

References il_op_pure_resolve(), rz_il_op_args_store_t::key, rz_il_op_args_store_t::mem, pj_end(), pj_k(), pj_kn(), pj_ks(), pj_o(), rz_strbuf_append(), rz_strbuf_appendf(), sb, and rz_il_op_args_store_t::value.

Referenced by il_op_effect_resolve().

◆ il_opdmp_sub()

static void il_opdmp_sub ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 258 of file il_export.c.

258  {
259  il_op_param_2("-", op->op.sub, pure, x, pure, y);
260 }

References il_op_param_2, and x.

Referenced by il_op_pure_resolve().

◆ il_opdmp_ule()

static void il_opdmp_ule ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 310 of file il_export.c.

310  {
311  il_op_param_2("ule", op->op.ule, pure, x, pure, y);
312 }

References il_op_param_2, and x.

Referenced by il_op_pure_resolve().

◆ il_opdmp_var()

static void il_opdmp_var ( RzILOpPure op,
RzStrBuf sb,
PJ pj 
)
static

Definition at line 145 of file il_export.c.

145  {
146  RzILOpArgsVar *opx = &op->op.var;
147  if (sb) {
148  rz_strbuf_appendf(sb, "(var %s)", opx->v);
149  } else {
150  pj_o(pj);
151  pj_ks(pj, "opcode", "var");
152  pj_ks(pj, "value", opx->v);
153  pj_end(pj);
154  }
155 }
op structure for var ('a var -> 'a pure)
const char * v
name of variable, const one

References pj_end(), pj_ks(), pj_o(), rz_strbuf_appendf(), sb, and rz_il_op_args_var_t::v.

Referenced by il_op_pure_resolve().

◆ rz_il_event_json()

RZ_API void rz_il_event_json ( RZ_NONNULL RzILEvent evt,
RZ_NONNULL PJ pj 
)

Definition at line 797 of file il_export.c.

797  {
798  rz_return_if_fail(evt && pj);
799  char *tmp0 = NULL, *tmp1 = NULL, *tmp2 = NULL;
800 
801  switch (evt->type) {
803  pj_o(pj);
804  pj_ks(pj, "type", "exception");
805  pj_ks(pj, "exception", evt->data.exception);
806  pj_end(pj);
807  break;
809  tmp0 = rz_bv_as_hex_string(evt->data.pc_write.old_pc, false);
810  tmp1 = rz_bv_as_hex_string(evt->data.pc_write.new_pc, false);
811  pj_o(pj);
812  pj_ks(pj, "type", "pc_write");
813  pj_ks(pj, "old", tmp0);
814  pj_ks(pj, "new", tmp1);
815  pj_end(pj);
816  break;
818  tmp0 = rz_bv_as_hex_string(evt->data.mem_read.address, false);
819  tmp1 = rz_bv_as_hex_string(evt->data.mem_read.value, false);
820  pj_o(pj);
821  pj_ks(pj, "type", "mem_read");
822  pj_ks(pj, "address", tmp0);
823  pj_ks(pj, "value", tmp1);
824  pj_end(pj);
825  break;
827  tmp1 = rz_il_value_stringify(evt->data.var_read.value);
828  pj_o(pj);
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");
832  pj_end(pj);
833  break;
835  tmp0 = rz_bv_as_hex_string(evt->data.mem_write.address, false);
836  tmp1 = evt->data.mem_write.old_value ? rz_bv_as_hex_string(evt->data.mem_write.old_value, false) : NULL;
837  tmp2 = rz_bv_as_hex_string(evt->data.mem_write.new_value, false);
838  pj_o(pj);
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);
843  pj_end(pj);
844  break;
846  tmp1 = rz_il_value_stringify(evt->data.var_write.old_value);
847  tmp2 = rz_il_value_stringify(evt->data.var_write.new_value);
848  pj_o(pj);
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);
853  pj_end(pj);
854  break;
855  default:
857  pj_o(pj);
858  pj_ks(pj, "type", "unknown");
859  pj_end(pj);
860  break;
861  }
862 
863  free(tmp0);
864  free(tmp1);
865  free(tmp2);
866 }
RZ_API char * rz_il_value_stringify(RZ_NONNULL const RzILVal *val)
Definition: il_export.c:739
#define rz_return_if_fail(expr)
Definition: rz_assert.h:100
@ RZ_IL_EVENT_VAR_READ
Definition: rz_il_events.h:23
@ RZ_IL_EVENT_MEM_READ
Definition: rz_il_events.h:22
@ RZ_IL_EVENT_MEM_WRITE
Definition: rz_il_events.h:24
@ RZ_IL_EVENT_EXCEPTION
Definition: rz_il_events.h:20
@ RZ_IL_EVENT_VAR_WRITE
Definition: rz_il_events.h:25
@ RZ_IL_EVENT_PC_WRITE
Definition: rz_il_events.h:21

References free(), NULL, pj_end(), pj_ks(), pj_o(), rz_bv_as_hex_string(), RZ_IL_EVENT_EXCEPTION, RZ_IL_EVENT_MEM_READ, RZ_IL_EVENT_MEM_WRITE, RZ_IL_EVENT_PC_WRITE, RZ_IL_EVENT_VAR_READ, RZ_IL_EVENT_VAR_WRITE, rz_il_value_stringify(), rz_return_if_fail, and rz_warn_if_reached.

Referenced by rz_core_analysis_il_step_with_events().

◆ rz_il_event_stringify()

RZ_API void rz_il_event_stringify ( RZ_NONNULL const RzILEvent evt,
RZ_NONNULL RzStrBuf sb 
)

Create a readable string representation of evt

Definition at line 753 of file il_export.c.

753  {
754  rz_return_if_fail(evt && sb);
755  char *tmp0 = NULL, *tmp1 = NULL, *tmp2 = NULL;
756 
757  switch (evt->type) {
759  rz_strbuf_appendf(sb, "exception(%s)", evt->data.exception);
760  break;
762  tmp0 = rz_bv_as_hex_string(evt->data.pc_write.old_pc, false);
763  tmp1 = rz_bv_as_hex_string(evt->data.pc_write.new_pc, false);
764  rz_strbuf_appendf(sb, "pc_write(old: %s, new: %s)", tmp0, tmp1);
765  break;
767  tmp0 = rz_bv_as_hex_string(evt->data.mem_read.address, false);
768  tmp1 = evt->data.mem_read.value ? rz_bv_as_hex_string(evt->data.mem_read.value, false) : NULL;
769  rz_strbuf_appendf(sb, "mem_read(addr: %s, value: %s)", tmp0, tmp1 ? tmp1 : "uninitialized memory");
770  break;
772  tmp1 = rz_il_value_stringify(evt->data.var_read.value);
773  rz_strbuf_appendf(sb, "var_read(name: %s, value: %s)", evt->data.var_write.variable, tmp1 ? tmp1 : "uninitialized variable");
774  break;
776  tmp0 = rz_bv_as_hex_string(evt->data.mem_write.address, false);
777  tmp1 = evt->data.mem_write.old_value ? rz_bv_as_hex_string(evt->data.mem_write.old_value, false) : NULL;
778  tmp2 = rz_bv_as_hex_string(evt->data.mem_write.new_value, false);
779  rz_strbuf_appendf(sb, "mem_write(addr: %s, old: %s, new: %s)", tmp0, tmp1 ? tmp1 : "uninitialized memory", tmp2);
780  break;
782  tmp1 = rz_il_value_stringify(evt->data.var_write.old_value);
783  tmp2 = rz_il_value_stringify(evt->data.var_write.new_value);
784  rz_strbuf_appendf(sb, "var_write(name: %s, old: %s, new: %s)", evt->data.var_write.variable, tmp1 ? tmp1 : "uninitialized variable", tmp2);
785  break;
786  default:
788  rz_strbuf_append(sb, "unknown(?)");
789  break;
790  }
791 
792  free(tmp0);
793  free(tmp1);
794  free(tmp2);
795 }

References free(), NULL, rz_bv_as_hex_string(), RZ_IL_EVENT_EXCEPTION, RZ_IL_EVENT_MEM_READ, RZ_IL_EVENT_MEM_WRITE, RZ_IL_EVENT_PC_WRITE, RZ_IL_EVENT_VAR_READ, RZ_IL_EVENT_VAR_WRITE, rz_il_value_stringify(), rz_return_if_fail, rz_strbuf_append(), rz_strbuf_appendf(), rz_warn_if_reached, and sb.

Referenced by rz_core_analysis_il_step_with_events().

◆ rz_il_op_effect_json()

RZ_API void rz_il_op_effect_json ( RZ_NONNULL RzILOpEffect op,
RZ_NONNULL PJ pj 
)

Generates the JSON representation of the IL statement

Parameters
opIL statement
pjPJ*, a pointer to the JSON buffer

Definition at line 731 of file il_export.c.

731  {
732  rz_return_if_fail(op && pj);
734 }

References il_op_effect_resolve(), NULL, and rz_return_if_fail.

Referenced by core_analysis_bytes_json().

◆ rz_il_op_effect_stringify()

RZ_API void rz_il_op_effect_stringify ( RZ_NONNULL RzILOpEffect op,
RZ_NONNULL RzStrBuf sb 
)

Generates the string representation of the IL statement

Parameters
opIL statement
sbRzStrBuf*, a pointer to the string buffer

Definition at line 711 of file il_export.c.

711  {
712  rz_return_if_fail(op && sb);
714 }

References il_op_effect_resolve(), NULL, rz_return_if_fail, and sb.

Referenced by core_analysis_bytes_standard(), ds_print_cmt_il(), and print_and_check_il().

◆ rz_il_op_pure_code_stringify()

RZ_API RZ_NONNULL const char* rz_il_op_pure_code_stringify ( RzILOpPureCode  code)

Get a readable representation of code

Returns
constant string, must not be freed

Definition at line 872 of file il_export.c.

872  {
873  switch (code) {
874  case RZ_IL_OP_VAR:
875  return "var";
876  case RZ_IL_OP_ITE:
877  return "ite";
878  case RZ_IL_OP_LET:
879  return "let";
880  case RZ_IL_OP_B0:
881  return "b0";
882  case RZ_IL_OP_B1:
883  return "b1";
884  case RZ_IL_OP_INV:
885  return "inv";
886  case RZ_IL_OP_AND:
887  return "and";
888  case RZ_IL_OP_OR:
889  return "or";
890  case RZ_IL_OP_XOR:
891  return "xor";
892  case RZ_IL_OP_BITV:
893  return "bitv";
894  case RZ_IL_OP_MSB:
895  return "msb";
896  case RZ_IL_OP_LSB:
897  return "lsb";
898  case RZ_IL_OP_IS_ZERO:
899  return "is_zero";
900  case RZ_IL_OP_NEG:
901  return "neg";
902  case RZ_IL_OP_LOGNOT:
903  return "lognot";
904  case RZ_IL_OP_ADD:
905  return "add";
906  case RZ_IL_OP_SUB:
907  return "sub";
908  case RZ_IL_OP_MUL:
909  return "mul";
910  case RZ_IL_OP_DIV:
911  return "div";
912  case RZ_IL_OP_SDIV:
913  return "sdiv";
914  case RZ_IL_OP_MOD:
915  return "mod";
916  case RZ_IL_OP_SMOD:
917  return "smod";
918  case RZ_IL_OP_LOGAND:
919  return "logand";
920  case RZ_IL_OP_LOGOR:
921  return "logor";
922  case RZ_IL_OP_LOGXOR:
923  return "logxor";
924  case RZ_IL_OP_SHIFTR:
925  return "shiftr";
926  case RZ_IL_OP_SHIFTL:
927  return "shiftl";
928  case RZ_IL_OP_EQ:
929  return "eq";
930  case RZ_IL_OP_SLE:
931  return "sle";
932  case RZ_IL_OP_ULE:
933  return "ule";
934  case RZ_IL_OP_CAST:
935  return "cast";
936  case RZ_IL_OP_APPEND:
937  return "append";
938  case RZ_IL_OP_LOAD:
939  return "load";
940  case RZ_IL_OP_LOADW:
941  return "loadw";
942  case RZ_IL_OP_PURE_MAX:
943  break;
944  }
945  return "invalid";
946 }
@ RZ_IL_OP_PURE_MAX
Definition: inftree9.h:24

References RZ_IL_OP_ADD, RZ_IL_OP_AND, RZ_IL_OP_APPEND, RZ_IL_OP_B0, RZ_IL_OP_B1, RZ_IL_OP_BITV, RZ_IL_OP_CAST, RZ_IL_OP_DIV, RZ_IL_OP_EQ, RZ_IL_OP_INV, RZ_IL_OP_IS_ZERO, RZ_IL_OP_ITE, RZ_IL_OP_LET, RZ_IL_OP_LOAD, RZ_IL_OP_LOADW, RZ_IL_OP_LOGAND, RZ_IL_OP_LOGNOT, RZ_IL_OP_LOGOR, RZ_IL_OP_LOGXOR, RZ_IL_OP_LSB, RZ_IL_OP_MOD, RZ_IL_OP_MSB, RZ_IL_OP_MUL, RZ_IL_OP_NEG, RZ_IL_OP_OR, RZ_IL_OP_PURE_MAX, RZ_IL_OP_SDIV, RZ_IL_OP_SHIFTL, RZ_IL_OP_SHIFTR, RZ_IL_OP_SLE, RZ_IL_OP_SMOD, RZ_IL_OP_SUB, RZ_IL_OP_ULE, RZ_IL_OP_VAR, and RZ_IL_OP_XOR.

Referenced by VALIDATOR_PURE().

◆ rz_il_op_pure_json()

RZ_API void rz_il_op_pure_json ( RZ_NONNULL RzILOpPure op,
RZ_NONNULL PJ pj 
)

Generates the JSON representation of the IL statement

Parameters
opIL statement
pjPJ*, a pointer to the JSON buffer

Definition at line 721 of file il_export.c.

721  {
722  rz_return_if_fail(op && pj);
723  il_op_pure_resolve(op, NULL, pj);
724 }

References il_op_pure_resolve(), NULL, and rz_return_if_fail.

◆ rz_il_op_pure_stringify()

RZ_API void rz_il_op_pure_stringify ( RZ_NONNULL RzILOpPure op,
RZ_NONNULL RzStrBuf sb 
)

Generates the string representation of the IL statement

Parameters
opIL statement
sbRzStrBuf*, a pointer to the string buffer

Definition at line 701 of file il_export.c.

701  {
702  rz_return_if_fail(op && sb);
704 }

References il_op_pure_resolve(), NULL, rz_return_if_fail, and sb.

◆ rz_il_sort_pure_stringify()

RZ_API RZ_OWN char* rz_il_sort_pure_stringify ( RzILSortPure  sort)

Get a readable representation of sort

Returns
dynamically allocated string, to be freed by the caller

Definition at line 952 of file il_export.c.

952  {
953  switch (sort.type) {
955  return rz_str_newf("bitvector:%u", (unsigned int)sort.props.bv.length);
957  return strdup("bool");
958  }
959  return strdup("invalid");
960 }
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 char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
@ RZ_IL_TYPE_PURE_BOOL
Definition: sort.h:24
@ RZ_IL_TYPE_PURE_BITVECTOR
Definition: sort.h:25
struct rz_il_sort_pure_t::@283::@284 bv
union rz_il_sort_pure_t::@283 props
RzILTypePure type
Definition: sort.h:29

References rz_il_sort_pure_t::bv, rz_il_sort_pure_t::props, RZ_IL_TYPE_PURE_BITVECTOR, RZ_IL_TYPE_PURE_BOOL, rz_str_newf(), strdup(), and rz_il_sort_pure_t::type.

Referenced by local_var_meet_known_cb(), VALIDATOR_EFFECT(), and VALIDATOR_PURE().

◆ rz_il_value_stringify()

RZ_API char* rz_il_value_stringify ( RZ_NONNULL const RzILVal val)

Create a readable string representation of val

Definition at line 739 of file il_export.c.

739  {
742  if (!bv) {
743  return NULL;
744  }
745  char *r = rz_bv_as_hex_string(bv, false);
746  rz_bv_free(bv);
747  return r;
748 }
ut16 val
Definition: armass64_const.h:6
#define r
Definition: crypto_rc6.c:12
RZ_API RZ_OWN RzBitVector * rz_il_value_to_bv(RZ_NONNULL const RzILVal *val)
Definition: value.c:141
#define rz_return_val_if_fail(expr, val)
Definition: rz_assert.h:108
RZ_API void rz_bv_free(RZ_NULLABLE RzBitVector *bv)
Definition: bitvector.c:85
structure for bitvector
Definition: rz_bitvector.h:19

References NULL, r, rz_bv_as_hex_string(), rz_bv_free(), rz_il_value_to_bv(), rz_return_val_if_fail, and val.

Referenced by rz_il_event_json(), and rz_il_event_stringify().