1- # Installing
21BAP python bindings
32
4- And if you're interested in python bindings, then you can install them using pip:
3+ # Installing
4+
5+ Install python bindings with pip:
56
67``` bash
78$ pip install git+git://github.com/BinaryAnalysisPlatform/bap-python.git
89```
910
11+ Alternatively you can just copy paste files into your project, or clone it
12+ with git-subtree, or whatever...
13+
14+ An optional low-level interface, called [ rpc] depends on requests, so
15+ install [ requests] package from pip and ` bap-server ` from opam.
16+
17+ ``` python
18+ >> > import bap
19+ >> > proj = bap.run(' /bin/true' , [' --symbolizer=ida' ])
20+ >> > text = proj.sections[' .text' ]
21+ >> > main = proj.program.subs.find(' main' )
22+ >> > entry = main.blks[0 ]
23+ >> > next = main.blks.find(entry.jmps[0 ].target.arg)
24+ ```
25+
26+ For more information, read builtin documentation, for example with
27+ ` ipython ` :
28+
29+ ``` python
30+ >> > bap?
31+ ```
32+
1033
11- # Using
34+ # Using low-level interface
35+
36+ The low-level interface provides an access to disassembler and image
37+ loader. It uses RPC interface to make calls to the library. So make
38+ sure that you have installed ` requests ` and ` bap-server ` (see
39+ Installation section).
1240
13- After BAP and python bindings are properly installed, you can start to
14- use it:
1541
1642``` python
1743 >> > import bap
@@ -31,12 +57,3 @@ A more complex example:
3157 sub sp, sp, # 0xc8
3258 ... < snip> ...
3359```
34-
35- For more information, read builtin documentation, for example with
36- ` ipython ` :
37-
38- ``` python
39- >> > bap?
40- ```
41-
42- Currently, only disassembler and lifter are exposed via python interface.
0 commit comments