| 1 | /* Capstone Disassembler Engine */cxx . . $ `<file>/cstool/cstool_mips.c`/ |
| 2 | /* By Nguyen Anh Quynh <[email protected]>, 2013> */ |
| 3 | |
| 4 | #include <stdio.h> |
| 5 | #include <stdlib.h> |
| 6 | |
| 7 | #include <capstone/capstone.h>cxx . . $ `<file>/include/capstone/capstone.h`/ |
| 8 | #include "cstool.h"cxx . . $ `<file>/cstool/cstool.h`/ |
| 9 | |
| 10 | void print_insn_detail_mipscxx . . $ print_insn_detail_mips(2888c3e5b0984e8d).(cshcxx . . $ csh# handle, cs_insncxx . . $ cs_insn# *ins) |
| 11 | { |
| 12 | int i; |
| 13 | cs_mipscxx . . $ cs_mips# *mips; |
| 14 | |
| 15 | // detail can be NULL on "data" instruction if SKIPDATA option is turned ON |
| 16 | if (ins->detailcxx . . $ cs_insn#detail. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!) |
| 17 | return; |
| 18 | |
| 19 | mips = &(ins->detailcxx . . $ cs_insn#detail.->mipscxx . . $ cs_detail#$anonymous_type_0#mips.); |
| 20 | if (mips->op_countcxx . . $ cs_mips#op_count.) |
| 21 | printfcxx . . $ printf(581fddd72a8db8fc).("\top_count: %u\n", mips->op_countcxx . . $ cs_mips#op_count.); |
| 22 | |
| 23 | for (i = 0; i < mips->op_countcxx . . $ cs_mips#op_count.; i++) { |
| 24 | cs_mips_opcxx . . $ cs_mips_op# *op = &(mips->operandscxx . . $ cs_mips#operands.[i]); |
| 25 | switch((int)op->typecxx . . $ cs_mips_op#type.) { |
| 26 | default: |
| 27 | break; |
| 28 | case MIPS_OP_REGcxx . . $ MIPS_OP_REG.: |
| 29 | printfcxx . . $ printf(581fddd72a8db8fc).("\t\toperands[%u].type: REG = %s\n", i, cs_reg_namecxx . . $ cs_reg_name(efd1348d9ae5172e).(handle, op->regcxx . . $ cs_mips_op#$anonymous_type_0#reg.)); |
| 30 | break; |
| 31 | case MIPS_OP_IMMcxx . . $ MIPS_OP_IMM.: |
| 32 | printfcxx . . $ printf(581fddd72a8db8fc).("\t\toperands[%u].type: IMM = 0x%" PRIx64cxx . . $ `<external>/15933738808807975373/inttypes.h:126:10`! "\n", i, op->immcxx . . $ cs_mips_op#$anonymous_type_0#imm.); |
| 33 | break; |
| 34 | case MIPS_OP_MEMcxx . . $ MIPS_OP_MEM.: |
| 35 | printfcxx . . $ printf(581fddd72a8db8fc).("\t\toperands[%u].type: MEM\n", i); |
| 36 | if (op->memcxx . . $ cs_mips_op#$anonymous_type_0#mem..basecxx . . $ mips_op_mem#base. != MIPS_REG_INVALIDcxx . . $ MIPS_REG_INVALID.) |
| 37 | printfcxx . . $ printf(581fddd72a8db8fc).("\t\t\toperands[%u].mem.base: REG = %s\n", |
| 38 | i, cs_reg_namecxx . . $ cs_reg_name(efd1348d9ae5172e).(handle, op->memcxx . . $ cs_mips_op#$anonymous_type_0#mem..basecxx . . $ mips_op_mem#base.)); |
| 39 | if (op->memcxx . . $ cs_mips_op#$anonymous_type_0#mem..dispcxx . . $ mips_op_mem#disp. != 0) |
| 40 | printfcxx . . $ printf(581fddd72a8db8fc).("\t\t\toperands[%u].mem.disp: 0x%" PRIx64cxx . . $ `<external>/15933738808807975373/inttypes.h:126:10`! "\n", i, op->memcxx . . $ cs_mips_op#$anonymous_type_0#mem..dispcxx . . $ mips_op_mem#disp.); |
| 41 | |
| 42 | break; |
| 43 | } |
| 44 | |
| 45 | } |
| 46 | } |