1
- # Installing
2
1
BAP python bindings
3
2
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:
5
6
6
7
``` bash
7
8
$ pip install git+git://github.com/BinaryAnalysisPlatform/bap-python.git
8
9
```
9
10
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
+
10
33
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).
12
40
13
- After BAP and python bindings are properly installed, you can start to
14
- use it:
15
41
16
42
``` python
17
43
>> > import bap
@@ -31,12 +57,3 @@ A more complex example:
31
57
sub sp, sp, # 0xc8
32
58
... < snip> ...
33
59
```
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