| 1 | #cxx . . $ `<file>/cstool/cstool_wasm.c`/include <stdio.h> |
| 2 | #include <stdlib.h> |
| 3 | |
| 4 | #include <capstone/capstone.h>cxx . . $ `<file>/include/capstone/capstone.h`/ |
| 5 | #include "cstool.h"cxx . . $ `<file>/cstool/cstool.h`/ |
| 6 | |
| 7 | void print_insn_detail_wasmcxx . . $ print_insn_detail_wasm(2888c3e5b0984e8d).(cshcxx . . $ csh# handle, cs_insncxx . . $ cs_insn# *ins) |
| 8 | { |
| 9 | cs_wasmcxx . . $ cs_wasm# *wasm; |
| 10 | |
| 11 | // detail can be NULL on "data" instruction if SKIPDATA option is turned ON |
| 12 | if (ins->detailcxx . . $ cs_insn#detail. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!) |
| 13 | return; |
| 14 | |
| 15 | wasm = &(ins->detailcxx . . $ cs_insn#detail.->wasmcxx . . $ cs_detail#$anonymous_type_0#wasm.); |
| 16 | if (wasm->op_countcxx . . $ cs_wasm#op_count. > 0) { |
| 17 | unsigned int i; |
| 18 | |
| 19 | printfcxx . . $ printf(581fddd72a8db8fc).("\tOperand count: %d\n", wasm->op_countcxx . . $ cs_wasm#op_count.); |
| 20 | |
| 21 | for (i = 0; i < wasm->op_countcxx . . $ cs_wasm#op_count.; i++) { |
| 22 | switch (wasm->operandscxx . . $ cs_wasm#operands.[i].typecxx . . $ cs_wasm_op#type.) { |
| 23 | default: |
| 24 | break; |
| 25 | case WASM_OP_INT7cxx . . $ WASM_OP_INT7.: |
| 26 | printfcxx . . $ printf(581fddd72a8db8fc).("\t\tOperand[%u] type: int7\n", i); |
| 27 | printfcxx . . $ printf(581fddd72a8db8fc).("\t\tOperand[%u] value: %d\n", i, wasm->operandscxx . . $ cs_wasm#operands.[i].int7cxx . . $ cs_wasm_op#$anonymous_type_0#int7.); |
| 28 | break; |
| 29 | case WASM_OP_UINT32cxx . . $ WASM_OP_UINT32.: |
| 30 | printfcxx . . $ printf(581fddd72a8db8fc).("\t\tOperand[%u] type: uint32\n", i); |
| 31 | printfcxx . . $ printf(581fddd72a8db8fc).("\t\tOperand[%u] value: 0x%x\n", i, wasm->operandscxx . . $ cs_wasm#operands.[i].uint32cxx . . $ cs_wasm_op#$anonymous_type_0#uint32.); |
| 32 | break; |
| 33 | case WASM_OP_UINT64cxx . . $ WASM_OP_UINT64.: |
| 34 | printfcxx . . $ printf(581fddd72a8db8fc).("\t\tOperand[%u] type: uint64\n", i); |
| 35 | printfcxx . . $ printf(581fddd72a8db8fc).("\t\tOperand[%u] value: 0x%" PRIx64cxx . . $ `<external>/15933738808807975373/inttypes.h:126:10`! "\n", i, wasm->operandscxx . . $ cs_wasm#operands.[i].uint64cxx . . $ cs_wasm_op#$anonymous_type_0#uint64.); |
| 36 | break; |
| 37 | case WASM_OP_VARUINT32cxx . . $ WASM_OP_VARUINT32.: |
| 38 | printfcxx . . $ printf(581fddd72a8db8fc).("\t\tOperand[%u] type: varuint32\n", i); |
| 39 | printfcxx . . $ printf(581fddd72a8db8fc).("\t\tOperand[%u] value: 0x%x\n", i, wasm->operandscxx . . $ cs_wasm#operands.[i].varuint32cxx . . $ cs_wasm_op#$anonymous_type_0#varuint32.); |
| 40 | break; |
| 41 | case WASM_OP_VARUINT64cxx . . $ WASM_OP_VARUINT64.: |
| 42 | printfcxx . . $ printf(581fddd72a8db8fc).("\t\tOperand[%u] type: varuint64\n", i); |
| 43 | printfcxx . . $ printf(581fddd72a8db8fc).("\t\tOperand[%u] value: 0x%" PRIx64cxx . . $ `<external>/15933738808807975373/inttypes.h:126:10`! "\n", i, wasm->operandscxx . . $ cs_wasm#operands.[i].varuint64cxx . . $ cs_wasm_op#$anonymous_type_0#varuint64.); |
| 44 | break; |
| 45 | } |
| 46 | |
| 47 | printfcxx . . $ printf(581fddd72a8db8fc).("\t\tOperand[%u] size: %u\n", i, wasm->operandscxx . . $ cs_wasm#operands.[i].sizecxx . . $ cs_wasm_op#size.); |
| 48 | } |
| 49 | } |
| 50 | } |