Rizin
unix-like reverse engineering framework and cli tools
|
#include <rz_analysis.h>
#include <capstone/capstone.h>
#include "arm_cs.h"
#include "arm_accessors64.h"
#include <rz_il/rz_il_opbuilder_begin.h>
#include "arm_il_common.inc"
#include <rz_il/rz_il_opbuilder_end.h>
Go to the source code of this file.
Macros | |
#define | IMM IMM64 |
#define | REGID REGID64 |
#define | ISIMM ISIMM64 |
#define | ISREG ISREG64 |
#define | ISMEM ISMEM64 |
#define | OPCOUNT OPCOUNT64 |
#define | MEMDISP(x) insn->detail->arm64.operands[x].mem.disp |
#define | REG(n) read_reg(REGID(n)) |
#define | REGBITS(n) reg_bits(REGID(n)) |
#define | MEMBASEID(x) insn->detail->arm64.operands[x].mem.base |
#define | MEMBASE(x) read_reg(MEMBASEID(x)) |
#define | ARG(n, bits) arg(insn, n, bits) |
Functions | |
static RzILOpBool * | cond (arm64_cc c) |
static arm64_reg | xreg (ut8 idx) |
static bool | is_xreg (arm64_reg reg) |
static ut8 | wreg_idx (arm64_reg reg) |
static bool | is_wreg (arm64_reg reg) |
static arm64_reg | xreg_of_reg (arm64_reg reg) |
static const char * | reg_var_name (arm64_reg reg) |
static ut32 | reg_bits (arm64_reg reg) |
static RzILOpBitVector * | read_reg (arm64_reg reg) |
static RzILOpBitVector * | adjust_unsigned (ut32 bits, RZ_OWN RzILOpBitVector *v) |
static RzILOpBitVector * | extend (ut32 dst_bits, arm64_extender ext, RZ_OWN RzILOpBitVector *v, ut32 v_bits) |
static RzILOpBitVector * | apply_shift (arm64_shifter sft, ut32 dist, RZ_OWN RzILOpBitVector *v) |
static RzILOpEffect * | write_reg (arm64_reg reg, RZ_OWN RZ_NONNULL RzILOpBitVector *v) |
static RzILOpBitVector * | arg_mem (RzILOpBitVector *base_plus_disp, cs_arm64_op *op) |
static RzILOpBitVector * | arg (cs_insn *insn, size_t n, ut32 *bits_inout) |
static RzILOpEffect * | update_flags_zn (RzILOpBitVector *v) |
static RzILOpEffect * | update_flags_zn00 (RzILOpBitVector *v) |
static RzILOpEffect * | add_sub (cs_insn *insn) |
static RzILOpEffect * | adr (cs_insn *insn) |
static RzILOpEffect * | bitwise (cs_insn *insn) |
static RzILOpEffect * | shift (cs_insn *insn) |
static RzILOpEffect * | branch (cs_insn *insn) |
static RzILOpEffect * | bl (cs_insn *insn) |
static RzILOpEffect * | bfm (cs_insn *insn) |
static RzILOpEffect * | bic (cs_insn *insn) |
static RzILOpEffect * | cbz (cs_insn *insn) |
static RzILOpEffect * | cmp (cs_insn *insn) |
static RzILOpEffect * | csinc (cs_insn *insn) |
static RzILOpEffect * | cset (cs_insn *insn) |
static RzILOpEffect * | cls (cs_insn *insn) |
static RzILOpEffect * | clz (cs_insn *insn) |
static RzILOpEffect * | extr (cs_insn *insn) |
static RzILOpEffect * | svc (cs_insn *insn) |
static void | label_svc (RzILVM *vm, RzILOpEffect *op) |
static RzILOpEffect * | hvc (cs_insn *insn) |
static void | label_hvc (RzILVM *vm, RzILOpEffect *op) |
static RzILOpEffect * | load_effect (ut32 bits, bool is_signed, arm64_reg dst_reg, RZ_OWN RzILOpBitVector *addr) |
static RzILOpEffect * | writeback (cs_insn *insn, size_t addr_op, RZ_BORROW RzILOpBitVector *addr) |
static RzILOpEffect * | ldr (cs_insn *insn) |
static RzILOpEffect * | str (cs_insn *insn) |
static RzILOpEffect * | madd (cs_insn *insn) |
static RzILOpEffect * | mul (cs_insn *insn) |
static RzILOpEffect * | movn (cs_insn *insn) |
static RzILOpEffect * | mov (cs_insn *insn) |
static RzILOpEffect * | movk (cs_insn *insn) |
static RzILOpEffect * | msr (cs_insn *insn) |
static RzILOpEffect * | sbfx (cs_insn *insn) |
static RzILOpEffect * | mrs (cs_insn *insn) |
static RzILOpEffect * | mvn (cs_insn *insn) |
static RzILOpEffect * | rbit (cs_insn *insn) |
static RzILOpEffect * | rev (cs_insn *insn) |
static RzILOpEffect * | sdiv (cs_insn *insn) |
static RzILOpEffect * | udiv (cs_insn *insn) |
static RzILOpEffect * | smaddl (cs_insn *insn) |
static RzILOpEffect * | smull (cs_insn *insn) |
static RzILOpEffect * | smulh (cs_insn *insn) |
static RzILOpEffect * | sxt (cs_insn *insn) |
static RzILOpEffect * | tbz (cs_insn *insn) |
static RzILOpEffect * | tst (cs_insn *insn) |
RZ_IPI RzILOpEffect * | rz_arm_cs_64_il (csh *handle, cs_insn *insn) |
RZ_IPI RzAnalysisILConfig * | rz_arm_cs_64_il_config (bool big_endian) |
Variables | |
static const char * | regs_bound [] |
#define IMM IMM64 |
Definition at line 11 of file arm_il64.c.
#define ISIMM ISIMM64 |
Definition at line 13 of file arm_il64.c.
#define ISMEM ISMEM64 |
Definition at line 15 of file arm_il64.c.
#define ISREG ISREG64 |
Definition at line 14 of file arm_il64.c.
#define MEMBASEID | ( | x | ) | insn->detail->arm64.operands[x].mem.base |
Definition at line 332 of file arm_il64.c.
#define MEMDISP | ( | x | ) | insn->detail->arm64.operands[x].mem.disp |
Definition at line 18 of file arm_il64.c.
#define OPCOUNT OPCOUNT64 |
Definition at line 16 of file arm_il64.c.
#define REGID REGID64 |
Definition at line 12 of file arm_il64.c.
|
static |
Capstone: ARM64_INS_ADD, ARM64_INS_ADC, ARM64_INS_SUB, ARM64_INS_SBC ARM: add, adds, adc, adcs, sub, subs, sbc, sbcs
Definition at line 442 of file arm_il64.c.
References a, ADD, ARG, ARM64_INS_ADC, ARM64_INS_SBC, ARM64_INS_SUB, b, bits(), CS_API_MAJOR, DUP, ISREG, ITE, NULL, REG, REGBITS, REGID, rz_il_op_pure_free(), SEQ6, SETG, SETL, SUB, UN, update_flags(), update_flags_zn(), VARG, VARL, and write_reg().
Referenced by rz_arm_cs_64_il().
|
static |
Perform an unsigned cast of v or adjust an already existing one
Definition at line 260 of file arm_il64.c.
References bits(), rz_bv_len(), RZ_IL_OP_BITV, RZ_IL_OP_CAST, UNSIGNED, and v.
Referenced by extend().
|
static |
Capstone: ARM64_INS_ADR, ARM64_INS_ADRP ARM: adr, adrp
Definition at line 497 of file arm_il64.c.
References IMM, ISREG, NULL, REGID, U64, and write_reg().
Referenced by rz_arm_cs_64_il().
|
static |
Definition at line 314 of file arm_il64.c.
References ARM64_SFT_ASR, ARM64_SFT_LSL, ARM64_SFT_LSR, SHIFTL0, SHIFTR0, SHIFTRA, UN, and v.
|
static |
IL to retrieve the value of the n
-th arg of insn
bits_inout
Setting the backing variable to non-0 indicates that the result must have this bitness. This is necessary for immediate operands for example. In any case, if a value is returned, its bitness is written back into this storage.
Definition at line 367 of file arm_il64.c.
References ADD, addr, apply_shift(), arg_mem(), ARM64_OP_IMM, ARM64_OP_MEM, ARM64_OP_REG, ARM64_SFT_LSL, extend(), IMM, MEMBASE, MEMDISP, n, NULL, r, REG, REGBITS, st64, SUB, U64, UN, ut64(), and val.
|
static |
Definition at line 351 of file arm_il64.c.
References ADD, apply_shift(), ARM64_REG_INVALID, extend(), read_reg(), and reg_bits().
Referenced by arg().
|
static |
Capstone: ARM64_INS_BFM, ARM64_INS_BFI, ARM64_INS_BFXIL ARM: bfm, bfc, bfi, bfxil
Definition at line 633 of file arm_il64.c.
References a, ARG, ARM64_INS_BFI, b, bits(), IMM, ISIMM, ISREG, LOGAND, LOGOR, mask, NULL, REGID, RZ_MIN, rz_num_bitmask(), SHIFTL0, SHIFTR0, UN, ut64(), and write_reg().
Referenced by rz_arm_cs_64_il().
|
static |
Capstone: ARM64_INS_BIC, ARM64_INS_BICS ARM: bic, bics
Definition at line 664 of file arm_il64.c.
References a, ARG, ARM64_REG_WZR, ARM64_REG_XZR, b, bits(), ISREG, LOGAND, LOGNOT, NULL, REG, REGBITS, REGID, rz_il_op_pure_free(), SEQ2, update_flags_zn00(), and write_reg().
Referenced by rz_arm_cs_64_il().
|
static |
Capstone: ARM64_INS_AND, ARM64_INS_EON, ARM64_INS_EOR, ARM64_INS_ORN, ARM64_INS_AORR ARM: and, eon, eor, orn, orr
Definition at line 508 of file arm_il64.c.
References a, ARG, ARM64_INS_EON, ARM64_INS_EOR, ARM64_INS_ORN, ARM64_INS_ORR, b, bits(), ISREG, LOGAND, LOGNOT, LOGOR, LOGXOR, NULL, REG, REGBITS, REGID, rz_il_op_pure_free(), SEQ2, update_flags_zn00(), and write_reg().
Referenced by rz_arm_cs_64_il().
|
static |
|
static |
Capstone: ARM64_INS_B, ARM64_INS_RET, ARM64_INS_RETAA, ARM64_INS_RETAB ARM: b, b.cond, ret, retaa, retab
Definition at line 595 of file arm_il64.c.
References a, ARG, ARM64_REG_LR, bits(), BRANCH, c, cond(), JMP, NOP, NULL, OPCOUNT, and read_reg().
Referenced by rz_arm_cs_64_il().
|
static |
Capstone: ARM64_INS_CBZ, ARM64_INS_CBNZ ARM: cbz, cbnz
Definition at line 789 of file arm_il64.c.
References ARG, ARM64_INS_CBNZ, bits(), BRANCH, INV, IS_ZERO, JMP, NULL, rz_il_op_pure_free(), and v.
Referenced by rz_arm_cs_64_il().
|
static |
Capstone: ARM64_INS_CLS ARM: cls
Definition at line 915 of file arm_il64.c.
References ADD, ARG, bits(), INV, ISREG, MSB, NULL, REGID, REPEAT, SEQ2, SEQ5, SETL, SHIFTL, SN, UN, v, VARL, write_reg(), and XOR.
Referenced by filter_classes(), hex_get_reg_in_class(), rz_analysis_class_method_recover(), rz_arm_cs_64_il(), rz_core_bin_class_build_flag_name(), rz_core_bin_field_build_flag_name(), rz_core_bin_method_build_flag_name(), and rz_core_bin_super_build_flag_name().
|
static |
|
static |
Capstone: ARM64_INS_CMP, ARM64_INS_CMN, ARM64_INS_CCMP, ARM64_INS_CCMN ARM: cmp, cmn, ccmp, ccmn
Definition at line 805 of file arm_il64.c.
References a, ADD, ARG, ARM64_INS_CCMN, ARM64_INS_CMN, b, bits(), BRANCH, c, cond(), IL_FALSE, IL_TRUE, IMM, imm, NULL, rz_il_op_pure_free(), SEQ4, SEQ6, SETG, SETL, SUB, update_flags_zn(), ut64(), and VARL.
Referenced by rz_arm_cs_64_il().
|
static |
IL for arm64 condition unconditional is returned as NULL (rather than true), for simpler code
Definition at line 38 of file arm_il64.c.
References AND, ARM64_CC_EQ, ARM64_CC_GE, ARM64_CC_GT, ARM64_CC_HI, ARM64_CC_HS, ARM64_CC_LE, ARM64_CC_LO, ARM64_CC_LS, ARM64_CC_LT, ARM64_CC_MI, ARM64_CC_NE, ARM64_CC_PL, ARM64_CC_VC, ARM64_CC_VS, c, INV, NULL, OR, VARG, and XOR.
|
static |
Capstone: ARM64_INS_CSET, ARM64_INS_CSETM ARM: cset, csetm
Definition at line 899 of file arm_il64.c.
References ARM64_INS_CSETM, bits(), c, cond(), ISREG, ITE, NULL, REGBITS, REGID, SN, and write_reg().
Referenced by allocset(), and rz_arm_cs_64_il().
|
static |
Capstone: ARM64_INS_CINC, ARM64_INS_CSINC, ARM64_INS_CINV, ARM64_INS_CSINV, ARM64_INS_CNEG, ARM64_INS_CSNEG, ARM64_INS_CSEL ARM: cinc, csinc, cinv, csinv, cneg, csneg, csel
Definition at line 840 of file arm_il64.c.
References ADD, ARG, ARM64_INS_CINV, ARM64_INS_CNEG, ARM64_INS_CSEL, ARM64_INS_CSINC, ARM64_INS_CSINV, ARM64_INS_CSNEG, bits(), c, cond(), ISREG, ITE, LOGNOT, NEG, NULL, OPCOUNT, REGBITS, REGID, rz_il_op_pure_free(), UN, and write_reg().
Referenced by rz_arm_cs_64_il().
|
static |
Definition at line 270 of file arm_il64.c.
References adjust_unsigned(), ARM64_EXT_SXTB, ARM64_EXT_SXTH, ARM64_EXT_SXTW, ARM64_EXT_SXTX, ARM64_EXT_UXTB, ARM64_EXT_UXTH, ARM64_EXT_UXTW, ARM64_EXT_UXTX, ext, SIGNED, UNSIGNED, and v.
Referenced by arg(), arg_mem(), print_insn_mips16(), and print_mips16_insn_arg().
|
static |
Capstone: ARM64_INS_EXTR ARM: extr
Definition at line 962 of file arm_il64.c.
References APPEND, ARG, bits(), h, ISREG, NULL, REGBITS, REGID, rz_il_op_pure_free(), SHIFTR0, UNSIGNED, and write_reg().
Referenced by rz_arm_cs_64_il().
|
static |
Capstone: ARM64_INS_HVC ARM: hvc
Definition at line 999 of file arm_il64.c.
References GOTO.
Referenced by il_unconditional(), and rz_arm_cs_64_il().
Definition at line 171 of file arm_il64.c.
References ARM64_REG_W0, ARM64_REG_W30, ARM64_REG_WSP, ARM64_REG_WZR, and reg.
Referenced by ldr(), load_effect(), read_reg(), reg_bits(), write_reg(), and xreg_of_reg().
Definition at line 116 of file arm_il64.c.
References ARM64_REG_SP, ARM64_REG_X0, ARM64_REG_X1, ARM64_REG_X10, ARM64_REG_X11, ARM64_REG_X12, ARM64_REG_X13, ARM64_REG_X14, ARM64_REG_X15, ARM64_REG_X16, ARM64_REG_X17, ARM64_REG_X18, ARM64_REG_X19, ARM64_REG_X2, ARM64_REG_X20, ARM64_REG_X21, ARM64_REG_X22, ARM64_REG_X23, ARM64_REG_X24, ARM64_REG_X25, ARM64_REG_X26, ARM64_REG_X27, ARM64_REG_X28, ARM64_REG_X29, ARM64_REG_X3, ARM64_REG_X30, ARM64_REG_X4, ARM64_REG_X5, ARM64_REG_X6, ARM64_REG_X7, ARM64_REG_X8, ARM64_REG_X9, ARM64_REG_XZR, and reg.
Referenced by reg_bits(), and writeback().
|
static |
Definition at line 1003 of file arm_il64.c.
Referenced by rz_arm_cs_64_il_config().
|
static |
Definition at line 991 of file arm_il64.c.
Referenced by rz_arm_cs_64_il_config().
|
static |
Capstone: ARM64_INS_LDR, ARM64_INS_LDRB, ARM64_INS_LDRH, ARM64_INS_LDRU, ARM64_INS_LDRUB, ARM64_INS_LDRUH, ARM64_INS_LDRSW, ARM64_INS_LDRSB, ARM64_INS_LDRSH, ARM64_INS_LDURSW, ARM64_INS_LDURSB, ARM64_INS_LDURSH, ARM64_INS_LDAPR, ARM64_INS_LDAPRB, ARM64_INS_LDAPRH, ARM64_INS_LDAPUR, ARM64_INS_LDAPURB, ARM64_INS_LDAPURH, ARM64_INS_LDAPURSB, ARM64_INS_LDAPURSH, ARM64_INS_LDAPURSW, ARM64_INS_LDAR, ARM64_INS_LDARB, ARM64_INS_LDARH, ARM64_INS_LDAXP, ARM64_INS_LDXP, ARM64_INS_LDAXR, ARM64_INS_LDAXRB, ARM64_INS_LDAXRH, ARM64_INS_LDLAR, ARM64_INS_LDLARB, ARM64_INS_LDLARH, ARM64_INS_LDP, ARM64_INS_LDNP, ARM64_INS_LDPSW, ARM64_INS_LDRAA, ARM64_INS_LDRAB, ARM64_INS_LDTR, ARM64_INS_LDTRB, ARM64_INS_LDTRH, ARM64_INS_LDTRSW, ARM64_INS_LDTRSB, ARM64_INS_LDTRSH, ARM64_INS_LDXR, ARM64_INS_LDXRB, ARM64_INS_LDXRH ARM: ldr, ldrb, ldrh, ldru, ldrub, ldruh, ldrsw, ldrsb, ldrsh, ldursw, ldurwb, ldursh, ldapr, ldaprb, ldaprh, ldapur, ldapurb, ldapurh, ldapursb, ldapursh, ldapursw, ldaxp, ldxp, ldaxr, ldaxrb, ldaxrh, ldar, ldarb, ldarh, ldp, ldnp, ldtr, ldtrb, ldtrh, ldtrsw, ldtrsb, ldtrsh, ldxr, ldxrb, ldxrh
Definition at line 1058 of file arm_il64.c.
References ADD, addr, ARG, ARM64_INS_LDARB, ARM64_INS_LDARH, ARM64_INS_LDAXP, ARM64_INS_LDAXRB, ARM64_INS_LDAXRH, ARM64_INS_LDNP, ARM64_INS_LDP, ARM64_INS_LDPSW, ARM64_INS_LDRB, ARM64_INS_LDRH, ARM64_INS_LDRSB, ARM64_INS_LDRSH, ARM64_INS_LDRSW, ARM64_INS_LDTRB, ARM64_INS_LDTRH, ARM64_INS_LDTRSB, ARM64_INS_LDTRSH, ARM64_INS_LDTRSW, ARM64_INS_LDURB, ARM64_INS_LDURH, ARM64_INS_LDURSB, ARM64_INS_LDURSH, ARM64_INS_LDURSW, ARM64_INS_LDXP, ARM64_INS_LDXRB, ARM64_INS_LDXRH, bits(), DUP, is_wreg(), ISREG, load_effect(), NULL, REGID, rz_il_op_effect_free(), SEQ2, SETL, U64, ut64(), VARL, and writeback().
Referenced by rz_arm_cs_64_il().
|
static |
Definition at line 1007 of file arm_il64.c.
References addr, bits(), is_wreg(), LOAD, LOADW, SIGNED, UNSIGNED, val, write_reg(), and xreg_of_reg().
Referenced by ldr().
|
static |
Capstone: ARM64_INS_MADD, ARM64_INS_MSUB ARM: madd, msub
Definition at line 1591 of file arm_il64.c.
References ADD, ARG, ARM64_INS_MSUB, bits(), ISREG, MUL, NULL, REGBITS, REGID, SUB, and write_reg().
Referenced by rz_arm_cs_64_il().
|
static |
Capstone: ARM64_INS_MOV, ARM64_INS_MOVZ ARM: mov, movz
Definition at line 1646 of file arm_il64.c.
References ARG, bits(), IMM, ISIMM, ISREG, movn(), NULL, REGBITS, REGID, src, and write_reg().
Referenced by rz_arm_cs_64_il().
|
static |
Capstone: ARM64_INS_MOVK ARM: movk
Definition at line 1670 of file arm_il64.c.
References ARG, ARM64_SFT_LSL, bits(), ISIMM, ISREG, LOGAND, LOGOR, NULL, REGID, shift(), src, UN, ut64(), and write_reg().
Referenced by rz_arm_cs_64_il().
|
static |
Capstone: ARM64_INS_MOVN ARM: movn
Definition at line 1688 of file arm_il64.c.
References ARM64_SFT_LSL, bits(), ISIMM, ISREG, NULL, REGBITS, REGID, shift(), UN, ut64(), and write_reg().
Referenced by mov(), and rz_arm_cs_64_il().
|
static |
Capstone: ARM64_INS_MRS ARM: mrs
Definition at line 1800 of file arm_il64.c.
References ARM64_OP_REG_MRS, ARM64_OP_SYS, bits(), ISREG, ITE, LOGOR, NULL, REGBITS, REGID, UN, VARG, and write_reg().
Referenced by rz_arm_cs_64_il().
|
static |
Capstone: ARM64_INS_MSR ARM: msr
Definition at line 1708 of file arm_il64.c.
References ARG, ARM64_OP_REG_MSR, ARM64_OP_SYS, bits(), DUP, INV, IS_ZERO, LOGAND, NULL, SEQ4, SETG, UN, and val.
Referenced by rz_arm_cs_64_il().
|
static |
Capstone: ARM64_INS_MUL, ARM64_INS_MNEG ARM: mul, mneg
Definition at line 1618 of file arm_il64.c.
References ARG, ARM64_INS_MNEG, bits(), ISREG, MUL, NEG, NULL, REGBITS, REGID, rz_il_op_pure_free(), and write_reg().
Referenced by rz_arm_cs_64_il().
|
static |
Capstone: ARM64_INS_MVN, ARM64_INS_NEG, ARM64_INS_NEGS, ARM64_INS_NGC, ARM64_INS_NGCS ARM: mvn, neg, negs, ngc, ngcs
Definition at line 1829 of file arm_il64.c.
References ADD, ARG, ARM64_INS_NEG, ARM64_INS_NEGS, ARM64_INS_NGC, ARM64_INS_NGCS, bits(), DUP, ISREG, ITE, LOGNOT, NEG, NULL, REG, REGID, SEQ5, SETG, SETL, UN, update_flags_zn(), val, VARG, VARL, and write_reg().
Referenced by rz_arm_cs_64_il().
|
static |
Capstone: ARM64_INS_RBIT ARM: rbit
Definition at line 1875 of file arm_il64.c.
References ARG, bits(), INV, IS_ZERO, ISREG, ITE, LOGOR, LSB, NULL, REGID, REPEAT, SEQ3, SEQ5, SETL, SHIFTL0, SHIFTR0, SUB, UN, v, VARL, and write_reg().
Referenced by rz_arm_cs_64_il().
|
static |
IL to read the given capstone reg
Definition at line 240 of file arm_il64.c.
References ARM64_REG_WZR, ARM64_REG_XZR, is_wreg(), NULL, reg, reg_var_name(), U32, U64, UNSIGNED, and VARG.
Get the bits of the given register or 0, if it is not known (e.g. not implemented yet)
Definition at line 227 of file arm_il64.c.
References ARM64_REG_WZR, ARM64_REG_XZR, is_wreg(), is_xreg(), and reg.
Referenced by arg_mem().
Variable name for a register given by cs
Definition at line 185 of file arm_il64.c.
References ARM64_REG_SP, ARM64_REG_X0, ARM64_REG_X1, ARM64_REG_X10, ARM64_REG_X11, ARM64_REG_X12, ARM64_REG_X13, ARM64_REG_X14, ARM64_REG_X15, ARM64_REG_X16, ARM64_REG_X17, ARM64_REG_X18, ARM64_REG_X19, ARM64_REG_X2, ARM64_REG_X20, ARM64_REG_X21, ARM64_REG_X22, ARM64_REG_X23, ARM64_REG_X24, ARM64_REG_X25, ARM64_REG_X26, ARM64_REG_X27, ARM64_REG_X28, ARM64_REG_X29, ARM64_REG_X3, ARM64_REG_X30, ARM64_REG_X4, ARM64_REG_X5, ARM64_REG_X6, ARM64_REG_X7, ARM64_REG_X8, ARM64_REG_X9, NULL, reg, and xreg_of_reg().
Referenced by read_reg(), and write_reg().
|
static |
Capstone: ARM64_INS_REV, ARM64_INS_REV32, ARM64_INS_REV16 ARM: rev, rev32, rev16
Definition at line 1904 of file arm_il64.c.
References APPEND, ARM64_INS_REV16, ARM64_INS_REV32, DUP, ISREG, NULL, read_reg(), REGBITS, REGID, SHIFTR0, src, UN, UNSIGNED, write_reg(), and xreg_of_reg().
Referenced by rz_arm_cs_64_il().
RZ_IPI RzILOpEffect* rz_arm_cs_64_il | ( | csh * | handle, |
cs_insn * | insn | ||
) |
Lift an AArch64 instruction to RzIL
Currently unimplemented:
Plausible to represent by adding another memory with a 60bit keys and 4bit values to hold the memory tags. Instructions:
Extremely complex internal calculations. Different options to implement it include:
Definition at line 2316 of file arm_il64.c.
References add_sub(), adr(), ARM64_INS_ADC, ARM64_INS_ADD, ARM64_INS_ADR, ARM64_INS_ADRP, ARM64_INS_AND, ARM64_INS_ASR, ARM64_INS_B, ARM64_INS_BFI, ARM64_INS_BFM, ARM64_INS_BFXIL, ARM64_INS_BIC, ARM64_INS_BL, ARM64_INS_BLR, ARM64_INS_BR, ARM64_INS_CBNZ, ARM64_INS_CBZ, ARM64_INS_CCMN, ARM64_INS_CCMP, ARM64_INS_CINC, ARM64_INS_CINV, ARM64_INS_CLS, ARM64_INS_CLZ, ARM64_INS_CMN, ARM64_INS_CMP, ARM64_INS_CNEG, ARM64_INS_CSEL, ARM64_INS_CSET, ARM64_INS_CSETM, ARM64_INS_CSINC, ARM64_INS_CSINV, ARM64_INS_CSNEG, ARM64_INS_EON, ARM64_INS_EOR, ARM64_INS_EXTR, ARM64_INS_HINT, ARM64_INS_HVC, ARM64_INS_LDAR, ARM64_INS_LDARB, ARM64_INS_LDARH, ARM64_INS_LDAXP, ARM64_INS_LDAXR, ARM64_INS_LDAXRB, ARM64_INS_LDAXRH, ARM64_INS_LDNP, ARM64_INS_LDP, ARM64_INS_LDPSW, ARM64_INS_LDR, ARM64_INS_LDRB, ARM64_INS_LDRH, ARM64_INS_LDRSB, ARM64_INS_LDRSH, ARM64_INS_LDRSW, ARM64_INS_LDTR, ARM64_INS_LDTRB, ARM64_INS_LDTRH, ARM64_INS_LDTRSB, ARM64_INS_LDTRSH, ARM64_INS_LDTRSW, ARM64_INS_LDUR, ARM64_INS_LDURB, ARM64_INS_LDURH, ARM64_INS_LDURSB, ARM64_INS_LDURSH, ARM64_INS_LDURSW, ARM64_INS_LDXP, ARM64_INS_LDXR, ARM64_INS_LDXRB, ARM64_INS_LDXRH, ARM64_INS_LSL, ARM64_INS_LSR, ARM64_INS_MADD, ARM64_INS_MNEG, ARM64_INS_MOV, ARM64_INS_MOVK, ARM64_INS_MOVN, ARM64_INS_MOVZ, ARM64_INS_MRS, ARM64_INS_MSR, ARM64_INS_MSUB, ARM64_INS_MUL, ARM64_INS_MVN, ARM64_INS_NEG, ARM64_INS_NEGS, ARM64_INS_NGC, ARM64_INS_NGCS, ARM64_INS_NOP, ARM64_INS_ORN, ARM64_INS_ORR, ARM64_INS_PRFM, ARM64_INS_PRFUM, ARM64_INS_RBIT, ARM64_INS_RET, ARM64_INS_REV, ARM64_INS_REV16, ARM64_INS_REV32, ARM64_INS_ROR, ARM64_INS_SBC, ARM64_INS_SBFIZ, ARM64_INS_SBFX, ARM64_INS_SDIV, ARM64_INS_SEV, ARM64_INS_SEVL, ARM64_INS_SMADDL, ARM64_INS_SMNEGL, ARM64_INS_SMSUBL, ARM64_INS_SMULH, ARM64_INS_SMULL, ARM64_INS_STLR, ARM64_INS_STLRB, ARM64_INS_STLRH, ARM64_INS_STLXP, ARM64_INS_STLXR, ARM64_INS_STLXRB, ARM64_INS_STLXRH, ARM64_INS_STNP, ARM64_INS_STP, ARM64_INS_STR, ARM64_INS_STRB, ARM64_INS_STRH, ARM64_INS_STTR, ARM64_INS_STTRB, ARM64_INS_STTRH, ARM64_INS_STUR, ARM64_INS_STURB, ARM64_INS_STURH, ARM64_INS_STXP, ARM64_INS_STXR, ARM64_INS_STXRB, ARM64_INS_STXRH, ARM64_INS_SUB, ARM64_INS_SVC, ARM64_INS_SXTB, ARM64_INS_SXTH, ARM64_INS_SXTW, ARM64_INS_TBNZ, ARM64_INS_TBZ, ARM64_INS_TST, ARM64_INS_UBFIZ, ARM64_INS_UBFX, ARM64_INS_UDIV, ARM64_INS_UMADDL, ARM64_INS_UMNEGL, ARM64_INS_UMSUBL, ARM64_INS_UMULH, ARM64_INS_UMULL, ARM64_INS_UXTB, ARM64_INS_UXTH, ARM64_INS_WFE, ARM64_INS_WFI, ARM64_INS_YIELD, bfm(), bic(), bitwise(), bl(), branch(), cbz(), cls(), clz(), cmp(), cset(), csinc(), extr(), hvc(), INV, ldr(), madd(), mov(), movk(), movn(), mrs(), msr(), mul(), mvn(), NOP, NULL, rbit(), rev(), sbfx(), sdiv(), SETG, shift(), smaddl(), smulh(), smull(), str(), svc(), sxt(), tbz(), tst(), udiv(), and VARG.
Referenced by analysis_op().
RZ_IPI RzAnalysisILConfig* rz_arm_cs_64_il_config | ( | bool | big_endian | ) |
Definition at line 2762 of file arm_il64.c.
References EFFECT_LABEL_SYSCALL, rz_il_effect_label_t::hook, label_hvc(), label_svc(), r, regs_bound, rz_analysis_il_config_add_label(), rz_analysis_il_config_new(), and rz_il_effect_label_new().
Referenced by il_config().
|
static |
Capstone: ARM64_INS_SBFX, ARM64_INS_SBFIZ, ARM64_INS_UBFX, ARM64_INS_UBFIZ ARM: sbfx, sbfiz, ubfx, ubfiz
Definition at line 1770 of file arm_il64.c.
References ARG, ARM64_INS_SBFIZ, ARM64_INS_SBFX, ARM64_INS_UBFIZ, bits(), IMM, ISIMM, ISREG, LET, NULL, REGBITS, REGID, SHIFTL0, SHIFTR0, SIGNED, src, UN, UNSIGNED, ut64(), VARLP, width, and write_reg().
Referenced by rz_arm_cs_64_il().
|
static |
Capstone: ARM64_INS_SDIV ARM: sdiv
Definition at line 1970 of file arm_il64.c.
References a, AND, ARG, b, bits(), DUP, EQ, ISREG, ITE, NULL, REGBITS, REGID, rz_il_op_pure_free(), SDIV, UN, and write_reg().
Referenced by rz_arm_cs_64_il().
|
static |
Capstone: ARM64_INS_ASR, ARM64_INS_LSL, ARM64_INS_LSR, ARM64_INS_ROR ARM: asr, asrv, lsl, lslv, lsr, lsrv, ror, rorv
Definition at line 555 of file arm_il64.c.
References a, ARG, ARM64_INS_ASR, ARM64_INS_LSR, ARM64_INS_ROR, b, bits(), DUP, ISREG, LOGOR, NEG, NULL, REGBITS, REGID, rz_il_op_pure_free(), SHIFTL0, SHIFTR0, SHIFTRA, and write_reg().
Referenced by movk(), movn(), and rz_arm_cs_64_il().
|
static |
Capstone: ARM64_INS_SMADDL, ARM64_INS_SMSUBL, ARM64_INS_UMADDL, ARM64_INS_UMSUBL ARM: smaddl, smsubl, umaddl, umsubl
Definition at line 2039 of file arm_il64.c.
References ADD, ARG, ARM64_INS_SMADDL, ARM64_INS_SMSUBL, ARM64_INS_UMSUBL, bits(), ISREG, MUL, NULL, REGBITS, REGID, rz_il_op_pure_free(), SIGNED, SUB, UNSIGNED, write_reg(), and x.
Referenced by rz_arm_cs_64_il().
|
static |
Capstone: ARM64_INS_SMULH, ARM64_INS_UMULH ARM: smulh, umulh
Definition at line 2092 of file arm_il64.c.
References ARG, ARM64_INS_SMULH, bits(), ISREG, MUL, NULL, REGBITS, REGID, rz_il_op_pure_free(), SHIFTR0, SIGNED, UN, UNSIGNED, write_reg(), and x.
Referenced by rz_arm_cs_64_il().
|
static |
Capstone: ARM64_INS_SMULL, ARM64_INS_SMNEGL, ARM64_INS_UMULL, ARM64_INS_UMNEGL ARM: smull, smnegl, umull, umnegl
Definition at line 2068 of file arm_il64.c.
References ARG, ARM64_INS_SMNEGL, ARM64_INS_SMULL, ARM64_INS_UMNEGL, bits(), ISREG, MUL, NEG, NULL, REGBITS, REGID, rz_il_op_pure_free(), SIGNED, UNSIGNED, write_reg(), and x.
Referenced by rz_arm_cs_64_il().
|
static |
Capstone: ARM64_INS_STR, ARM64_INS_STUR, ARM64_INS_STRB, ARM64_INS_STURB, ARM64_INS_STRH, ARM64_INS_STURH, ARM64_INS_STLLR, ARM64_INS_STLLRB, ARM64_INS_STLLRH, ARM64_INS_STLR, ARM64_INS_STLRB, ARM64_INS_STLRH, ARM64_INS_STLUR, ARM64_INS_STLURB, ARM64_INS_STLURH, ARM64_INS_STP, ARM64_INS_STXR, ARM64_INS_STXRB, ARM64_INS_STXRH, ARM64_INS_STXP, ARM64_INS_STLXR, ARM64_INS_STLXRB. ARM64_INS_STLXRH, ARM64_INS_STLXP, ARM64_INS_STNP, ARM64_INS_STTR, ARM64_INS_STTRB, ARM64_INS_STTRH ARM: str, stur, strb, sturb, strh, sturh, stllr, stllrb, stllrh, stlr, stlrb, stlrh, stlur, stlurb, stlurh, stp, stxr, stxrb, stxrh, stxp, stlxr, stlxrb. stlxrh, stlxp, stnp, sttr, sttrb, sttrh
Definition at line 1169 of file arm_il64.c.
References ADD, addr, ARG, ARM64_INS_STLRB, ARM64_INS_STLRH, ARM64_INS_STLXP, ARM64_INS_STLXR, ARM64_INS_STLXRB, ARM64_INS_STLXRH, ARM64_INS_STNP, ARM64_INS_STP, ARM64_INS_STRB, ARM64_INS_STRH, ARM64_INS_STTRB, ARM64_INS_STTRH, ARM64_INS_STURB, ARM64_INS_STURH, ARM64_INS_STXP, ARM64_INS_STXR, ARM64_INS_STXRB, ARM64_INS_STXRH, bits(), DUP, ISREG, NULL, REGBITS, REGID, rz_il_op_effect_free(), rz_il_op_pure_free(), SEQ2, STORE, STOREW, U64, UN, val, write_reg(), and writeback().
Referenced by rz_arm_cs_64_il().
|
static |
Capstone: ARM_INS_SVC ARM: svc
Definition at line 987 of file arm_il64.c.
References GOTO.
Referenced by rz_arm_cs_64_il().
|
static |
Capstone: ARM64_INS_SXTB, ARM64_INS_SXTH, ARM64_INS_SXTW, ARM64_INS_UXTB, ARM64_INS_UXTH ARM: sxtb, sxth, sxtw, uxtb, uxth
Definition at line 2173 of file arm_il64.c.
References ARG, ARM64_INS_SXTB, ARM64_INS_SXTH, ARM64_INS_UXTB, ARM64_INS_UXTH, bits(), ISREG, NULL, REGBITS, REGID, SIGNED, src, UNSIGNED, and write_reg().
Referenced by rz_arm_cs_64_il().
|
static |
Capstone: ARM64_INS_TBNZ, ARM64_TBZ ARM: tbnz, tbz
Definition at line 2207 of file arm_il64.c.
References ARG, ARM64_INS_TBNZ, bits(), BRANCH, c, IMM, ISIMM, JMP, LSB, NULL, rz_il_op_pure_free(), SHIFTR0, src, and UN.
Referenced by rz_arm_cs_64_il().
|
static |
Capstone: ARM64_INS_TST ARM: tst
Definition at line 2229 of file arm_il64.c.
References a, ARG, b, bits(), LOGAND, NULL, rz_il_op_pure_free(), and update_flags_zn00().
Referenced by rz_arm_cs_64_il().
|
static |
Capstone: ARM64_INS_UDIV ARM: udiv
Definition at line 1996 of file arm_il64.c.
References a, ARG, b, bits(), DIV, DUP, EQ, ISREG, ITE, NULL, REGBITS, REGID, rz_il_op_pure_free(), UN, and write_reg().
Referenced by rz_arm_cs_64_il().
|
static |
|
static |
Definition at line 157 of file arm_il64.c.
References ARM64_REG_W0, ARM64_REG_W30, ARM64_REG_WSP, ARM64_REG_WZR, reg, and rz_warn_if_reached.
Referenced by xreg_of_reg().
|
static |
IL to write a value to the given capstone reg
Definition at line 338 of file arm_il64.c.
References is_wreg(), NULL, reg, reg_var_name(), rz_il_op_pure_free(), rz_return_val_if_fail, SETG, UNSIGNED, and v.
Referenced by add_sub(), adr(), bfm(), bic(), bitwise(), cls(), clz(), cset(), csinc(), extr(), load_effect(), madd(), mov(), movk(), movn(), mrs(), mul(), mvn(), rbit(), rev(), sbfx(), sdiv(), shift(), smaddl(), smulh(), smull(), str(), sxt(), udiv(), and writeback().
|
static |
Definition at line 73 of file arm_il64.c.
References ARM64_REG_INVALID, ARM64_REG_SP, ARM64_REG_X0, ARM64_REG_X1, ARM64_REG_X10, ARM64_REG_X11, ARM64_REG_X12, ARM64_REG_X13, ARM64_REG_X14, ARM64_REG_X15, ARM64_REG_X16, ARM64_REG_X17, ARM64_REG_X18, ARM64_REG_X19, ARM64_REG_X2, ARM64_REG_X20, ARM64_REG_X21, ARM64_REG_X22, ARM64_REG_X23, ARM64_REG_X24, ARM64_REG_X25, ARM64_REG_X26, ARM64_REG_X27, ARM64_REG_X28, ARM64_REG_X29, ARM64_REG_X3, ARM64_REG_X30, ARM64_REG_X4, ARM64_REG_X5, ARM64_REG_X6, ARM64_REG_X7, ARM64_REG_X8, ARM64_REG_X9, ARM64_REG_XZR, setup::idx, and rz_warn_if_reached.
Referenced by xreg_of_reg().
Definition at line 175 of file arm_il64.c.
References is_wreg(), reg, wreg_idx(), and xreg().
Referenced by load_effect(), reg_var_name(), and rev().
|
static |
All regs available as global IL variables
Definition at line 27 of file arm_il64.c.
Referenced by rz_arm_cs_64_il_config().