EVTXtract recovers and reconstructs fragments of EVTX log files from raw binary data, including unallocated space and memory images.



EVTXtract recovers and reconstructs fragments of EVTX log files from raw binary data, including unallocated space and memory images.

Quick Run

Install EVTXtract via pip:

pip install evtxtract

Now the tool is ready to go!

C:/Python27/Scripts/evtxtract.exe   Z:/evidence/1/image.dd   >   Z:/work/1/evtx.xml

Quicker Run

Download standalone executable nightly builds of EVTXtract here:

Then you can do:

./evtxtract    /path/to/evidence    >   /path/to/output.xml


EVTX records are XML fragments encoded using a Microsoft-specific binary XML representation. Despite the convenient format, it is not easy to recover EVTX event log records from a corrupted file or unallocated space. This is because the complete representation of a record often depends on other records found nearby. The event log service recognizes similarities among records and refactors commonalities into "templates". A template is a fixed structure with placeholders that reserve space for variable content. The on-disk event log record structure is a reference to a template, and a list of substitutions (the variable content the replaces a placeholder in a template). To decode a record into XML, the event log service resolves the template and replaces its placeholders with the entries of the substitution array. Therefore, template corruption renders many records unrecoverable within the local 64KB "chunk". However, the substitution array for the remaining records may still be intact. If so, it may be possible to produce XML fragments that match the original records if the damaged template can be reconstructed. For many common events, such as process creation or account logon, empirical testing demonstrates the relevant templates remain mostly constant. In these cases, recovering event log records boils down to identifying appropriate templates found in other EVTX chunks.


  1. Scan for chunk signatures ("ElfChnk")
    • check header for sane values (0x80 <= size <= 0x200)
    • verify checksums (header, data)
  2. Extract records from valid chunks found in (1)
  3. Extract templates from valid chunks found in (1)
  4. Scan for record signatures
    • check header for sane values
    • extract timestamp
    • attempt to parse substitutions
    • attempt to decode substitutions into EID, other fields
  5. Reconstruct records by reusing old templates with recovered substitutions


The EVTXtract is a pure Python script. This means it easily runs on Windows, Linux, and MacOS. Simply invoke the script, providing the path to a binary image, and EVTXtract writes its results to the standard out stream. The binary file can be any data: a raw image, memory dump, etc.

Example command line:

C:/Python27/Scripts/evtxtract.exe   Z:/evidence/1/image.dd   >   Z:/work/1/evtx.xml

Below are some example results from the above command. It shows two records: a complete and incomplete record. The first record is completely reconstructed, and is formatted just like it would be in event viewer. However, EVTXtract was unable to complete reconstruct the second record, since some critical template data was missing. So, its been formatted with as much data as was recovered. EVTXtract uses a schema that allows you to continue processing despite incomplete data.

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
        <Provider Name="Microsoft-Windows-PrintService" Guid="{747ef6fd-e535-4d16-b510-42c90f6873a1}"></Provider>
        <EventID Qualifiers="">823</EventID>
        <TimeCreated SystemTime="2013-03-23 02:05:57.848455"></TimeCreated>
        <Correlation ActivityID="" RelatedActivityID=""></Correlation>
        <Execution ProcessID="1204" ThreadID="1208"></Execution>
        <Security UserID="S-1-5-21-3454551831-629247693-1078506759-1000"></Security>
        <ChangingDefaultPrinter xmlns:auto-ns3="http://schemas.microsoft.com/win/2004/08/events" xmlns="http://manifests.microsoft.com/win/2005/08/windows/printing/spooler/core/events">
            <NewDefaultPrinter>Microsoft XPS Document Writer,winspool,Ne00:</NewDefaultPrinter>


  <Substitution index="0">
  <Substitution index="1">
  <Substitution index="2">
  <Substitution index="3">
  <Substitution index="4">
  <Substitution index="5">
  <Substitution index="6">
    <Value>2013-03-23 02:02:35.679552</Value>
  <Substitution index="7">
  <Substitution index="8">
  <Substitution index="9">
  <Substitution index="10">
  <Substitution index="11">
  <Substitution index="12">
  <Substitution index="13">
  <Substitution index="14">
    <Value>Microsoft-Windows-User Profiles Service</Value>
  <Substitution index="15">
  <Substitution index="16">