Debian Codegraph @

INSTALL.md

raw symbols SCIP
1 Before You Start
2 ================
3
4 Binwalk supports Python 3.8+.
5
6 It is recommended to install Binwalk through the package repository of your Linux distribution, whenever possible.
7
8 Installation
9 ============
10
11 Installation follows the typical Python installation procedure:
12
13 ```bash
14 # Python3.x
15 $ python3 setup.py install --user
16 ```
17
18 **NOTE**: Older versions of binwalk (e.g., v1.0) are not compatible with the latest version of binwalk. It is strongly recommended that you uninstall any existing binwalk installations before installing the latest version in order to avoid API conflicts.
19
20 Dependencies
21 ============
22
23 Besides a Python interpreter, there are no installation dependencies for binwalk. All dependencies are optional run-time dependencies, and unless otherwise specified, are available from most Linux package managers.
24
25 Binwalk uses pytest for tests and `pytest-cov` for test coverage:
26
27 ```bash
28 $ sudo apt install python3-pytest python3-pytest-cov
29 ```
30
31 Binwalk uses [matplotlib](https://matplotlib.org/) to generate graphs and visualizations:
32
33 ```bash
34 $ sudo apt install python3-matplotlib
35 ```
36
37 Binwalk's `--disasm` option requires the [Capstone](http://www.capstone-engine.org/) disassembly framework and its corresponding Python bindings:
38
39 ```bash
40 $ sudo apt install python3-capstone
41 ```
42
43 Binwalk relies on multiple external utilties in order to automatically extract/decompress files and data:
44
45 ```bash
46 # Install standard extraction utilities
47 $ sudo apt install mtd-utils gzip bzip2 tar arj lhasa p7zip p7zip-full cabextract cramfsswap squashfs-tools sleuthkit default-jdk lzop srecord
48 ```
49
50 ```bash
51 # Install sasquatch to extract non-standard SquashFS images
52 $ sudo apt install zlib1g-dev liblzma-dev liblzo2-dev
53 $ git clone https://github.com/devttys0/sasquatch
54 $ cd sasquatch
55 $ wget https://github.com/devttys0/sasquatch/pull/47.patch && patch -p1 < 47.patch
56 $ ./build.sh
57 ```
58
59 ```bash
60 # Install cramfs tools
61 $ git clone --quiet --depth 1 --branch "master" https://github.com/npitre/cramfs-tools
62 $ (cd cramfs-tools && make && sudo install cramfsck /usr/local/bin)
63 ```
64
65 ```bash
66 # Install jefferson to extract JFFS2 file systems
67 $ pipx install jefferson
68 ```
69
70 ```bash
71 # Install ubi_reader to extract UBIFS file systems
72 $ pipx install ubi_reader
73 ```
74
75 ```bash
76 # Install yaffshiv to extract YAFFS file systems
77 $ git clone https://github.com/devttys0/yaffshiv
78 $ (cd yaffshiv && pipx install .)
79 ```
80
81 Note that for Debian/Ubuntu users, all of the above dependencies can be installed automatically using the included `deps.sh` script:
82
83 ```bash
84 $ sudo ./deps.sh
85 ```
86
87 Installing the IDA Plugin
88 =========================
89
90 If IDA is installed on your system, you may optionally install the binwalk IDA plugin:
91
92 ```bash
93 $ python setup.py idainstall --idadir=/home/user/ida
94 ```
95
96 Likewise, the binwalk IDA plugin can be uninstalled:
97
98 ```bash
99 $ python setup.py idauninstall --idadir=/home/user/ida
100 ```
101
102
103 Uninstalling Binwalk
104 ====================
105
106 If binwalk has been installed to a standard system location (e.g., via `setup.py install`), it can be removed by running:
107
108 ```bash
109 # Python3
110 $ sudo python3 setup.py uninstall
111 ```
112
113 Note that this does _not_ remove any of the manually installed dependencies.
114