[#65] Print GUID and Hash128 as single hex strings in dump output#112
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the dump command’s text output to print Unity GUID and Hash128 fields as single 32-character lowercase hex strings (matching Unity’s GUIDToString / Hash128.ToString() conventions), improving readability and making it easier to correlate dump output with .meta files and build reports.
Changes:
- Added compound-type recognition in
TextDumperTool.RecursiveDumpto formatGUID(4×uint32) andHash128(16 bytes) as single hex strings while preserving the generic fallback when the TypeTree layout doesn’t match. - Added a regression test that dumps a LeadingEdge ContentDirectory build report and asserts known GUID/Hash128 values are emitted in hex form.
- Regenerated expected dump snapshots and updated documentation examples to reflect the new formatting.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| TextDumper/TextDumperTool.cs | Adds compound-type formatting logic for GUID and Hash128 during recursive dumping. |
| UnityDataTool.Tests/DumpTests.cs | Adds a test covering GUID/Hash128 hex-string output on a build report dump. |
| Documentation/analyze-examples.md | Updates example dump output to show Hash128 printed as a single hex string. |
| UnityDataTool.Tests/ExpectedData/2023.1.0a16/dump/CAB-5d40f7cad7c871cf2ad2af19ac542994.txt | Updates expected dump snapshot to reflect Hash128 hex formatting. |
| UnityDataTool.Tests/ExpectedData/2023.1.0a16/dump-s/CAB-5d40f7cad7c871cf2ad2af19ac542994.txt | Updates expected dump snapshot (-s variant) for Hash128 hex formatting. |
| UnityDataTool.Tests/ExpectedData/2022.1.20f1/dump/CAB-5d40f7cad7c871cf2ad2af19ac542994.txt | Updates expected dump snapshot to reflect Hash128 hex formatting (multiple occurrences). |
| UnityDataTool.Tests/ExpectedData/2022.1.20f1/dump-s/CAB-5d40f7cad7c871cf2ad2af19ac542994.txt | Updates expected dump snapshot (-s variant) to reflect Hash128 hex formatting. |
| UnityDataTool.Tests/ExpectedData/2021.3.0f1/dump/CAB-5d40f7cad7c871cf2ad2af19ac542994.txt | Updates expected dump snapshot to reflect Hash128 hex formatting (multiple occurrences). |
| UnityDataTool.Tests/ExpectedData/2021.3.0f1/dump-s/CAB-5d40f7cad7c871cf2ad2af19ac542994.txt | Updates expected dump snapshot (-s variant) to reflect Hash128 hex formatting. |
| UnityDataTool.Tests/ExpectedData/2020.3.0f1/dump/CAB-5d40f7cad7c871cf2ad2af19ac542994.txt | Updates expected dump snapshot to reflect Hash128 hex formatting (multiple occurrences). |
| UnityDataTool.Tests/ExpectedData/2020.3.0f1/dump-s/CAB-5d40f7cad7c871cf2ad2af19ac542994.txt | Updates expected dump snapshot (-s variant) to reflect Hash128 hex formatting. |
| UnityDataTool.Tests/ExpectedData/2019.4.0f1/dump/CAB-5d40f7cad7c871cf2ad2af19ac542994.txt | Updates expected dump snapshot to reflect Hash128 hex formatting. |
| UnityDataTool.Tests/ExpectedData/2019.4.0f1/dump-s/CAB-5d40f7cad7c871cf2ad2af19ac542994.txt | Updates expected dump snapshot (-s variant) to reflect Hash128 hex formatting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
SkowronskiAndrew
marked this pull request as ready for review
July 24, 2026 18:32
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.
Summary
Fixes #65.
The
dumpcommand printedGUIDandHash128fields as their raw serialized representation (4 uint32s / 16 bytes), which is hard to read and impossible to correlate with asset GUIDs or hash strings seen elsewhere. They are now printed as a single 32-character hex string matching Unity's ownGUIDToString/Hash128.ToString()formats, e.g.:Changes
TextDumperTool: newTryReadCompoundValuestep inRecursiveDump, alongside the existingstringspecial case. It matches compound types by type name plus expected TypeTree layout (falling back to the generic field-by-field dump if the layout doesn't match), and reusesGuidHelper.FormatUnityGuid/FormatUnityHash128from UnityBinaryFormat. Adding future friendly-printed compound types is a matter of adding a case to its switch.DumpTests: new test dumping the LeadingEdge ContentDirectory build report, asserting known GUID and Hash128 values. The expected strings are independently verifiable:buildSessionGUIDmatches the build report's filename and the scene'ssourceAssetGUIDmatchesScene1.unity.metain the LeadingEdge project.UnityDataTool.Tests/ExpectedData(only GUID/Hash128 lines changed) and updated theanalyze-examples.mdexample that showed the oldm_PropertiesHashoutput.Testing
dotnet test -c Release— full suite green (762 passed, 10 skipped, 0 failed).Manually verified the new output on the checked-in build reports, ContentDirectory
.cffiles, and Player data; all GUID/Hash128 fields now print as hex strings and cross-check against.metafiles and the build-report filename.