HyperDbg Debugger
Loading...
Searching...
No Matches
keystone.h File Reference
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include "arm64.h"
#include "arm.h"
#include "evm.h"
#include "hexagon.h"
#include "mips.h"
#include "ppc.h"
#include "riscv.h"
#include "sparc.h"
#include "systemz.h"
#include "x86.h"

Go to the source code of this file.

Macros

#define KEYSTONE_EXPORT
 
#define KS_API_MAJOR   0
 
#define KS_API_MINOR   9
 
#define KS_VERSION_MAJOR   KS_API_MAJOR
 
#define KS_VERSION_MINOR   KS_API_MINOR
 
#define KS_VERSION_EXTRA   2
 
#define KS_MAKE_VERSION(major, minor)   ((major << 8) + minor)
 
#define KS_ERR_ASM   128
 
#define KS_ERR_ASM_ARCH   512
 

Typedefs

typedef struct ks_struct ks_engine
 
typedef enum ks_arch ks_arch
 
typedef enum ks_mode ks_mode
 
typedef enum ks_err ks_err
 
typedef bool(* ks_sym_resolver) (const char *symbol, uint64_t *value)
 
typedef enum ks_opt_type ks_opt_type
 
typedef enum ks_opt_value ks_opt_value
 

Enumerations

enum  ks_arch {
  KS_ARCH_ARM = 1 , KS_ARCH_ARM64 , KS_ARCH_MIPS , KS_ARCH_X86 ,
  KS_ARCH_PPC , KS_ARCH_SPARC , KS_ARCH_SYSTEMZ , KS_ARCH_HEXAGON ,
  KS_ARCH_EVM , KS_ARCH_RISCV , KS_ARCH_MAX
}
 
enum  ks_mode {
  KS_MODE_LITTLE_ENDIAN = 0 , KS_MODE_BIG_ENDIAN = 1 << 30 , KS_MODE_ARM = 1 << 0 , KS_MODE_THUMB = 1 << 4 ,
  KS_MODE_V8 = 1 << 6 , KS_MODE_MICRO = 1 << 4 , KS_MODE_MIPS3 = 1 << 5 , KS_MODE_MIPS32R6 = 1 << 6 ,
  KS_MODE_MIPS32 = 1 << 2 , KS_MODE_MIPS64 = 1 << 3 , KS_MODE_16 = 1 << 1 , KS_MODE_32 = 1 << 2 ,
  KS_MODE_64 = 1 << 3 , KS_MODE_PPC32 = 1 << 2 , KS_MODE_PPC64 = 1 << 3 , KS_MODE_QPX = 1 << 4 ,
  KS_MODE_RISCV32 = 1 << 2 , KS_MODE_RISCV64 = 1 << 3 , KS_MODE_SPARC32 = 1 << 2 , KS_MODE_SPARC64 = 1 << 3 ,
  KS_MODE_V9 = 1 << 4
}
 
enum  ks_err {
  KS_ERR_OK = 0 , KS_ERR_NOMEM , KS_ERR_ARCH , KS_ERR_HANDLE ,
  KS_ERR_MODE , KS_ERR_VERSION , KS_ERR_OPT_INVALID , KS_ERR_ASM_EXPR_TOKEN = KS_ERR_ASM ,
  KS_ERR_ASM_DIRECTIVE_VALUE_RANGE , KS_ERR_ASM_DIRECTIVE_ID , KS_ERR_ASM_DIRECTIVE_TOKEN , KS_ERR_ASM_DIRECTIVE_STR ,
  KS_ERR_ASM_DIRECTIVE_COMMA , KS_ERR_ASM_DIRECTIVE_RELOC_NAME , KS_ERR_ASM_DIRECTIVE_RELOC_TOKEN , KS_ERR_ASM_DIRECTIVE_FPOINT ,
  KS_ERR_ASM_DIRECTIVE_UNKNOWN , KS_ERR_ASM_DIRECTIVE_EQU , KS_ERR_ASM_DIRECTIVE_INVALID , KS_ERR_ASM_VARIANT_INVALID ,
  KS_ERR_ASM_EXPR_BRACKET , KS_ERR_ASM_SYMBOL_MODIFIER , KS_ERR_ASM_SYMBOL_REDEFINED , KS_ERR_ASM_SYMBOL_MISSING ,
  KS_ERR_ASM_RPAREN , KS_ERR_ASM_STAT_TOKEN , KS_ERR_ASM_UNSUPPORTED , KS_ERR_ASM_MACRO_TOKEN ,
  KS_ERR_ASM_MACRO_PAREN , KS_ERR_ASM_MACRO_EQU , KS_ERR_ASM_MACRO_ARGS , KS_ERR_ASM_MACRO_LEVELS_EXCEED ,
  KS_ERR_ASM_MACRO_STR , KS_ERR_ASM_MACRO_INVALID , KS_ERR_ASM_ESC_BACKSLASH , KS_ERR_ASM_ESC_OCTAL ,
  KS_ERR_ASM_ESC_SEQUENCE , KS_ERR_ASM_ESC_STR , KS_ERR_ASM_TOKEN_INVALID , KS_ERR_ASM_INSN_UNSUPPORTED ,
  KS_ERR_ASM_FIXUP_INVALID , KS_ERR_ASM_LABEL_INVALID , KS_ERR_ASM_FRAGMENT_INVALID , KS_ERR_ASM_INVALIDOPERAND = KS_ERR_ASM_ARCH ,
  KS_ERR_ASM_MISSINGFEATURE , KS_ERR_ASM_MNEMONICFAIL
}
 
enum  ks_opt_type { KS_OPT_SYNTAX = 1 , KS_OPT_SYM_RESOLVER }
 
enum  ks_opt_value {
  KS_OPT_SYNTAX_INTEL = 1 << 0 , KS_OPT_SYNTAX_ATT = 1 << 1 , KS_OPT_SYNTAX_NASM = 1 << 2 , KS_OPT_SYNTAX_MASM = 1 << 3 ,
  KS_OPT_SYNTAX_GAS = 1 << 4 , KS_OPT_SYNTAX_RADIX16 = 1 << 5
}
 

Functions

KEYSTONE_EXPORT unsigned int ks_version (unsigned int *major, unsigned int *minor)
 
KEYSTONE_EXPORT bool ks_arch_supported (ks_arch arch)
 
KEYSTONE_EXPORT ks_err ks_open (ks_arch arch, int mode, ks_engine **ks)
 
KEYSTONE_EXPORT ks_err ks_close (ks_engine *ks)
 
KEYSTONE_EXPORT ks_err ks_errno (ks_engine *ks)
 
KEYSTONE_EXPORT const char * ks_strerror (ks_err code)
 
KEYSTONE_EXPORT ks_err ks_option (ks_engine *ks, ks_opt_type type, size_t value)
 
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)
 
KEYSTONE_EXPORT void ks_free (unsigned char *p)
 

Macro Definition Documentation

◆ KEYSTONE_EXPORT

#define KEYSTONE_EXPORT

◆ KS_API_MAJOR

#define KS_API_MAJOR   0

◆ KS_API_MINOR

#define KS_API_MINOR   9

◆ KS_ERR_ASM

#define KS_ERR_ASM   128

◆ KS_ERR_ASM_ARCH

#define KS_ERR_ASM_ARCH   512

◆ KS_MAKE_VERSION

#define KS_MAKE_VERSION ( major,
minor )   ((major << 8) + minor)

◆ KS_VERSION_EXTRA

#define KS_VERSION_EXTRA   2

◆ KS_VERSION_MAJOR

#define KS_VERSION_MAJOR   KS_API_MAJOR

◆ KS_VERSION_MINOR

#define KS_VERSION_MINOR   KS_API_MINOR

Typedef Documentation

◆ ks_arch

typedef enum ks_arch ks_arch

◆ ks_engine

typedef struct ks_struct ks_engine

◆ ks_err

typedef enum ks_err ks_err

◆ ks_mode

typedef enum ks_mode ks_mode

◆ ks_opt_type

typedef enum ks_opt_type ks_opt_type

◆ ks_opt_value

typedef enum ks_opt_value ks_opt_value

◆ ks_sym_resolver

typedef bool(* ks_sym_resolver) (const char *symbol, uint64_t *value)

Enumeration Type Documentation

◆ ks_arch

enum ks_arch
Enumerator
KS_ARCH_ARM 
KS_ARCH_ARM64 
KS_ARCH_MIPS 
KS_ARCH_X86 
KS_ARCH_PPC 
KS_ARCH_SPARC 
KS_ARCH_SYSTEMZ 
KS_ARCH_HEXAGON 
KS_ARCH_EVM 
KS_ARCH_RISCV 
KS_ARCH_MAX 
57{
58 KS_ARCH_ARM = 1, // ARM architecture (including Thumb, Thumb-2)
59 KS_ARCH_ARM64, // ARM-64, also called AArch64
60 KS_ARCH_MIPS, // Mips architecture
61 KS_ARCH_X86, // X86 architecture (including x86 & x86-64)
62 KS_ARCH_PPC, // PowerPC architecture (currently unsupported)
63 KS_ARCH_SPARC, // Sparc architecture
64 KS_ARCH_SYSTEMZ, // SystemZ architecture (S390X)
65 KS_ARCH_HEXAGON, // Hexagon architecture
66 KS_ARCH_EVM, // Ethereum Virtual Machine architecture
67 KS_ARCH_RISCV, // RISC-V architecture
69} ks_arch;
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

◆ ks_err

enum ks_err
Enumerator
KS_ERR_OK 
KS_ERR_NOMEM 
KS_ERR_ARCH 
KS_ERR_HANDLE 
KS_ERR_MODE 
KS_ERR_VERSION 
KS_ERR_OPT_INVALID 
KS_ERR_ASM_EXPR_TOKEN 
KS_ERR_ASM_DIRECTIVE_VALUE_RANGE 
KS_ERR_ASM_DIRECTIVE_ID 
KS_ERR_ASM_DIRECTIVE_TOKEN 
KS_ERR_ASM_DIRECTIVE_STR 
KS_ERR_ASM_DIRECTIVE_COMMA 
KS_ERR_ASM_DIRECTIVE_RELOC_NAME 
KS_ERR_ASM_DIRECTIVE_RELOC_TOKEN 
KS_ERR_ASM_DIRECTIVE_FPOINT 
KS_ERR_ASM_DIRECTIVE_UNKNOWN 
KS_ERR_ASM_DIRECTIVE_EQU 
KS_ERR_ASM_DIRECTIVE_INVALID 
KS_ERR_ASM_VARIANT_INVALID 
KS_ERR_ASM_EXPR_BRACKET 
KS_ERR_ASM_SYMBOL_MODIFIER 
KS_ERR_ASM_SYMBOL_REDEFINED 
KS_ERR_ASM_SYMBOL_MISSING 
KS_ERR_ASM_RPAREN 
KS_ERR_ASM_STAT_TOKEN 
KS_ERR_ASM_UNSUPPORTED 
KS_ERR_ASM_MACRO_TOKEN 
KS_ERR_ASM_MACRO_PAREN 
KS_ERR_ASM_MACRO_EQU 
KS_ERR_ASM_MACRO_ARGS 
KS_ERR_ASM_MACRO_LEVELS_EXCEED 
KS_ERR_ASM_MACRO_STR 
KS_ERR_ASM_MACRO_INVALID 
KS_ERR_ASM_ESC_BACKSLASH 
KS_ERR_ASM_ESC_OCTAL 
KS_ERR_ASM_ESC_SEQUENCE 
KS_ERR_ASM_ESC_STR 
KS_ERR_ASM_TOKEN_INVALID 
KS_ERR_ASM_INSN_UNSUPPORTED 
KS_ERR_ASM_FIXUP_INVALID 
KS_ERR_ASM_LABEL_INVALID 
KS_ERR_ASM_FRAGMENT_INVALID 
KS_ERR_ASM_INVALIDOPERAND 
KS_ERR_ASM_MISSINGFEATURE 
KS_ERR_ASM_MNEMONICFAIL 
111{
112 KS_ERR_OK = 0, // No error: everything was fine
113 KS_ERR_NOMEM, // Out-Of-Memory error: ks_open(), ks_emulate()
114 KS_ERR_ARCH, // Unsupported architecture: ks_open()
115 KS_ERR_HANDLE, // Invalid handle
116 KS_ERR_MODE, // Invalid/unsupported mode: ks_open()
117 KS_ERR_VERSION, // Unsupported version (bindings)
118 KS_ERR_OPT_INVALID, // Unsupported option
119
120 // generic input assembly errors - parser specific
121 KS_ERR_ASM_EXPR_TOKEN = KS_ERR_ASM, // unknown token in expression
122 KS_ERR_ASM_DIRECTIVE_VALUE_RANGE, // literal value out of range for directive
123 KS_ERR_ASM_DIRECTIVE_ID, // expected identifier in directive
124 KS_ERR_ASM_DIRECTIVE_TOKEN, // unexpected token in directive
125 KS_ERR_ASM_DIRECTIVE_STR, // expected string in directive
126 KS_ERR_ASM_DIRECTIVE_COMMA, // expected comma in directive
127 KS_ERR_ASM_DIRECTIVE_RELOC_NAME, // expected relocation name in directive
128 KS_ERR_ASM_DIRECTIVE_RELOC_TOKEN, // unexpected token in .reloc directive
129 KS_ERR_ASM_DIRECTIVE_FPOINT, // invalid floating point in directive
130 KS_ERR_ASM_DIRECTIVE_UNKNOWN, // unknown directive
131 KS_ERR_ASM_DIRECTIVE_EQU, // invalid equal directive
132 KS_ERR_ASM_DIRECTIVE_INVALID, // (generic) invalid directive
133 KS_ERR_ASM_VARIANT_INVALID, // invalid variant
134 KS_ERR_ASM_EXPR_BRACKET, // brackets expression not supported on this target
135 KS_ERR_ASM_SYMBOL_MODIFIER, // unexpected symbol modifier following '@'
136 KS_ERR_ASM_SYMBOL_REDEFINED, // invalid symbol redefinition
137 KS_ERR_ASM_SYMBOL_MISSING, // cannot find a symbol
138 KS_ERR_ASM_RPAREN, // expected ')' in parentheses expression
139 KS_ERR_ASM_STAT_TOKEN, // unexpected token at start of statement
140 KS_ERR_ASM_UNSUPPORTED, // unsupported token yet
141 KS_ERR_ASM_MACRO_TOKEN, // unexpected token in macro instantiation
142 KS_ERR_ASM_MACRO_PAREN, // unbalanced parentheses in macro argument
143 KS_ERR_ASM_MACRO_EQU, // expected '=' after formal parameter identifier
144 KS_ERR_ASM_MACRO_ARGS, // too many positional arguments
145 KS_ERR_ASM_MACRO_LEVELS_EXCEED, // macros cannot be nested more than 20 levels deep
146 KS_ERR_ASM_MACRO_STR, // invalid macro string
147 KS_ERR_ASM_MACRO_INVALID, // invalid macro (generic error)
148 KS_ERR_ASM_ESC_BACKSLASH, // unexpected backslash at end of escaped string
149 KS_ERR_ASM_ESC_OCTAL, // invalid octal escape sequence (out of range)
150 KS_ERR_ASM_ESC_SEQUENCE, // invalid escape sequence (unrecognized character)
151 KS_ERR_ASM_ESC_STR, // broken escape string
152 KS_ERR_ASM_TOKEN_INVALID, // invalid token
153 KS_ERR_ASM_INSN_UNSUPPORTED, // this instruction is unsupported in this mode
154 KS_ERR_ASM_FIXUP_INVALID, // invalid fixup
155 KS_ERR_ASM_LABEL_INVALID, // invalid label
156 KS_ERR_ASM_FRAGMENT_INVALID, // invalid fragment
157
158 // generic input assembly errors - architecture specific
162} ks_err;
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
#define KS_ERR_ASM_ARCH
Definition keystone.h:107
#define KS_ERR_ASM
Definition keystone.h:104

◆ ks_mode

enum ks_mode
Enumerator
KS_MODE_LITTLE_ENDIAN 
KS_MODE_BIG_ENDIAN 
KS_MODE_ARM 
KS_MODE_THUMB 
KS_MODE_V8 
KS_MODE_MICRO 
KS_MODE_MIPS3 
KS_MODE_MIPS32R6 
KS_MODE_MIPS32 
KS_MODE_MIPS64 
KS_MODE_16 
KS_MODE_32 
KS_MODE_64 
KS_MODE_PPC32 
KS_MODE_PPC64 
KS_MODE_QPX 
KS_MODE_RISCV32 
KS_MODE_RISCV64 
KS_MODE_SPARC32 
KS_MODE_SPARC64 
KS_MODE_V9 
73{
74 KS_MODE_LITTLE_ENDIAN = 0, // little-endian mode (default mode)
75 KS_MODE_BIG_ENDIAN = 1 << 30, // big-endian mode
76 // arm / arm64
77 KS_MODE_ARM = 1 << 0, // ARM mode
78 KS_MODE_THUMB = 1 << 4, // THUMB mode (including Thumb-2)
79 KS_MODE_V8 = 1 << 6, // ARMv8 A32 encodings for ARM
80 // mips
81 KS_MODE_MICRO = 1 << 4, // MicroMips mode
82 KS_MODE_MIPS3 = 1 << 5, // Mips III ISA
83 KS_MODE_MIPS32R6 = 1 << 6, // Mips32r6 ISA
84 KS_MODE_MIPS32 = 1 << 2, // Mips32 ISA
85 KS_MODE_MIPS64 = 1 << 3, // Mips64 ISA
86 // x86 / x64
87 KS_MODE_16 = 1 << 1, // 16-bit mode
88 KS_MODE_32 = 1 << 2, // 32-bit mode
89 KS_MODE_64 = 1 << 3, // 64-bit mode
90 // ppc
91 KS_MODE_PPC32 = 1 << 2, // 32-bit mode
92 KS_MODE_PPC64 = 1 << 3, // 64-bit mode
93 KS_MODE_QPX = 1 << 4, // Quad Processing eXtensions mode
94 // riscv
95 KS_MODE_RISCV32 = 1 << 2, // 32-bit mode
96 KS_MODE_RISCV64 = 1 << 3, // 64-bit mode
97 // sparc
98 KS_MODE_SPARC32 = 1 << 2, // 32-bit mode
99 KS_MODE_SPARC64 = 1 << 3, // 64-bit mode
100 KS_MODE_V9 = 1 << 4, // SparcV9 mode
101} ks_mode;
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

◆ ks_opt_type

Enumerator
KS_OPT_SYNTAX 
KS_OPT_SYM_RESOLVER 
176{
177 KS_OPT_SYNTAX = 1, // Choose syntax for input assembly
178 KS_OPT_SYM_RESOLVER, // Set symbol resolver callback
ks_opt_type
Definition keystone.h:176
@ KS_OPT_SYM_RESOLVER
Definition keystone.h:178
@ KS_OPT_SYNTAX
Definition keystone.h:177

◆ ks_opt_value

Enumerator
KS_OPT_SYNTAX_INTEL 
KS_OPT_SYNTAX_ATT 
KS_OPT_SYNTAX_NASM 
KS_OPT_SYNTAX_MASM 
KS_OPT_SYNTAX_GAS 
KS_OPT_SYNTAX_RADIX16 
183{
184 KS_OPT_SYNTAX_INTEL = 1 << 0, // X86 Intel syntax - default on X86 (KS_OPT_SYNTAX).
185 KS_OPT_SYNTAX_ATT = 1 << 1, // X86 ATT asm syntax (KS_OPT_SYNTAX).
186 KS_OPT_SYNTAX_NASM = 1 << 2, // X86 Nasm syntax (KS_OPT_SYNTAX).
187 KS_OPT_SYNTAX_MASM = 1 << 3, // X86 Masm syntax (KS_OPT_SYNTAX) - unsupported yet.
188 KS_OPT_SYNTAX_GAS = 1 << 4, // X86 GNU GAS syntax (KS_OPT_SYNTAX).
189 KS_OPT_SYNTAX_RADIX16 = 1 << 5, // All immediates are in hex format (i.e 12 is 0x12)
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

Function Documentation

◆ ks_arch_supported()

KEYSTONE_EXPORT bool ks_arch_supported ( ks_arch arch)

◆ ks_asm()

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_close()

KEYSTONE_EXPORT ks_err ks_close ( ks_engine * ks)

◆ ks_errno()

KEYSTONE_EXPORT ks_err ks_errno ( ks_engine * ks)

◆ ks_free()

KEYSTONE_EXPORT void ks_free ( unsigned char * p)

◆ ks_open()

KEYSTONE_EXPORT ks_err ks_open ( ks_arch arch,
int mode,
ks_engine ** ks )

◆ ks_option()

KEYSTONE_EXPORT ks_err ks_option ( ks_engine * ks,
ks_opt_type type,
size_t value )

◆ ks_strerror()

KEYSTONE_EXPORT const char * ks_strerror ( ks_err code)

◆ ks_version()

KEYSTONE_EXPORT unsigned int ks_version ( unsigned int * major,
unsigned int * minor )