initial commit
This commit is contained in:
commit
a2922b8bad
59 changed files with 2684583 additions and 0 deletions
19
fuzz/fuzz_targets/fuzz_sig_abi.rs
Normal file
19
fuzz/fuzz_targets/fuzz_sig_abi.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#![no_main]
|
||||
//! The single-function disassembly consumers: `candidate_entries` linear-sweeps the exec sections,
|
||||
//! then `abi_shape` (backward register liveness) and `make_sig` (wildcard-emitting decode) run from
|
||||
//! each entry. All decode attacker-controlled code bytes and must never panic — the decoder can hit
|
||||
//! any instruction, any truncation, any span boundary.
|
||||
use source2rosetta::elf::CodeImage;
|
||||
use source2rosetta::{abi, emit, locate};
|
||||
use libfuzzer_sys::fuzz_target;
|
||||
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
let Ok(img) = CodeImage::from_bytes(data.to_vec()) else {
|
||||
return;
|
||||
};
|
||||
for &addr in locate::candidate_entries(&img).iter().take(96) {
|
||||
// Discard results: this fuzzer only asserts the decoders never panic.
|
||||
let _ = abi::abi_shape(&img, addr);
|
||||
let _ = emit::make_sig(&img, addr, 128);
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue