Skip to main content

No project description provided

Project description

BinwalkPy

BinwalkPy is a Python wrapper for the Rust binwalk tool, designed to facilitate the analysis and extraction of firmware images. This project leverages the performance and safety of Rust while providing a convenient Python interface for users.

Features

  • Analyze firmware images for embedded files and executable code.
  • Extract embedded files from firmware images.
  • Support for various compression and file system formats.

Requirements

  • Rust (stable toolchain)
  • Python 3.12

Installing Dependencies

  1. Clone the repository:
git clone https://github.com/P1tt1cus/BinwalkPy.git
cd BinwalkPy
  1. Set up a Python virtual environment:
python3.12 -m venv .venv
source .venv/bin/activate
  1. Install Python dependencies:
pip install maturin
  1. Build and install the Python package:
maturin develop --release

Usage

Analyzing a Firmware Image

import binwalkpy

#[pyfunction]
# fn scan_file(file_path: &str) -> PyResult<Vec<HashMap<String, String>>>

# Analyze a firmware image
results = binwalkpy.scan_file("path/to/your/firmware/image")
for result in results:
    print(result)

Extracting Embedded Files

import binwalkpy

# #[pyfunction]
# fn extract(
#     file_path: String,
#     output_path: Option<String>,
#     include: Option<Vec<String>>,
#     exclude: Option<Vec<String>>,
#     full_search: Option<bool>,
# ) -> PyResult<Vec<HashMap<String, String>>>

file_path = os.path.abspath("./path/to/image")
output_path = os.path.abspath("./extracted")

# Only extract PNG, HTML
results = binwalkpy.extract(file_path, include=["png", "html"], full_search=True)
for extract_result in results:
    print(extract_result)

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

  • Binwalk - The original Binwalk tool.
  • Rust - The programming language used for the core implementation.
  • Maturin - A tool for building and publishing Rust-based Python packages.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

binwalkpy-0.1.1-cp313-cp313-win_amd64.whl (540.5 kB view details)

Uploaded CPython 3.13Windows x86-64

File details

Details for the file binwalkpy-0.1.1-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for binwalkpy-0.1.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 04e2d924a5797489875f72f1c23c07934e40f40c04735cef1586e9e69b46c298
MD5 f11fb5f4bb43bed4009cef438ce820ed
BLAKE2b-256 692e1428e9fe1318ab8d8c49d4d4b6d1d67eb7b15cc77ce7c1b5a2a680edf669

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page