6 #include <capstone/capstone.h>
7 #include <capstone/xcore.h>
10 #error Old Capstone not supported
13 #define INSOP(n) insn->detail->xcore.operands[n]
22 pj_ka(pj,
"operands");
24 for (
i = 0;
i <
x->op_count;
i++) {
29 pj_ks(pj,
"type",
"reg");
33 pj_ks(pj,
"type",
"imm");
37 pj_ks(pj,
"type",
"mem");
41 pj_ki(pj,
"disp",
op->mem.disp);
44 pj_ks(pj,
"type",
"invalid");
63 if (!strcmp(
a->cpu,
"v9")) {
88 op->size = insn->size;
131 .desc =
"Capstone XCORE analysis",
140 #ifndef RZ_PLUGIN_INCORE
RzAnalysisPlugin rz_analysis_plugin_xcore_cs
static void opex(RzStrBuf *buf, csh handle, cs_insn *insn)
static int analop(RzAnalysis *a, RzAnalysisOp *op, ut64 addr, const ut8 *buf, int len, RzAnalysisOpMask mask)
RZ_API RzLibStruct rizin_plugin
static mcore_handle handle
@ CS_ARCH_XCORE
XCore architecture.
@ CS_MODE_BIG_ENDIAN
big-endian mode
@ CS_MODE_V9
SparcV9 mode (Sparc)
@ CS_OPT_DETAIL
Break down instruction structure into details.
@ CS_OPT_ON
Turn ON an option (CS_OPT_DETAIL, CS_OPT_SKIPDATA).
@ XCORE_OP_REG
= CS_OP_REG (Register operand).
@ XCORE_OP_IMM
= CS_OP_IMM (Immediate operand).
@ XCORE_OP_MEM
= CS_OP_MEM (Memory 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)
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_open(cs_arch arch, cs_mode mode, csh *handle)
CAPSTONE_EXPORT void CAPSTONE_API cs_free(cs_insn *insn, size_t count)
CAPSTONE_EXPORT const char *CAPSTONE_API cs_reg_name(csh ud, unsigned int reg)
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_close(csh *handle)
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_option(csh ud, cs_opt_type type, size_t value)
@ RZ_ANALYSIS_OP_MASK_OPEX
@ RZ_ANALYSIS_OP_TYPE_SUB
@ RZ_ANALYSIS_OP_TYPE_CALL
@ RZ_ANALYSIS_OP_TYPE_ADD
@ RZ_ANALYSIS_OP_TYPE_ILL
@ RZ_ANALYSIS_OP_TYPE_RET
RZ_API PJ * pj_ka(PJ *j, const char *k)
RZ_API PJ * pj_ki(PJ *j, const char *k, int d)
RZ_API PJ * pj_end(PJ *j)
RZ_API const char * pj_string(PJ *pj)
RZ_API void pj_free(PJ *j)
RZ_API PJ * pj_ks(PJ *j, const char *k, const char *v)
RZ_API bool rz_strbuf_append(RzStrBuf *sb, const char *s)
RZ_API void rz_strbuf_init(RzStrBuf *sb)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()