Skip to content

wevt_templates: switch offline cache to single .wevtcache file#279

Merged
omerbenamram merged 7 commits intomasterfrom
wevtcache-single-file
Jan 3, 2026
Merged

wevt_templates: switch offline cache to single .wevtcache file#279
omerbenamram merged 7 commits intomasterfrom
wevtcache-single-file

Conversation

@omerbenamram
Copy link
Owner

@omerbenamram omerbenamram commented Jan 3, 2026

Summary

  • Replace the offline WEVT template cache (dir + JSONL index) with a single portable .wevtcache container.
  • Make WevtCache fully in-memory (no internal filesystem I/O) and update CLI flags/docs accordingly.
  • Fix MAPS parsing when the offsets array is out-of-order; add a regression test.

Test plan

  • cargo test --features wevt_templates
  • (Optional) evtx_dump extract-wevt-templates --output cache.wevtcache --overwrite + evtx_dump --wevt-cache cache.wevtcache <log.evtx>

Note

Release v0.11.0

  • BREAKING: Offline WEVT template cache now a single .wevtcache file (replaces dir + index.jsonl); WevtCache is pure in-memory. CLI flags renamed to --wevt-cache and apply-wevt-cache --cache.
  • Fix: Deterministic MAPS parsing for non-monotonic offsets (uses declared VMAP size).
  • Added: Git-LFS tracked DLL/EXE fixtures under samples/dlls/ with snapshot tests for WEVT extraction stats; CI enables lfs checkout.
  • Chore: Version bump to 0.11.0, changelog updated.

Written by Cursor Bugbot for commit 2adb2b2. This will update automatically on new commits. Configure here.

This makes offline template fallback portable and binding-friendly by replacing the directory+JSONL cache with a single `.wevtcache` container and keeping `WevtCache` fully in-memory.
…ze field

- Remove sorting hack for MAPS offset array
- Map 0 is implied at MAPS+16+(count-1)*4, maps 1+ use offsets in array order
- VMAP declares its own size field — no boundary guessing needed
- Add comprehensive test against real DLL fixtures (adtschema, lsasrv, scesrv, services.exe, wevtsvc)
- Document MAPS structure (value maps + bitmap maps for enum/flag types)

Fixes wevtsvc.dll parsing which had non-monotonic offset arrays.
Add Windows system DLL/EXE fixtures (via git-lfs) for validating
WEVT_TEMPLATE extraction against libfwevt reference implementation:

- adtschema.dll: 1 provider, 464 templates, 488 events
- lsasrv.dll: 4 providers, 67 templates, 104 events
- services.exe: 3 providers, 51 templates, 60 events
- wevtsvc.dll: 1 provider, 38 templates, 44 events, 2 maps

Snapshot values validated against pyfwevt (libfwevt Python bindings).
The DLL test fixtures are stored in Git LFS. Enable LFS checkout
so CI can run the wevt_templates_research tests.
Bump evtx to 0.11.0 and document the WEVT_TEMPLATE cache breaking changes.
@omerbenamram omerbenamram merged commit fb8842c into master Jan 3, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant