Skip to content

Compile From Source

devttys0 edited this page Nov 21, 2024 · 5 revisions

Note

The following assumes you are running Ubuntu, or an Ubuntu-based operating system

Step 1

Install the Rust compiler:

sudo apt install curl
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
. $HOME/.cargo/env

Step 2

Download binwalk:

sudo apt install git
git clone https://github.com/ReFirmLabs/binwalk

Step 3

Install dependencies:

sudo ./binwalk/dependencies/ubuntu.sh

Tip

To only install build dependencies, skip the above script and instead:

sudo apt install build-essential libfontconfig1-dev liblzma-dev

Step 4

Compile Binwalk:

cd binwalk
cargo build --release

Tip

The compiled binary will be located at binwalk/target/release/binwalk.

You may copy it to, and run it from, any directory you prefer.

Note

You can stay up-to-date with the latest "bleeding-edge" updates at any time by pulling from the github repository and re-building:

git pull
cargo build --release