Rizin
unix-like reverse engineering framework and cli tools
sort.h File Reference

Type and Sort identifiers for values in the IL. More...

#include <rz_types.h>

Go to the source code of this file.

Classes

struct  rz_il_sort_pure_t
 

Typedefs

typedef struct rz_il_sort_pure_t RzILSortPure
 

Enumerations

enum  RzILTypePure { RZ_IL_TYPE_PURE_BOOL , RZ_IL_TYPE_PURE_BITVECTOR }
 
enum  RzILTypeEffect { RZ_IL_TYPE_EFFECT_NONE = 0 , RZ_IL_TYPE_EFFECT_DATA = (1 << 0) , RZ_IL_TYPE_EFFECT_CTRL = (1 << 1) }
 

Functions

static bool rz_il_sort_pure_eq (RzILSortPure a, RzILSortPure b)
 
static RzILSortPure rz_il_sort_pure_bool ()
 
static RzILSortPure rz_il_sort_pure_bv (ut32 length)
 
RZ_API RZ_OWN char * rz_il_sort_pure_stringify (RzILSortPure sort)
 

Detailed Description

Type and Sort identifiers for values in the IL.

Our notion:

  • Types only tell which kind of value something is. E.g. whether it is a bitvector or boolean, but no other info. They can generally be expressed sufficiently as an enum.
  • Sorts carry any additional info that makes up the structure of a value, in particular bitvector sorts specify a concrete bit count.

Definition in file sort.h.

Typedef Documentation

◆ RzILSortPure

Enumeration Type Documentation

◆ RzILTypeEffect

Enumerator
RZ_IL_TYPE_EFFECT_NONE 

nop

RZ_IL_TYPE_EFFECT_DATA 

mutating mems, vars, etc.

RZ_IL_TYPE_EFFECT_CTRL 

jmp/goto

Definition at line 66 of file sort.h.

66  {
68  RZ_IL_TYPE_EFFECT_DATA = (1 << 0),
69  RZ_IL_TYPE_EFFECT_CTRL = (1 << 1)
RzILTypeEffect
Definition: sort.h:66
@ RZ_IL_TYPE_EFFECT_DATA
mutating mems, vars, etc.
Definition: sort.h:68
@ RZ_IL_TYPE_EFFECT_CTRL
jmp/goto
Definition: sort.h:69
@ RZ_IL_TYPE_EFFECT_NONE
nop
Definition: sort.h:67

◆ RzILTypePure

Enumerator
RZ_IL_TYPE_PURE_BOOL 
RZ_IL_TYPE_PURE_BITVECTOR 

Definition at line 23 of file sort.h.

23  {
26 } RzILTypePure;
RzILTypePure
Definition: sort.h:23
@ RZ_IL_TYPE_PURE_BOOL
Definition: sort.h:24
@ RZ_IL_TYPE_PURE_BITVECTOR
Definition: sort.h:25

Function Documentation

◆ rz_il_sort_pure_bool()

static RzILSortPure rz_il_sort_pure_bool ( )
inlinestatic

Definition at line 47 of file sort.h.

47  {
48  RzILSortPure r = {
50  { { 0 } },
51  };
52  return r;
53 }
#define r
Definition: crypto_rc6.c:12

References r, and RZ_IL_TYPE_PURE_BOOL.

Referenced by rz_il_vm_setup_reg_binding(), and VALIDATOR_PURE().

◆ rz_il_sort_pure_bv()

static RzILSortPure rz_il_sort_pure_bv ( ut32  length)
inlinestatic

Definition at line 55 of file sort.h.

55  {
56  RzILSortPure r = {
58  { { 0 } },
59  };
60  r.props.bv.length = length;
61  return r;
62 }
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 static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void length
Definition: sflib.h:133

References length, r, and RZ_IL_TYPE_PURE_BITVECTOR.

Referenced by rz_il_vm_setup_reg_binding(), and VALIDATOR_PURE().

◆ rz_il_sort_pure_eq()

static bool rz_il_sort_pure_eq ( RzILSortPure  a,
RzILSortPure  b 
)
inlinestatic

Definition at line 37 of file sort.h.

37  {
38  if (a.type != b.type) {
39  return false;
40  }
41  if (a.type == RZ_IL_TYPE_PURE_BITVECTOR && a.props.bv.length != b.props.bv.length) {
42  return false;
43  }
44  return true;
45 }
#define b(i)
Definition: sha256.c:42
#define a(i)
Definition: sha256.c:41

References a, b, and RZ_IL_TYPE_PURE_BITVECTOR.

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

◆ 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
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().