feat: port KiouEditor sites to 1.0.2 + migrate AFK to CAVE_ENTRY - #7
Merged
Conversation
Adds the 17 non-AFK KiouEditor hook sites to recipes/v1_0_2.py so a
KiouEditor build targeting KIOU 1.0.2 can chinlan-patch them
alongside the existing KiouForge base + kifu observer + HeaderProvider
entries.
RVAs verified against assets/1.0.2/dump.cs on 2026-07-01; prologue
bytes captured from assets/1.0.2/Kiou-1.0.2.ipa UnityFramework. Ran
python -m tools.verify_sites --recipe recipes --index
assets/1.0.2/dump.cs.index.json --ipa assets/1.0.2/Kiou-1.0.2.ipa:
32 / 33 sites pass (the pre-existing HeaderProvider verification
skip is unrelated — index-lookup misses the fully-qualified type
name).
0x5C3C29C SyncItemListReply.InternalMergeFrom
0x5C458C4 UpdateCollectionPresetReply.InternalMergeFrom
0x5CACEF8 GameServiceClient.SelectCharacterAsync
0x5C2C034 SelectCharacterReply.InternalMergeFrom
0x5B51C3C ShogiMatchingPlayerStatus.InternalMergeFrom
0x5C06590 GetShogiHistoryDetailListReply.InternalMergeFrom
0x5C05FF0 GetShogiHistoryDetailListReply.get_IsPremiumUser
0x585E000 KifuDetailModel.IsPremiumUser
0x582E614 CharacterVoicePlayer.SatisfiesRule
0x584DB64 CharacterVoiceScrollerCellModel.get_IsLocked
0x597E608 BeginnerSupportEvaluator.ctor
0x5980890 BeginnerSupportEvaluator.EnsureInitializedLocked
0x5942AA0 ResolvedBeginnerSupport.get_Enabled
0x5942AC0 ResolvedBeginnerSupport.get_Depth
0x5AA4054 HomeUtilityPresenter.ctor
0x5DD7F54 UIButtonBase.OnPointerClick
0x5DD2874 TitleScene+<OnActivateAsync>d__10.MoveNext
GAME_ORCHESTRATOR_IS_AFK is intentionally NOT ported to a CAVE_ENTRY
on 1.0.2. KiouForge's build already patches that site inline via
AFK_SITE / AFK_ORIG_8 to force IsAfkEnabled -> false, and a KiouEditor
1.0.2 build that wants feature-flag-gated AFK toggling would crash on
first call unless KiouForge simultaneously publishes the cave slot
(BLR to null slot pointer). Migrating 1.0.2 AFK to a cave will land
in a follow-up PR that coordinates with a KiouForge update.
Also drops tools/__init__.py — PEP-420 namespace packages let
python -m tools.check_recipes resolve without it, and its presence
was shadowing the sibling shared/tools/ package on consumer builds.
Verified: python -m tools.check_recipes still passes locally
(HOOK_IDS=34 ENTRY_SLOT_INDEX=29 sites=60).
Not addressed in this PR:
- C-side catalog RVAs for the KiouEditor sites in KIOUHook.h /
KIOUHook.m are still pinned to 1.0.1 (via the KIOU_HOOK_RVA_*
macros). On chinlan builds this is inert (the dispatcher's
g_inject_entry table drives hook dispatch, not the catalog
RVAs), so the recipe port here is sufficient for the primary
consumer (KiouEditor chinlan). Direct-ABI callouts from
Hook/AssistTune.m and Hook/FriendUnhide.m (SetHashSize /
GameObject.GetComponent / RectTransformUtility.WorldToScreenPoint)
WILL land at wrong addresses on a 1.0.2 build until the catalog
gains version-aware dispatch — track that as a follow-up.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Retires the AFK_SITE inline patch on 1.0.2 in favour of a CAVE_ENTRY
so both 1.0.1 and 1.0.2 route GameOrchestrator.IsAfkEnabled through
the same hook-body path.
Recipe changes (recipes/v1_0_2.py):
- AFK_SITE / AFK_ORIG_8 -> None / "" (drops the inline
`MOVZ W0, #0; RET` patch)
- GAME_ORCHESTRATOR_IS_AFK row added to SITES (CAVE_ENTRY at
0x594A034, prologue f44fbea9)
To keep the "AFK is always off" behaviour KiouForge relied on
without pulling in the KIOUEditor feature-flag surface, KIOU-Hook
now exposes a thin convenience installer:
void KIOUAfkDisableAlwaysFalseInstall(uintptr_t unityBase);
It publishes a static `return false` hook body into the cave's
entry slot. One call from a consumer's Tweak.m is enough to
restore the historic behaviour. The feature-flag-gated variant
(KIOUEditorInstallAfkDisableHook in Hook/AfkDisable.m) is
unchanged.
**Coordinated rollout required.** Once this lands on main, any
consumer that chinlan-patches with the updated recipe will get
the AFK cave inserted. Consumers MUST publish the AFK cave slot
before their patched IPA runs, or the first IsAfkEnabled call
BLR-jumps to a null slot pointer and crashes. KiouForge's
companion change (call `KIOUAfkDisableAlwaysFalseInstall` from
its Tweak.m + submodule bump) is expected to land in the same
window as this PR.
Verified with:
python -m tools.check_recipes -> 61 sites (was 60)
TARGET_VERSION=1.0.2 python -m tools.verify_sites ... ->
33/34 rows pass (the pre-existing HeaderProvider miss is the
lone FAIL, unrelated).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This was referenced Jul 1, 2026
tkgstrator
added a commit
that referenced
this pull request
Jul 27, 2026
feat: port KiouEditor sites to 1.0.2 + migrate AFK to CAVE_ENTRY
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two related deliveries bundled together so 1.0.2 chinlan builds route every hookable site through the same
CAVE_ENTRYpath (no moreAFK_SITEspecial case):recipes/v1_0_2.py— RVAs verified againstassets/1.0.2/dump.cs, prologues extracted fromassets/1.0.2/Kiou-1.0.2.ipa.GameOrchestrator.IsAfkEnabledfrom the historicAFK_SITEinline patch to aCAVE_ENTRY, matching v1_0_1's shape, and shipKIOUAfkDisableAlwaysFalseInstall(unityBase)so consumers that just want the "AFK is always off" behaviour can wire the slot with one call.Sites ported to 1.0.2
KIOUAfkDisableAlwaysFalseInstallDrop-in replacement for the retired
AFK_SITEinline patch. Publishes a staticreturn falsehook body into the AFK cave slot. One call from a consumer'sTweak.mrestores the historic "AFK is always off" behaviour without pulling in theKIOUEditorfeature-flag surface. The feature-flag-gated variant (KIOUEditorInstallAfkDisableHookinHook/AfkDisable.m) is unchanged for consumers that want a runtime toggle.🚨 Coordinated rollout required
Once this merges, any consumer that chinlan-patches with the updated recipe gets the AFK cave inserted. Consumers MUST publish the AFK cave slot before their patched IPA runs, or the first
IsAfkEnabledcall BLR-jumps to a null slot pointer and crashes.KiouForge needs a companion change: call
KIOUAfkDisableAlwaysFalseInstall(unityBase)fromTweak.mand bump itsvendor/KIOU-Hooksubmodule pointer to this PR's merge commit. That PR will land in the same window as this one.Verification
python -m tools.check_recipes→HOOK_IDS=34 ENTRY_SLOT_INDEX=29 sites=61TARGET_VERSION=1.0.2 python -m tools.verify_sites ... --ipa Kiou-1.0.2.ipa→ 33/34 rows pass (only the pre-existingProject.Network.HeaderProvider.SetOrUpdateHeaderdump-index lookup miss remains, unrelated to this PR)ruff check recipes/ tools/→ cleanAlso in this PR
tools/__init__.py— PEP-420 namespace packages letpython -m tools.check_recipesresolve without it, and its presence shadowed the siblingshared/tools/package on consumer builds.Not addressed (follow-up)
KIOUHook.h/KIOUHook.mare still pinned to 1.0.1 (via theKIOU_HOOK_RVA_*macros). On chinlan this is inert — the dispatcher'sg_inject_entrytable drives dispatch, not the catalog RVAs. Direct-ABI callouts fromHook/AssistTune.mandHook/FriendUnhide.m(SetHashSize/GameObject.GetComponent/RectTransformUtility.WorldToScreenPoint) will still land at 1.0.1 addresses on a 1.0.2 build until a follow-up PR adds-DKIOU_TARGET_BUILD=12compile-time selection.🤖 Generated with Claude Code