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
- Clone the repository:
git clone https://github.com/P1tt1cus/BinwalkPy.git
cd BinwalkPy
- Set up a Python virtual environment:
python3.12 -m venv .venv
source .venv/bin/activate
- Install Python dependencies:
pip install maturin
- 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file binwalkpy-0.1.1-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: binwalkpy-0.1.1-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 540.5 kB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04e2d924a5797489875f72f1c23c07934e40f40c04735cef1586e9e69b46c298
|
|
| MD5 |
f11fb5f4bb43bed4009cef438ce820ed
|
|
| BLAKE2b-256 |
692e1428e9fe1318ab8d8c49d4d4b6d1d67eb7b15cc77ce7c1b5a2a680edf669
|