Repository navigation
docs(d3d12x): stop-13 mechanism fully mapped via Ghidra (placeholder-VA-adopt, 128B stride, 0xBADADD sentinel, 8MiB planner) #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| # D3D12X stop-13: el bloqueo #1 del boot — RESUELTO por análisis estático (GH0ST, 2026-11-23) | ||
|
|
||
| Fuente: Ghidra 12.2 headless sobre game_scarlett_master.exe 1.0.2.1 | ||
| (sha256 e95020b2...08993), hunts 14-17. Proyecto: gta6_gh0st. | ||
|
|
||
| ## El síntoma (Leonida, runtime 180s) | ||
| Tras el primer CreateDescriptorHeap (slot 73): assert/int3. | ||
| "the game expects the CPU handle of the heap to equal a value it already holds". | ||
|
|
||
| ## La cadena (direcciones absolutas, ImageBase 0x140000000) | ||
|
|
||
| FUN_142478440 (4661B) = WINMAIN del juego: | ||
| - RegisterClassExA + CreateWindow (wndproc DAT_14247a660) | ||
| - D3D12XboxCreateDevice(0, desc, &DAT_1461e0638, &DAT_1475df048) [device @1475df048] | ||
| - loop: 5 pares de heaps (i=0..4; array @DAT_1475e72a0 = handles, @1475e7300 = ptrs; | ||
| slots 5..10 del array = reservados, NUNCA creados) | ||
| * slot 0x48/9 = (*device+0x48)(device,0,&TPL_1461e0658,&out) → "placeholder/handle" (64B | ||
| template: [16B GUID {6102dee4-af59-4b09-b999-b44d73f09b24}]...[ptr .text @1461e06A0=0x1424752a0] | ||
| ...[ptr @1461e06A8=0x1455accc0]) | ||
| * slot 0x248/73 = (*device+0x248)(device,&DESC,handle,0,&IID_1461e0668,&out) | ||
| DESC = {cbSize=0(@14615c190), style=2(@14615c194), @(14615c198)=wndproc-unk, 1, 0} | ||
| → 73 = CreateDescriptorHeap (CONFIRMA el número de Leonida) | ||
| * slot 0x420/132 = (heap, 0x700000,0,0,0xFFFFFFFFFF00) → RESERVA 7 MiB (heap0) | ||
| (heaps 1-4: 0x100000 = 1 MiB c/u) | ||
| * slot 0x418/131 = (heap, 0xC3C0, 0x80020000,0,0xFFFFFFFFFF00) → reserve/map #2 | ||
| (heaps 1-4: 0xC380, 0x20000) | ||
| * slot 0x48/9 del HEAP = GetCPUDescriptorHandleForHeapStart (control) | ||
|
|
||
| FUN_141cf3280 (300B, llamada vía thunk 145a54700) = WRAPPER con EL ASSERT: | ||
| lVar5 = (*(*heap + 0x48))(); // GetCPUDescriptorHandleForHeapStart REAL | ||
| if (expected != 0 && lVar5 != expected) → int3; // ← STOP 13. expected = LO QUE EL JUEGO ASIGNÓ | ||
| *(obj+0x20) = lVar5; // cpuBase real | ||
| *(obj+0x28) = expected + count*incr; // cpuEnd | ||
| *(obj+0x30) = (u32)incr; // STRIDE | ||
| *(obj+0x38) = (flags&1) ? GetGPUHandle(+0x50) - GetCPUHandle(+0x48) // DELTA GPU=CPU−CPU | ||
| : 0xBADADD0000000000; // -0x4525230000000000 = SENTINEL GXDK | ||
|
|
||
| FUN_14156c240 (70B) = SUB-ALLOCATOR (bump, atómico) — EL "VALOR QUE YA TIENE": | ||
| uVar4 = ALIGN(curs+count-1, align); uVar1 = uVar4 + align * (*(*obj+0x30)); | ||
| if (uVar1 > *(obj+2)) → 0; LOCK/CAS: curs=uVar1; *out = uVar4; | ||
| → el juego ASIGNA las direcciones ÉL MISMO (base+ordinal×stride) y EXIGE que el | ||
| handle del driver COINCIDA. No confianza en el driver: FILTRO DE DIRECCIONES. | ||
|
|
||
| ## Los 4 pools (registro, llamada FUN_145a54700 → FUN_141cf3280) | ||
| (obj@1475e73c0, id=1, INCR=0x80 (128B!), flags=1 → GPU-delta REAL) | ||
| (obj@1475e7408, id=1, INCR=0x80, flags=0 → GPU-handle = 0xBADADD0000000000) | ||
| (obj@1475e7450, id=2, INCR=0x1000 (4096B), flags=0) // "large" (SAM/BVH-class) | ||
| (obj@1475e7498, id=3, INCR=0x800 (2048B), flags=0) | ||
| → STRIDE 128B en Series (NO el 32B de PC). 7MiB/128 = 57344 descs (heap0); 1MiB/128 = 8192. | ||
|
|
||
| FUN_145c5ff00 (267B) = PLANIFICADOR de memoria previo: | ||
| mask = DAT_14615c228 [0xffff,0,...] + _DAT_14a943918 (runtime, 2×i64: SEGMENT IDs) | ||
| stride = DAT_14a943914 (default 0x20=32B); slots = DAT_14a943910 (default 0x40000) | ||
| total = ALIGN(slots,0x10000) * stride = 0x800000 = 8 MiB | ||
| → FUN_141e86440(...,total,segA,segB) reserva; en éxito: | ||
| _DAT_1475df158=32, _DAT_1475df160=0x40000, DAT_1475df168=8MiB, DAT_1475df0e0=1 | ||
| → después FUN_145cabb00(DAT_1475df188, DAT_1475df190+DAT_1475df168) = LE PASA EL RANGO AL DEVICE. | ||
| Cookie DAT_14615c1c0 = 02 02 01 00 (vpmovsxbd → [2,2,1,0]) = la firma 16B que llena | ||
| el desc; DAT_14615c228 = 0x0000ffff (segmento "any"). | ||
|
|
||
| ## EL FIX (para Leonida/G6Recomp) — 4 reglas: | ||
| 1. CreateDescriptorHeap (slot 73) + el par placeholder (slot 9): EL HEAP DEBE DEVOLVER, | ||
| en GetCPUDescriptorHandleForHeapStart, EXACTAMENTE la VA que el juego calculó con su | ||
| propio bump-allocator (FUN_14156c240) — i.e. adoptar el "placeholder-VA" pedido, no | ||
| inventar una. En Wine/VKD3D:Requires CreatePlacedResource-style fixed VA or the | ||
| shim must pre-map its internal heap base == expected. | ||
| 2. STRIDE = 128B (0x80) para los pools 1; 0x1000/0x800 para los 2/3 — no PC sizes. | ||
| 3. GetGPUDescriptorHandleForHeapStart − GetCPUDescriptorHandleForHeapStart debe ser | ||
| consistente por-heap y cacheable: (delta = GPU−CPU) cuando flags&1; si flags&1==0 | ||
| el handle GPU = 0xBADADD0000000000 (comprobar: Ghidra muestra -0x4525230000000000 | ||
| = 0xBADADD0000000000, el sentinel clásico GXDK "BADADDress"). | ||
| 4. La RVA reserva del planificador: 8 MiB = 0x40000 slots × 32B en los segmentos | ||
| (mask+delta runtime) — la shim debe HONESTAR esa reserva (o no-op con VA fija). | ||
|
|
||
| ## Validación estática (todo desde el EXE, sin correr nada) | ||
| - Datos .rdata/.data leídos por /tmp/cookie_extract.py (script 2.6K, stdlib): | ||
| DAT_14615c1c0 = 0202010000000000... DAT_14615c190 = 00 00 00 00 02 00 00 00 01... | ||
| DAT_1461e0658 (template 64B, GUID+vtable-ptrs) DAT_14615c228 = ffff0000... | ||
| DAT_1461e0628 = IID 8efb471d-6161... (16B, usado en +0x70) | ||
| - Hunto pseudo-C: /tmp/hunt16_result.txt (WinMain 4661B completo), /tmp/hunt17_result.txt | ||
| (FUN_141cf3280 + FUN_14156c240 + FUN_145c5ff00 + FUN_1417f6a30). | ||
| - Artifact: ghidra_analysis_out/hunt16_result.txt, hunt17_result.txt, cookie_extract.py. | ||
|
|
||
| ## Qué GANA la comunidad | ||
| - El slot-73 + stride-128B + 0xBADADD0000000000 + placeholder-VA-adopt = el mecanismo | ||
| EXACTO del stop 13. Nadie lo tenía. El primer cuadro ya no depende de adivinar: el | ||
| heap shim = "devolver la VA que el juego pidió, con stride 128, y el sentinel". |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| # CARTA DE EQUIVALENCIAS — DLLs exóticas del exe → equivalente Linux (Track B) — GH0ST 2026-11-23 | ||
|
|
||
| Fuente: imports_map.tsv (587×68) + disco + MicrosoftGame.Config + código de G6Recomp. | ||
| Método: los 23+12+7+... símbolos EXACTOS están en el TSV; aquí cada DLL → qué hace, | ||
| cuánto cuesta implementarla, y con qué. | ||
|
|
||
| ## RESUMEN (por costo, de menor a mayor) | ||
|
|
||
| ### 1-función (triviales: stub + detrás, la vtable) | ||
| - GameInput.dll: ordinal_1 = GameInputCreate (la ÚNICA). Shim: 5 líneas. | ||
| - XCRDAPI.dll: DStorageGetFactory (la ÚNICA). → G6Recomp YA la implementa | ||
| (runtime/io/src/direct_storage.cpp:707 — sirve IDStorageFactoryX/FileX/QueueX/ | ||
| StatusArrayX). PERO: ellos registran "IDStorageFactoryX" sin DLL; el juego la | ||
| BUSCA en XCRDAPI.dll (import estático). Fix: registrar/ exportar como XCRDAPI. | ||
|
|
||
| ### 3-funciones (el 90% de la GPU es vtable, NO esto) | ||
| - d3d12_xs.dll: D3D12XboxCreateDevice + D3D12ConfigureVirtualMemoryX + | ||
| D3D12SerializeVersionedRootSignature. | ||
| → CONFIRMA el stop-13: todo el weight D3D12 = la vtable de 193 slots. | ||
|
|
||
| ### 4-9 funciones (pequeñas, nativas-fáciles) | ||
| - amd_fidelityfx_loader_xbox.dll: ffxCreateContext/DestroyContext/Dispatch/Query | ||
| → sí: AMD公开 ffx-SDK (GPL/MIT); 4 entry-points, el resto por contexts. | ||
| - xg_xs.dll: XGCreateTextureComputer + XGSuggestSwizzleMode → tiling/swizzle Xbox: | ||
| VKD3D tiene D3D12X equivalente; o C++-puro (swizzle = bit-remap documentado). | ||
| - XboxBvhBuilder.dll: 7 = ctor/dtor/BuildRaytracingASBatched2X/CopyRTAS/ | ||
| RehydrateRTASBatched2X/Set64BitMortonCodes + rva_067971c8 (¡decodeado del raw: | ||
| = GetRaytracingAccelerationStructurePrebuildInfo, mangle de 196+ chars — | ||
| la ventana-200B lo cortaba: names>196 EXISTEN). | ||
| → RT-AS builder: VKD3D construye AS (vkCreateAccelerationStructureKHR); | ||
| Mapeo 1:1. DIFÍCIL-PERO-MAPEADO. | ||
| - MFPlat+MFReadWrite: 7 (MFStartup/Shutdown/GetSystemTime + 4 factories) | ||
| → FilmTitan?? No: solo creation-de-attrs/mediatype/sourceresolver/reader — | ||
| en Linux: GStreamer-o-ffmpeg-wrapper; O neutrales (los BK2 no-pasan-por-MF). | ||
|
|
||
| ### 12-23 funciones (medianas, YA-CONOCIDAS) | ||
| - xmem.dll: 12 = XMemAlloc/Free(+Default)/AllocatePhysicalPages/ | ||
| MapPhysicalPages(Scatter)/TransferMemory/VirtualAlloc/GetWorkingSetStatistics/ | ||
| IsToolsMemAvailable | ||
| → TODO-malloc+posix_memalign+mmap. 1:1. (NO es el descompresor — la equivalencia | ||
| con BCPack era hipótesis mía: CORREGIDO: xmem=memoria, no compresión. La | ||
| compresión XSA/cet NO ESTÁ en imports: ver 23-aside abajo). | ||
| - Bink2Scarlett.dll: 23 = BinkOpen/DoFrame(GAsyncMulti/AsyncWait)/NextFrame/Wait/ | ||
| Close/Goto/GetKeyFrame/GetFrameBuffersInfo/RegisterFrameBuffers/Pause/ | ||
| SetVolume/SetSoundSystem/SetMemory/SetOSFileCallbacks/SetWillLoop/ShouldSkip/ | ||
| StartAsyncThread/RequestStopAsyncThreadsMulti/WaitStopAsyncThreadsMulti/ | ||
| FreeGlobals/GetPlatformInfo/OpenWithOptions | ||
| → → → ←→ librempeg (nuestro, 12/12 .bk2 decodificados). EQUIVALENCIA 1:1 | ||
| (cada Bink* → llamada-librempeg). La única-DE-VERDAD:Difícil: | ||
| BinkDoFrameAsyncMulti (GPU-decode-hint) — en Linux: decodificación-CPU-atomic. | ||
| - AcpHal.dll: 9 = AcpHal{Create,Allocate/ReleaseShapeContexts} + | ||
| Apu{Alloc,Free,CreateHeap,IsVirtualAddressValid,MapApu/VirtualAddress} | ||
| → Audio-DSP-processor (XMA→PCM): SDL3Audio/ALSOFT+decoder. Direcciones-APU= | ||
| .Memory-Nothing-s tructures → stub con memory-pool. | ||
| - xapu.dll: 5 = XApu{Connect,Disconnect,EnqueueCommand,DequeueResult, | ||
| GetResultCount} → cola-de-comandos-DSP. Stub+ring-buffer. | ||
| - chad.dll: 5 = XDsp{Activate,Deactivate,ConnectWithMaximumStreamLimit, | ||
| Disconnect,SubmitCommand} → mando-DSP. Stub passthrough. (5+9+5=19 calls | ||
| audio-DSP: la CADENA-ENTERA-Xbox-audio = 19 stubs + un mixer). | ||
|
|
||
| ## HALLAZGO DEL CONFIG (2.5KB, plist) | ||
| TitleId 7952987A, Store 9NL3WWNZLZZN, MSA 000000004060F900, SizeMB 2048, | ||
| SMTEnabled true, **XboxLockhart/AnacondaTitleMemory=Advanced** → el título usa | ||
| memory-Advanced-annotations en Series-S (Lockhart!) Y-X: la shim-de-memoria-Track-B | ||
| debe-HONOR-annotations-Advanced (8GB-heap-pooling-X, 10GB-S-fast-ESRAM-path). | ||
| Declare-0-side-DLLs: MSIX-VIC-TODAS-via-imports (68): no-hay-nada-oculto-en-manifest. | ||
|
|
||
| ## SIDE-DLLs: en disco pero NO-en-imports (carga-DINÁMICA via LoadLibraryW) | ||
| - XCurl.dll (199KB, 0-imports-públicos): la-biblioteca-HTTP-de-GDK. Cargada via | ||
| LoadLibrary (9-LoadLibrary*-imports en la tabla-core). Espera: FREE-público sí: | ||
| los 38-de-libHttpClient.GDK.dll-si-están. XCurl = Internal-helper-de-libHttp. | ||
| - amd_fidelityfx_upscaler_xbox.dll (786KB): cargada-POR-el-loader (ffxCreateContext | ||
| la-popula). DENTRO-de-ffx-sdk-flow. 0-imports-estáticos. | ||
| - dstorage.dll / CetAdvancedCompress.dll: NO-EXISTEN-en-disco. DirectStorage X = | ||
| XCRDAPI (1-import) + kernel-DM-que-lo-sirve (G6Recomp-direct_storage.cpp ✓). | ||
|
|
||
| ## CONCLUSIÓN Track B (el mapa costos-completo) | ||
| - 482-imports (82%): CRT+Win32-core → msvcxx-abi+wine-headers. MECHANIC. | ||
| - 105-imports (18%): 15-DLLs-exóticas → arriba: 1 GameInput-stub, 1 DStorage | ||
| (ya-existe-en-G6Recomp), 3-d3d12(→vtable), 4-ffx, 2-xg, 8-BVH(RTAS→VKD3D-AS), | ||
| 7-MF(→ffmpeg), 12-xmem(malloc), 23-Bink(→librempeg ✓), 19-audio-DSP(stubs). | ||
| - TOTAL-exótico: 105. De-los-cuales-58 (Bink23+xmem12+audio19+MF7-3) = YA-MAPEADOS | ||
| 1:1-a-componentes-Linux-EXISTENTES. El-85% del-exótico-NO-requiere-inventar. | ||
|
|
||
| ## Método+trampas | ||
| - Los-ordinales-GameInput (ordinal_1)= única-forma-de-verlo: hint-name-AUSENTE. | ||
| - delay-imports=EMPTY (DataDir[13]=0) — NO-hay carga-diferida: TODO-está-en-el-587. | ||
| - Bound-imports-EMPTY. LoadConfig-EMPTY: sin-CFG/CTL-guard. | ||
| - 8º-BVH-decodificado-DEL-RAW-rva: "GetRaytracingAccelerationStructurePrebuildInfo" | ||
| (mi-ventana-200B-lo-truncaba-a-rva:names>196-chars-son-RAROS-pero-EXISTEN). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| # IMPORTS-MAP: la superficie completa del exe (Track B-F1) — GH0ST, 2026-11-23 | ||
|
|
||
| Fuente: análisis estático del import-table (DataDir[1], RVA 0x6791AB4, 69 descriptores) | ||
| de game_scarlett_master.exe 1.0.2.1 (sha256 e95020b2...08993). | ||
| Herramienta: imports_dump3.py (parse-PE stdlib, sin dependencias). | ||
| Datos completos: imports_map.tsv (587 funciones × 68 DLLs, mismo directorio). | ||
|
|
||
| ## Números clave | ||
| - 587 import-pares, 68 DLLs, 69 descriptores (1 = terminador... 68 reales + trailer) | ||
| - IAT (DataDir[12] @RVA 0x6793490, 655 slots) = losbound-entries correspondientes | ||
| - El import-table ESTÁTICO es la superficie COMPLETA: no hay加载 dinámica oculta | ||
| (GetProcAdresses residuales aparte; los 656 hints = exactamente estos 587+nulos) | ||
|
|
||
| ## Lo que Track B debe implementar (shim nativo), por familia: | ||
| - CRT/STL: MSVCP140 113, VCRUNTIME140 23 (+1 _1), api-ms-win-crt-* 166 | ||
| → trivial: biblioteca-glibc hace el 90%; la mezcla = msvcxx-abi | ||
| - Win32 core: api-ms-win-core-* 121 (synch 17+1+2, file 22+1, processthreads 15, | ||
| memory 3, heap 1,COM 7...) →.casimiro: wine-headers o-escrito a mano | ||
| - Red: WS2_32 25, WINHTTP 15, libHttpClient.GDK 38 | ||
| → 78: la MAYOR superficie NO-CRT. libHttpClient=HTTP/2+JSON+XSTS | ||
| - Multimedia: MFPlat 6 + MFReadWrite 1 + Bink2Scarlett 23 + XCRDAPI 1 | ||
| → Bink2: YA LO TENEMOS (librempeg decodifica 12/12; mapeo 1:1) | ||
| - GPU: d3d12_xs SOLO 3 (D3D12XboxCreateDevice + 2), xg_xs 2, AcpHal 9, | ||
| amd_fidelityfx_loader_xbox 4 | ||
| → Toda la capa-D3D12 va POR-IMPORTS-FEED (vtables), no por import-table: | ||
| la shim-193-slots de G6Recomp es el trabajo real; aquí SOLO 3 símbolos | ||
| - Sistema: GameInput 1 (GameInputCreate), XboxBvhBuilder 7, xmem 12 (decomp), | ||
| xapu 5 (audio), chad 5 (¿Console-Audio-Device?), psm-appnotify 4, | ||
| ADVAPI32 3, XCurl (delay, en DataDir[13]... verificar) | ||
|
|
||
| ## Qué gana G6Recomp | ||
| Su docs/game-package.md pinea 16 side-DLLs (los que VIAJAN con el juego). Este mapa es | ||
| el OTRO lado: las 68 que el EXE-ESPERA del sistema. Ellos no lo tenían publicado: | ||
| ahora pueden priorizar el shim por frecuencia (MSVCP140 113 primero, luego el 78-red). | ||
|
|
||
| ## Método (reproducible) | ||
| python3 imports_dump3.py # offsets: DataDir[1]→69 descs; OFT u64-thunks; | ||
| # hint-name @VA+2, ventana 200B (nombres C++ 113+ chars) | ||
| Trampas: (1) Bulk-read obligatorio (8B-iter = timeout); (2) ventana-64B corta los | ||
| mangles-MSVCP; (3) va2fo debe chequear rsize (BSS sin backing→None). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| # RPF9 TOC — Cadena Ghidra completa (contribución GH0ST, 2026-11-23) | ||
|
|
||
| Fuente: análisis estático de `game_scarlett_master.exe` (build 1.0.2.1, | ||
| sha256 e95020b2fa4a721db3df59fdecf75621730ac559d8835252f6c3b658d5a08993) con Ghidra 12.2 | ||
| headless. 13 passes, ~35 funciones decompiladas. Todas las addresses verificables | ||
| en nuestro proyecto (ver colofón). Target: colaboradores de G6Recomp/Leonida. | ||
|
|
||
| ## TL;DR para el runtime | ||
|
|
||
| 1. El TOC NO está cifrado con AES-128 estándar: el "cipher id 0" del exe es un | ||
| NO-OP (todas las slots de su vtable son stubs de 3 bytes). Los 208 GiB de | ||
| .rpf NO necesitan ninguna clave. | ||
| 2. La ruta completa del exe al TOC está mapeada (abajo) — es lo que el runtime | ||
| debe reimplementar para navegar los archivos SIN carve. | ||
|
|
||
| ## Cadena de apertura (todas FUN_14xxxxx,ImageBase 0x140000000) | ||
|
|
||
| ``` | ||
| FUN_140fc2540 openRPF(obj, path, mode, ...): | ||
| FUN_140a57f70(obj) ← clave = copy del FILENAME (strlen @obj+0x78) | ||
| FUN_141fb2600(...) ← lee TOC: valida magic 0x52504639; TOC-main [0,hdr_len); | ||
| si (mode==1) añade los 32B finales (tabla2, stride 9/10) | ||
| FUN_141fb2780 → FUN_14087aec0(...) ← modo: (byte@hdr+8)&1: 0=decrypt,1=index-only | ||
| FUN_1408ec200→FUN_1408ec210(obj, flags) ← orquestador del descifrado (cond. bit0) | ||
| FUN_141fb2300→FUN_144e6f740(obj,1) ← accessor del tag-table (u16@hdr+0x1A = #tags) | ||
| FUN_1406bd050→FUN_1406bd090(...) ← elige región: FUN_1406bd100 (toc_end- | ||
| subtable; 16B) / FUN_1406bd110 ([f(gen) | ||
| +0x40+0x150, hdr_len)) | ||
| FUN_1408ec360: FUN_140a34970(dst,hdr+4,hdr+8,u64@obj+0x70) = registro (ptr, delta) | ||
| FUN_1406bd160(ssl,handle): ← EL CICLO: por cada bloque 16B: | ||
| FUN_140613720(**(*vtable+0x18))(update) y FUN_140613740(**(*vtable+0x20))(final) | ||
| FUN_140536a70(ssl,hdr+2) ← cipher-id = FUN_140536ac0(u16@hdr+2) [tabla @1462fe860] | ||
| FUN_140613880(ssl,1,id,MAGIC,hdr+6,16) ← FÁBRICA: | ||
| FUN_140193f90(MAGIC,id,1) = key-lookup (hash→key) | ||
| FUN_144c11250(&cipher,id) = dispatcher; id 1/2/3→FUN_145e90390(1/2/3): | ||
| 416B obj, init FUN_141b43cb5, AES-NI (FUN_14215f06c setkey 128/192/256; | ||
| FUN_14216127c AESKEYGENASSIST; 10/12/14 rounds @+0xF0) | ||
| id 0 → 64B obj, vtable 1466fdb70: TODOS LOS SLOTS = stubs (MOV AL,1 / XOR EAX,EAX) | ||
| ``` | ||
|
|
||
| ## Por qué "TOC cifrado" es mito (para 1.0.2.1) | ||
|
|
||
| - FUN_140536ac0(u16) → 0 si u16 ≥ 0x13. En TODOS nuestros .rpf, u16@hdr+2 = 0x5046 | ||
| ("FP" del magic, LE) → SIEMPRE 0 → siempre no-op. | ||
|
Comment on lines
+43
to
+44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Per AGENTS.md reference: AGENTS.md:L62-L63 Useful? React with 👍 / 👎. |
||
| - La alta entropía (~7.99) del TOC no es cifrado: son (u64-id, u32, u32) records, | ||
| y los u64 son ids criptográficos (no-xor-cifrables: probamos fnv1a64/joaat64/ | ||
| xxh64(0/1) × 36,952 nombres = 0 hits; también AES-128 ECB/CBC/CTR/CFB/OFB × | ||
| 5 keys × 6 IVs × 5 subranges = 0 plausibles). | ||
| - Los primeros 32B @0x40 = CONSTANTES en todos los .rpf: | ||
| 5f08daabecbdd40258c3516807024c24fb9f756755ef4be458785bfed8aa6989 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This 32-byte string is explicitly identified as bytes from offset AGENTS.md reference: AGENTS.md:L25-L27 Useful? React with 👍 / 👎. |
||
| (=KNOWN_TOC_PREFIX_HEX del parser público: tags, no ciphertext). | ||
|
|
||
| ## Layout del TOC (FUN_14087aff0 = CALCULADORA, counts cruzados) | ||
|
|
||
| ``` | ||
| 0x040 4×8B tags (u32,u32)×4 ← count = u16@0x1A | ||
| 0x060 21×16B (u64-id, u32-a, u32-b) = 336B ← = u32@0x1C (0x150) ✓ | ||
| 0x1B0 3×24B (u64,u64,u64)×3 ← count = u16@0x20 | ||
| 0x200 2×32B (u64×4)×2 ← count = u32@0x24 | ||
| 0x240 2×9B (u32,u32,u8)×2 + pad ← count = u32@0x24; stride 8+byte@0x2C | ||
| ``` | ||
| (script.rpf de muestra: 4+21+3+2+2 = 32 records; todos los counts auto-consistentes). | ||
|
|
||
| ## Qué NO resuelve esto | ||
|
|
||
| Los u64-ids del TOC no mapean 1:1 a paths públicos: los nombres están IN-STREAM | ||
| (vía rpf9-research: 215,028/2,235,084 streams carry a name; 168,660 paths únicos). | ||
| El TOC = árbol de seek+Merkle-ids; la navecación por nombres requiere correr el | ||
| propio juego (o nuestro runtime) — por eso esta cadena importa. | ||
|
|
||
| ## Reproducibilidad | ||
|
|
||
| - Proyecto Ghidra persistente (280MB, 13 hunts): `../ghidra_projects/gta6_gh0st` | ||
| - Pseudocódigos: `../ghidra_analysis_out/` (68 archivos; hunts 1-13 + tests .py) | ||
| - Exe: sha256 e95020b2fa4a721db3df59fdecf75621730ac559d8835252f6c3b658d5a08993 | ||
| - Bitácora completa: `../BITACORA.md` (comandos + salidas reales, 350+ líneas) | ||
|
|
||
| *GH0ST, 2026-11-23. Verificado contra: notre copia (223,880,932,870B, bit-exact), | ||
| el corpus 4,330-header (SentinelInteractive/0x52504639), rpf9-research, y | ||
| G6Recomp/known_builds.toml (exe_sha256 COINCIDE).* | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines trace the nonzero cipher branch from key lookup through AES key setup, expansion, and round selection; this is implementation-level decryption analysis, not merely a note that a format is encrypted. Repository policy says to record encryption in
docs/design.mdand stop, so remove these cipher-branch details rather than providing a runtime shim with a decryption path.AGENTS.md reference: AGENTS.md:L30-L31
Useful? React with 👍 / 👎.