Static-RE findings for 1.0.2.1 (exe sha256 e95020b2...): TOC layout validated 23/23, stop-13 mechanism (descriptor-heap assert) decoded, full import-map 587x68, exotic-DLL equivalence #1
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Kajcsi--G6Recomp#1
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@umbraotus7 on GitHub · 2026-11-24 02:35 UTC · original
Hi! Independent RE effort here (working dir: gta-6-linux-engine; we forked/cloned your repo — thanks for known_builds.toml, our retail dump matches your pinned exe sha256 exactly, which made every address directly comparable). Sharing four findings from ~2 days of static analysis (Ghidra 12.2 headless, zero execution). All addresses are RVAs (ImageBase 0x140000000), so they map 1:1 onto your copy of the binary.
1) RPF9 TOC: not encrypted — layout validated at scale (23/23)
We validated the TOC geometry against all 22 .rpf containers of the retail build + pack/story000/story000_script.rpf (78MB) — 23/23 pass both invariants:
toc_end - subtable == ceil((8 + b2C) * w24 / 16) * 16whereb2C = byte@0x2C(stride = 8 + b2C; 0x00090F01 → b2C=1 → 9-byte records). 23/23.5f08daabecbdd40258c3516807024c24fb9f756755ef4be458785bfed8aa6989(4 tags, u16@0x1A=4). 23/23.Open question we could NOT close: an extra ~16B per-file delta in the TOC tail (deltas observed: 1, 6, 7, 9, 11, 12, 13, 28, 29, 35, 42, 632... not a function of w24/v_lo/b2C alone — we tried ~10 formulas). If anyone nails the tail-region layout, the TOC is 100% modeled.
2) Stop-13 (descriptor-heap assert) — mechanism decoded
Your boot.md lists this as the one open blocker. We found it statically. It's not a driver-quirk: the game computes its own descriptor addresses and asserts equality.
D3D12XboxCreateDevice(import thunk 0x145f3fd80, 3 imports total from d3d12_xs.dll) → 5-iteration loop creating paired heaps (handles array @0x1475e72a0, pointers @0x1475e7300; device-alloc via slots 0x48/9 → 0x248/73 CreateDescriptorHeap → 0x420/132 reserve 0x700000 (heap0) / 0x100000 (heaps1-4) → 0x418/131 second reserve 0xC3C0/0xC380).handle = ALIGN(curs+count-1, align) + align * stride@obj+0x30, cap @obj+0x28. The game adopts the placeholder-VA it asked for — a shim must return exactly that VA from GetCPUDescriptorHandleForHeapStart, not its own allocation.(id=1, 0x80, flags=1),(1, 0x80, 0),(2, 0x1000, 0),(3, 0x800, 0). flags&1 → GPU-delta path; else the 0xBADADD0000000000 sentinel is stored.02 02 01 00(vpmovsxbd → [2,2,1,0]).Fix for the shim: CreateDescriptorHeap must (a) accept/record the caller-provided base-VA, (b) return it verbatim from GetCPUDescriptorHandleForHeapStart, (c) keep GetGPU−GetCPU consistent per-heap, (d) report 0xBADADD0000000000 for GPU start when the pool is CPU-only, (e) strides 128/4096/2048 by pool-id. In Wine/VKD3D terms: CreatePlacedResource-style fixed-VA semantics, not regular allocations.
3) Full import-map: 587 imports × 68 DLLs (nothing hidden)
Parsed the static import table (DataDir[1] @RVA 0x6791ab4, 69 descriptors; IAT = DataDir[12] @0x6793490, 655 slots). delay-imports, bound-imports,LoadConfig: all EMPTY — the 587×68 is the complete surface. Top: MSVCP140 113, api-ms-win-crt-math 41, libHttpClient.GDK 38, api-ms-win-crt-string 31, stdio 29, WS2_32 25, crt-runtime 25, Bink2Scarlett 23, VCRUNTIME140 23, core-file 22, core-synch 17, WINHTTP 15, processthreads 12, xmem 12. Exotic: d3d12_xs.dll 3 (D3D12XboxCreateDevice, D3D12ConfigureVirtualMemoryX, D3D12SerializeVersionedRootSignature — confirming all GPU weight is vtable-193, not imports), xg_xs 2, XboxBvhBuilder 7, GameInput.dll 1 (ordinal_1 = GameInputCreate), XCRDAPI 1 (DStorageGetFactory), amd_fidelityfx_loader_xbox 4, AcpHal 9, xapu 5, chad 5, MFPlat 6+1, XCurl 0 (loaded via LoadLibrary; 9 loader-imports present), amd_fidelityfx_upscaler_xbox 0 (same), CetAdvancedCompress/dstorage do not exist in this build.
Rough shim-ontology: 482/587 (82%) = CRT+Win32-core (mechanic); 105/587 (18%) = 15 exotic DLLs, of which 58 (55%) map 1:1 to existing Linux components: Bink23→Bink2/GL-entropy decoder (we use a librempeg/FFmpeg-based pipeline — 12/12 .bk2 from movies.rpf decode), BVH7→VKD3D-AS (vkCreateAccelerationStructureKHR), xmem12→malloc/posix_memalign/mmap, MF7→ffmpeg. Audio-DSP (AcpHal9+xapu5+chad5=19) = stubs+ring-buffer.
Also from MicrosoftGame.Config: TitleId 7952987A, Store 9NL3WWNZLZZN, SMTEnabled true, XboxLockhart/AnacondaTitleMemory = Advanced — the memory-annotations matter for the Series-S/X memory-shim.
4) Because it's the least-documented: 8th XboxBvhBuilder import
The 7 named mangles for XboxBvhBuilder.dll are: ctor/dtor, BuildRaytracingAccelerationStructureBatched2X, CopyRaytracingAccelerationStructure, RehydrateRaytracingAccelerationStructureBatched2X, Set64BitMortonCodes, and (the one that truncates in <200B windows) GetRaytracingAccelerationStructurePrebuildInfo (196+ char mangle). Straight 1:1 onto VKD3D-AS.
If useful, we're happy to: (a) PR our three docs (rpf9-TOC-ghidra.md, d3d12x-stop13-ghidra.md, imports-map.md + exotic-DLL equivalence) into your docs/; (b) contribute the 23/23 TOC-validator (pure-stdlib Python, no deps) under tests/; (c) share the Ghidra hunt logs + full import TSV. Say the word and we'll open the PRs.
— GH0ST (oscena), independent, no affiliation.
@umbraotus7 on GitHub · 2026-11-24 02:51 UTC · original
Follow-up — the TOC-geometry question I left open in the original post is now CLOSED (except one variable). Independent arithmetic identity, verified 22/22 on the retail containers:
Residual is literally 0 on all 22 files (from 80B appdata0 to 0x1B070 levels.rpf). My earlier 0/22 was a pad8-vs-pad16 + missing-section modeling error — the 16B-alignment everywhere is the invariant.
What remains data-driven is only R (count of 16B-records of a 5th section between the 32B-entries and the 9B-table; observed 0,0,5,6,8,10,10,12,13,28,29,35,41,323,394,540,632,653,1258,1428,2105,2485). Tests that failed: linear fits on (w24, v_lo, v_hi, b2C, tr0C) incl. exhaustive ±4 coefficient search; sums of the root-dir u32 fields (they are hashes — values ~4e9, sums ~4e10, 0/22 hits). The 5th-section records have the SAME shape as root-dir records (u64,u32,u32), all fields hash-like — consistent with FUN_1406bd110's second 16B-table at [f(gen)+0x40+0x150, hdr_len). If anyone gets the semantics of that table (my guess: (entryHash, dirHash, langHash) or a second (nameHash,offset,size) column), the TOC layout is 100% mapped.
So the honest state: geometry 100% (every byte of every TOC accounted, 22/22 resid==0), semantics of the 5th section = open. Everything else from the original post stands.