Skip to content

Repository files navigation

BootViewer

A friendly, dark-themed viewer and verifier for the Windows measured boot log. It reads the TCG event log of the current boot (the Windows Boot Configuration Log), explains every entry in plain language, replays the PCRs and checks that what the TPM actually holds matches what the log says. Microsoft's own TBSLogGenerator.exe (from the Hardware Lab Kit) runs under the hood as an independent second opinion.

Events view

Features

  • One single .exe, no installer, no DLLs, no runtime to ship (Go + Wails on the WebView2 engine that is already part of Windows 10/11). Runs without administrator rights.
  • Current boot via the TBS API (Tbsi_Get_TCG_Log) or any archived log from C:\Windows\Logs\MeasuredBoot (or a file you pick).
  • Every event explained: firmware volumes, Secure Boot variables (PK/KEK/db/dbx with certificate subjects), boot options and device paths, GPT layout, EFI applications, BitLocker PCR 11 locks, and the Windows-specific SIPA events (boot manager / OS loader trust boundaries, loaded modules with Authenticode hashes, signers and versions, ELAM, VBS, Code Integrity policy, debugging flags...).
  • Digest verification: for event types whose digest is defined as the hash of the event data, the hash is recomputed and compared.
  • PCR replay and TPM comparison: expected PCR values are computed from the log for every bank and compared with TPM2_PCR_Read results. The boot manager's own PCR snapshot event is cross-checked too. H-CRTM logs (first event EV_EFI_HCRTM_EVENT) replay PCR 0 from locality 4. Only banks the log covers completely are compared: Windows measures into a single bank (SHA256) and its boot manager caps the others by extending zeros, so on a TPM with several active banks those are shown but marked as not comparable instead of being reported as mismatches (TBSLogGenerator validates the same single bank).
  • Files re-hashed on disk: every file the boot chain measured with an Authenticode hash (the boot manager on the EFI System Partition, winload.efi, ntoskrnl.exe, hal.dll, boot drivers, ELAM, MUI resources...) is hashed again now and compared with the value recorded at boot. A difference turns the verdict yellow: the file was modified after boot, or a tampered version booted and was restored afterwards. Reading the EFI System Partition requires administrator rights.
  • Boot path check: the EFI applications the firmware executed (PCR 4) are inspected. The verdict turns yellow when the first application is not the Windows Boot Manager (USB installer, Linux shim/GRUB in a dual-boot setup, another bootloader), when several applications were chained before Windows, when one was loaded from USB/optical/network media, when the GPT partition it came from does not exist on this system, or when the OS loader reported Code Integrity disabled. Entering the firmware setup is noted too.
  • TBSLogGenerator integration: the Microsoft tool is embedded and run with -vlf; its decoded output and MATCH/MISMATCH table are shown next to BootViewer's own results. A copy placed next to BootViewer.exe takes precedence over the embedded one.
  • Findings at a glance: Secure Boot off, test signing, debugging, ELAM, BitLocker unlock method, VBS...
  • English UI with a Spanish translation (one-click switch, remembered), search, PCR/category filters, hex dumps, JSON export.
  • Headless helpers: logdump (parse + replay + compare from the console) and tbsdump (TPM info and raw PCRs).

PCR view

Download / build

Grab BootViewer.exe from the releases page, or build it yourself:

Easiest: double-click build.bat (installs the Wails CLI if missing and leaves everything in build�in). Manually:

go install github.com/wailsapp/wails/v2/cmd/wails@v2.15.0
git clone https://github.com/TheCruZ/bootviewer
cd bootviewer
wails build -platform windows/amd64        # -> build\bin\BootViewer.exe

Requirements: Go 1.23+, no C compiler, no Node.js (the frontend is plain HTML/CSS/JS, embedded with go:embed). ARM64: wails build -platform windows/arm64. Plain go build -tags desktop,production -ldflags "-H windowsgui" also works.

Console helpers:

go run ./cmd/logdump            # current boot, replay + compare with the TPM
go run ./cmd/logdump -v file.log
go run ./cmd/logdump -files       # also re-hash the measured files on disk
go run ./cmd/tbsdump            # TPM properties, banks, PCR values

How the verification works

  1. The raw log is parsed (SHA1 or crypto-agile format, Spec ID Event03).

  2. For each bank, every PCR starts at its reset value (zeros; FF..FF for PCR 17-22; the startup locality for PCR 0) and is extended with each event digest: PCR = H(PCR || digest).

  3. The resulting values are compared with the PCRs read from the TPM through TBS. EV_NO_ACTION events are informational and not extended.

  4. Independently, TBSLogGenerator.exe -vlf performs the same validation with Microsoft's implementation.

  5. Every measured file that still exists on disk is re-hashed with the Authenticode algorithm (the PE image without its checksum and signature) using the algorithm recorded in the log (SHA1 or SHA256), and compared with the hash the boot manager / OS loader measured. \EFI\... paths are resolved on the EFI System Partition named by the boot manager's device path (\\?\Volume{<partition GUID>}\), \Windows\... paths on the system drive.

  6. The boot path is analysed: which EFI applications ran, in which order, from which media/partition, whether they returned control to the firmware, and whether Code Integrity was off.

A green verdict means the log faithfully describes what the TPM measured, the measured files are unchanged and the boot path is the usual one. A yellow verdict means TPM and log agree but something deserves a look: a measured file now has a different hash on disk, or the boot path was unusual. A red mismatch means the log was truncated, modified, or does not belong to this boot. Archived logs are replayed but cannot be compared with the current TPM state (file differences are then only informational, since Windows may have been updated since that boot).

About TBSLogGenerator / PCPTool

TBSLogGenerator.exe is part of the Windows Hardware Lab Kit (HLK), inside the HLK OnecoreUAP.System.Fundamentals Content MSI (Tests\<arch>\nttest\BASETEST\ngscb). The x86, amd64 and arm64 builds are in third_party/TBSLogGenerator and the matching one is embedded at build time. PCPTool.exe (Platform Crypto Provider tool) is no longer shipped in current HLK versions, so BootViewer implements the PCR reading and TPM property queries natively through tbs.dll (Tbsip_Submit_Command with TPM2_PCR_Read / TPM2_GetCapability).

These Microsoft binaries are redistributed unmodified and are subject to the HLK license, not to the MIT license of this project.

Project layout

main.go / app.go          Wails application and JSON bindings
frontend/dist             HTML/CSS/JS user interface (no build step)
internal/tcglog           TCG log parser, UEFI/SIPA decoders, PCR replay
internal/tbs              cgo-free tbs.dll wrapper (log, PCR read, capabilities)
internal/tbslog           TBSLogGenerator.exe driver and output parser
internal/explain          Event explanations (English, Spanish translation)
internal/authenticode     Authenticode (PE) hash of files on disk
internal/filecheck        Re-hash of the measured files and comparison with the log
internal/bootpath         Boot path analysis (EFI applications, media, Code Integrity)
cmd/logdump, cmd/tbsdump  console utilities
third_party/TBSLogGenerator  Microsoft HLK binaries (x86 / amd64 / arm64)

Automation: set BOOTVIEWER_STARTVIEW (pcrs, tbs, events:28, file:C:\path\to.log, lang:en; join several with ;) to open the UI on a given view, handy for screenshots and tests. BOOTVIEWER_FILEROOT=<dir> makes the on-disk file check resolve \Windows\... paths under <dir> and \EFI\... paths under <dir>\ESP\ instead of the real system drive and EFI System Partition, so a tampered file can be simulated without touching the system.

Changelog

v1.1.1

  • H-CRTM logs (first event EV_EFI_HCRTM_EVENT) now replay PCR 0 from locality 4 (initial value 00…04), fixing a false PCR 0 mismatch on such systems.
  • On TPMs with several active banks, banks the log does not cover completely (Windows measures into SHA256 only and the boot manager caps the others by extending zeros) are shown but no longer compared or counted as mismatches; the PCR view explains why and opens on the first comparable bank.
  • New findings for H-CRTM boots and for uncompared banks; logdump reports uncompared banks.
  • UI: translation placeholders used more than once in a string are now all substituted.

v1.1.0

  • Measured files are re-hashed on disk (Authenticode) and compared with the log; differences turn the verdict yellow.
  • Boot path analysis: foreign or chained EFI applications, USB/optical/network media, unknown boot partition, firmware setup entered, Code Integrity disabled.
  • Yellow "attention" verdict with the list of reasons; new per-event flags and findings.
  • logdump -files, BOOTVIEWER_FILEROOT test hook.

v1.0.0

  • Initial release.

License

MIT for BootViewer's own code. See LICENSE for the note about the Microsoft binaries.

About

Windows Measured Boot viewer & TPM verifier. See exactly what your PC measured at boot. Decode the Windows TCG/TPM event log, explain each entry, verify PCRs against the real TPM and spot tampering, Secure Boot issues or unexpected drivers.

Resources

Stars

10 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages