Repository navigation
fix(TypeTreeHelper): handle ManagedReferencesRegistry version 1 - #406
Open
1915rising wants to merge 3 commits into
Open
1915rising wants to merge 3 commits into
1915rising wants to merge 3 commits into
Conversation
isHarryh
suggested changes
Dec 1, 2026
isHarryh
approved these changes
Dec 1, 2026
isHarryh
reviewed
Dec 1, 2026
This branch has not been deployed
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.
Fixes #347.
A version 1 registry has no count. The data holds ReferencedObjects one after another, ended by one with the type Terminus / UnityEngine.DMAT / FAKE_ASM, which has no data. UnityPy read only the first object, so reading failed with "Expected to read X bytes, but only read Y bytes".
This adds version 1 handling to the Python reader and writer and to the boost reader: read objects until the Terminus type, write them back out with the Terminus at the end. Version 2 goes through the existing code as before.
Repro: built a version 1 registry by hand with two objects plus the Terminus. Before: ValueError, Expected to read 144 bytes, but only read 52 bytes, in both the Python and boost readers. After: both objects read back, and writing gives the same bytes again.
Tests: new tests/test_managed_references_registry.py, 2 passed (version 1 read and write round trip, version 2 read). Full suite: 44 passed / 4 failed before, 46 passed / 4 failed after. The 4 failures are the pre-existing sample data ones in test_extractor and test_mesh_helper.