10 #include <capstone/platform.h>
11 #include <capstone/capstone.h>
13 #define X86_CODE32 "\x75\x01"
39 printf(
"ERROR: Failed to disasm given code!\n");
55 printf(
"Failed on cs_open() with error returned: %u\n",
err);
60 printf(
"Disassemble X86 code with default instruction mnemonic\n");
64 printf(
"\nNow customize engine to change mnemonic from 'JNE' to 'JNZ'\n");
71 printf(
"\nReset engine to use the default mnemonic\n");
static mcore_handle handle
@ CS_ARCH_X86
X86 architecture (including x86 & x86-64)
@ CS_MODE_32
32-bit mode (X86)
@ CS_OPT_MNEMONIC
Customize instruction mnemonic.
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)
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
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
static void print_insn(csh handle)
static void print_string_hex(unsigned char *str, size_t len)