33 #ifdef CAPSTONE_HAS_ARM
43 #ifdef CAPSTONE_HAS_X86
44 #define X86_CODE32 "\x8d\x4c\x32\x08\x01\xd8\x81\xc6\x34\x12\x00\x00\x00\x91\x92"
46 #define RANDOM_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"
48 #if defined(CAPSTONE_HAS_X86)
55 #ifdef CAPSTONE_HAS_ARM
56 cs_opt_skipdata skipdata_callback = {
63 #ifdef CAPSTONE_HAS_X86
69 "X86 32 (Intel syntax) - Skip data",
76 "X86 32 (Intel syntax) - Skip data with custom mnemonic",
83 #ifdef CAPSTONE_HAS_ARM
96 "Arm - Skip data with callback",
100 (size_t) &skipdata_callback,
113 printf(
"****************\n");
117 printf(
"Failed on cs_open() with error returned: %u\n",
err);
135 for (j = 0; j <
count; j++) {
136 printf(
"0x%" PRIx64
":\t%s\t\t%s\n",
137 insn[j].address, insn[j].mnemonic, insn[j].op_str);
141 printf(
"0x%" PRIx64
":\n", insn[j-1].address + insn[j-1].
size);
146 printf(
"****************\n");
149 printf(
"ERROR: Failed to disasm given code!\n");
164 #define offsetof(st, m) __builtin_offsetof(st, m)
167 printf(
"size: %lu\n",
sizeof(insn));
168 printf(
"@id: %lu\n", offsetof(cs_insn,
id));
169 printf(
"@address: %lu\n", offsetof(cs_insn, address));
170 printf(
"@size: %lu\n", offsetof(cs_insn,
size));
172 printf(
"@mnemonic: %lu\n", offsetof(cs_insn, mnemonic));
173 printf(
"@op_str: %lu\n", offsetof(cs_insn, op_str));
174 printf(
"@regs_read: %lu\n", offsetof(cs_insn, regs_read));
175 printf(
"@regs_read_count: %lu\n", offsetof(cs_insn, regs_read_count));
176 printf(
"@regs_write: %lu\n", offsetof(cs_insn, regs_write));
177 printf(
"@regs_write_count: %lu\n", offsetof(cs_insn, regs_write_count));
179 printf(
"@groups_count: %lu\n", offsetof(cs_insn, groups_count));
180 printf(
"@arch: %lu\n", offsetof(cs_insn,
x86));