Skip to content

[#65] Print GUID and Hash128 as single hex strings in dump output#112

Merged
SkowronskiAndrew merged 1 commit into
mainfrom
issue65-dump-guid-hash128
Jul 24, 2026
Merged

[#65] Print GUID and Hash128 as single hex strings in dump output#112
SkowronskiAndrew merged 1 commit into
mainfrom
issue65-dump-guid-hash128

Conversation

@SkowronskiAndrew

@SkowronskiAndrew SkowronskiAndrew commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #65.

The dump command printed GUID and Hash128 fields 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 own GUIDToString / Hash128.ToString() formats, e.g.:

sourceAssetGUID (GUID) 162c015549f8733449ac70ae78ad3aa5
buildManifestHash (Hash128) baff06b928d147276f2245dd3b19216a

Changes

  • TextDumperTool: new TryReadCompoundValue step in RecursiveDump, alongside the existing string special 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 reuses GuidHelper.FormatUnityGuid / FormatUnityHash128 from 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: buildSessionGUID matches the build report's filename and the scene's sourceAssetGUID matches Scene1.unity.meta in the LeadingEdge project.
  • Regenerated the per-Unity-version expected dump snapshots in UnityDataTool.Tests/ExpectedData (only GUID/Hash128 lines changed) and updated the analyze-examples.md example that showed the old m_PropertiesHash output.

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 .cf files, and Player data; all GUID/Hash128 fields now print as hex strings and cross-check against .meta files and the build-report filename.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.RecursiveDump to format GUID (4×uint32) and Hash128 (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
SkowronskiAndrew marked this pull request as ready for review July 24, 2026 18:32
@SkowronskiAndrew
SkowronskiAndrew merged commit 9f5ec7d into main Jul 24, 2026
6 checks passed
@SkowronskiAndrew
SkowronskiAndrew deleted the issue65-dump-guid-hash128 branch July 24, 2026 18:33
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.

dump command - support GUID and Hash128

2 participants