4 #ifdef CAPSTONE_HAS_ARM
9 #include "../../cs_priv.h"
13 #define GET_INSTRINFO_ENUM
17 static const name_map reg_name_maps[] = {
130 static const name_map reg_name_maps2[] = {
247 #ifndef CAPSTONE_DIET
251 return reg_name_maps[
reg].
name;
259 #ifndef CAPSTONE_DIET
263 return reg_name_maps2[
reg].
name;
273 #ifndef CAPSTONE_DIET
274 { 0 }, { 0 }, { 0 }, 0, 0
286 insn->id =
insns[
i].mapid;
289 #ifndef CAPSTONE_DIET
306 insn->detail->groups[insn->detail->groups_count] =
ARM_GRP_JUMP;
307 insn->detail->groups_count++;
314 #ifndef CAPSTONE_DIET
315 static const name_map insn_name_maps[] = {
757 #ifndef CAPSTONE_DIET
761 return insn_name_maps[
id].
name;
767 #ifndef CAPSTONE_DIET
815 #ifndef CAPSTONE_DIET
824 static const unsigned int insn_rel[] = {
841 static const unsigned int insn_blx_rel_to_arm[] = {
851 for (
i = 0; insn_rel[
i];
i++) {
852 if (
id == insn_rel[
i]) {
864 for (
i = 0; insn_blx_rel_to_arm[
i];
i++)
865 if (
id == insn_blx_rel_to_arm[
i])
873 #ifndef CAPSTONE_DIET
875 typedef struct insn_op {
879 static insn_op insn_ops[] = {
893 return insn_ops[
i].access;
900 cs_regs regs_read,
uint8_t *regs_read_count,
901 cs_regs regs_write,
uint8_t *regs_write_count)
904 uint8_t read_count, write_count;
907 read_count = insn->detail->regs_read_count;
908 write_count = insn->detail->regs_write_count;
911 memcpy(regs_read, insn->detail->regs_read, read_count *
sizeof(insn->detail->regs_read[0]));
912 memcpy(regs_write, insn->detail->regs_write, write_count *
sizeof(insn->detail->regs_write[0]));
915 for (
i = 0;
i <
arm->op_count;
i++) {
917 switch((
int)
op->type) {
931 regs_read[read_count] = (
uint16_t)
op->mem.base;
935 regs_read[read_count] = (
uint16_t)
op->mem.index;
939 regs_write[write_count] = (
uint16_t)
op->mem.base;
947 *regs_read_count = read_count;
948 *regs_write_count = write_count;
const char * ARM_reg_name2(csh handle, unsigned int reg)
const char * ARM_insn_name(csh handle, unsigned int id)
void ARM_reg_access(const cs_insn *insn, cs_regs regs_read, uint8_t *regs_read_count, cs_regs regs_write, uint8_t *regs_write_count)
const char * ARM_reg_name(csh handle, unsigned int reg)
uint8_t * ARM_get_op_access(cs_struct *h, unsigned int id)
bool ARM_blx_to_arm_mode(cs_struct *h, unsigned int insn_id)
void ARM_get_insn_id(cs_struct *h, cs_insn *insn, unsigned int id)
const char * ARM_group_name(csh handle, unsigned int id)
bool ARM_rel_branch(cs_struct *h, unsigned int insn_id)
static name_map group_name_maps[]
static mcore_handle handle
@ ARM_GRP_BRANCH_RELATIVE
= CS_GRP_BRANCH_RELATIVE
@ ARM_GRP_JUMP
= CS_GRP_JUMP
@ ARM_GRP_INVALID
= CS_GRP_INVALID
@ ARM_GRP_PRIVILEGE
= CS_GRP_PRIVILEGE
@ ARM_GRP_INT
= CS_GRP_INT
@ ARM_GRP_CALL
= CS_GRP_CALL
@ ARM_OP_REG
= CS_OP_REG (Register operand).
@ ARM_OP_MEM
= CS_OP_MEM (Memory operand).
@ CS_AC_READ
Operand read from memory or register.
@ CS_AC_WRITE
Operand write to memory or register.
CAPSTONE_EXPORT bool CAPSTONE_API cs_reg_write(csh ud, const cs_insn *insn, unsigned int reg_id)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
static static fork const void static count static fd const char static mode const char static pathname const char static path const char static dev const char static group static getpid static getuid void void static data static pause access
bool arr_exist(uint16_t *arr, unsigned char max, unsigned int id)
unsigned int count_positive(const uint16_t *list)
unsigned int count_positive8(const unsigned char *list)
unsigned short insn_find(const insn_map *insns, unsigned int max, unsigned int id, unsigned short **cache)
const char * id2name(const name_map *map, int max, const unsigned int id)
static struct insnlist * insns[64]