Files
reverse-engineering-anything/docs/guides/data/evtx-archives.md
2SinceJuly aea385cda1 feat(evtx): inventory Windows event log records offline
Inventory EVTX file, chunk and record headers with source-scoped identities, full timestamp precision and explicit partial coverage. Discover the reader from first-contact inspection.

Refs #9174.
2026-11-30 20:25:14 +08:00

4.5 KiB

Offline Windows event log inventory

inspect_evtx_archive / rea inspect-evtx-archive reads one local Windows Event Log (.evtx) file and lists its records. It never contacts a live Event Log service, boots the source system, or executes event-provided content.

rea inspect-artifact ./capture.data recognizes the complete ElfFile signature and recommends inspect_evtx_archive, regardless of the filename. Recognition names the format; the dedicated reader reports malformed or incomplete structure.

What this version reads

Records are reported in file order. For each record the inventory keeps the chunk it was found in, its byte offset inside that 64 KiB chunk, the EventRecordID its header states as a lossless decimal string, the SystemTime with all seven fractional digits, and the byte extent the record declares. Each chunk reports its position in the file as chunk_number, the event numbers and timestamps of its first and last record, and whether its header checksum matched. When the inventory stops inside a chunk — the max_records allowance runs out, or a damaged record ends the walk — the records after that point were never examined, so the chunk's last_event_record_id and last_timestamp_ms are null rather than the last record that was listed.

The channel, provider, event ID, level, EventData values and user identifiers live inside the embedded event XML, which this version does not decode: they are absent rather than inferred from the record number. Typed payload values, event templates, substitution arrays and per-record checksums are likewise not resolved.

Sources and coverage

source_coverage states what the inventory examined. event_xml and typed_payload_values are always not-decoded; templates is always not-resolved. record_checksums is always not-verified and network is always not-contacted. status is complete-within-scope only when every chunk was read without any diagnostic; a limit, a truncated record, an undecodable chunk or a chunk whose first record identifier disagrees with the identifier in that record makes it partial and each cause appears in diagnostics.

A chunk is numbered by its physical position in the file, never by a value stored in the chunk. The first event record number at 0x08 and the first record identifier at 0x18 are distinct fields. A disagreement between the identifier and the first record's own identifier is reported as first-record-id-mismatch.

The declared file chunk count and the physical chunk-slot count are reported separately. A disagreement is partial coverage; readable chunks are still inventoried. Both endpoint identifiers are checked after a complete chunk walk, and each record must carry a matching trailing size. Child identifiers include the source digest, so identical paths or positions do not conflate different logs.

A wrapped log leaves stale bytes after its last record. Those bytes are not reported as a truncation, and they do not discard the events the chunk did contain.

The chunk's last-record offset bounds the last record's start, and the free-space offset bounds its end. Bytes after the last record are not inventoried. Invalid or inconsistent offsets leave the live region unknown and make coverage partial. An incomplete final chunk is also reported and skipped.

Structure and bounds

The file must start with the ElfFile signature and the 128-byte block header must be at least as large as itself; anything else is reported as not-an-evtx-file or invalid-header rather than being scanned as records. A chunk that does not start with ElfChnk is skipped with invalid-chunk, and its neighbours are still read.

max_file_bytes (64 MiB) bounds the read. A file over that limit is refused with a resource error before parsing starts, so it yields no inventory at all. max_records (20000) bounds the number of records decoded; reaching it returns a partial inventory carrying a diagnostic instead of silently truncating. Diagnostic growth is bounded separately, because one malformed chunk can contain many bad records.

Retain the complete inventory with a summary

Use --detail summary --evidence_output /absolute/new-evidence.bundle.json for counts, artifact identity and source coverage in the reply. The bundle retains the complete parent Evidence, including the inventoried records and diagnostics. The summary names that parent and its digest. Complete summary projection does not imply complete source coverage; format limits, omissions and unsupported content remain explicit in source_coverage.