FFXiMain.dll / FFXi.dll build 2026-10-05: R1 function discovery for static recompilation
=====================================================================================

Retail files  a private-server install's FFXiMain.dll, FFXi.dll and patch.ver (first a loose
              FFXiMain.dll alone, paired with 2026-09-03's FFXi.dll until the install's arrived)
  FFXiMain.dll  SHA-256 042884888eea4fadac183e520f2ae9f8c4fa267860e685048e1880efd358e872
                PE timestamp 0x6ac37846 (2026-10-05); unpacked .text 0x10001000-0x1032862e,
                real entry 0x1031676f
  FFXi.dll      SHA-256 760f8245173c85976ddf2b0828f90a11db6a2987e96982efc58df812dff5b2a4
                PE timestamp 0x6ac37836
Metadata      FFXiMain.2026-10-05.meta.json, FFXi.2026-10-05.meta.json (ffxi-recomp-meta/1)
Version       30261006_0, read from patch.ver (the PE date alone would give 30261005_0)

What changed from 2026-09-03
----------------------------
FFXi.dll: rebuilt, but its unpacked .text and .reloc are byte-identical to 2026-09-03's;
.rdata/.data/.rsrc differ in 27 bytes (as 2026-08-22 -> 2026-09-03). Its metadata is
2026-09-03's with the new hash and label (tools/version/newbuild.py meta).

FFXiMain.dll: a small update. .text is 0x40 bytes longer; code moves by 0 at the bottom (the
Present call site, the hooks, the menu functions and nearly every manual verdict are unchanged) and
by +0x20 / +0x40 near the top (the CRT slice, malloc, five NOT_CODE and one REDECODE verdict by +0x40, two
switch overrides by +0x20). Every section after .text keeps its address and size; .rdata differs
in 1,556 bytes and .data in 379, mostly code pointers into the moved range.

Carrying addresses over
-----------------------
tools/version/newbuild.py carry --from 2026-09-03 --to 2026-10-05 --write mapped everything except five:
  cexi_region          not an image address: cexi_sites.py's fixed REGION (0xfe000000), kept
  cexi_fx_spell_edi    no unique byte window; disassembly at 0x100a8e9c is the same
                       `add edi,0xaf0 ; push 0x34 ; mov [esp+0x18],edi ; call <malloc>` in both
                       builds (only the call's rel32 moved, by +0x40) -> 0x100a8e9c
  menus_conf1win       menu-table entries no code references. The whole table
  menus_display        0x10372000..0x10376400 is byte-identical to 2026-09-03's (the entries read
  menus_addons         "menu    conf1win", "tkdebug dbdelsel", "menu    oplev") -> 0x10375064,
                       0x10375b0c, 0x103740ec, unchanged
  character table pointer 0x104df770 (1,733 of 1,733 sites agree), Present call site 0x100035cb.
After prepare, tools/version/frame_sites.py and tools/version/cexi_sites.py (without --slots) found their sites
by shape: every one where 2026-09-03 has it or moved by +0x20 (frame_yield, the lobby's wait sites,
some frame_int_sites); cexi_item_ranges, cexi_gear_groups, cexi_item_general and the cexi_items
patch bytes unchanged. The cexi_slots patches (91) are carry's byte-window mapping; no cexidats
checkout was at hand to re-derive them with --slots.

The scene renderer's addresses (29 scene_* globals and functions, the fx_draw and model_draw hooks,
the mesh_draw wrap), recorded for 2026-09-03 only, were mapped with newbuild.py's map_code and
map_data: every one unchanged (data by unanimous votes, code by a unique window). Each function is
an entry in the new metadata with the same ranges, and its body is byte-identical apart from
call rel32s into code that moved (_ftol 0x10311c2c -> 0x10311c6c, as the CRT slice, and others by
+0x20 / +0x40); the zone and character draw ranges likewise.

Method
------
Ghidra 11.3.2 headless (JDK 21), tools/version/discover.py, as for 2026-09-03.
The carried verdicts (10 NOT_CODE, 4 REDECODE, 5 switch overrides) were enough: round 1 and
round 2 both ended with 0 conflicts, 0 suspect functions, switch review 0. No new verdicts.

Results
-------
                                  auto-analysis   after discovery   2026-09-03 after discovery
functions in .text                14,159          21,761            21,762
instructions                      890,486         996,147           996,083
instruction bytes                 83.3%           93.0%             93.0%
instructions outside functions    152,197         0                 0
scaled-index switches             857             943               943
tail_jumps                        -               2,165             2,165

Verification
------------
macOS arm64, a folder of links to a retail install with this build's FFXiMain.dll, FFXi.dll and patch.ver in place (rerun with the real FFXi.dll, same results):
tools/build_posix.py prepare -> build 2026-10-05.
boot64: translated 21,891 entries (211 with unimplemented instructions, all MMX/3DNow!/SSE;
21,735 jmp and 156 int3 entry patches); BOOT64 OK.
host64: FFXi.dll module 399 functions; built build/host64, no compiler warnings.
With the scene renderer's addresses added: host64 rebuilt, generated/build.h has every
FFXI_SCENE_* define. Scene renderer not yet seen running on this build.
No geometry section (as 2026-09-03), so no geometry replay test. Windows targets (difftest, host,
boot64, host64) not run. Not yet run in-game (sign in, zone in, fight, zone again).
