#include <stdio.h>
#include <capstone/platform.h>
#include <capstone/capstone.h>
Go to the source code of this file.
|
#define | SYSZ_CODE "\xed\x00\x00\x00\x00\x1a\x5a\x0f\x1f\xff\xc2\x09\x80\x00\x00\x00\x07\xf7\xeb\x2a\xff\xff\x7f\x57\xe3\x01\xff\xff\x7f\x57\xeb\x00\xf0\x00\x00\x24\xb2\x4f\x00\x78\xec\x18\x00\x00\xc1\x7f" |
|
◆ SYSZ_CODE
#define SYSZ_CODE "\xed\x00\x00\x00\x00\x1a\x5a\x0f\x1f\xff\xc2\x09\x80\x00\x00\x00\x07\xf7\xeb\x2a\xff\xff\x7f\x57\xe3\x01\xff\xff\x7f\x57\xeb\x00\xf0\x00\x00\x24\xb2\x4f\x00\x78\xec\x18\x00\x00\xc1\x7f" |
◆ main()
◆ print_insn_detail()
static void print_insn_detail |
( |
cs_insn * |
ins | ) |
|
|
static |
Definition at line 31 of file test_systemz.c.
37 if (ins->detail ==
NULL)
40 sysz = &(ins->detail->sysz);
46 switch((
int)
op->type) {
53 printf(
"\t\toperands[%u].type: ACREG = %u\n",
i,
op->reg);
59 printf(
"\t\toperands[%u].type: MEM\n",
i);
61 printf(
"\t\t\toperands[%u].mem.base: REG = %s\n",
64 printf(
"\t\t\toperands[%u].mem.index: REG = %s\n",
66 if (
op->mem.length != 0)
67 printf(
"\t\t\toperands[%u].mem.length: 0x%" PRIx64 "\n",
i,
op->mem.length);
68 if (
op->mem.disp != 0)
69 printf(
"\t\t\toperands[%u].mem.disp: 0x%" PRIx64 "\n",
i,
op->mem.disp);
76 printf(
"\tCode condition: %u\n", sysz->
cc);
@ SYSZ_OP_MEM
= CS_OP_MEM (Memory operand).
@ SYSZ_OP_IMM
= CS_OP_IMM (Immediate operand).
@ SYSZ_OP_ACREG
Access register operand.
@ SYSZ_OP_REG
= CS_OP_REG (Register operand).
CAPSTONE_EXPORT const char *CAPSTONE_API cs_reg_name(csh ud, unsigned int reg)
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
cs_sysz_op operands[6]
operands for this instruction.
References cs_sysz::cc, cs_reg_name(), handle, i, NULL, cs_sysz::op_count, cs_sysz::operands, printf(), PRIx64, SYSZ_OP_ACREG, SYSZ_OP_IMM, SYSZ_OP_MEM, SYSZ_OP_REG, and SYSZ_REG_INVALID.
Referenced by test().
◆ print_string_hex()
◆ test()
Definition at line 81 of file test_systemz.c.
83 #define SYSZ_CODE "\xed\x00\x00\x00\x00\x1a\x5a\x0f\x1f\xff\xc2\x09\x80\x00\x00\x00\x07\xf7\xeb\x2a\xff\xff\x7f\x57\xe3\x01\xff\xff\x7f\x57\xeb\x00\xf0\x00\x00\x24\xb2\x4f\x00\x78\xec\x18\x00\x00\xc1\x7f"
103 printf(
"Failed on cs_open() with error returned: %u\n",
err);
113 printf(
"****************\n");
118 for (j = 0; j <
count; j++) {
127 printf(
"****************\n");
130 printf(
"ERROR: Failed to disasm given code!\n");
@ CS_ARCH_SYSZ
SystemZ architecture.
@ CS_MODE_BIG_ENDIAN
big-endian mode
@ CS_OPT_DETAIL
Break down instruction structure into details.
@ CS_OPT_ON
Turn ON an option (CS_OPT_DETAIL, CS_OPT_SKIPDATA).
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)
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
struct platform platforms[]
static void print_string_hex(const char *comment, unsigned char *str, size_t len)
static void print_insn_detail(cs_insn *ins)
References arch, platform::comment, count, CS_ARCH_SYSZ, cs_close(), cs_disasm(), cs_free(), CS_MODE_BIG_ENDIAN, cs_open(), CS_OPT_DETAIL, CS_OPT_ON, cs_option(), err, handle, i, platforms, print_insn_detail(), print_string_hex(), printf(), PRIx64, and SYSZ_CODE.
Referenced by main().
◆ handle