diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7d42a97..3374439 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,21 @@ All notable changes to KiouForge are documented here.
## [Unreleased]
+## [0.3.0] — 2026-10-19
+
+### Added
+
+- **KIOU 1.5.0 support** (CFBundleVersion 22). All hook sites were checked statically against the 1.5.0 `dump.cs` and Mach-O; the `_gameAdapter` / `_stateStore` / `_matchConfig` offsets of the five `IMatchMode` implementations and the `KIFWriteOptions` layout are switched per build, and builds 11 / 12 / 15 are unchanged.
+
+### Changed
+
+- `TARGET_VERSION` now defaults to `1.5.0`; `1.0.1`, `1.0.2` and `1.1.0` remain buildable by passing it explicitly.
+- On 1.5.0 the KIF export goes through `KIFWriter.Write(Position, IReadOnlyList, KIFWriteOptions)`, with the initial position and main line taken from the `RecordManager` that `ParseUSI` returns, because the `Write(RecordManager, KIFWriteOptions)` overload no longer exists. These three methods are addressed by RVA from `dump.cs` rather than through the KIOU-Hook catalog.
+
+### Known issues
+
+- Not verified on a device against KIOU 1.5.0. The static checks pass, but Kifu Autosave (new `KIFWriter.Write` overload, new `KIFWriteOptions` layout) in particular has not run on real hardware yet.
+
## [0.2.2] — 2026-08-01
### Added
diff --git a/Makefile b/Makefile
index bbf17a4..d7b8190 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,7 @@ TARGET_PROCESS := KIOU
TARGET_BUNDLE_ID := com.neconome.shogi
# Override on the command line: make ipa TARGET_VERSION=1.0.2
-TARGET_VERSION ?= 1.1.0
+TARGET_VERSION ?= 1.5.0
DECRYPTED_IPA ?= $(CURDIR)/assets/$(TARGET_VERSION)/Kiou-$(TARGET_VERSION).ipa
# KIOU-Hook selects its per-version RVA header (vendor/KIOU-Hook/rva/) by
@@ -30,9 +30,10 @@ DECRYPTED_IPA ?= $(CURDIR)/assets/$(TARGET_VERSION)/Kiou-$(TARGET_VER
KIOU_BUILD_1.0.1 := 11
KIOU_BUILD_1.0.2 := 12
KIOU_BUILD_1.1.0 := 15
+KIOU_BUILD_1.5.0 := 22
KIOU_HOOK_TARGET_BUILD := $(KIOU_BUILD_$(TARGET_VERSION))
ifeq ($(KIOU_HOOK_TARGET_BUILD),)
-$(error unknown TARGET_VERSION '$(TARGET_VERSION)'; known: 1.0.1 1.0.2 1.1.0)
+$(error unknown TARGET_VERSION '$(TARGET_VERSION)'; known: 1.0.1 1.0.2 1.1.0 1.5.0)
endif
IPA_RECIPE := recipes.__init__
KIOU_HOOK_DIR := $(CURDIR)/vendor/KIOU-Hook
diff --git a/README.ja.md b/README.ja.md
index 453b891..d72dc02 100644
--- a/README.ja.md
+++ b/README.ja.md
@@ -11,8 +11,8 @@
-
-
+
+
@@ -136,13 +136,15 @@ KIOU はオンラインゲームのため頻繁にアップデートされ、古
### 機能 × バージョン対応表
-| 機能 | 1.0.1 (build 11) | 1.0.2 (build 12) | 1.1.0 (build 15) |
-|---|:---:|:---:|:---:|
-| FPS Override | ✓ | ✓ | ✓ |
-| AFK Guard | ✓ | ✓ | ✓ |
-| Analysis Tune | ✓ | ✓ | ✓ |
-| Kifu Autosave | ✓ | ✓ | ✓ |
-| **アカウント切り替え** | — | ✓ | ✓ |
+| 機能 | 1.0.1 (build 11) | 1.0.2 (build 12) | 1.1.0 (build 15) | 1.5.0 (build 22) |
+|---|:---:|:---:|:---:|:---:|
+| FPS Override | ✓ | ✓ | ✓ | ✓ |
+| AFK Guard | ✓ | ✓ | ✓ | ✓ |
+| Analysis Tune | ✓ | ✓ | ✓ | ✓ |
+| Kifu Autosave | ✓ | ✓ | ✓ | ✓ |
+| **アカウント切り替え** | — | ✓ | ✓ | ✓ |
+
+1.5.0 (build 22) は実機で未検証です。フックサイトと構造体オフセットは 1.5.0 の `dump.cs` と Mach-O に対する静的な確認のみで、とくに Kifu Autosave は別の `KIFWriter.Write` オーバーロードを経由するため、実機で動かすまでは未確認として扱ってください。
アカウント切り替えは 1.0.2 で追加されたフックサイトが必要なため、1.0.1 では非対応です。アドレスはどの配布形式でもビルド時に `TARGET_VERSION` で決まります。Patched IPA はレシピを、dylib は対応する RVA ヘッダを選択します。
@@ -150,7 +152,7 @@ KIOU はオンラインゲームのため頻繁にアップデートされ、古
| | |
|---|---|
-| **最新対応 KIOU** | `1.1.0`(CFBundleVersion 15) |
+| **最新対応 KIOU** | `1.5.0`(CFBundleVersion 22) |
| **KIOU の最低 iOS バージョン** | 10.0(アプリの `MinimumOSVersion`) |
| **KiouForge の最低 iOS バージョン** | 13.0(`UIWindowScene` が必要) |
| **動作確認済み** | iOS 15.0 〜 26、arm64 |
@@ -187,9 +189,9 @@ TrollStore が使えないデバイス向けです。[Sideloadly](https://sidelo
**復号済み** の KIOU IPA が必要です([palera1n](https://palera.in/) + Filza または [TrollDecrypt](https://github.com/donato-fiore/TrollDecrypt) で取得できます)。App Store からダウンロードした IPA は FairPlay で暗号化されているため、そのままでは使用できません。
```sh
-# デフォルト(1.1.0)
-mkdir -p assets/1.1.0
-cp ~/Downloads/Kiou-1.1.0.ipa assets/1.1.0/
+# デフォルト(1.5.0)
+mkdir -p assets/1.5.0
+cp ~/Downloads/Kiou-1.5.0.ipa assets/1.5.0/
make ipa
# -> packages/ipa/KiouForge-patched.ipa
@@ -201,8 +203,8 @@ make ipa TARGET_VERSION=1.0.2
```sh
# 特定バージョンの dump + IPA でレシピを検証
-PYTHONPATH=shared:vendor/KIOU-Hook TARGET_VERSION=1.1.0 python3 -m tools.verify_sites \
+PYTHONPATH=shared:vendor/KIOU-Hook TARGET_VERSION=1.5.0 python3 -m tools.verify_sites \
--recipe recipes \
- --index assets/1.1.0/dump.cs.index.json \
- --ipa assets/1.1.0/Kiou-1.1.0.ipa
+ --index assets/1.5.0/dump.cs.index.json \
+ --ipa assets/1.5.0/Kiou-1.5.0.ipa
```
diff --git a/README.md b/README.md
index 588ed6c..a0adb6c 100644
--- a/README.md
+++ b/README.md
@@ -11,8 +11,8 @@
-
-
+
+
@@ -179,13 +179,18 @@ server-side. The recommended target is always the **latest supported version**.
### Feature × version matrix
-| Feature | 1.0.1 (build 11) | 1.0.2 (build 12) | 1.1.0 (build 15) |
-|---|:---:|:---:|:---:|
-| FPS Override | ✓ | ✓ | ✓ |
-| AFK Guard | ✓ | ✓ | ✓ |
-| Analysis Tune | ✓ | ✓ | ✓ |
-| Kifu Autosave | ✓ | ✓ | ✓ |
-| **Account Switching** | — | ✓ | ✓ |
+| Feature | 1.0.1 (build 11) | 1.0.2 (build 12) | 1.1.0 (build 15) | 1.5.0 (build 22) |
+|---|:---:|:---:|:---:|:---:|
+| FPS Override | ✓ | ✓ | ✓ | ✓ |
+| AFK Guard | ✓ | ✓ | ✓ | ✓ |
+| Analysis Tune | ✓ | ✓ | ✓ | ✓ |
+| Kifu Autosave | ✓ | ✓ | ✓ | ✓ |
+| **Account Switching** | — | ✓ | ✓ | ✓ |
+
+1.5.0 (build 22) has not been verified on a device yet: the hook sites and
+struct offsets were checked statically against the 1.5.0 `dump.cs` and Mach-O
+only. Kifu Autosave in particular goes through a different `KIFWriter.Write`
+overload there, so treat it as untested until it has run on a real device.
Account Switching requires hook sites introduced in 1.0.2. Every build shape
pins its addresses at build time via `TARGET_VERSION`: the Patched IPA picks
@@ -195,7 +200,7 @@ the recipe, and the dylib picks the matching RVA header.
| | |
|---|---|
-| **Latest supported KIOU** | `1.1.0` (CFBundleVersion 15) |
+| **Latest supported KIOU** | `1.5.0` (CFBundleVersion 22) |
| **KIOU minimum iOS** | 10.0 (`MinimumOSVersion` in app bundle) |
| **KiouForge minimum iOS** | 13.0 (requires `UIWindowScene`) |
| **Tested on** | iOS 15.0 – 26, arm64 |
@@ -238,9 +243,9 @@ Filza, or [TrollDecrypt](https://github.com/donato-fiore/TrollDecrypt)). The
App Store download is FairPlay-encrypted and cannot be patched directly.
```sh
-# default (1.1.0)
-mkdir -p assets/1.1.0
-cp ~/Downloads/Kiou-1.1.0.ipa assets/1.1.0/
+# default (1.5.0)
+mkdir -p assets/1.5.0
+cp ~/Downloads/Kiou-1.5.0.ipa assets/1.5.0/
make ipa
# -> packages/ipa/KiouForge-patched.ipa
@@ -252,9 +257,9 @@ Before building after editing hook sites or after a KIOU update:
```sh
# verify current recipe against a specific version's dump + IPA
-PYTHONPATH=shared:vendor/KIOU-Hook TARGET_VERSION=1.1.0 python3 -m tools.verify_sites \
+PYTHONPATH=shared:vendor/KIOU-Hook TARGET_VERSION=1.5.0 python3 -m tools.verify_sites \
--recipe recipes \
- --index assets/1.1.0/dump.cs.index.json \
- --ipa assets/1.1.0/Kiou-1.1.0.ipa
+ --index assets/1.5.0/dump.cs.index.json \
+ --ipa assets/1.5.0/Kiou-1.5.0.ipa
```
diff --git a/Sources/KiouForge/Internal.h b/Sources/KiouForge/Internal.h
index 793c2d0..b1a68ce 100644
--- a/Sources/KiouForge/Internal.h
+++ b/Sources/KiouForge/Internal.h
@@ -68,17 +68,49 @@ typedef struct {
// in X2 so we can pick the right `_gameAdapter` field offset on `self` and
// recover the live GameController without guessing.
//
-// Reference (dump.cs):
-// AIMatchMode _gameAdapter @ 0x48
-// CPUStreamMode _gameAdapter @ 0x50
-// LocalPvPMode _gameAdapter @ 0x18
-// OnlinePvPMode _gameAdapter @ 0x30
-// RecordReplayMode _gameAdapter @ 0x18
+// Reference (dump.cs, `_gameAdapter` field offset per build):
+// 1.0.1/1.0.2/1.1.0 (11/12/15) 1.5.0 (22)
+// AIMatchMode 0x48 0x38
+// CPUStreamMode 0x50 0x40
+// LocalPvPMode 0x18 0x18
+// OnlinePvPMode 0x30 0x58
+// RecordReplayMode 0x18 0x18
+// 1.5.0 dropped the Sunfish4 / UseRshogi fields from AIMatchMode and
+// CPUStreamMode and grew OnlinePvPMode's heartbeat state, so those three
+// moved (and so did every _stateStore, see below); the other two did not.
//
// The order MUST match _SITES observer rows in recipes/ — the recipe bakes
// each mode index as `MOVZ X2,#imm` in the cave.
// ---------------------------------------------------------------------------
+// IMatchMode subclass field offsets (dump.cs, see the table above).
+// OnlinePvPMode also supplies the MatchConfig the KIF writer reads player
+// names from (OnlinePvPMode _matchConfig); its _stateStore is the 0x50 /
+// 0x28 entry of kKiouMatchModeStateStoreOffsets below.
+#if KIOU_HOOK_TARGET_BUILD >= 22
+#define AIMATCHMODE_OFF_GAME_ADAPTER 0x38
+#define AIMATCHMODE_OFF_STATE_STORE 0x30
+#define CPUSTREAMMODE_OFF_GAME_ADAPTER 0x40
+#define CPUSTREAMMODE_OFF_STATE_STORE 0x38
+#define ONLINEPVPMODE_OFF_GAME_ADAPTER 0x58
+#define ONLINEPVPMODE_OFF_STATE_STORE 0x50 // GameStateStore*
+#define ONLINEPVPMODE_OFF_MATCHCONFIG 0x60 // MatchConfig*
+#else
+#define AIMATCHMODE_OFF_GAME_ADAPTER 0x48
+#define AIMATCHMODE_OFF_STATE_STORE 0x40
+#define CPUSTREAMMODE_OFF_GAME_ADAPTER 0x50
+#define CPUSTREAMMODE_OFF_STATE_STORE 0x48
+#define ONLINEPVPMODE_OFF_GAME_ADAPTER 0x30
+#define ONLINEPVPMODE_OFF_STATE_STORE 0x28 // GameStateStore*
+#define ONLINEPVPMODE_OFF_MATCHCONFIG 0x38 // MatchConfig*
+#endif
+// LocalPvPMode and RecordReplayMode: _stateStore @ 0x10, _gameAdapter @ 0x18
+// on every build.
+#define LOCALPVPMODE_OFF_STATE_STORE 0x10
+#define LOCALPVPMODE_OFF_GAME_ADAPTER 0x18
+#define REPLAYMODE_OFF_STATE_STORE 0x10
+#define REPLAYMODE_OFF_GAME_ADAPTER 0x18
+
// ShogiGameAdapter -> Project.ShogiCore.GameController field offset.
#define KIOU_ADAPTER_OFF_GAMECTRL 0x10
@@ -105,13 +137,26 @@ NSString *KIOUKifTextFromGameController(void *gameCtrl,
void *stateStore,
const char *matchModeTag);
-// KIFWriteOptions field offsets (KIOU 1.0.1 build 11).
+// KIFWriteOptions field offsets (dump.cs, Project.ShogiCore.KIFWriteOptions).
+// 1.5.0 inserted EndingThinkingTimeMicros (0x48) ahead of EndingLabel and
+// appended EndingComment (0x60) / WinnerSide (0x68, Nullable),
+// so the instance now ends at 0x70. Offsets up to TimeRuleLabel are the same
+// on every build.
#define KIFOPTS_OFF_BLACK_PLAYER_NAME 0x10
#define KIFOPTS_OFF_WHITE_PLAYER_NAME 0x18
#define KIFOPTS_OFF_START_DATETIME 0x20
#define KIFOPTS_OFF_MATCH_TITLE 0x30
#define KIFOPTS_OFF_TIME_RULE_LABEL 0x38
+#if KIOU_HOOK_TARGET_BUILD >= 22
+#define KIFOPTS_OFF_ENDING_LABEL 0x58
+// Raw zeroed buffer handed to KIFWriter.Write (see Kif/Helpers.m); padded
+// past the last field for headroom.
+#define KIFWRITEOPTIONS_SIZE 0x80
+#else
#define KIFOPTS_OFF_ENDING_LABEL 0x48
+// Last field (EndingLabel) ends at 0x50; padded to 0x60 for headroom.
+#define KIFWRITEOPTIONS_SIZE 0x60
+#endif
void *KIOUIl2cppStringNew(const char *utf8);
void KIOUKifFillWriteOptions(void *opts,
@@ -157,11 +202,11 @@ NSString *KIOUKifuModeLabel(KiouMatchMode m);
// the observer rows of _SITES in recipes/ — the recipe bakes each index as
// `MOVZ X2,#imm` in the cave.
static const uintptr_t kKiouMatchModeAdapterOffsets[KIOU_MMODE_COUNT] = {
- [KIOU_MMODE_AI_MATCH] = 0x48,
- [KIOU_MMODE_CPU_STREAM] = 0x50,
- [KIOU_MMODE_LOCAL_PVP] = 0x18,
- [KIOU_MMODE_ONLINE_PVP] = 0x30,
- [KIOU_MMODE_RECORD_REPLAY] = 0x18,
+ [KIOU_MMODE_AI_MATCH] = AIMATCHMODE_OFF_GAME_ADAPTER,
+ [KIOU_MMODE_CPU_STREAM] = CPUSTREAMMODE_OFF_GAME_ADAPTER,
+ [KIOU_MMODE_LOCAL_PVP] = LOCALPVPMODE_OFF_GAME_ADAPTER,
+ [KIOU_MMODE_ONLINE_PVP] = ONLINEPVPMODE_OFF_GAME_ADAPTER,
+ [KIOU_MMODE_RECORD_REPLAY] = REPLAYMODE_OFF_GAME_ADAPTER,
};
// IMatchMode self -> _stateStore field offsets. All five IMatchMode
@@ -170,11 +215,11 @@ static const uintptr_t kKiouMatchModeAdapterOffsets[KIOU_MMODE_COUNT] = {
// player names via the same ReactiveProperty path online
// matches use.
static const uintptr_t kKiouMatchModeStateStoreOffsets[KIOU_MMODE_COUNT] = {
- [KIOU_MMODE_AI_MATCH] = 0x40,
- [KIOU_MMODE_CPU_STREAM] = 0x48,
- [KIOU_MMODE_LOCAL_PVP] = 0x10,
- [KIOU_MMODE_ONLINE_PVP] = 0x28,
- [KIOU_MMODE_RECORD_REPLAY] = 0x10,
+ [KIOU_MMODE_AI_MATCH] = AIMATCHMODE_OFF_STATE_STORE,
+ [KIOU_MMODE_CPU_STREAM] = CPUSTREAMMODE_OFF_STATE_STORE,
+ [KIOU_MMODE_LOCAL_PVP] = LOCALPVPMODE_OFF_STATE_STORE,
+ [KIOU_MMODE_ONLINE_PVP] = ONLINEPVPMODE_OFF_STATE_STORE,
+ [KIOU_MMODE_RECORD_REPLAY] = REPLAYMODE_OFF_STATE_STORE,
};
static const char *const kKiouMatchModeTags[KIOU_MMODE_COUNT] = {
diff --git a/Sources/KiouForge/Kif/Helpers.m b/Sources/KiouForge/Kif/Helpers.m
index 640d302..aa320ca 100644
--- a/Sources/KiouForge/Kif/Helpers.m
+++ b/Sources/KiouForge/Kif/Helpers.m
@@ -76,10 +76,8 @@
// addresses come from KIOUHookSiteAddr and follow KIOU_HOOK_TARGET_BUILD
// instead of being pinned to one app version here.
-// KIFWriteOptions instance size needed for the raw-buffer trick. See the
-// KIFOPTS_OFF_* constants in Internal.h for the field map. Last field
-// (EndingLabel) sits at 0x48, ends at 0x50; we pad to 0x60 for headroom.
-#define KIFWRITEOPTIONS_SIZE 0x60
+// KIFWRITEOPTIONS_SIZE (raw-buffer trick) and the KIFOPTS_OFF_* field map
+// live in Internal.h.
// Project.ShogiCore.GameController -> private WinReason k__BackingField at +0x30
// (dump.cs L1484318). The enum is a 4-byte int.
@@ -102,11 +100,8 @@
#define GSS_OFF_BLACK_PLAYER_INFO 0x50 // ReactiveProperty*
#define GSS_OFF_WHITE_PLAYER_INFO 0x58 // ReactiveProperty*
-// Each IMatchMode subclass stores its GameStateStore at a per-mode
-// offset. We currently only walk this for OnlinePvPMode (the only mode
-// where MatchConfig is initialized to placeholders and the real names
-// arrive over the wire).
-#define ONLINEPVPMODE_OFF_STATE_STORE 0x28 // GameStateStore*
+// Each IMatchMode subclass stores its GameStateStore at a per-mode,
+// per-build offset (kKiouMatchModeStateStoreOffsets in Internal.h).
// ReactiveProperty currentValue offset. dump.cs lists every generic
// instantiation as "offset 0x0", so this had to be probed at runtime —
@@ -145,10 +140,33 @@
typedef void *(*KIFWriter_Write_t)(void *record, void *opts);
typedef void *(*Position_ToSFEN_t)(void *position);
+#if KIOU_HOOK_TARGET_BUILD >= 22
+// KIOU 1.5.0 dropped KIFWriter.Write(RecordManager, KIFWriteOptions); only
+// Write(Position initialPosition, IReadOnlyList mainLineMoves,
+// KIFWriteOptions) remains, so the KIF path pulls both out of the
+// RecordManager ParseUSI returned. None of these three has a KIOU-Hook
+// catalog row (KIOU_HOOK_RVA_KIFWRITER_WRITE is 0x0 on 1.5.0), so they are
+// addressed by RVA straight from dump.cs (assets/1.5.0/dump.cs).
+// KIFWriter.Write(Position, IReadOnlyList, KIFWriteOptions) L1176660
+// RecordManager.get_MainLineMoves() (self-only getter) L1176767
+// RecordManager.get_InitialPosition() (self-only getter, Slot 16) L1176776
+#define KIOU150_RVA_KIFWRITER_WRITE3 0x5EA8EBCUL
+#define KIOU150_RVA_RECORD_GET_MAINLINE_MOVES 0x5EACA10UL
+#define KIOU150_RVA_RECORD_GET_INITIAL_POS 0x5EACA28UL
+typedef void *(*KIFWriter_Write3_t)(void *initialPos, void *mainLineMoves,
+ void *opts);
+typedef void *(*RecordManager_Get_t)(void *record);
+static KIFWriter_Write3_t g_KIFWriter_Write3 = NULL;
+static RecordManager_Get_t g_Record_GetInitPos = NULL;
+static RecordManager_Get_t g_Record_GetMoves = NULL;
+#endif
+
static GameCtrl_GetUSIText_t g_GetUSIText = NULL;
static USIParser_ParseUSI_t g_ParseUSI = NULL;
static KIFWriteOptions_Ctor_t g_KIFOpts_Ctor = NULL;
+#if KIOU_HOOK_TARGET_BUILD < 22
static KIFWriter_Write_t g_KIFWriter_Write = NULL;
+#endif
static Position_ToSFEN_t g_PositionToSFEN = NULL;
// KIOUHookSiteAddr returns 0 for a name the catalog doesn't carry; return
@@ -179,10 +197,25 @@ static void resolveIl2cppFunctions(void) {
g_KIFOpts_Ctor = (KIFWriteOptions_Ctor_t)
resolveSite(KIOU_HOOK_NAME_KIFWRITEOPTIONS_CTOR);
}
+#if KIOU_HOOK_TARGET_BUILD >= 22
+ if (!g_KIFWriter_Write3) {
+ g_KIFWriter_Write3 = (KIFWriter_Write3_t)(g_unityBase +
+ KIOU150_RVA_KIFWRITER_WRITE3);
+ }
+ if (!g_Record_GetInitPos) {
+ g_Record_GetInitPos = (RecordManager_Get_t)(g_unityBase +
+ KIOU150_RVA_RECORD_GET_INITIAL_POS);
+ }
+ if (!g_Record_GetMoves) {
+ g_Record_GetMoves = (RecordManager_Get_t)(g_unityBase +
+ KIOU150_RVA_RECORD_GET_MAINLINE_MOVES);
+ }
+#else
if (!g_KIFWriter_Write) {
g_KIFWriter_Write = (KIFWriter_Write_t)
resolveSite(KIOU_HOOK_NAME_KIFWRITER_WRITE);
}
+#endif
if (!g_PositionToSFEN) {
g_PositionToSFEN = (Position_ToSFEN_t)
resolveSite(KIOU_HOOK_NAME_POSITION_TO_SFEN);
@@ -210,9 +243,16 @@ static void resolveIl2cppFunctions(void) {
void *stateStore,
const char *matchModeTag) {
resolveIl2cppFunctions();
+#if KIOU_HOOK_TARGET_BUILD >= 22
+ if (!g_GetUSIText || !g_ParseUSI || !g_KIFOpts_Ctor ||
+ !g_KIFWriter_Write3 || !g_Record_GetInitPos || !g_Record_GetMoves) {
+ return nil;
+ }
+#else
if (!g_GetUSIText || !g_ParseUSI || !g_KIFOpts_Ctor || !g_KIFWriter_Write) {
return nil;
}
+#endif
if (!ptrLooksValid(gameCtrl)) return nil;
// Step 1: GetUSIText(self) → "position startpos moves 2g2f 1c1d ..."
@@ -272,6 +312,23 @@ static void resolveIl2cppFunctions(void) {
// Step 4: KIFWriter.Write(record, opts) → KIF 2.0 string
void *kifStrPtr = NULL;
+#if KIOU_HOOK_TARGET_BUILD >= 22
+ // 1.5.0: Write(initialPosition, mainLineMoves, opts). The moves list is
+ // only passed through (IReadOnlyList*), never read here.
+ @try {
+ void *initPos = g_Record_GetInitPos(recordPtr);
+ void *moves = g_Record_GetMoves(recordPtr);
+ if (!ptrLooksValid(initPos) || !ptrLooksValid(moves)) {
+ IPALog(@"[KIF] record accessor returned null");
+ return nil;
+ }
+ kifStrPtr = g_KIFWriter_Write3(initPos, moves, opts);
+ } @catch (NSException *e) {
+ IPALog([NSString stringWithFormat:
+ @"[KIF] KIFWriter.Write threw: %@", e]);
+ return nil;
+ }
+#else
@try {
kifStrPtr = g_KIFWriter_Write(recordPtr, opts);
} @catch (NSException *e) {
@@ -279,6 +336,7 @@ static void resolveIl2cppFunctions(void) {
@"[KIF] KIFWriter.Write threw: %@", e]);
return nil;
}
+#endif
if (!ptrLooksValid(kifStrPtr)) {
IPALog(@"[KIF] KIFWriter.Write returned null");
return nil;
@@ -591,7 +649,7 @@ static void resolveIl2cppFunctions(void) {
// `opts` is not a managed object (klass header is NULL — see
// Helpers.m's raw-buffer trick). il2cpp's GC therefore does not
// treat the il2cpp string pointers we store at offsets 0x10 / 0x18 /
-// 0x30 / 0x38 / 0x48 as roots. The strings remain live across
+// 0x30 / 0x38 / ENDING_LABEL as roots. The strings remain live across
// KIFWriter.Write only because Unity's Boehm conservative GC scans
// the running threads' stacks for pointer-shaped values, and the
// call is short enough (microseconds) that a GC pass during it is
@@ -788,14 +846,15 @@ void KIOUKifFillWriteOptions(void *opts,
@" +0x28 (StartDT hi) = 0x%016llx\n"
@" +0x30 (Title) = 0x%016llx\n"
@" +0x38 (TimeRule) = 0x%016llx\n"
- @" +0x48 (Ending) = 0x%016llx",
- *(unsigned long long *)(base + 0x10),
- *(unsigned long long *)(base + 0x18),
- *(unsigned long long *)(base + 0x20),
- *(unsigned long long *)(base + 0x28),
- *(unsigned long long *)(base + 0x30),
- *(unsigned long long *)(base + 0x38),
- *(unsigned long long *)(base + 0x48));
+ @" +0x%x (Ending) = 0x%016llx",
+ *(unsigned long long *)(base + KIFOPTS_OFF_BLACK_PLAYER_NAME),
+ *(unsigned long long *)(base + KIFOPTS_OFF_WHITE_PLAYER_NAME),
+ *(unsigned long long *)(base + KIFOPTS_OFF_START_DATETIME),
+ *(unsigned long long *)(base + KIFOPTS_OFF_START_DATETIME + 8),
+ *(unsigned long long *)(base + KIFOPTS_OFF_MATCH_TITLE),
+ *(unsigned long long *)(base + KIFOPTS_OFF_TIME_RULE_LABEL),
+ KIFOPTS_OFF_ENDING_LABEL,
+ *(unsigned long long *)(base + KIFOPTS_OFF_ENDING_LABEL));
}
// ---------------------------------------------------------------------------
diff --git a/Sources/KiouForge/Kif/Writer.m b/Sources/KiouForge/Kif/Writer.m
index 20e7b4e..b6fc5c8 100644
--- a/Sources/KiouForge/Kif/Writer.m
+++ b/Sources/KiouForge/Kif/Writer.m
@@ -99,9 +99,6 @@
// Either being off skips emission silently.
// ===========================================================================
-#define ONLINEPVPMODE_OFF_STATE_STORE 0x28
-#define ONLINEPVPMODE_OFF_MATCHCONFIG 0x38
-
static void *kf_resolveGameController(void *self, uint32_t mode_index) {
if (mode_index >= KIOU_MMODE_COUNT) {
IPALog([NSString stringWithFormat:
diff --git a/control b/control
index 091f645..9009c98 100644
--- a/control
+++ b/control
@@ -1,6 +1,6 @@
Package: work.tkgstrator.kiouforge
Name: KiouForge
-Version: 0.2.2
+Version: 0.3.0
Architecture: iphoneos-arm64
Description: KIOU (Shogi) local quality-of-life tool. Extends the frame-rate preset beyond 30/60, suppresses false AFK warnings during long-think sessions, and lets you tune the depth and hash used by the on-device post-game kifu analysis engine. Runs entirely client-side and never modifies any server-stored data. For authorized testing only.
Maintainer: NEVER KNOWS BEST
diff --git a/vendor/KIOU-Hook b/vendor/KIOU-Hook
index 8ab5868..91269cf 160000
--- a/vendor/KIOU-Hook
+++ b/vendor/KIOU-Hook
@@ -1 +1 @@
-Subproject commit 8ab586811f017520fe185631bc238c551d711adc
+Subproject commit 91269cf23ccfe71e807ff2fc77b2a706bc763cef