Rizin
unix-like reverse engineering framework and cli tools
arm_accessors32.h File Reference
#include <capstone/capstone.h>

Go to the source code of this file.

Macros

#define REGID(x)   insn->detail->arm.operands[x].reg
 
#define IMM(x)   (ut32)(insn->detail->arm.operands[x].imm)
 
#define INSOP(x)   insn->detail->arm.operands[x]
 
#define REGBASE(x)   insn->detail->arm.operands[x].mem.base
 
#define HASMEMINDEX(x)   (insn->detail->arm.operands[x].mem.index != ARM_REG_INVALID)
 
#define ISMEMINDEXSUB(x)   insn->detail->arm.operands[x].subtracted
 
#define MEMDISP(x)   insn->detail->arm.operands[x].mem.disp
 
#define ISIMM(x)   (insn->detail->arm.operands[x].type == ARM_OP_IMM)
 
#define ISREG(x)   (insn->detail->arm.operands[x].type == ARM_OP_REG)
 
#define ISMEM(x)   (insn->detail->arm.operands[x].type == ARM_OP_MEM)
 
#define LSHIFT(x)   0
 
#define LSHIFT2(x)   0
 
#define OPCOUNT()   insn->detail->arm.op_count
 
#define ISSHIFTED(x)   (insn->detail->arm.operands[x].shift.type != ARM_SFT_INVALID && insn->detail->arm.operands[x].shift.value != 0)
 
#define SHIFTTYPE(x)   insn->detail->arm.operands[x].shift.type
 
#define SHIFTVALUE(x)   insn->detail->arm.operands[x].shift.value
 
#define ISWRITEBACK32()   insn->detail->arm.writeback
 
#define ISPREINDEX32()   (((OPCOUNT() == 2) && (ISMEM(1)) && (ISWRITEBACK32())) || ((OPCOUNT() == 3) && (ISMEM(2)) && (ISWRITEBACK32())))
 
#define ISPOSTINDEX32()   (((OPCOUNT() == 3) && (ISIMM(2) || ISREG(2)) && (ISWRITEBACK32())) || ((OPCOUNT() == 4) && (ISIMM(3) || ISREG(3)) && (ISWRITEBACK32())))
 

Detailed Description

Common macros for easy access of capstone arm (32) members when having: cs_insn *insn

Definition in file arm_accessors32.h.

Macro Definition Documentation

◆ HASMEMINDEX

#define HASMEMINDEX (   x)    (insn->detail->arm.operands[x].mem.index != ARM_REG_INVALID)

Definition at line 17 of file arm_accessors32.h.

◆ IMM

#define IMM (   x)    (ut32)(insn->detail->arm.operands[x].imm)

Definition at line 13 of file arm_accessors32.h.

◆ INSOP

#define INSOP (   x)    insn->detail->arm.operands[x]

Definition at line 14 of file arm_accessors32.h.

◆ ISIMM

#define ISIMM (   x)    (insn->detail->arm.operands[x].type == ARM_OP_IMM)

Definition at line 20 of file arm_accessors32.h.

◆ ISMEM

#define ISMEM (   x)    (insn->detail->arm.operands[x].type == ARM_OP_MEM)

Definition at line 22 of file arm_accessors32.h.

◆ ISMEMINDEXSUB

#define ISMEMINDEXSUB (   x)    insn->detail->arm.operands[x].subtracted

Definition at line 18 of file arm_accessors32.h.

◆ ISPOSTINDEX32

#define ISPOSTINDEX32 ( )    (((OPCOUNT() == 3) && (ISIMM(2) || ISREG(2)) && (ISWRITEBACK32())) || ((OPCOUNT() == 4) && (ISIMM(3) || ISREG(3)) && (ISWRITEBACK32())))

Definition at line 38 of file arm_accessors32.h.

◆ ISPREINDEX32

#define ISPREINDEX32 ( )    (((OPCOUNT() == 2) && (ISMEM(1)) && (ISWRITEBACK32())) || ((OPCOUNT() == 3) && (ISMEM(2)) && (ISWRITEBACK32())))

Definition at line 37 of file arm_accessors32.h.

◆ ISREG

#define ISREG (   x)    (insn->detail->arm.operands[x].type == ARM_OP_REG)

Definition at line 21 of file arm_accessors32.h.

◆ ISSHIFTED

#define ISSHIFTED (   x)    (insn->detail->arm.operands[x].shift.type != ARM_SFT_INVALID && insn->detail->arm.operands[x].shift.value != 0)

Definition at line 32 of file arm_accessors32.h.

◆ ISWRITEBACK32

#define ISWRITEBACK32 ( )    insn->detail->arm.writeback

Definition at line 36 of file arm_accessors32.h.

◆ LSHIFT

#define LSHIFT (   x)    0

Definition at line 28 of file arm_accessors32.h.

◆ LSHIFT2

#define LSHIFT2 (   x)    0

Definition at line 29 of file arm_accessors32.h.

◆ MEMDISP

#define MEMDISP (   x)    insn->detail->arm.operands[x].mem.disp

Definition at line 19 of file arm_accessors32.h.

◆ OPCOUNT

#define OPCOUNT ( )    insn->detail->arm.op_count

Definition at line 31 of file arm_accessors32.h.

◆ REGBASE

#define REGBASE (   x)    insn->detail->arm.operands[x].mem.base

Definition at line 15 of file arm_accessors32.h.

◆ REGID

#define REGID (   x)    insn->detail->arm.operands[x].reg

Definition at line 12 of file arm_accessors32.h.

◆ SHIFTTYPE

#define SHIFTTYPE (   x)    insn->detail->arm.operands[x].shift.type

Definition at line 33 of file arm_accessors32.h.

◆ SHIFTVALUE

#define SHIFTVALUE (   x)    insn->detail->arm.operands[x].shift.value

Definition at line 34 of file arm_accessors32.h.