Skip to content

Reduce external dependecies, try to make binwalk portable #919

@impervius

Description

@impervius

Currently binwalk isn't portable:

  1. It has many external dependencies: dumpifs,lzop,uefi-firmware-parser,tsk_recover,lz4,sasquatch,sasquatch-v4be,zstd,7zz,ubireader_extract_files,unrar,srec_cat,jefferson,dmg2img,vmlinux-to-elf,lzfse,unyaffs, cabextract, tar and maybe more.
  2. It implicitly relies on external dependencies versions, so you can't really know that everything is set up correctly even if you have these utilities available (for example a recent 7zip version for APFS support).

Some of them are standard but others are rare and might not be available on certain systems.

While the docker exists and acts as a portable version of binwalk, it is rather not a good solution (it requires some overhead, not all systems have docker installed or available to non root users, etc.).

I suggest that we will try to make binwalk more portable (aiming for a single executable, maybe that can even be built for windows):

  1. Replace external extractors with crates / internal code where possible.
  2. Reduce redundant external dependencies (for example I am pretty sure that 7z can be used to extract many archives and can replace the use of tar, lz4, lzop, unrar (with an extra package), etc.).
  3. Manage a python venv (using uv or another tool) to install and run python utilities such as jefferson. Maybe think of another solution, or make python support optional via a CLI argument.
  4. Include the (minimized) requirements in the README in an accessible format to allow easy installation (currently you can run binwalk --list, and then you need to filter the third column, etc. which is not a good solution. Or you can look at the Dockerfile which is not that readable and only applies for Ubuntu / Debian).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions