mirror of
https://github.com/Momoko-Ayase/Senbei.git
synced 2026-11-24 02:52:47 +08:00
Inspect the protected input and actual recovered image, with bounded structural evidence, source identities and scoped recovery traces. Keep ordinary unpack lightweight and retain no research output files or logs. Preserve Android extraction, restoration and metadata evidence, distinguish incomplete analyses from rejected candidates, and render detailed text and JSON reports with explicit address provenance.
33 lines
1.1 KiB
Rust
33 lines
1.1 KiB
Rust
#![no_main]
|
|
|
|
//! PE header/RVA parser over arbitrary bytes.
|
|
//!
|
|
//! Exercises format parsing/mapping and the bounded research inspector,
|
|
//! including partially parsed inputs. A returned issue is fine; a panic is a bug.
|
|
|
|
use libfuzzer_sys::fuzz_target;
|
|
|
|
const MAX_INPUT: usize = 256 * 1024;
|
|
|
|
fuzz_target!(|data: &[u8]| {
|
|
let data = &data[..data.len().min(MAX_INPUT)];
|
|
let limits = senbei_engine::windows::InspectionLimits {
|
|
prefix_scratch_bytes: 64 * 1024,
|
|
max_candidates: 16,
|
|
max_issues: 16,
|
|
..Default::default()
|
|
};
|
|
let _ = senbei_engine::windows::inspect_research_with_limits(data, &limits);
|
|
let Ok(headers) = senbei_pe::parse(data) else {
|
|
return;
|
|
};
|
|
let _ = senbei_pe::sections(data, headers);
|
|
let _ = senbei_pe::characteristics(data, headers);
|
|
for index in 0..16u16 {
|
|
let _ = senbei_pe::data_directory(data, headers, index);
|
|
}
|
|
let _ = senbei_pe::rva_to_offset(data, headers, headers.entry_rva);
|
|
let _ = senbei_pe::rva_range(data, headers, headers.entry_rva, 0x10);
|
|
let _ = senbei_pe::rva_range(data, headers, u32::MAX, 4);
|
|
});
|