Skip to content

fix(afk): publish entrySlots[GAME_ORCHESTRATOR_IS_AFK] on chinlan - #10

Merged
tkgstrator merged 2 commits into
masterfrom
fix/afk-always-false-chinlan-slot
Jul 1, 2026
Merged

fix(afk): publish entrySlots[GAME_ORCHESTRATOR_IS_AFK] on chinlan#10
tkgstrator merged 2 commits into
masterfrom
fix/afk-always-false-chinlan-slot

Conversation

@tkgstrator

Copy link
Copy Markdown
Contributor

Problem

KIOUAfkDisableAlwaysFalseInstall only routes through KIOUHookInstall, which on chinlan is a no-op for slot publishing — it just returns the bypass entry so callers can invoke orig; it doesn't write into the entry slot table. So the AFK cave ends up BLR'ing through a NULL entrySlots[GAME_ORCHESTRATOR_IS_AFK] and crashes on the first IsAfkEnabled call — the exact regression the "always false" installer exists to prevent.

Fix

Write the slot directly on chinlan so a plain KIOUAfkDisableAlwaysFalseInstall(unityBase) in the consumer tweak is enough. JB path is unchanged (KIOUHookInstallMSHookFunction still works).

#if IPA_CHINLAN
    void * volatile *entrySlots =
        (void * volatile *)(unityBase + KIOU_HOOK_ENTRY_SLOT_BASE_RVA);
    entrySlots[KIOU_HOOK_SLOT_GAME_ORCHESTRATOR_IS_AFK] =
        (void *)kiou_afk_always_false;
#else
    KIOUHookInstall(KIOU_HOOK_NAME_GAME_ORCHESTRATOR_IS_AFK,
                    (void *)kiou_afk_always_false, unityBase);
#endif

Test plan

  • python -m tools.check_recipes clean
  • ruff clean
  • On-device via KiouForge follow-up: IsAfkEnabled returns false without the cave crashing.

🤖 Generated with Claude Code

tkgstrator and others added 2 commits July 1, 2026 16:36
`KIOUAfkDisableAlwaysFalseInstall` used to only route through
`KIOUHookInstall`, which is a no-op for slot publishing on chinlan (it
returns the bypass entry so callers can invoke orig; it does not write
into the entry slot table). That meant the AFK cave BLR'd through a
NULL `entrySlots[GAME_ORCHESTRATOR_IS_AFK]` and crashed on the first
`IsAfkEnabled` call — the exact regression the "always false" installer
exists to prevent.

Write the slot directly on chinlan so a plain
`KIOUAfkDisableAlwaysFalseInstall(unityBase)` call in the consumer
tweak is enough. JB path keeps calling `KIOUHookInstall` (which does
the right thing there via `MSHookFunction`).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The default branch was renamed main -> master; workflow triggers need
to match or push events / PR CI won't fire.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@tkgstrator
tkgstrator merged commit 4042f32 into master Jul 1, 2026
4 checks passed
@tkgstrator
tkgstrator deleted the fix/afk-always-false-chinlan-slot branch July 1, 2026 16:46
tkgstrator added a commit that referenced this pull request Jul 27, 2026
* fix(afk): publish entrySlots[GAME_ORCHESTRATOR_IS_AFK] on chinlan

`KIOUAfkDisableAlwaysFalseInstall` used to only route through
`KIOUHookInstall`, which is a no-op for slot publishing on chinlan (it
returns the bypass entry so callers can invoke orig; it does not write
into the entry slot table). That meant the AFK cave BLR'd through a
NULL `entrySlots[GAME_ORCHESTRATOR_IS_AFK]` and crashed on the first
`IsAfkEnabled` call — the exact regression the "always false" installer
exists to prevent.

Write the slot directly on chinlan so a plain
`KIOUAfkDisableAlwaysFalseInstall(unityBase)` call in the consumer
tweak is enough. JB path keeps calling `KIOUHookInstall` (which does
the right thing there via `MSHookFunction`).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* ci: update trigger branch from main to master

The default branch was renamed main -> master; workflow triggers need
to match or push events / PR CI won't fire.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant