Skip to content

Read the NTFS $LogFile (restart areas and log records, as recorded) - #168

Merged
switch-nz merged 1 commit into
mainfrom
claude/logfile-parser
Oct 1, 2026
Merged

switch-nz merged 1 commit into
mainfrom
claude/logfile-parser

Conversation

@switch-nz

Copy link
Copy Markdown
Owner

Part of #57, at the conservative scope agreed.

What it does

New artefact NTFS log (Artefacts → route /api/logfile, viewer with filter and paging):

  • Restart areas: clean-shutdown flag, log version, size, client name, LSNs; both restart pages, newest picked, differences reported.
  • Log records: LSN, transaction, client, type, redo/undo operation (name and code), target attribute, VCN/LCN fields, and whether the LSN's encoded file offset matches where the record lies. Records that run across pages are joined.
  • Names and timestamps only where an add/delete-index-entry or update-file-name payload is a plain $FILE_NAME passing length/time/character checks.
  • Torn pages (failed update-sequence check) are skipped and counted; unused pages tallied; record cap reported.

Deliberately not done

No reconstruction of events or timeline (the log is a ring; an inferred story could mislead), no target MFT record number, no names from whole-MFT-record payloads. Noted in ROADMAP.

Verification — please read

  • Layout follows ntfs-3g's logfile.h and the walking approach of third-party parsers. There is no real $LogFile in the repository or available to me, so this is tested on synthetic logs only (new builder imagebuild_logfile.py, which is written from the format description rather than the parser). Uncertain points (record continuation across pages, next_record_offset semantics) follow those sources and need checking against a real log.
  • 25 new tests including through the real server on an NTFS image; fuzz target (3000 cases, no findings); UI checked in a browser; full suite passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_017DPjyZZHvaivtvJ3N4hZhz


Generated by Claude Code

Part of #57, at a conservative scope: restart areas, log record headers and
redo/undo operations, target attribute fields, and names with timestamps
only where the payload is a plain $FILE_NAME or index entry. No timeline is
reconstructed. Adds the artefact route and viewer, a synthetic $LogFile
builder and a fuzz target.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017DPjyZZHvaivtvJ3N4hZhz
@switch-nz
switch-nz merged commit 71dc354 into main Oct 1, 2026
32 checks passed
@switch-nz
switch-nz deleted the claude/logfile-parser branch October 1, 2026 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants