Technical architecture
exav is a Cargo workspace of focused crates rather than one binary, plus two WebAssembly packages built outside the workspace with their own profile. How the scanner works inside is in How scanning works, and how the extractor does in How extraction works.
How the crates compose
Section titled “How the crates compose”The CLI (which is also the daemon) drives the scanning engine, exav-core,
which also builds its own WASI binary, exav-wasm (feature wasi-bin). Two
front ends use only the extractor, exav-unpack: the archive grep and
@exav/unpack-wasm. @exav/viewer’s wasm modules use only exav-render.
exav-core hashes images through exav-imagehash (the image-hash
feature), which decodes them with exav-render. exav-render reads DWG and DXF
with exav-unpack’s drawing parsers (its dwg feature); the scanner draws
nothing. exav-update, behind the http-update feature (part of http),
sits to the side, feeding fresh signatures out of band.
Every arrow points down: nothing calls anything above it, which is what lets the extraction, decoding and hashing crates be taken on their own. Dashed arrows are optional dependencies, each behind the Cargo feature it is labelled with.
Every crate in the graph is #![forbid(unsafe_code)] except exav, whose
daemon calls libc to fork its workers, set their limits, handle signals and
pass file descriptors between processes.
The unsafe that remains is in dependencies (see
Dependencies).
Extraction touches hostile bytes first and hardest, so it lives in its own crate with its own budget and panic containment. It also means one piece can be used alone: a build system that needs to look inside archives does not need a virus scanner, and a reverse engineer who wants to unpack a packed executable needs neither.
exav-pe-emu sits below the extractor for the same reason. Running a packer’s stub
is the one place where the scanner executes attacker-authored control flow
rather than parsing attacker-authored data, so it is its own crate with its own
budgets and no way to reach a syscall.
Each crate has its own page, with install instructions, API, and examples:
exav-unpack and @exav/unpack-wasm
under Archive extraction, @exav/viewer under File viewer, and the rest
under Subprojects.