Microsoft has not published the EVTX file layout (only the binary XML inside records,
in [MS-EVEN6]). This page follows Joachim Metz’s libevtx documentation,
Windows XML Event Log (EVTX) format, and the evtx_file_header
structure in libevtx’s source, both based on study of real files. All numbers are
little-endian. Checksums are the CRC-32 of RFC 1952 with an initial value of 0.
File header
The first 4,096 bytes; libevtx knows the meaning of fields in the first 128 only.
| Offset | Size | Name | Description |
|---|---|---|---|
0 | 8 | Signature | ElfFile and a zero byte. |
8 | 8 | First chunk number | The oldest chunk in use. |
16 | 8 | Last chunk number | The newest chunk. |
24 | 8 | Next record identifier | The identifier the next event will get. |
32 | 4 | Header size | 128. |
36 | 2 | Minor version | Format 3.1 is seen on Windows Vista and later, 3.2 on Windows 10 (2004) and later. |
38 | 2 | Major version | 3. |
40 | 2 | Header block size | 4,096 (also the offset of the chunk data). |
42 | 4 | Number of chunks | Chunks in the file. A 4-byte field in both libevtx’s documentation and its number_of_chunks[4] structure member. libevtx notes the count can be wrong in dirty files, which Event Viewer appears to correct. |
46 | 74 | – | Unknown (empty values). |
120 | 4 | File flags | 0x1 is dirty; 0x2 is full. |
124 | 4 | Checksum | CRC-32 of the first 120 bytes. |
128 | 3,968 | – | Unknown (empty values). |
Chunk header
Each chunk is 65,536 bytes, following the 4,096-byte file header: a 512-byte chunk header, an array of event records, then unused space. (libevtx leaves “file size = number of chunks × 65,536 + 4,096” as a check still to confirm.) Records refer to strings and templates inside the same chunk by offsets from the chunk’s start.
| Offset | Size | Name | Description |
|---|---|---|---|
0 | 8 | Signature | ElfChnk and a zero byte. |
8 | 8 | First event record number | – |
16 | 8 | Last event record number | – |
24 | 8 | First event record identifier | – |
32 | 8 | Last event record identifier | – |
40 | 4 | Header size | 128. |
44 | 4 | Last event record offset | From the start of the chunk. |
48 | 4 | Free space offset | From the start of the chunk. libevtx: in archived files it sometimes points to the end of the chunk, with zeros after the last record. |
52 | 4 | Event records checksum | CRC-32 of the event records data. |
56 | 64 | – | Unknown (empty values). |
120 | 4 | Unknown | Possibly flags. |
124 | 4 | Header checksum | CRC-32 of bytes 0–119 and 128–511. |
128 | 256 | Common string offsets | 64 offsets from the chunk’s start of strings common to the chunk’s records, stored once and referred to by later records (libevtx marks this as not yet confirmed). |
384 | 128 | Template pointers | 32 32-bit values (libevtx: TemplatePtr, not yet confirmed). |
Event record
| Offset | Size | Name | Description |
|---|---|---|---|
0 | 4 | Signature | 2A 2A 00 00. |
4 | 4 | Size | The record’s size, including the signature and this field. |
8 | 8 | Record identifier | The event record identifier. |
16 | 8 | Written time | A FILETIME. |
24 | varies | Event | The event as binary XML. |
| end − 4 | 4 | Size | The size again. |