Repository navigation
Skip unknown stream types instead of raising ValueError - #51
Open
stevenlafl wants to merge 1 commit into
Open
stevenlafl wants to merge 1 commit into
stevenlafl wants to merge 1 commit into
Conversation
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
force-pushed
the
tolerate-unknown-stream-types
branch
from
September 1, 2026 06:29
8a71a9b to
745afbb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Skip unknown stream types instead of raising ValueError
Fixes #47.
Problem
MINIDUMP_DIRECTORY.parse/aparseonly skip unknown stream types when the raw value is aboveLastReservedStream(0xFFFF). Writers can also emit non-standard types inside the reserved range: Wine/Proton crash dumps (for example Unreal EngineUEMinidump.dmpfiles written by games running under Proton) contain stream type0xFFF0(65520), which hits theMINIDUMP_STREAM_TYPE(raw_stream_type_value)constructor and raises: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_headerandAMinidumpFile.__parse_header) seek toStreamDirectoryRva + i * 12before parsing each entry, and both already log skipped entries through their existing unknown-stream handling.Related work
directory.pybut only adds writer-side code (to_buffer,DirectoryBuffer); the read paths changed here do not overlap with it and the two merge cleanly in either order.Verification
Tested against a real Wine/Proton-generated UE crash dump containing stream types 0xFFF0 and 0x10000 alongside 10 standard streams:
ValueError: 65520 is not a valid MINIDUMP_STREAM_TYPEfrom both the library andpython -m minidump--moduleslists all 123 modules,--exceptionprints the exception record, and the two unknown streams are skipped and logged as beforeDisclosure
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.