initial commit
All checks were successful
CI / fuzz (push) Successful in 1m41s
CI / lint (push) Successful in 16s
CI / test (push) Successful in 22s

This commit is contained in:
Kamal Tufekcic 2026-07-27 10:12:04 +03:00
commit a2922b8bad
59 changed files with 2684583 additions and 0 deletions

View file

@ -0,0 +1,21 @@
#![no_main]
//! The whole-binary cross-reference index decodes every function's `[start,next)` range and records
//! call/data references; the string-anchor locators then query it. Feeding arbitrary code + rodata
//! bytes exercises the decode, the containing-function lookup, and the string search — none may panic.
use source2rosetta::elf::CodeImage;
use source2rosetta::xref;
use libfuzzer_sys::fuzz_target;
fuzz_target!(|data: &[u8]| {
let Ok(img) = CodeImage::from_bytes(data.to_vec()) else {
return;
};
let xr = xref::XrefIndex::build(&img);
// Exercise the lookups over a bounded set of the discovered call targets — none may panic.
for &t in xr.call_targets().iter().take(64) {
let _ = xr.referrers(t);
let _ = xr.refs_to(t);
let _ = xr.containing_func(t);
}
let _ = xref::funcs_using_string(&img, &xr, "CBaseEntity");
});