Expand description
§zarja-core
A library for extracting and reconstructing Protocol Buffer definitions from compiled binaries.
This crate provides the core functionality for:
- Scanning binary files for embedded protobuf file descriptors
- Parsing raw protobuf wire format data
- Reconstructing human-readable
.protosource files
§Architecture
The library is organized into several modules:
scanner: Binary scanning and wire format parsingproto: Proto definition reconstructionerror: Error types and handling
§Example
use zarja_core::{Scanner, ScanStrategy, ProtoReconstructor};
use std::fs;
// Read a binary file
let data = fs::read("./target/release/my_app")?;
// Scan for embedded descriptors
let scanner = Scanner::new();
let results = scanner.scan(&data)?;
// Reconstruct proto definitions
for result in results {
if let Ok(reconstructor) = ProtoReconstructor::from_bytes(result.as_bytes()) {
println!("{}", reconstructor.reconstruct());
}
}§Extensibility
The library provides several traits for customization:
ProtoWriter: Customize how proto elements are writtenScanStrategy: Customize the binary scanning algorithm
Re-exports§
pub use error::Error;pub use error::Result;pub use proto::NullWriter;pub use proto::ProtoReconstructor;pub use proto::ProtoWriter;pub use proto::ReconstructorConfig;pub use proto::StatsWriter;pub use scanner::ScanResult;pub use scanner::ScanStrategy;pub use scanner::Scanner;pub use scanner::ScannerConfig;
Modules§
- error
- Error types for the zarja-core library.
- proto
- Proto definition reconstruction module.
- scanner
- Binary scanning module for finding embedded protobuf descriptors.
Constants§
- MAX_
FIELD_ NUMBER - Maximum valid protobuf field number (2^29 - 1)
Used for
reserved X to maxranges - VERSION
- Crate version for programmatic access