Expand description
cfb-forensic — forensic carving over OLE Compound File Binary ([MS-CFB])
files.
Happy-path reading — live storages/streams, clean-file metadata (CLSID,
FILETIMEs, sizes) — is delegated to the mature cfb crate. This crate adds
the carving and anomaly layer cfb deliberately hides: the directory
entries, sectors, and slack space a spec-faithful reader skips because they
are no longer part of the live tree.
let bytes: &[u8] = b"...";
for anomaly in cfb_forensic::audit_bytes(bytes) {
println!("{} — {}", anomaly.code(), anomaly.note());
}All findings are observations, hedged “consistent with”, never verdicts —
the analyst/tribunal concludes. Format constants come from
forensicnomicon::olecf; nothing is hardcoded here.
§Anomaly classes
OLECF-ORPHANED-DIR-ENTRY— a stream/storage directory entry that the live red-black tree no longer reaches: deleted-stream metadata that survived, with name/size/timestamps/start-sector recovered and the stream bytes carved from the still-resident FAT chain.OLECF-FREE-SECTOR-RESIDUE— a FAT/mini-FAT slot marked free whose backing sector still holds non-zero bytes.OLECF-SLACK-RESIDUE— non-zero bytes past a stream’s declared size in its final (mini-)sector.OLECF-STRUCTURE-ANOMALY— a red-black / sibling-cycle / chain-loop / off-file-DIFAT structural violation, or a stream entry whose CLSID / state-bits / FILETIMEs are non-zero ([MS-CFB]§2.6.3 requires them zero) — a tamper tell.OLECF-ROOT-CLSID— provenance: the root/storage CLSID and the create/modify FILETIMEs CFB carries.
Modules§
- raw
- Thin, panic-free raw decode of the parts of an OLE Compound File the
cfbcrate hides: the header, the FAT and mini-FAT sector chains, and the full 128-byte directory-entry array (including entries the live red-black tree no longer reaches). Offsets and sentinels come fromforensicnomicon::olecf— never hardcoded here.
Structs§
- Orphan
Detail - Recovered detail for an orphaned (live-tree-unreachable) directory entry.
Enums§
- Olecf
Anomaly - A forensic anomaly observed in an OLE Compound File. Each variant maps to a
stable, scheme-prefixed
code(the published contract). - Scope
- How much of the file the audit covered, surfaced on the
Sourcescope. - Structure
Issue - Which structural rule a
OlecfAnomaly::StructureAnomalyflags.
Functions§
- audit_
bytes - Audit a compound file’s bytes, returning every anomaly observed. Never panics on malformed or hostile input; a buffer that is not a CFB yields an empty list.
- audit_
findings - Audit and return canonical
Findings, tagged with the producingSource. - live_
entry_ names - Cross-check helper: the set of live stream/storage names the
cfbcrate reaches, used by tests/consumers as a sanity oracle against our orphan set. ReturnsNoneifcfbcannot open the bytes at all. - read_
live_ stream - Read a live stream’s bytes via the
cfbcrate (happy-path extraction), for consumers that want clean-file stream content rather than carved residue. - source
- The producing
Sourcefor acfb-forensicfinding.