• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
10. This documentation explains how to install the Python bindings for Capstone
2   from source. If you want to install it from a PyPi package (recommended if
3   you are on Windows), see README.txt.
4
51. To install capstone and the python bindings on *nix, run the command below:
6
7		$ sudo make install
8
9   To install capstone for python 3, run the command below:
10   (Note: this requires python3 installed in your machine)
11
12		$ sudo make install3
13
14   To control the install destination, set the DESTDIR environment variable.
15
162. For better Python performance, install cython-based binding with:
17
18		$ sudo make install_cython
19
20	Note that this requires Cython installed first. To install Cython, see
21	below.
22
233. To install Cython, you have to ensure that the header files
24   and the static library for Python are installed beforehand.
25
26	E.g. on Ubuntu, do:
27
28		$ sudo apt-get install python-dev
29
30	Depending on if you already have pip or easy_install installed, install
31	Cython with either:
32
33		$ sudo pip install cython
34	or:
35		$ sudo easy_install cython
36
37	NOTE: Depending on your distribution you might also be able to
38	      install the required Cython version using your repository.
39
40	E.g. on Ubuntu, do:
41
42		$ sudo apt-get install cython
43
44	However, our cython-based binding requires Cython version 0.19 or newer,
45	but sometimes distributions only provide older version. Make sure to
46	verify the current installed version before going into section 2 above.
47
48	E.g, on Ubuntu, you can verify the current Cython version with:
49
50		$ apt-cache policy cython
51
52	Which should at least print version 0.19
53
544. This directory contains some test code to show how to use the Capstone API.
55
56- test_basic.py
57  This code shows the most simple form of API where we only want to get basic
58  information out of disassembled instruction, such as address, mnemonic and
59  operand string.
60
61- test_lite.py
62  Similarly to test_basic.py, but this code shows how to use disasm_lite(), a lighter
63  method to disassemble binary. Unlike disasm() API (used by test.py), which returns
64  CsInsn objects, this API just returns tuples of (address, size, mnemonic, op_str).
65
66  The main reason for using this API is better performance: disasm_lite() is at least
67  20% faster than disasm(). Memory usage is also less. So if you just need basic
68  information out of disassembler, use disasm_lite() instead of disasm().
69
70- test_detail.py:
71  This code shows how to access to architecture-neutral information in disassembled
72  instructions, such as implicit registers read/written, or groups of instructions
73  that this instruction belong to.
74
75- test_<arch>.py
76  These code show how to access architecture-specific information for each
77  architecture.
78