6 #include <capstone/capstone.h>
15 int mode,
n, ret = -1;
20 if (
a->cpu && *
a->cpu) {
21 if (!strcmp(
a->cpu,
"micro")) {
23 }
else if (!strcmp(
a->cpu,
"r6")) {
25 }
else if (!strcmp(
a->cpu,
"v3")) {
27 }
else if (!strcmp(
a->cpu,
"v2")) {
58 op->size = insn->size;
59 char *
str =
rz_str_newf(
"%s%s%s", insn->mnemonic, insn->op_str[0] ?
" " :
"", insn->op_str);
90 .desc =
"Capstone MIPS disassembler",
93 .cpus =
"mips32/64,micro,r6,v3,v2",
101 #ifndef RZ_PLUGIN_INCORE
RZ_API void rz_asm_op_set_asm(RzAsmOp *op, const char *str)
RZ_IPI int mips_assemble(const char *str, ut64 pc, ut8 *out)
RZ_API RzLibStruct rizin_plugin
RzAsmPlugin rz_asm_plugin_mips_cs
static int disassemble(RzAsm *a, RzAsmOp *op, const ut8 *buf, int len)
static int assemble(RzAsm *a, RzAsmOp *op, const char *str)
const lzma_allocator const uint8_t size_t uint8_t * out
@ CS_ARCH_MIPS
Mips architecture.
@ CS_MODE_MIPS64
Mips64 ISA (Mips)
@ CS_MODE_MICRO
MicroMips mode (MIPS)
@ CS_MODE_MIPS3
Mips III ISA.
@ CS_MODE_MIPS32
Mips32 ISA (Mips)
@ CS_MODE_MIPS32R6
Mips32r6 ISA.
@ CS_MODE_BIG_ENDIAN
big-endian mode
@ CS_MODE_LITTLE_ENDIAN
little-endian mode (default mode)
@ CS_MODE_MIPS2
Mips II ISA.
@ CS_OPT_DETAIL
Break down instruction structure into details.
@ CS_OPT_SYNTAX
Assembly output syntax.
@ CS_OPT_SYNTAX_NOREGNAME
Prints register name with only number (CS_OPT_SYNTAX)
@ CS_OPT_OFF
Turn OFF an option - default for CS_OPT_DETAIL, CS_OPT_SKIPDATA, CS_OPT_UNSIGNED.
@ CS_OPT_SYNTAX_DEFAULT
Default asm syntax (CS_OPT_SYNTAX).
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 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_API void Ht_() free(HtName_(Ht) *ht)
return memset(p, 0, total)
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
RZ_API int rz_str_replace_char(char *s, int a, int b)
RZ_API char * rz_strbuf_get(RzStrBuf *sb)
#define RZ_SYS_ENDIAN_BIG
#define RZ_SYS_ENDIAN_LITTLE
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static const char * mnemonics[]