Go to the documentation of this file.
36 cs_regs regs_read, regs_write;
37 unsigned char regs_read_count, regs_write_count;
41 if (ins->detail == NULL)
44 arm64 = &(ins->detail->arm64);
48 for (
i = 0;
i <
arm64->op_count;
i++) {
57 printf(
"\t\toperands[%u].type: IMM = 0x%" PRIx64
"\n",
i,
op->imm);
60 #if defined(_KERNEL_MODE)
62 printf(
"\t\toperands[%u].type: FP = <float_point_unsupported>\n",
i);
64 printf(
"\t\toperands[%u].type: FP = %f\n",
i,
op->fp);
68 printf(
"\t\toperands[%u].type: MEM\n",
i);
73 if (
op->mem.disp != 0)
74 printf(
"\t\t\toperands[%u].mem.disp: 0x%x\n",
i,
op->mem.disp);
78 printf(
"\t\toperands[%u].type: C-IMM = %u\n",
i, (
int)
op->imm);
81 printf(
"\t\toperands[%u].type: REG_MRS = 0x%x\n",
i,
op->reg);
84 printf(
"\t\toperands[%u].type: REG_MSR = 0x%x\n",
i,
op->reg);
87 printf(
"\t\toperands[%u].type: PSTATE = 0x%x\n",
i,
op->pstate);
90 printf(
"\t\toperands[%u].type: SYS = 0x%x\n",
i,
op->sys);
93 printf(
"\t\toperands[%u].type: PREFETCH = 0x%x\n",
i,
op->prefetch);
96 printf(
"\t\toperands[%u].type: BARRIER = 0x%x\n",
i,
op->barrier);
105 printf(
"\t\toperands[%u].access: READ\n",
i);
108 printf(
"\t\toperands[%u].access: WRITE\n",
i);
111 printf(
"\t\toperands[%u].access: READ | WRITE\n",
i);
117 printf(
"\t\t\tShift: type = %u, value = %u\n",
118 op->shift.type,
op->shift.value);
124 printf(
"\t\t\tVector Arrangement Specifier: 0x%x\n",
op->vas);
127 printf(
"\t\t\tVector Element Size Specifier: %u\n",
op->vess);
129 if (
op->vector_index != -1)
130 printf(
"\t\t\tVector Index: %u\n",
op->vector_index);
133 if (
arm64->update_flags)
134 printf(
"\tUpdate-flags: True\n");
136 if (
arm64->writeback)
137 printf(
"\tWrite-back: True\n");
144 regs_read, ®s_read_count,
145 regs_write, ®s_write_count)) {
146 if (regs_read_count) {
147 printf(
"\tRegisters read:");
148 for(
i = 0;
i < regs_read_count;
i++) {
154 if (regs_write_count) {
155 printf(
"\tRegisters modified:");
156 for(
i = 0;
i < regs_write_count;
i++) {
222 #define ARM64_CODE "\x09\x00\x38\xd5\xbf\x40\x00\xd5\x0c\x05\x13\xd5\x20\x50\x02\x0e\x20\xe4\x3d\x0f\x00\x18\xa0\x5f\xa2\x00\xae\x9e\x9f\x37\x03\xd5\xbf\x33\x03\xd5\xdf\x3f\x03\xd5\x21\x7c\x02\x9b\x21\x7c\x00\x53\x00\x40\x21\x4b\xe1\x0b\x40\xb9\x20\x04\x81\xda\x20\x08\x02\x8b\x10\x5b\xe8\x3c"
242 printf(
"Failed on cs_open() with error returned: %u\n",
err);
252 printf(
"****************\n");
257 for (j = 0; j <
count; j++) {
258 printf(
"0x%" PRIx64
":\t%s\t%s\n", insn[j].address, insn[j].mnemonic, insn[j].op_str);
261 printf(
"0x%" PRIx64
":\n", insn[j-1].address + insn[j-1].
size);
266 printf(
"****************\n");
269 printf(
"ERROR: Failed to disasm given code!\n");
@ ARM64_OP_FP
= CS_OP_FP (Floating-Point operand).
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_close(csh *handle)
@ ARM64_OP_PREFETCH
Prefetch operand (PRFM).
static void print_string_hex(const char *comment, unsigned char *str, size_t len)
@ ARM64_OP_REG_MRS
MRS register operand.
CAPSTONE_EXPORT size_t CAPSTONE_API cs_disasm(csh ud, const uint8_t *buffer, size_t size, uint64_t offset, size_t count, cs_insn **insn)
_Use_decl_annotations_ int __cdecl printf(const char *_Format,...)
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_open(cs_arch arch, cs_mode mode, csh *handle)
cs_arch
Architecture type.
@ CS_OPT_DETAIL
Break down instruction structure into details.
@ ARM64_OP_REG
= CS_OP_REG (Register operand).
@ ARM64_OP_SYS
SYS operand for IC/DC/AT/TLBI instructions.
@ CS_AC_READ
Operand read from memory or register.
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_regs_access(csh ud, const cs_insn *insn, cs_regs regs_read, uint8_t *regs_read_count, cs_regs regs_write, uint8_t *regs_write_count)
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_option(csh ud, cs_opt_type type, size_t value)
@ ARM64_OP_REG_MSR
MSR register operand.
@ ARM64_OP_PSTATE
PState operand.
const CAPSTONE_EXPORT char *CAPSTONE_API cs_reg_name(csh ud, unsigned int reg)
unsigned __int64 uint64_t
@ CS_OPT_ON
Turn ON an option (CS_OPT_DETAIL, CS_OPT_SKIPDATA).
@ ARM64_OP_CIMM
C-Immediate.
@ ARM64_OP_BARRIER
Memory barrier operand (ISB/DMB/DSB instructions).
static void print_insn_detail(cs_insn *ins)
@ ARM64_OP_IMM
= CS_OP_IMM (Immediate operand).
CAPSTONE_EXPORT void CAPSTONE_API cs_free(cs_insn *insn, size_t count)
@ ARM64_OP_MEM
= CS_OP_MEM (Memory operand).
@ CS_ARCH_ARM64
ARM-64, also called AArch64.
struct platform platforms[]
@ CS_AC_WRITE
Operand write to memory or register.
grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:27