Files
WoW-Hybrid-gateway/docs/NATIVE_CLIENT_FEASIBILITY.md
praxisandClaude Fable 5.2 60b6d4b7a5 Design records
59 files, from working commit b1a079a.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-19 01:32:48 +02:00

283 lines
20 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Native Forever client compatibility assessment
Current implementation evidence superseding the earlier queue unknowns:
`ENGINE_SESSION_BOUNDARY.md` and `NATIVE_ROSTER_HANDOFF.md`. A real native frame
host and genuine in-process Turtle roster delivery to Forever's main-thread
copied queue are verified. Engine account/realm/transport adoption and native
character selection/world entry remain incomplete. This is not a playable-client
compatibility claim; the earlier gateway fallback is preserved.
2026-10-15. Target remains actual64-bit WowB1.60.1.70334. LocalTortoise is
an implementation reference, **not evidence of live Octo protocol equivalence**.
No live realm, production login, launcher startup or launcher modification was used.
## Findings before architectural changes
| Question | Evidence and present conclusion |
|---|---|
| Are memory hooks required for account authentication? | Not established. The existing watcher changes a client-side Ed25519 trust key for the modern world-channel handshake. It does not change SRP credentials/proofs or grant server authorization. Turtle SRP is separately implemented and verifies M2. A direct Turtle session can avoid this modern handshake; connecting it to Forever's login state machine is still engine work. |
| Can the gateway be embedded? | Its bounded parsers, serializers, GUID translation, SRP and legacy session implementation can run in a library. The current executable cannot simply be embedded unchanged: it uses a local Forever auth DB, external world-auth provider, loopback listeners, POSIX poll and fork/exec serializer helpers. |
| Is Forever client source available? | Actual Lua/XML/assets and extracted client data are available. Trinity is server source. WoWee/manila are reference clients, not Forever engine source. No matching Forever C++ engine source was found. Compiled WowB.exe imports only WowB_loader.dll ordinal1 on disk; runtime networking cannot be inferred from a normal executable Winsock IAT alone. |
| Is an executable patch required? | Not proved. On this Wine system a process-local ELF module can be loaded for an isolated launch without changing PE bytes. This is a Wine development technique, not a portable Windows plugin API. Engine dispatch/login hooks or reproducible patches may still be required. |
| Can the official launcher start another executable? | Installed1.4.3 code has OCTO_GAME_EXE, OCTO_LOADER_EXE, OCTO_WINE_WRAPPER/OCTO_LAUNCH_WRAPPER and OCTO_LAUNCH_WRAPPER_ARGS. It also verifies mods, prepares its login route, rewrites config and may patch the expected32-bit WoW.exe. Therefore custom launch selection exists, but safe Forever integration is unverified. No launcher protection was disabled. |
The native proof must not be called playable compatibility until the actual
Forever engine consumes the translated roster/world, displays and controls the
Turtle character without the external gateway. A DLL that authenticates in the
same process is an intermediate result only. Native unit tests or an independent
library's backend world login cannot prove Forever engine world entry.
## Authentication layers and trust
`/usr/local/bin/forever70334-autopatch::table_state`, `find_table`,
`guarded_patch_fd` validate a12-entry/40-byte CertStore and replace only group8's
32-byte public key in the original working process. The system service targets
one exact original executable path. Leave it intact. No private key or account
secret is embedded in the watcher. This is server-identity trust adaptation for
the local modern handshake, distinct from server-side client-integrity checks.
Forever server `src/server/game/Server/WorldSocket.cpp::SendEnterEncryptedMode`
selects the Ed25519 RegionGroup. `AuthPackets.cpp::EnterEncryptedMode::Write`
serializes/signs that transition. HTTPS login/tickets and account SRP are covered
by existing `docs/ARCHITECTURE.md` and `LOCAL_INTEGRATION.md`. Gateway
`Provider::key` reads only the authorized local frontend account's session key;
`derive` establishes the independent modern GCM contexts. None is an appropriate
production dependency for a native Turtle client.
Turtle `src/realmd/AuthSocket.cpp::_HandleLogonChallenge`, `_HandleLogonProof`,
`VerifyVersion` and `src/game/WorldSocket.cpp` implement a different SRP256/auth
and world-session/header-cipher protocol. `src/legacy_client.cpp::LegacySession`
performs real SRP, validates M2 and world auth. The preserved gateway constructor uses explicit local
ports. The new LegacyLogin/native discovery API retrieves the genuine realm list
before selection; this local profile uses logon7272/world5875. Existing local server build hashes are unset, which its own
`VerifyVersion` treats as unavailable. This **does not attest Forever client files**
or establish acceptance by another server with populated integrity requirements.
Unsupported PIN/security/Warden/integrity challenges remain failures. Native work
must surface them rather than spoof approved client-file proofs.
## Component migration
| Component | Reusable code | Required host/engine work |
|---|---|---|
| Turtle account auth | protocol.cpp, srp.cpp, LegacySession | Secure credential UI/callback, explicit endpoint policy, realm-list negotiation. Remove frontend-provider dependence. |
| Modern frontend auth bridge | relay.cpp Provider/derive/Instance | Transitional reference only. Direct mode needs a legitimate local session state in the engine after real Turtle auth, not forged external tickets. |
| Realm/world sessions | legacy_client.cpp, protocol codecs | Event-loop integration, cancellation, reconnect, engine login/realm lifecycle and instance assumptions. |
| Opcodes/framing/encryption | forever.cpp, legacy_client.cpp | Intercept semantic plaintext dispatch boundaries; using raw Winsock alone still leaves modern auth and completion semantics. |
| Character/GUID mapping | roster_translation.cpp, world.cpp | Call/replace actual70334 roster/login packet handlers with matching ownership/thread rules. |
| Object updates | object_updates.cpp plus source-derived native serializer | Link serializer code as a library; fork/exec per update is unsuitable for a native implementation. Retain schema/hash checks. |
| Player/NPC movement | world.cpp, splines.cpp | Feed engine receive dispatcher; intercept outbound movement at its existing send boundary. Keep Turtle authoritative. |
| Gameplay/state | gameplay.cpp, reputation.cpp, talents.cpp | Reuse codecs and acknowledged-state rules; replace network transport, not gameplay authority. |
| Spells/client data | turtle_data.py, compare_gameplay_data.py | Actual DB2 conversion, ID collision handling, custom icons/visuals/effects, engine spell API compatibility remain required. |
| UI | owned GatewayDiagnostics Turtle provider/adapter | Retain original native frame. Replace reserved chat transport with an in-process bounded callback/API once a safe engine Lua registration point is known. |
The preferred reusable boundary is an engine-independent session/translation
library with explicit host callbacks, not duplicate implementations for gateway
and native mode. Preserve gateway tests as oracle fixtures. Keep credentials,
keys and raw auth packets out of diagnostics. Never allow C++ exceptions across
a C ABI or let a network thread mutate UI/game objects directly.
## Approaches
1. **Client source:** best maintainability if matching engine source becomes
available; currently only UI/data are accessible. Do not substitute reference
open-source clients for WowB.
2. **Disposable executable patches:** deterministic SHA/expected-byte manifests,
relocation-aware loading and rollback can be built. More version-sensitive;
no patch is justified before identifying concrete engine entry points.
3. **In-process library:** largest codec reuse. Wine-native ELF is a practical
first laboratory host for existing POSIX/OpenSSL code; Windows needs a native
socket/build/crypto deployment path. It does not by itself replace engine auth.
4. **Native networking handlers:** eventual clean boundary. Requires identifying
actual unpacked login/session creation, receive dispatch and send functions,
allocator ownership and main-thread queue. These interfaces are not mapped yet.
5. **External gateway:** keep operational for regression and packet evidence.
Native work should remove mandatory external translations, not discard that oracle.
## Launcher evidence and limitations
The official [open-source announcement](https://forge.octowow.st/forum/viewtopic.php?t=156)
links its inspectable launcher project. The [upstream README](https://octowow.st/git/OctoWoW/OctoLauncher/raw/branch/main/README.md)
describes its updater/config/mod responsibilities. Those upstream pages are
older than installed1.4.3 and do not establish the installed launch contract.
Read-only extraction of installed `resources/app.asar/out/main/index.js` found
main-bundle SHA256 `d34c7865bf825a752a035ebaa9946b96606ead5b66c5d819175369ac1b4a684e`.
`gameExeName`, `loaderExeName`, `wrapperBin`, `resolveLaunch` and
`launcherRouter.start` establish the environment overrides above. The latter
calls `Mods.verify`, `preparePrivateRoute`, `patchConfig` and sometimes
`patchExecutable` before spawning. Updater paths still refer to WoW.exe.
VanillaFixes/mod DLLs from the32-bit client cannot be assumed compatible with64-bit
Forever. Do not point the normal launcher updater at the preserved Forever tree.
A separate local startup wrapper is the safer first integration experiment.
Official launcher launch/verification behavior remains untested against Forever.
## Initial native experiment and acceptance gates
Build a shared process-local backend session using the **existing** legacy SRP,
framing and roster code. A bounded opt-in Wine bootstrap can authenticate and
collect local world packets in the WowB process without modifying its executable.
All outputs/working copies stay in gateway. No loader code, credentials or API
claims should be called complete without actual execution evidence.
Success gates are separate: module loads in the real WowB PID; real authorized
SRP/M2/world auth; real roster; engine character selection; engine character login
and world entry; NPC/player movement; gameplay. Stop the external gateway only
for the controlled test interval, then restore fallback. Verify process/socket
ownership and capture evidence for each gate. A backend-only login does not pass
the engine gates. No live Octo compatibility claim is in scope.
## Executed process-local milestone
The shared library and opt-in ELF bootstrap compiled with the existing C++20
codec/session sources. On2026-10-15 actual WowB PID1085193 mapped both libraries
from the gateway build. The original and disposable PE files remained byte-identical.
The original gateway PID1078458 was stopped and absent for this experiment.
Within WowB, the library completed real local SRP/M2 and world authentication,
enumerated4 Turtle characters, logged in disposable4509 at level60, and received
19 backend world packets including14 object creations. Authoritative map0
position was(-8914.02637,-209.304962,82.9930573), beside the real trainer.
Evidence: [native-inprocess-backend-proof.json](evidence/gameplay/native-inprocess-backend-proof.json).
This is **backend-in-WowB verification only**. No translated roster/world packet
was delivered to Forever's engine. `engine_world_entry=false` is intentional.
The client did not independently display/control that character through this
native path. No engine code, CertStore, original executable, launcher or OS
security policy was patched. The proof did not use MariaDB/provider credentials.
`native/session.h` is an exception-free C ABI over the existing `LegacySession`.
`native/session.cpp` bounds local connection parameters, binds owned roster GUIDs,
parses backend world/object updates and fails on unsupported integrity challenges.
The initial host is Wine/Linux; these ELF binaries are not Windows PE DLLs.
`ops/native_local_test.py` prepares the isolated copy, records gateway flags,
launches the opt-in module, verifies PID/mappings and restores fallback. Only
archive data is shared for reads; no updater is launched. Credentials/configs
and runtime logs remain ignored and private. Normal test shutdown/save is used;
modern logout lifecycle translation itself remains incomplete.
The original client/gateway fallback was restored after the experiment. All8
CTest entries pass in debug and ASan/UBSan builds, including native ABI parameter,
null-session and failure-output checks. Python ctypes additionally validates the
exported C symbols in the ordinary build. These do not pass the engine gates.
## Concrete engine investigation boundary
`ops/native_netclient_audit.py` reuses earlier code-only captures instead of
redumping authentication memory. Five independently addressed4096-byte pages
establish snapshot base0x141e45000. PE unwind bounds and RIP string references
identify these candidates, **not callable API signatures**:
- 0x141e46020–0x141e462af references “Opening game realm connection” and checks
state2 at object+0x98 before storing4. This confirms a native state-machine
requirement beyond simply opening a Turtle socket.
- 0x141e48de0–0x141e48f4c searches four connection pointers beginning at object+0x1a0.
- 0x141e46f60 matches a connection and begins constructing an event, but part of
its captured following page is still encoded/uninitialized. Treat its body,
calling convention and ownership requirements as unverified.
The missing implementation is a validated70334 engine/main-thread receive queue
and login-state bridge, plus an outbound send interception point. A roster or
world packet cannot safely be passed to an arbitrary function inferred from a
string reference. No unknown function was invoked and no client was deliberately
crashed to discover an ABI. Code/data replacement remains possible; the current
module establishes a reuse/load/auth boundary, not a finished direct client.
The final restored original client was observed in the Hall of Arms at level60.
Its native talent frame and the fresh Turtle packet state agreed on36 unspent
points and acknowledged rank spells12664,12679,12658,16466. The additional Rend
rank2 is recorded as current observed state, not claimed as part of the earlier
automated13-point allocation. The gateway and native-frame UI remain the working
fallback. See the restored-state JSON/screenshot in `docs/evidence/gameplay`.
## Callable serializers,2026-10-15 continuation
`src/forever_create.cpp::source_forever_serialize` now returns bytes directly.
The generated/pinned70334 serializer code is linked into
`build/forever-schema/libforever_codec.so`; `native/serializer.h` exposes a
bounded, exception-contained C ABI with caller-owned buffers and explicit
per-call talent options. Only two C symbols are exported. This library creates
no sockets or subprocesses, reads no environment options or databases, and calls
no engine functions. It is a reusable codec dependency, not an embedded relay.
`src/forever_codec_cli.cpp` preserves the gateway's command-line oracle using
that same library. The gateway process and transport architecture remain intact.
Reproduce with `python3 ops/build_forever_create.py`, then
`python3 tests/native_serializer_test.py`. Seven existing fixture groups now
also run directly through ctypes, including self/items/skills, creatures,
game objects, templates, real captured splines, vendors, gossip, melee and spell
events. ABI error/bounds checks and72 parallel calls pass. Fixed public packets
also match the saved pre-change executable when it is available. All8 existing
CTest entries pass. An unchanged serializer rebuild took0.077s and compiled or
linked nothing. See `evidence/gameplay/native-serializer-tests.json` for local
microbenchmarks. They isolate serialization/process-launch cost; they do not
measure game latency, gateway end-to-end overhead or native world entry.
The actual client re-entered the Hall of Arms through the preserved gateway
after this change. Screenshots of level60/player/nearby trainers were reviewed;
the four generic UI groups are recorded as captures, not feature assertions.
No talent purchase/reset or position change was requested in this regression.
The diagnostic-parent restart exposed two real automation gaps: the Wine
process can precede its KWin window, and an unsuccessful first modern world
handshake can return to idle login without a Disconnected modal. The session
controller now polls window discovery for at most30s and permits guarded login
retry only after continuously recognizing login for the existing5s retry
interval. Actual recovery passed login→ruleset→login→characters→loading→world.
The trust-key service and OS process-security settings were left unchanged.
## Verified realm discovery and startup correction
The incomplete experimental installation was found to select the wrong
StartupFiles schema after the original backend proof. That proof remains
backend-only; it did not establish successful engine startup. See
[STARTUP_SCHEMA_RECOVERY.md](STARTUP_SCHEMA_RECOVERY.md) for the complete private
archive clone, byte-identical executable/data controls and actual login readiness.
In the corrected full clone, actual WowB PID1110676 stayed at its genuine login
screen with no new schema crash while the external gateway was absent. Its
process-local module completed legitimate SRP/M2, requested0x10 realm discovery,
received ThunderClan Warriors at127.0.0.1:8090, selected that actual endpoint,
authenticated the world session, received4 characters and logged in disposable
4509 at level60. It collected30 backend packets/12 object creates. The test
session was then closed; this report is historical proof, not a retained engine
connection. `engine_world_entry=false` remains explicit.
`LegacyLogin` owns and wipes the verified key internally. `LegacySession` shares
it only internally for selected-world authentication; no key is exported across
the C ABI. `turtle_realm_list` follows local AuthSocket::LoadRealmlist exactly:
unused32,count8,type32,flags8,name/address NUL strings,population float32,
character-count/category/trailing-byte8, trailer16=2. The trailing byte is0 in
this server and is **not its database realm ID**. Metadata is retained unchanged.
Offline, malformed and non-loopback endpoints fail closed without DNS or silent
rewriting. Multiple realms are supported by the C API/independent fixture; the
bootstrap auto-selects only the single local online realm or an explicit unique
preference. Manual engine/UI realm selection is not implemented.
Only the disposable local realm1's advertised host was changed to127.0.0.1 to
make this real-discovery test local. Previous metadata and guarded rollback SQL
are in `recovery/native-local-realm-loopback`. No realm build, progression rule,
authentication requirement, character record or server schema was changed.
All11 CTest entries pass in ordinary and ASan/UBSan builds, including fragmented
independent SRP, invalid proofs/M2, realm discovery, offline/public selection
rejection and selected-world authentication. Actual invalid-credential entry
through Forever's UI and engine adoption of this session remain unverified.
The loose-file read-only Glue probe did not emit its loaded marker; it is not
claimed to intercept the login UI. Matching Lua source alone does not establish
that the engine loads an override from disk.
## Windows main-thread observer after startup repair
The complete private archive installation and a separate CoW Wine prefix now
support a minimal Windows PE observer DLL. Actual WowB1127860 completed local
SRP/M2/realm discovery with the gateway absent and separately forwarded one real
C_Login.IsLoginReady invocation on its engine thread, retaining its result and
Lua stack. A subsequent real empty-credential guard remained functional.
No Lua provider namespace, engine session adoption or native world entry is
claimed. The attempted Lua table allocation did not return and was removed from
the default observer. See [NATIVE_ENGINE_LOGIN.md](NATIVE_ENGINE_LOGIN.md) for the
actual addresses, failed experiments, safe tested boundary and rollback.
All13 tests passed in ordinary and ASan/UBSan builds; actual Windows shim
execution was verified in the normal client, not under sanitizers.