Macros | Functions | Variables
cs.c File Reference
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <capstone/capstone.h>
#include "utils.h"
#include "MCRegisterInfo.h"
#include "arch/AArch64/AArch64Module.h"
#include "arch/ARM/ARMModule.h"
#include "arch/EVM/EVMModule.h"
#include "arch/M680X/M680XModule.h"
#include "arch/M68K/M68KModule.h"
#include "arch/Mips/MipsModule.h"
#include "arch/PowerPC/PPCModule.h"
#include "arch/Sparc/SparcModule.h"
#include "arch/SystemZ/SystemZModule.h"
#include "arch/TMS320C64x/TMS320C64xModule.h"
#include "arch/X86/X86Module.h"
#include "arch/XCore/XCoreModule.h"
#include "arch/MOS65XX/MOS65XXModule.h"
Include dependency graph for cs.c:

Go to the source code of this file.

Macros

#define INSN_CACHE_SIZE   32
 
#define SKIPDATA_MNEM   ".byte"
 

Functions

CAPSTONE_EXPORT cs_err CAPSTONE_API cs_close (csh *handle)
 
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 CAPSTONE_DEPRECATED size_t CAPSTONE_API cs_disasm_ex (csh ud, const uint8_t *buffer, size_t size, uint64_t offset, size_t count, cs_insn **insn)
 
CAPSTONE_EXPORT bool CAPSTONE_API cs_disasm_iter (csh ud, const uint8_t **code, size_t *size, uint64_t *address, cs_insn *insn)
 
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_errno (csh handle)
 
CAPSTONE_EXPORT void CAPSTONE_API cs_free (cs_insn *insn, size_t count)
 
const CAPSTONE_EXPORT char *CAPSTONE_API cs_group_name (csh ud, unsigned int group)
 
CAPSTONE_EXPORT bool CAPSTONE_API cs_insn_group (csh ud, const cs_insn *insn, unsigned int group_id)
 
const CAPSTONE_EXPORT char *CAPSTONE_API cs_insn_name (csh ud, unsigned int insn)
 
CAPSTONE_EXPORT cs_insn *CAPSTONE_API cs_malloc (csh ud)
 
CAPSTONE_EXPORT int CAPSTONE_API cs_op_count (csh ud, const cs_insn *insn, unsigned int op_type)
 
CAPSTONE_EXPORT int CAPSTONE_API cs_op_index (csh ud, const cs_insn *insn, unsigned int op_type, unsigned int post)
 
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_open (cs_arch arch, cs_mode mode, csh *handle)
 
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_option (csh ud, cs_opt_type type, size_t value)
 
const CAPSTONE_EXPORT char *CAPSTONE_API cs_reg_name (csh ud, unsigned int reg)
 
CAPSTONE_EXPORT bool CAPSTONE_API cs_reg_read (csh ud, const cs_insn *insn, unsigned int reg_id)
 
CAPSTONE_EXPORT bool CAPSTONE_API cs_reg_write (csh ud, const cs_insn *insn, unsigned int reg_id)
 
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_regs_access (csh ud, const cs_insn *insn, cs_regs regs_read, uint8_t *regs_read_count, cs_regs regs_write, uint8_t *regs_write_count)
 
const CAPSTONE_EXPORT char *CAPSTONE_API cs_strerror (cs_err code)
 
CAPSTONE_EXPORT bool CAPSTONE_API cs_support (int query)
 
CAPSTONE_EXPORT unsigned int CAPSTONE_API cs_version (int *major, int *minor)
 
static void fill_insn (struct cs_struct *handle, cs_insn *insn, char *buffer, MCInst *mci, PostPrinter_t postprinter, const uint8_t *code)
 
static void skipdata_opstr (char *opstr, const uint8_t *buffer, size_t size)
 
static uint8_t skipdata_size (cs_struct *handle)
 

Variables

static uint32_t all_arch = 0
 
static cs_mode cs_arch_disallowed_mode_mask [MAX_ARCH]
 
static cs_err(* cs_arch_init [MAX_ARCH])(cs_struct *)
 
static cs_err(* cs_arch_option [MAX_ARCH])(cs_struct *, cs_opt_type, size_t value)
 
cs_calloc_t cs_mem_calloc = NULL
 
cs_free_t cs_mem_free = NULL
 
cs_malloc_t cs_mem_malloc = NULL
 
cs_realloc_t cs_mem_realloc = NULL
 
cs_vsnprintf_t cs_vsnprintf = NULL
 

Macro Definition Documentation

◆ INSN_CACHE_SIZE

#define INSN_CACHE_SIZE   32

Definition at line 42 of file cs.c.

◆ SKIPDATA_MNEM

#define SKIPDATA_MNEM   ".byte"

Definition at line 50 of file cs.c.

Function Documentation

◆ cs_close()

CAPSTONE_EXPORT cs_err CAPSTONE_API cs_close ( csh handle)

Definition at line 522 of file cs.c.

◆ cs_disasm()

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 
)

Definition at line 822 of file cs.c.

◆ cs_disasm_ex()

CAPSTONE_EXPORT CAPSTONE_DEPRECATED size_t CAPSTONE_API cs_disasm_ex ( csh  ud,
const uint8_t buffer,
size_t  size,
uint64_t  offset,
size_t  count,
cs_insn **  insn 
)

Definition at line 1033 of file cs.c.

◆ cs_disasm_iter()

CAPSTONE_EXPORT bool CAPSTONE_API cs_disasm_iter ( csh  ud,
const uint8_t **  code,
size_t *  size,
uint64_t address,
cs_insn *  insn 
)

Definition at line 1080 of file cs.c.

◆ cs_errno()

CAPSTONE_EXPORT cs_err CAPSTONE_API cs_errno ( csh  handle)

Definition at line 423 of file cs.c.

◆ cs_free()

CAPSTONE_EXPORT void CAPSTONE_API cs_free ( cs_insn *  insn,
size_t  count 
)

Definition at line 1039 of file cs.c.

◆ cs_group_name()

const CAPSTONE_EXPORT char* CAPSTONE_API cs_group_name ( csh  ud,
unsigned int  group 
)

Definition at line 1200 of file cs.c.

◆ cs_insn_group()

CAPSTONE_EXPORT bool CAPSTONE_API cs_insn_group ( csh  ud,
const cs_insn *  insn,
unsigned int  group_id 
)

Definition at line 1212 of file cs.c.

◆ cs_insn_name()

const CAPSTONE_EXPORT char* CAPSTONE_API cs_insn_name ( csh  ud,
unsigned int  insn 
)

Definition at line 1188 of file cs.c.

◆ cs_malloc()

CAPSTONE_EXPORT cs_insn* CAPSTONE_API cs_malloc ( csh  ud)

Definition at line 1052 of file cs.c.

◆ cs_op_count()

CAPSTONE_EXPORT int CAPSTONE_API cs_op_count ( csh  ud,
const cs_insn *  insn,
unsigned int  op_type 
)

Definition at line 1293 of file cs.c.

◆ cs_op_index()

CAPSTONE_EXPORT int CAPSTONE_API cs_op_index ( csh  ud,
const cs_insn *  insn,
unsigned int  op_type,
unsigned int  post 
)

Definition at line 1396 of file cs.c.

◆ cs_open()

CAPSTONE_EXPORT cs_err CAPSTONE_API cs_open ( cs_arch  arch,
cs_mode  mode,
csh handle 
)

Definition at line 474 of file cs.c.

◆ cs_option()

CAPSTONE_EXPORT cs_err CAPSTONE_API cs_option ( csh  ud,
cs_opt_type  type,
size_t  value 
)

Definition at line 670 of file cs.c.

◆ cs_reg_name()

const CAPSTONE_EXPORT char* CAPSTONE_API cs_reg_name ( csh  ud,
unsigned int  reg 
)

Definition at line 1176 of file cs.c.

◆ cs_reg_read()

CAPSTONE_EXPORT bool CAPSTONE_API cs_reg_read ( csh  ud,
const cs_insn *  insn,
unsigned int  reg_id 
)

Definition at line 1239 of file cs.c.

◆ cs_reg_write()

CAPSTONE_EXPORT bool CAPSTONE_API cs_reg_write ( csh  ud,
const cs_insn *  insn,
unsigned int  reg_id 
)

Definition at line 1266 of file cs.c.

◆ cs_regs_access()

CAPSTONE_EXPORT cs_err CAPSTONE_API cs_regs_access ( csh  ud,
const cs_insn *  insn,
cs_regs  regs_read,
uint8_t regs_read_count,
cs_regs  regs_write,
uint8_t regs_write_count 
)

Definition at line 1539 of file cs.c.

◆ cs_strerror()

const CAPSTONE_EXPORT char* CAPSTONE_API cs_strerror ( cs_err  code)

Definition at line 435 of file cs.c.

◆ cs_support()

CAPSTONE_EXPORT bool CAPSTONE_API cs_support ( int  query)

Definition at line 388 of file cs.c.

◆ cs_version()

CAPSTONE_EXPORT unsigned int CAPSTONE_API cs_version ( int major,
int minor 
)

Definition at line 377 of file cs.c.

◆ fill_insn()

static void fill_insn ( struct cs_struct handle,
cs_insn *  insn,
char *  buffer,
MCInst mci,
PostPrinter_t  postprinter,
const uint8_t code 
)
static

Definition at line 557 of file cs.c.

◆ skipdata_opstr()

static void skipdata_opstr ( char *  opstr,
const uint8_t buffer,
size_t  size 
)
static

Definition at line 789 of file cs.c.

◆ skipdata_size()

static uint8_t skipdata_size ( cs_struct handle)
static

Definition at line 622 of file cs.c.

Variable Documentation

◆ all_arch

uint32_t all_arch = 0
static

Definition at line 286 of file cs.c.

◆ cs_arch_disallowed_mode_mask

cs_mode cs_arch_disallowed_mode_mask[MAX_ARCH]
static

Definition at line 210 of file cs.c.

◆ cs_arch_init

cs_err(* cs_arch_init[MAX_ARCH])(cs_struct *)
static

Definition at line 70 of file cs.c.

◆ cs_arch_option

cs_err(* cs_arch_option[MAX_ARCH])(cs_struct *, cs_opt_type, size_t value)
static

Definition at line 139 of file cs.c.

◆ cs_mem_calloc

cs_calloc_t cs_mem_calloc = NULL

Definition at line 369 of file cs.c.

◆ cs_mem_free

cs_free_t cs_mem_free = NULL

Definition at line 371 of file cs.c.

◆ cs_mem_malloc

cs_malloc_t cs_mem_malloc = NULL

Definition at line 368 of file cs.c.

◆ cs_mem_realloc

cs_realloc_t cs_mem_realloc = NULL

Definition at line 370 of file cs.c.

◆ cs_vsnprintf

cs_vsnprintf_t cs_vsnprintf = NULL

Definition at line 372 of file cs.c.



grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:09