Format:Windows XML Event Log (EVTX)
| On this wiki | Facts · Code · Notes · Topics |
|---|
The .evtx event log: a 4096-byte 'ElfFile' header, 64 KiB 'ElfChnk' chunks of event records (0x2A2A) whose payload is binary XML with templates and substitutions.
EVTX is the log format of Windows Vista and later (Security.evtx, System.evtx, Microsoft-Windows-*.evtx). Layout from libevtx (libyal, LGPL), documentation/Windows XML Event Log (EVTX).asciidoc. Little endian; times are FILETIME.
Identification
- File starts with
ElfFile\0(45 6C 66 46 69 6C 65 00); each chunk starts withElfChnk\0(45 6C 66 43 68 6E 6B 00); each record starts with2A 2A 00 00. - Do not confuse with the pre-Vista EVT format (
LfLe). Unverified here.
File header (4096 bytes)
| Offset | Size | Field |
|---|---|---|
| 0 | 8 | signature |
| 8 | 8 | first chunk number |
| 16 | 8 | last chunk number |
| 24 | 8 | next record identifier |
| 32 | 4 | header size (128) |
| 36 | 2 | minor version |
| 38 | 2 | major version (3.1 Vista and later, 3.2 Windows 10 2004 and later) |
| 40 | 2 | header block size (4096) |
| 42 | 4 | number of chunks (libevtx documentation: 4 bytes, followed by 74 unknown bytes at 46) |
| 120 | 4 | file flags: 0x1 dirty, 0x2 full |
| 124 | 4 | CRC32 of the first 120 bytes |
Chunks follow at 4096 + n x 65536.
Chunk (65536 bytes)
Header of 512 bytes: signature, first and last event record number (8 bytes each), first and last record identifier, header size (128), last record data offset, free space offset, CRC32 of the record data, CRC32 of header bytes 0-119 plus 128-511 at offset 124; then a table of 64 common string offsets (at 128) and 32 template pointers (at 384). Records follow from offset 512.
Event record
2A 2A 00 00, size (including signature and the trailing size copy), record identifier (8), written FILETIME (8), binary XML, copy of size (4).
Binary XML tokens
0x00 EOF, 0x01 (0x41 with attributes) open start element, 0x02 close start element, 0x03 close empty element, 0x04 end element, 0x05 value (0x45), 0x06 attribute (0x46), 0x07 CDATA, 0x08 char reference, 0x09 entity reference, 0x0A PI target, 0x0B PI data, 0x0C template instance, 0x0D normal substitution, 0x0E optional substitution, 0x0F fragment header. Flag 0x40 means more data follows.
Events are stored as a template instance: a template definition (the XML skeleton, shared through the chunk's template pointers) plus an array of values typed by value type codes, which the substitution tokens index.
Structure of elements, attributes, names, template definitions and substitutions: Fact:Windows XML Event Log (EVTX)/struct/Binary XML element start, attribute and name and Fact:Windows XML Event Log (EVTX)/struct/Template instance, definition and instance data. Note that a binary XML document is a fragment header (0F 01 01 00) followed by an element or template instance and ends with token 0x00; element and attribute names are given as offsets into the chunk. Checksums and record recovery: Fact:Windows XML Event Log (EVTX)/behavior/Record recovery and plausibility check.
Value types
0x00 null, 0x01 UTF-16 string, 0x02 ANSI string, 0x03-0x0A int8/uint8/int16/uint16/int32/uint32/int64/uint64, 0x0B float, 0x0C double, 0x0D bool, 0x0E binary, 0x0F GUID, 0x10 size_t, 0x11 FILETIME, 0x12 SYSTEMTIME, 0x13 SID, 0x14 hex int32, 0x15 hex int64, 0x21 nested binary XML. OR 0x80 for an array of the type.
Notes
- Message text is not in the log: it comes from event message files via the provider (message tables, WEVT_TEMPLATE, MUI). See Format:Windows message table resource (RT MESSAGETABLE).
- Dirty files can have a wrong chunk count; recovery tools scan for the chunk and record signatures.
Code & repositories
- https://github.com/libyal/libevtx @
bcd4a82f5da8bb4beacf617ab6d5fb65623c0c4e· license: LGPL-3.0
libyal C library and tools (evtxinfo, evtxexport) with the EVTX format specification in documentation/.
Tested on: source read, not run: source read, not run · checked 2026-10-18; last activity 2026-10-09
See also
Format:Windows Registry hive (REGF), Format:Windows Prefetch.