aboutsummaryrefslogtreecommitdiffstats
path: root/capstone/bindings/python/pyx/ccapstone.pxd
blob: 8b163f2f6986b0bcf2baab473b38d4d43a36d6ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# By Dang Hoang Vu <danghvu@gmail.com>, 2014

from libcpp cimport bool
from libc.stdint cimport uint8_t, uint64_t, uint16_t

cdef extern from "<capstone/capstone.h>":

    ctypedef size_t csh

    ctypedef enum cs_mode:
        pass

    ctypedef enum cs_arch:
        pass

    ctypedef struct cs_detail:
        pass

    ctypedef struct cs_insn:
        unsigned int id
        uint64_t address
        uint16_t size
        uint8_t bytes[24]
        char mnemonic[32]
        char op_str[160]
        cs_detail *detail

    ctypedef enum cs_err:
        pass

    ctypedef enum cs_opt_type:
        pass

    unsigned int cs_version(int *major, int *minor)

    bool cs_support(int arch)

    cs_err cs_open(cs_arch arch, cs_mode mode, csh *handle)

    cs_err cs_close(csh *handle)

    cs_err cs_errno(csh handle)

    size_t cs_disasm(csh handle,
        const uint8_t *code, size_t code_size,
        uint64_t address,
        size_t count,
        cs_insn **insn)

    cs_err cs_option(csh handle, cs_opt_type type, size_t value)

    void cs_free(cs_insn *insn, size_t count)

    const char *cs_reg_name(csh handle, unsigned int reg_id)

    const char *cs_insn_name(csh handle, unsigned int insn_id)

    const char *cs_group_name(csh handle, unsigned int group_id)

    bool cs_insn_group(csh handle, cs_insn *insn, unsigned int group_id)

    bool cs_reg_read(csh handle, cs_insn *insn, unsigned int reg_id)

    bool cs_reg_write(csh handle, cs_insn *insn, unsigned int reg_id)

    int cs_op_count(csh handle, cs_insn *insn, unsigned int op_type)

    cs_err cs_regs_access(csh handle, cs_insn *insn, uint16_t *regs_read, uint8_t *read_count, uint16_t *regs_write, uint8_t *write_count)

    int cs_op_index(csh handle, cs_insn *insn, unsigned int op_type,
        unsigned int position)