CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 09:14:01 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-robots-tag: none
etag: W/"71272950ee93e41ca9ba5686f981b225"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=KXQNvqZ%2FSWfEQqVjsvm217pooIH%2FctrM0u7R2CzAwFAN6kiXlE0K%2Bch0uNCVZok38IDkrQqlf%2Bv%2Br0QxkKhyEPMVHL8TbjRtLdxFeeM1QSh6wEN67bPdUw2lDmODU5QIL5iBFnydD4%2Fco9cuVTbWQ%2F1H0Cm56QLb2BH6X1P%2Fzj4Y%2BSLzJN9fiyjggrPnW%2FvGfV8qDDg5KYLuEXhQp9xLxxhwTf7hNCwIDqrgbyPKrOGsdIq54LI3ueLvdVZc1saIOeLvyNvg52H2LwJzKlIbzg%3D%3D--IIYHxbSLCWq7BTtR--Pxj%2F7c8me1WmyboyWpm1AA%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.799751746.1753607641; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 09:14:01 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 09:14:01 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: BF5E:32A0BD:3401D0:471715:6885EDD9
Using the Rust Library · ReFirmLabs/binwalk Wiki · GitHub
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Using the Rust Library
devttys0 edited this page Oct 31, 2024
·
4 revisions
Binwalk includes a library that can be integrated into other Rust projects.
You will need to install the following system dependencies:
sudo apt install build-essential libfontconfig1-dev liblzma-dev
Tip
Detailed API documentation can be found in Binwalk's Rust documentation:
cargo doc --open
Create a new Rust project:
cargo new my_project
To use the latest release, add the following dependency to your project's Cargo.toml
file:
binwalk = "3.1.0"
To build against the the latest master branch (possibly unstable), add the following dependency to your project's Cargo.toml
file:
binwalk = { git = "https://github.com/ReFirmLabs/binwalk.git" }
Edit your project's src/main.rs
file:
use binwalk::Binwalk;
fn main() {
// Create a new Binwalk instance
let binwalker = Binwalk::new();
// Read in the data you want to analyze
let file_data = std::fs::read("/tmp/firmware.bin").expect("Failed to read from file");
// Scan the file data and print the results
for result in binwalker.scan(&file_data) {
println!("{:#?}", result);
}
}
Build and run your project:
$ cargo run
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.06s
Running `target/debug/my_project`
SignatureResult {
offset: 0,
id: "82df43be-c867-4291-8d81-7c46f1769f31",
size: 116,
name: "dlob",
confidence: 128,
description: "DLOB firmware header, header size: 116 bytes, data size: 19996704",
always_display: false,
extraction_declined: false,
preferred_extractor: None,
}
SignatureResult {
offset: 116,
id: "49385de3-0265-44d5-9923-f6d5fb888851",
size: 1808138,
name: "lzma",
confidence: 250,
description: "LZMA compressed data, properties: 0x5D, dictionary size: 33554432 bytes, compressed size: 1808138 bytes, uncompressed size: 4897632 bytes",
always_display: false,
extraction_declined: false,
preferred_extractor: None,
}
SignatureResult {
offset: 1835124,
id: "3900f0df-2ca2-4213-89c3-13ba2e9754e5",
size: 32,
name: "packimg",
confidence: 0,
description: "PackImg firmware header, header size: 32 bytes, data size: 2102529 bytes",
always_display: false,
extraction_declined: false,
preferred_extractor: None,
}
SignatureResult {
offset: 1835156,
id: "ee1af66f-e64f-4195-bc07-9ffc5f046550",
size: 18159869,
name: "squashfs",
confidence: 250,
description: "SquashFS file system, little endian, version: 4.0, compression: xz, inode count: 2673, block size: 131072, image size: 18159869 bytes, created: 2016-05-24 09:50:50",
always_display: false,
extraction_declined: false,
preferred_extractor: None,
}
You can’t perform that action at this time.