4#ifndef KEYSTONE_ENGINE_H
5#define KEYSTONE_ENGINE_H
17# pragma warning(disable : 4201)
18# pragma warning(disable : 4100)
19# ifndef KEYSTONE_STATIC
20# define KEYSTONE_EXPORT __declspec(dllexport)
22# define KEYSTONE_EXPORT
27# ifndef KEYSTONE_STATIC
28# define KEYSTONE_EXPORT __attribute__((visibility("default")))
30# define KEYSTONE_EXPORT
33# define KEYSTONE_EXPORT
45#define KS_VERSION_MAJOR KS_API_MAJOR
46#define KS_VERSION_MINOR KS_API_MINOR
47#define KS_VERSION_EXTRA 2
53#define KS_MAKE_VERSION(major, minor) ((major << 8) + minor)
104#define KS_ERR_ASM 128
107#define KS_ERR_ASM_ARCH 512
332 unsigned char ** encoding,
333 size_t * encoding_size,
334 size_t * stat_count);
ks_opt_value
Definition keystone.h:183
@ KS_OPT_SYNTAX_ATT
Definition keystone.h:185
@ KS_OPT_SYNTAX_NASM
Definition keystone.h:186
@ KS_OPT_SYNTAX_MASM
Definition keystone.h:187
@ KS_OPT_SYNTAX_INTEL
Definition keystone.h:184
@ KS_OPT_SYNTAX_RADIX16
Definition keystone.h:189
@ KS_OPT_SYNTAX_GAS
Definition keystone.h:188
KEYSTONE_EXPORT ks_err ks_errno(ks_engine *ks)
KEYSTONE_EXPORT unsigned int ks_version(unsigned int *major, unsigned int *minor)
#define KEYSTONE_EXPORT
Definition keystone.h:33
ks_err
Definition keystone.h:111
@ KS_ERR_ASM_VARIANT_INVALID
Definition keystone.h:133
@ KS_ERR_ASM_FIXUP_INVALID
Definition keystone.h:154
@ KS_ERR_VERSION
Definition keystone.h:117
@ KS_ERR_ASM_MACRO_LEVELS_EXCEED
Definition keystone.h:145
@ KS_ERR_ASM_DIRECTIVE_UNKNOWN
Definition keystone.h:130
@ KS_ERR_ASM_MACRO_STR
Definition keystone.h:146
@ KS_ERR_ASM_ESC_OCTAL
Definition keystone.h:149
@ KS_ERR_ASM_MACRO_TOKEN
Definition keystone.h:141
@ KS_ERR_ASM_DIRECTIVE_RELOC_TOKEN
Definition keystone.h:128
@ KS_ERR_ASM_UNSUPPORTED
Definition keystone.h:140
@ KS_ERR_ASM_DIRECTIVE_FPOINT
Definition keystone.h:129
@ KS_ERR_ASM_MACRO_EQU
Definition keystone.h:143
@ KS_ERR_ASM_DIRECTIVE_STR
Definition keystone.h:125
@ KS_ERR_ASM_MACRO_PAREN
Definition keystone.h:142
@ KS_ERR_ASM_INVALIDOPERAND
Definition keystone.h:159
@ KS_ERR_ASM_ESC_SEQUENCE
Definition keystone.h:150
@ KS_ERR_ASM_MISSINGFEATURE
Definition keystone.h:160
@ KS_ERR_ASM_DIRECTIVE_TOKEN
Definition keystone.h:124
@ KS_ERR_ASM_MNEMONICFAIL
Definition keystone.h:161
@ KS_ERR_ASM_MACRO_INVALID
Definition keystone.h:147
@ KS_ERR_ASM_ESC_STR
Definition keystone.h:151
@ KS_ERR_ASM_DIRECTIVE_ID
Definition keystone.h:123
@ KS_ERR_ASM_TOKEN_INVALID
Definition keystone.h:152
@ KS_ERR_ASM_SYMBOL_REDEFINED
Definition keystone.h:136
@ KS_ERR_NOMEM
Definition keystone.h:113
@ KS_ERR_ASM_SYMBOL_MODIFIER
Definition keystone.h:135
@ KS_ERR_ARCH
Definition keystone.h:114
@ KS_ERR_MODE
Definition keystone.h:116
@ KS_ERR_ASM_EXPR_BRACKET
Definition keystone.h:134
@ KS_ERR_ASM_INSN_UNSUPPORTED
Definition keystone.h:153
@ KS_ERR_OK
Definition keystone.h:112
@ KS_ERR_ASM_DIRECTIVE_COMMA
Definition keystone.h:126
@ KS_ERR_ASM_MACRO_ARGS
Definition keystone.h:144
@ KS_ERR_ASM_LABEL_INVALID
Definition keystone.h:155
@ KS_ERR_HANDLE
Definition keystone.h:115
@ KS_ERR_ASM_FRAGMENT_INVALID
Definition keystone.h:156
@ KS_ERR_ASM_DIRECTIVE_INVALID
Definition keystone.h:132
@ KS_ERR_ASM_EXPR_TOKEN
Definition keystone.h:121
@ KS_ERR_ASM_DIRECTIVE_VALUE_RANGE
Definition keystone.h:122
@ KS_ERR_ASM_RPAREN
Definition keystone.h:138
@ KS_ERR_ASM_DIRECTIVE_EQU
Definition keystone.h:131
@ KS_ERR_OPT_INVALID
Definition keystone.h:118
@ KS_ERR_ASM_SYMBOL_MISSING
Definition keystone.h:137
@ KS_ERR_ASM_DIRECTIVE_RELOC_NAME
Definition keystone.h:127
@ KS_ERR_ASM_STAT_TOKEN
Definition keystone.h:139
@ KS_ERR_ASM_ESC_BACKSLASH
Definition keystone.h:148
KEYSTONE_EXPORT void ks_free(unsigned char *p)
KEYSTONE_EXPORT ks_err ks_close(ks_engine *ks)
#define KS_ERR_ASM_ARCH
Definition keystone.h:107
KEYSTONE_EXPORT ks_err ks_option(ks_engine *ks, ks_opt_type type, size_t value)
#define KS_ERR_ASM
Definition keystone.h:104
KEYSTONE_EXPORT const char * ks_strerror(ks_err code)
ks_mode
Definition keystone.h:73
@ KS_MODE_LITTLE_ENDIAN
Definition keystone.h:74
@ KS_MODE_RISCV64
Definition keystone.h:96
@ KS_MODE_THUMB
Definition keystone.h:78
@ KS_MODE_PPC32
Definition keystone.h:91
@ KS_MODE_MIPS3
Definition keystone.h:82
@ KS_MODE_16
Definition keystone.h:87
@ KS_MODE_QPX
Definition keystone.h:93
@ KS_MODE_MIPS64
Definition keystone.h:85
@ KS_MODE_RISCV32
Definition keystone.h:95
@ KS_MODE_MIPS32R6
Definition keystone.h:83
@ KS_MODE_PPC64
Definition keystone.h:92
@ KS_MODE_SPARC64
Definition keystone.h:99
@ KS_MODE_ARM
Definition keystone.h:77
@ KS_MODE_MICRO
Definition keystone.h:81
@ KS_MODE_V9
Definition keystone.h:100
@ KS_MODE_64
Definition keystone.h:89
@ KS_MODE_V8
Definition keystone.h:79
@ KS_MODE_SPARC32
Definition keystone.h:98
@ KS_MODE_BIG_ENDIAN
Definition keystone.h:75
@ KS_MODE_MIPS32
Definition keystone.h:84
@ KS_MODE_32
Definition keystone.h:88
KEYSTONE_EXPORT int ks_asm(ks_engine *ks, const char *string, uint64_t address, unsigned char **encoding, size_t *encoding_size, size_t *stat_count)
ks_arch
Definition keystone.h:57
@ KS_ARCH_RISCV
Definition keystone.h:67
@ KS_ARCH_MIPS
Definition keystone.h:60
@ KS_ARCH_ARM
Definition keystone.h:58
@ KS_ARCH_ARM64
Definition keystone.h:59
@ KS_ARCH_SYSTEMZ
Definition keystone.h:64
@ KS_ARCH_MAX
Definition keystone.h:68
@ KS_ARCH_HEXAGON
Definition keystone.h:65
@ KS_ARCH_SPARC
Definition keystone.h:63
@ KS_ARCH_PPC
Definition keystone.h:62
@ KS_ARCH_X86
Definition keystone.h:61
@ KS_ARCH_EVM
Definition keystone.h:66
KEYSTONE_EXPORT ks_err ks_open(ks_arch arch, int mode, ks_engine **ks)
struct ks_struct ks_engine
Definition keystone.h:38
bool(* ks_sym_resolver)(const char *symbol, uint64_t *value)
Definition keystone.h:172
ks_opt_type
Definition keystone.h:176
@ KS_OPT_SYM_RESOLVER
Definition keystone.h:178
@ KS_OPT_SYNTAX
Definition keystone.h:177
KEYSTONE_EXPORT bool ks_arch_supported(ks_arch arch)