6 #include <capstone/capstone.h>
7 #include "../arch/ppc/libvle/vle.h"
8 #include "../arch/ppc/libps/libps.h"
58 static int omode = -1, obits = -1;
62 if (
a->cpu && strncmp(
a->cpu,
"vle", 3) == 0) {
71 }
else if (
a->cpu && strncmp(
a->cpu,
"ps", 2) == 0) {
93 if (
mode != omode ||
a->bits != obits) {
109 if (
n > 0 && insn->size > 0) {
111 insn->op_str[0] ?
" " :
"", insn->op_str);
124 .desc =
"Capstone PowerPC disassembler",
128 .cpus =
"ppc,vle,ps",
135 #ifndef RZ_PLUGIN_INCORE
RZ_API void rz_asm_op_set_asm(RzAsmOp *op, const char *str)
static int decompile_vle(RzAsm *a, RzAsmOp *op, const ut8 *buf, int len)
RzAsmPlugin rz_asm_plugin_ppc_cs
static int decompile_ps(RzAsm *a, RzAsmOp *op, const ut8 *buf, int len)
RZ_API RzLibStruct rizin_plugin
static int disassemble(RzAsm *a, RzAsmOp *op, const ut8 *buf, int len)
static bool the_end(void *p)
static int opstr(RzAsm *a, ut8 *data, const Opcode *op)
@ CS_ARCH_PPC
PowerPC architecture.
@ CS_MODE_64
64-bit mode (X86, PPC)
@ CS_MODE_32
32-bit mode (X86)
@ CS_MODE_BIG_ENDIAN
big-endian mode
@ CS_MODE_LITTLE_ENDIAN
little-endian mode (default mode)
@ CS_OPT_DETAIL
Break down instruction structure into details.
@ CS_OPT_OFF
Turn OFF an option - default for CS_OPT_DETAIL, CS_OPT_SKIPDATA, CS_OPT_UNSIGNED.
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 char * sdb_fmt(const char *fmt,...)
void libps_snprint(char *str, int size, ut64 addr, ppcps_t *instr)
bool libps_decode(ut32 data, ppcps_t *ps)
#define RZ_SYS_ENDIAN_BIG
#define RZ_SYS_ENDIAN_LITTLE
vle_t * vle_next(vle_handle *handle)
int vle_init(vle_handle *handle, const ut8 *buffer, const ut32 size)
void vle_snprint(char *str, int size, ut32 addr, vle_t *instr)
void vle_free(vle_t *instr)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()