FFXiMain.dll / FFXi.dll build 2025-12-26: R1 function discovery for static recompilation
=====================================================================================

Retail files  loose copies (a downloads folder), no install folder and no patch.ver
  FFXiMain.dll  SHA-256 f5ed4c3b6aabef3936ac2c1cf49c2475b3ab9a5b7c20c3c2744bdb938ce7a7f6
                PE timestamp 0x694e5965 (2025-12-26); packer's original entry 0x10314cef
  FFXi.dll      SHA-256 8a12ecba859c8ba5653dea89c80d23acf4a23f18021ea755724d5d6bde36a663
                PE timestamp 0x694e5955
Metadata      FFXiMain.2025-12-26.meta.json, FFXi.2025-12-26.meta.json (ffxi-recomp-meta/1)
Label         the date of the PE timestamp. This client is older than both known builds.

What changed from 2026-09-03
----------------------------
FFXi.dll: .text byte-identical to 2026-08-22 and 2026-09-03; its metadata is 2026-09-03's
(newbuild.py meta), no discovery pass.

FFXiMain.dll: an older game version. Code sits lower: 0 at the bottom (0x100035cb, the Present
call site, is unchanged), -0x16 around 0x10006400, -0x1f0 at 0x100863d6, -0x410 at 0x100f46b0,
-0x12d0 around 0x1015b000, -0x1a40 near the top. Struct offsets differ as in 2026-08-22
(`mov [edi+0xccc],esi` at 0x1015ac0d, 0x14cc in 2026-09-03).

Carrying addresses over
-----------------------
Carried from 2026-09-03 (tools/version/newbuild.py carry); a dry run from 2026-08-22 lands every shared
address on the same new address.
  character table pointer       0x104df770 -> 0x104dd600 (votes 1521 of 1521)
  Present call site             0x100035cb (unchanged)
  nameplate_scale hook          0x100863d6 -> 0x100861e6 (same `fstp [esp+0x50]; jle` sequence)
  difftest CRT slice            each -0x1a40 (strlen 0x10315a00 ... strpbrk 0x10321170)
  manual verdicts               12 of 14 by byte window; by hand, verified by disassembly:
    0x1015bee0/0x1015bedd -> 0x1015ac10/0x1015ac0d  (same -0x12d0; the 0xccc displacement broke
                                                    the window; the 2026-08-22 carry matches it)
    0x1015d7e0 -> 0x1015c510  4-entry jump table into the function before it, after its ret
  dropped: 2026-09-03's 0x100657d0/0x100657ce pair. Here the instruction is
    `mov eax,0x10351ba0` at 0x100655de: no 0x90 byte, so no false aligned start.

Method
------
Ghidra 11.3.2 headless, as for 2026-09-03 (tools/version/discover.py). The first run's gate failed on
one conflict, the verdict below was added, and two --reuse runs followed (the first with the
verdict at the wrong address, 0x100076a0).

New in this build (Conflicts.py, "0x1000769c falls into 0x100076a0"):
  0x10007670  the 21-case table of `jmp [ecx*4+0x10007670]` at 0x100063fc, right after the ret
              ending 0x10005a40, created as a function by the after-ret heuristic. Its first
              entry 0x100065c0 begins with 0xc0 (shl); in 2026-09-03 the table began with 0xd6
              (salc), which the checks reject. -> NOT_CODE
After re-applying: 0 conflicts, 0 suspect functions, SwitchAudit review 0.

Results
-------
                                  auto-analysis   after discovery   2026-09-03 after discovery
functions in .text                14,123          21,698            21,762
instructions                      888,535         994,162           996,083
instruction bytes                 83.3%           93.0%             93.0%
instructions outside functions    151,744         0                 0
scaled-index switches             857             943               943
tail_jumps                        -               2,156             2,165

Verification (FFXIRecompile)
----------------------------
tools/prepare.py --game <folder holding the two DLLs> -> build 2025-12-26.
tools/build.py difftest: PASS, 133,681 calls, 0 mismatches.
tools/build.py host: translated 21,828 functions (the 21,698 of the metadata plus the entries
recomp.py adds for code pointers in data and branch targets inside other bodies; 212 with
unimplemented instructions); 21,828 entries patched; BOOT OK at the preferred base and relocated.
tools/build.py boot64: BOOT64 OK. host64 (Windows x64): built build\host64.exe.
macOS arm64 not built (needs the Mac).
The version string 30251226_0 is inferred (PE timestamp date); a server whose version check
expects another string will refuse the client at the lobby. Not yet run in-game.
