mirror of
https://github.com/vee1e/naksheap.git
synced 2026-09-01 10:18:37 +00:00
Rust workspace that turns a core dump of a stripped, optimized C/C++ binary into a typed heap object graph: objects, sizes, allocator state, references, and probable struct layouts, all without debug info. - glibc ptmalloc carving (main + thread arenas, tcache/fastbin freed state, mmap allocations), ELF core + memory-list minidump parsing - pointer scan, layout clustering, vtable/string/vector detection, confidence + evidence on every node - ASCII/JSON/Graphviz/HTML output, synthetic fixtures with ground truth, and real-dump validation harness (aarch64 glibc 2.39) in scripts/ - web deployment reference stack in deploy/ MIT OR Apache-2.0
20 lines
708 B
Rust
20 lines
708 B
Rust
//! Generates a fixture core dump + ground-truth manifest for manual testing.
|
|
//!
|
|
//! Usage: `cargo run -p naksheap-testkit --example gen_fixture -- <out-dir>`
|
|
|
|
use naksheap_testkit::CoreSpec;
|
|
|
|
fn main() {
|
|
let out = std::env::args()
|
|
.nth(1)
|
|
.unwrap_or_else(|| "/tmp/naksheap-fixtures".to_string());
|
|
let dir = std::path::Path::new(&out);
|
|
std::fs::create_dir_all(dir).expect("create out dir");
|
|
|
|
let spec = CoreSpec::default();
|
|
let fixture = spec.build().expect("build fixture");
|
|
let core = dir.join("toy-server.core");
|
|
fixture.write(&core).expect("write core");
|
|
fixture.write_manifest(&core).expect("write manifest");
|
|
println!("wrote {}", core.display());
|
|
}
|