Skip to content

nextendo/sign-in: bound request time and reply size - #8

Merged
eyasbzour merged 1 commit into
eyasbzour:socket-grpc-resolver-msgfrom
sofianbll:patch2589/signin-deadline
Nov 24, 2026
Merged

eyasbzour merged 1 commit into
eyasbzour:socket-grpc-resolver-msgfrom
sofianbll:patch2589/signin-deadline

Conversation

@sofianbll

Copy link
Copy Markdown

What and why

The sign-in bridge waits without a deadline for an HTTP completion. Cap each request at 12 seconds and cancel on timeout. Limit the reply buffer to 64 KiB even when no content length is sent. A transport failure now gives a fixed message instead of the system’s localized text.

Checked

  • make -C dm/host/tests GAME=010015100B514000 nextendo-account: synthetic HTTP covers a small reply, oversized replies, a stalled request and cancellation. The Mac helper compiled but was not run.
  • A transport that never calls back held the old code past the 1-second watchdog. With a 250 ms test deadline, the new wait returned a timeout and requested cancellation.
  • Both affected iOS files compiled with the existing UIWindow.init deprecation left as a warning. iOS was not run.
  • No game build, gameplay, or Nextendo sign-in or online session.
  • scripts/regress.py impact ran; check --games was not run, as no game data was used.

Docs

  • Added the finding to docs/reference/services.md and regenerated the symptom index.
  • No game files, keys or data extracted from a game.

@github-actions github-actions Bot added host The Horizon host: SVCs, services, threads, memory (dm/host) ios The iPhone and iPad app (dm/ios) docs Documentation labels Nov 23, 2026
eyasbzour pushed a commit that referenced this pull request Nov 23, 2026
Issue seedds#3046 reported that building FINAL FANTASY TACTICS 1.5.1 (v524288)
from a derived profile lost the 1.4.0 build-keyed job-pool wake-up cut,
leaving a blank window on Mac and iPad. A plain MATCH_CUTS rule cannot
carry that cut because main+0x12558 overwrites a PC-relative `b SignalEvent`
whose encoding changes when the PLT moves, and the 8-byte wrapper at
0x12554 is byte-identical to an adjacent wrapper at 0x1254c.

- dm/tools/nso_match.py: share locate_rule and validate_called_by so
  MATCH_STUBS / MATCH_FRAME_STEP support `called_by` for short ambiguous
  callees, fail-closed like MATCH_CUTS.
- dm/games/010038B015560000/patches.py: replace 1.4.0 CUTS with a
  game-bound MATCH_STUBS rule located via the single-job submit caller
  (main+0x14790, bl at +0x94) with the wait wrapper (main+0x12500)
  checked in `others`. Patch only `ldr x0,[x0]` into a 3-instruction
  trampoline (`str x0,[x0,#8]; ldr x0,[x0]; b site+4`), leaving
  `b SignalEvent` untouched across PLT shifts. Moves BINDING from
  `build` to `game`.
- dm/tools/check_thread_cuts.py: support MATCH_STUBS and dynamic
  SignalEvent/WaitEvent PLT lookup in FFT's Unicorn replay.
- dm/tools/tests/test_nso_match.py: add unit test for `called_by` in
  locate_stub.
- Docs: update game note, rewriter/threads reference entries, and
  regenerate docs/agents/game-patches.md.

Verified with test_nso_match.py, test_patches.py, test_docs.py,
test_nro_pack.py, full patch_nso.py rewrites, and Unicorn instruction
replay on both 1.0.0 (v0) and 1.4.0 (v393216) mains. 1.5.1 runtime
retest awaits confirmation on seedds#3046.

Co-authored-by: Phil Wu <194177+runty@users.noreply.github.com>
eyasbzour pushed a commit that referenced this pull request Nov 23, 2026
…ostbite frame regulator (PR seedds#3234)

Rewriter (dm/tools/patch_nso.py):
- Check DATA_BLOCKS and spin_quick(T, hi) at the start of spin_region before calling spin_lock(T), guard spin_lock(a) on its first instruction's mnemonic before decoding lookahead words, and clear spin_dec in spin_region's finally block after every head.
- Bounds spin_dec to <= ~135 entries per head instead of growing with text size per worker (which passed 24 GB on EA SPORTS FC 27 1.8e's 185 MB main; full 1.8d main rewrite now peaks at 2.20 GiB RSS), while cutting spin-search decodes by 39% and time by 30% with byte-identical output.
- Add synthetic unit tests in test_spin_waits.py and drop the two fixed pyright reportOptionalSubscript entries from lint_python_baseline.tsv.

Host (dm/host/hle_fpslock.c):
- Extend fb_find() to read GameRenderSettings.Enable from Frostbite reflection and locate the unique fmov vD.2d, seedds#30.0 / adrp+ldr / stur qD, [xR, #8] regulator store (failing closed with [RED] on ambiguity), verified on EA SPORTS FC 27 v0 (0xd9f4e18), 1.8d.310c (0xda20e38), and 1.8e.50bc disassembly (0xda5d0f8).
- Remove the build-gated FC 27 row from k_locks[] and its HOST_BINDING entry in docs_patches.py, add dynamic and negative cases in t_fpslock.c, and update docs and generated indexes (including the 1.8e.50bc iPhone 17 Pro and Mac 5K notes).

Co-authored-by: Vertu User <55468974+vertu-user@users.noreply.github.com>
A stalled sign-in request can hold the caller because its semaphore wait has no deadline. Cap the total transfer at 12 seconds and cancel on timeout. Stream replies into a 64 KiB buffer instead of letting the completion handler accumulate them.

Checked a small JSON reply, advertised and streamed oversize replies, a stalled task and cancellation with a synthetic transport. No game or online session was run.
@sofianbll
sofianbll force-pushed the patch2589/signin-deadline branch from 7b31752 to 206e093 Compare November 23, 2026 22:09
@eyasbzour
eyasbzour merged commit 994ec29 into eyasbzour:socket-grpc-resolver-msg Nov 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation host The Horizon host: SVCs, services, threads, memory (dm/host) ios The iPhone and iPad app (dm/ios)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants