Skip to content

Skip unknown stream types instead of raising ValueError - #51

Open
stevenlafl wants to merge 1 commit into
skelsec:mainfrom
stevenlafl:tolerate-unknown-stream-types
Open

stevenlafl wants to merge 1 commit into
skelsec:mainfrom
stevenlafl:tolerate-unknown-stream-types

Conversation

@stevenlafl

Copy link
Copy Markdown

Skip unknown stream types instead of raising ValueError

Fixes #47.

Problem

MINIDUMP_DIRECTORY.parse/aparse only skip unknown stream types when the raw value is above LastReservedStream (0xFFFF). Writers can also emit non-standard types inside the reserved range: Wine/Proton crash dumps (for example Unreal Engine UEMinidump.dmp files written by games running under Proton) contain stream type 0xFFF0 (65520), which hits the MINIDUMP_STREAM_TYPE(raw_stream_type_value) constructor and raises:

ValueError: 65520 is not a valid MINIDUMP_STREAM_TYPE

This aborts parsing of the whole file, so both the library and the command line tool fail on such dumps, which is exactly what issue #47 reports.

Fix

Per the MSDN remarks for MINIDUMP_STREAM_TYPE (already linked in the code comment), readers should ignore stream types they do not recognize. The parser now skips any stream type not present in the enum, in both the sync and async paths.

This is safe with respect to buffer position: both callers (MinidumpFile.__parse_header and AMinidumpFile.__parse_header) seek to StreamDirectoryRva + i * 12 before parsing each entry, and both already log skipped entries through their existing unknown-stream handling.

Related work

Verification

Tested against a real Wine/Proton-generated UE crash dump containing stream types 0xFFF0 and 0x10000 alongside 10 standard streams:

  • before: ValueError: 65520 is not a valid MINIDUMP_STREAM_TYPE from both the library and python -m minidump
  • after: the file parses; --modules lists all 123 modules, --exception prints the exception record, and the two unknown streams are skipped and logged as before

Disclosure

This fix was developed in a Claude Code session: the AI assistant located the failure and authored the patch; I (the human) hit the original bug on real crash dumps, verified the fix against them, and reviewed the change.

The directory parser only skipped unknown stream types above
LastReservedStream (0xFFFF). Writers can also emit non-standard types
inside the reserved range: Wine/Proton crash dumps (e.g. Unreal Engine
UEMinidump.dmp files from games running under Proton) contain stream
type 0xFFF0, which raised
'ValueError: 65520 is not a valid MINIDUMP_STREAM_TYPE' and aborted
parsing entirely. Per the MSDN remarks for MINIDUMP_STREAM_TYPE,
readers should ignore stream types they do not recognize.

Skip any stream type that is not in the enum, in both the sync and
async parsers. Both callers seek to StreamDirectoryRva + i * 12 before
each entry, so the early return does not desync the reader, and
unknown entries are already logged by the callers.

Fixes skelsec#47
@stevenlafl
stevenlafl force-pushed the tolerate-unknown-stream-types branch from 8a71a9b to 745afbb Compare September 1, 2026 06:29
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.

65520 is not a valid MINIDUMP_STREAM_TYPE (Commandline Doesnt Work)

1 participant