Repository navigation
Read Unreal pak version 9 (Monster Jam Steel Titans 2 shaders) - #1618
Open
528z4b2kgc-ux wants to merge 1 commit into
Open
528z4b2kgc-ux wants to merge 1 commit into
528z4b2kgc-ux wants to merge 1 commit into
Conversation
2 tasks done
528z4b2kgc-ux
force-pushed
the
fix/pak-version-9
branch
2 times, most recently
from
November 12, 2026 21:37
11a8df3 to
0dc7522
Compare
528z4b2kgc-ux
force-pushed
the
fix/pak-version-9
branch
from
November 13, 2026 14:01
0dc7522 to
91bff0d
Compare
Contributor
Author
|
The two red jobs (host tests and sanitizers) are the same single check in |
…rs are found Unreal Engine 4.25 writes version 9 paks (PakFile_Version_FrozenIndex). Their footer has a u8 frozen index flag between the SHA-1 and the five compression method names, so the magic is 0xcd bytes from the end; uepak.py looked only at 0x2c, 0xc8 and 0xcc, so unreal_paks skipped them and neither the archive decoder nor the shader split saw them. Past the footer the pak is version 8's (per-file index, methods named in the footer). uepak.py reads version 9's footer at 0xcd and its index as version 8's (PER_FILE = LEGACY + (9,)), and refuses a frozen index with a reason. Unlike 4 and 8, a version 9 pak is not taken as inline outright: inline_shaders reads its file names, so Monster Jam's pakchunk0 (two .ushaderbytecode archives) goes to uepak.job and pakchunk1 (cooked packages only) to ue_legacy_jobs. An encrypted index (Monster Jam's are) is opened with main's key through uepak.Keys, as for versions 4 and 8. Checked: dm/tools/tests/test_uepak_v9.py (new; synthetic paks and main, no game files or keys; 6 tests, all fail on main); the uepak tests (60), test_docs, test_profile_guess and test_nsp_* (426) pass; ruff 0.17.2 clean on the changed files (pyright not run locally). Monster Jam Steel Titans 2 1.0.2's two paks: main finds neither; with this change pakchunk0 is an archive pak (44,512 + 1,722 records, the 44,148 + 1,717 unique shaders of the game's build) and pakchunk1 an inline one. The game played on the Mac and an iPhone with these shaders (with the earlier version of this change). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
528z4b2kgc-ux
force-pushed
the
fix/pak-version-9
branch
from
November 14, 2026 14:39
91bff0d to
13f1542
Compare
YoungTreeTree
added a commit
to YoungTreeTree/nxnative
that referenced
this pull request
Nov 14, 2026
Pak v9 moves the footer magic by one byte and can store its index as a frozen UE4 memory image. The reader previously skipped these archives, leaving Demon Slayer's shader split empty. Read the FrozenIndex flag and bounded relative pointers, UTF-16 strings, entry arrays and sparse directory maps. Preserve the serialized v9 index path and recognize encrypted frozen mounts during key discovery. Classify audio-only paks separately from shader archives after reading the index. Synthetic tests cover both layouts, sparse holes, backward pointers, multi-block compression, encrypted indices and malformed references. Both real game indices validate, all 57,982 shaders build, and an M2 Pro run reaches the Simplified Chinese title menu. Combat is not tested. Related to seedds#2134 and seedds#1618. Co-authored-by: YoungTreeTree <24680817+YoungTreeTree@users.noreply.github.com>
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.
What and why
Unreal Engine 4.25 writes version 9 paks (
PakFile_Version_FrozenIndex). Their footer has a frozen-index flag byte between the SHA-1 and the compression method names, so the magic is 0xcd bytes from the end, anduepak.pynever found it.unreal_pakstherefore skipped the paks, so neither the archive decoder (uepak.job) nor the shader split saw them. Past the footer the pak is version 8's.uepak.pyreads version 9's footer at 0xcd and its index as version 8's (PER_FILE = LEGACY + (9,)), and refuses a frozen index with a reason. Unlike 4 and 8, a version 9 pak is not taken as inline outright:inline_shadersreads its file names. Monster Jam'spakchunk0holds the two.ushaderbytecodearchives and goes touepak.job;pakchunk1holds only cooked packages and goes toue_legacy_jobs. Its indexes are encrypted; since 050580d they are opened with main's key throughuepak.Keyslike versions 4 and 8.Rebased onto current
main(Nov 12): this PR's earlier key handling (pak_key,main=parameters ininline_shaders,unreal_paks,ue_legacy_jobsandprofile_guess.py) is gone, sincemainnow does that for every legacy pak. What's left is the version 9 footer and index.Reference entry: Unreal Engine 4.25 paks (version 9).
Checked
dm/tools/tests/test_uepak_v9.py(synthetic paks and a synthetic main, no game files or keys): 6 tests (footer, frozen index refused, Zlib and stored files read, a pak with archives not inline, encrypted index opened with the key from main, key carried in the jobs), all of which fail onmain. Thetest_uepak_*tests (60),test_docs,test_profile_guessandtest_nsp_*(426) pass. ruff 0.17.2 is clean on the changed files; pyright not run locally.010051B0131F0000, 1.0.2), its two paks (4.7 GB) with this branch:mainfinds neither; with the changepakchunk0is an archive pak (44,512 + 1,722 records, the 44,148 + 1,717 unique shaders of the game's build) andpakchunk1an inline one. The game played on the Mac and an iPhone with those shaders, with the earlier version of this change.regress.pyon other Unreal games (no builds on hand). Version 4, 8 and 11 paks take the same code paths as before.Docs
docs_symptoms.pyrun🤖 Generated with Claude Code