Go to the documentation of this file.
66 if (ins->detail == NULL)
69 ppc = &(ins->detail->ppc);
71 printf(
"\top_count: %u\n",
ppc->op_count);
73 for (
i = 0;
i <
ppc->op_count;
i++) {
75 switch((
int)
op->type) {
82 printf(
"\t\toperands[%u].type: IMM = 0x%" PRIx64
"\n",
i,
op->imm);
85 printf(
"\t\toperands[%u].type: MEM\n",
i);
87 printf(
"\t\t\toperands[%u].mem.base: REG = %s\n",
89 if (
op->mem.disp != 0)
90 printf(
"\t\t\toperands[%u].mem.disp: 0x%x\n",
i,
op->mem.disp);
94 printf(
"\t\toperands[%u].type: CRX\n",
i);
95 printf(
"\t\t\toperands[%u].crx.scale: %d\n",
i,
op->crx.scale);
109 printf(
"\tUpdate-CR0: True\n");
116 #define PPC_CODE "\x43\x20\x0c\x07\x41\x56\xff\x17\x80\x20\x00\x00\x80\x3f\x00\x00\x10\x43\x23\x0e\xd0\x44\x00\x80\x4c\x43\x22\x02\x2d\x03\x00\x80\x7c\x43\x20\x14\x7c\x43\x20\x93\x4f\x20\x00\x21\x4c\xc8\x00\x21\x40\x82\x00\x14"
117 #define PPC_CODE2 "\x10\x60\x2a\x10\x10\x64\x28\x88\x7c\x4a\x5d\x0f"
144 printf(
"Failed on cs_open() with error returned: %u\n",
err);
154 printf(
"****************\n");
159 for (j = 0; j <
count; j++) {
160 printf(
"0x%" PRIx64
":\t%s\t%s\n", insn[j].address, insn[j].mnemonic, insn[j].op_str);
163 printf(
"0x%" PRIx64
":\n", insn[j-1].address + insn[j-1].
size);
168 printf(
"****************\n");
171 printf(
"ERROR: Failed to disasm given code!\n");
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_close(csh *handle)
static const char * get_bc_name(int bc)
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)
@ CS_ARCH_PPC
PowerPC architecture.
_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.
@ PPC_OP_MEM
= CS_OP_MEM (Memory operand).
@ CS_OPT_DETAIL
Break down instruction structure into details.
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_option(csh ud, cs_opt_type type, size_t value)
@ CS_MODE_QPX
Quad Processing eXtensions mode (PPC)
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).
static void print_string_hex(const char *comment, unsigned char *str, size_t len)
@ CS_MODE_BIG_ENDIAN
big-endian mode
@ PPC_BC_NS
not summary overflow
@ PPC_BC_SO
summary overflow
@ PPC_OP_REG
= CS_OP_REG (Register operand).
CAPSTONE_EXPORT void CAPSTONE_API cs_free(cs_insn *insn, size_t count)
struct platform platforms[]
@ PPC_OP_IMM
= CS_OP_IMM (Immediate operand).
static void print_insn_detail(cs_insn *ins)
@ PPC_OP_CRX
Condition Register field.
grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:28