59 files, from working commit b1a079a. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
13 KiB
Forever70334 session and packet ownership investigation
Latest follow-up: NATIVE_SESSION_LIFECYCLE.md records the real transport-listener
ownership/callback path, separate world-authentication data provider, retained
authenticated backend lifetime and two actual-client tests. Native character
selection/world entry still remain unverified. The Windows-thread packet host
described as a prerequisite below has since been implemented and verified.
This continues checkpoints6261eaf/5cc5fe2. Direct native engine authentication and world entry are not implemented or verified. The live observations below used an explicitly labelled local gateway reference session. No Lua callback registration was enabled, no engine method was called from the inspector, and no account/connection success flags were written.
Live object and callback discovery
ops/debug_client_owner.py serve-clean-copy launches the complete, pinned
disposable client with the restored private graphics dependency and without the
native bootstrap/DLL. The diagnostic parent owns its child under normal process
permissions. serve-reference-copy additionally uses the existing authorized
local trust-key watcher; it still installs no callback hooks.
The fixed inspect-engine-session request runs ops/engine_session_inspect.py.
It reads only known public structure fields and registered image pointers,
rejects oversized/changing registry containers, and never exports arbitrary heap
pointers, credentials, keys or packet contents. Source tests cover bounds, changed
containers, invalid objects and exception-message redaction.
The actual registry at0x147ed91e8 held27 descriptor pointers. A clean login screen had NetClient state2 and four empty connection slots. After legitimate reference authentication/character selection it had state5 and slots0/1 present, with25 receive callbacks executable. Initially nonexecutable callback addresses were not invoked or forced executable; code captures waited for the genuine path.
The known NetClient pointer slot is0x145e7a098. Its +0xa0 queue pointer was present and the queue's owner pointer matched that same NetClient. Its virtual method at+0x30 was0x141e47960. This independently ties the static dispatcher to a real object and queue; it does not establish an API for constructing a replacement connection or authenticated account.
Actual delivery chain
All addresses require the pinned executable SHA256
c49ce22c3e0aaeb7a7007a5c5cb792e4c3e6cdecc55a1145a5933fc113e3e57f.
Private executable-only captures are retained in runtime/native-handler-code.
- PacketPipe0x141e4c400 assembles a modern plaintext buffer containing the
four-byte opcode followed by payload. It calls0x141e47120 with
(NetClient*, connection*, timestamp32, buffer*, total_size32)and frees a fragmented buffer after return. Compressed-message handling also frees its decoded temporary buffer after the same dispatcher returns. - The dispatcher validates a real connection slot/state/mode, then invokes registry descriptor+0x30. This is the network-side receive callback.
- For example,0x140844ca0 and0x140a23510 submit event0x12 to0x141e54190. Arguments are queue pointer, event type, an unused third argument, NetClient owner, buffer pointer and total byte count. The third argument is not an account/session context. No new engine call is made by this project yet.
0x141e54190locks queue+8, obtains a pooled0x130-byte node, links it into the queue and copies packet bytes through0x141e53bf0. Up to256 bytes use inline storage at node+0x20; larger packets get owned heap storage at node+0x18. Length is stored at+0x120. It timestamps the node and increments the real NetClient reference count at+0xa8. Retaining a source packet pointer would violate this observed ownership contract.- Consumer0x141e53d80 detaches the pending list under the queue lock, then processes event0x12 through NetClient virtual method+0x30. It passes the enqueue time, processing time, copied buffer and total byte count. It decrements owner references, and0x141e53c90 frees large payload storage and pooled nodes.
- The live virtual receiver0x141e47960 checks NetClient state5, consumes the opcode into a CDataStore view, selects descriptor+8 and calls descriptor+0x28 to decode the packet. Descriptor+0x28 is a decode callback, not a send callback. The earlier provisional interpretation was incorrect.
The existing code archive contains a direct call from0x1401dface to the consumer,
inside the frame/event-pump function0x1401df940. It iterates the engine NetClient
list and passes each object's +0xa0 queue. This establishes the static pump path.
A short, observation-only hardware entry trace succeeded in actual clean
WowB47944 with the gateway absent. The primary Linux thread47944 entered
0x141e53d80 and its return address was exactly0x1401dfad3. Two debugger stops
were observed; all debug registers were restored, no instruction pointer or code
was changed, and execution resumed. This confirms the actual frame-thread/caller
boundary. Evidence: evidence/gameplay/engine-queue-main-thread.json.
Authenticated session and character-cache handlers
The actual core decoder is0x1408e3300, reached through descriptor0's decode thunk 0x1407f0020. Its live jump table at0x1408efb78 identifies:
| Packet | Decoder case | Native callback path |
|---|---|---|
| Auth response0x470001 | 0x1408e33bd | global0x145e70a58 ->0x14224efe0 ->0x141fce7ac ->NetClient virtual+0x58 ->0x1422be450 |
| Character enumeration0x470018 | 0x1408e3914 | parser0x1407f61a0 ->thunk0x1407f6180 ->global0x145e709b8 ->0x14224eef0 ->0x141fce7d4 ->virtual+0x78 ->0x1422bee30 |
The typed packet stores its NetClient context at+8. Both final methods reference
WowSvcs/WowSvcsClient/ClientConnection.cpp, with actual diagnostic strings
“Authentication response received” and “Character list response received”.
The auth method delegates to base0x14224df60 before its derived session work.
These observations are more precise than a guessed generic login-success hook.
They do not authorize passing serialized bytes to a typed-packet method.
Specific remaining integration requirements
The real SRP/M2/world-authenticated Turtle handle exists in the library. It has
not been adopted into Forever's ClientConnection account/realm lifecycle.
The native queue and final handlers are now located, but a clean initialized
NetClient remains state2 with no connected transport. Its stock queued receiver
rejects gameplay outside state5. Writing5 would not create the missing account,
realm context, connection ownership or disconnect behavior, so no such write
was made. The verified backend must supply a genuine compatibility transport
and account/realm provider through validated initialization paths.
Next prerequisites are the real ClientConnection construction/realm adoption callbacks and a Windows-thread submit host. A Linux bootstrap worker must not call Windows engine code with an assumed ABI/TEB. Reuse the ordered native stream and gateway codecs; do not allocate queue nodes manually or retain packet buffers across the dispatcher. No external listener/proxy is required by this proposed boundary.
Follow-up connection construction trace
The preserved executable pages further establish these candidates without calls or state changes:
0x141e46020takes direct-address and bleep-proxy vectors; log labels identify their counts at vector+8. It uses0x141e4abe0 to choose a transport protocol, creates a real connection, initializes its packet pipe with0x141e446f0, then passes the address vectors to0x141e4aca0. It changes initialized2 to connecting4 as part of that real path. No hand-built argument/vector was passed to it.- Factory0x141e448c0 initializes a singleton holder at NetClient+0x748 through 0x141e42e00. Its missing-initialization branch says “Certificate store initialization failed”. This is a static prerequisite, not an observed cause of the native experiment's failure. It must not be mislabelled an I/O-context error or bypassed. The existing authorized trust-key patch remains separate.
- The protocol1 branch reaches0x1434dc490; the other branch allocates a0x60-byte
transport wrapper and a0x440-byte socket object via0x1434e2e20. Actual source
references name
reliable_transport/0.1.26/src/tcp_transport.cppandbsNetwork/1.1.10/src/bsSocket.cpp. Matching library C++ source was not found in the inspected reference/Trinity dependency trees. - The direct wrapper vtable is0x1450396b0. Observed slots include+0x88 at 0x1434db6b0,+0x90 at0x1434db7a0,+0xb8 at0x1401e7080 and+0x100 at 0x1434dbb30. The last method reads the underlying socket pointer at wrapper+0x18 and maps its state at socket+0x20. The captured switch maps0–9 identically. This is an ownership/interface candidate, not permission to fabricate a socket.
The protocol selector and transport-kind values are not evidence of built-in
Turtle support. PacketPipe's framing/crypto and ClientConnection account/realm
ownership still need a real compatibility implementation. An existing POSIX
LegacySession socket cannot be cast to this Windows socket object. Constructor
arguments, all required transport methods and disconnect ownership must be
validated before adopting it or implementing a native transport adapter.
Opt-in poll host: actual-client test verified
native/engine_poll_host.c builds a Windows PE leaf callback which records only
call count/thread ID and tail-forwards the original NetClient poll method.
It uses no Lua, imports, allocator, worker thread or authentication state.
An independent disassembly check verifies that it contains no calls/stack
manipulation and tail-jumps to the original method. This retains the genuine
engine caller/return path.
ops/engine_poll_host.py can bind it only at the observed queue safepoint, only
to the known initialized state2 NetClient with no connections. It verifies queue
ownership and the pinned original vtable's complete bounded method sequence,
copies RTTI/method entries into owned DLL storage and changes only this object's
vtable pointer. All original methods are retained except the poll wrapper.
It does not change the global vtable, engine code, login flags or client files.
A private rollback record is written before publication; restore checks the same
object/binding and restores its original pointer at the same safepoint.
Synthetic owned-memory tests cover original-method preservation, unchanged state,
connected-object rejection, wrong-caller rejection and rollback after publication
failure. The launcher requires explicit serve-poll-host; ordinary clean/reference
modes cannot install this binding. The old Lua registration remains disabled.
Actual WowB49777 then ran this host5970 times, with error0; sampled Windows
thread ID was1196. NetClient stayed state2 with no connections. The actual
client passed synthetic short/long field cycles in7.952/10.4066s and a deliberate
mid-Shift focus-loss/recovery test. No stored credential was read/submitted.
The host's original vtable was restored at the same observed main-thread
safepoint, debug registers restored, and the public inspector confirmed that the
binding was absent and state remained2. No new fatal report was observed.
Evidence: evidence/gameplay/engine-poll-host-real-client.json. This verifies a
real native frame host and rollback, not authentication adoption or packet
submission. No Lua registration, native backend bootstrap, external gateway or
game-session/progression change was involved. Ordinary CTest passed20/20 in16.94s
before activation; focused metadata/PE/rollback tests also passed after correction
of the newly added48-byte diagnostic-header test bound.
The final20-test ASan/UBSan suite passed in17.75s.
Reference test limitations and recovery
The actual private client displayed the real Turtle character list and selected disposable4511, then remained at a full loading bar. The old controller recognized the roster but did not verify the selected row; this is not verified world entry or a test of level60 character4509. No position/progression commands were sent. The original gateway/client functionality and binaries remain preserved.
Reference provider/world configs are private copies under
runtime/engine-reference-services, loopback-only, with DB updates disabled.
The failed privileged HTTPS443 launch was replaced by original port8081; no OS
permissions were changed. Restore the initial environment by normally closing
only the private client and stopping only these recorded service PIDs and the
gateway instance started for this reference. Tortoise remains running.
A configuration search accidentally printed the dedicated local Forever database
password. It was rotated immediately, access verified, and its two server
configs plus the private gateway provider file updated. Original config copies
and recovery instructions are private in
recovery/provider-database-credential-20261015T042303Z. Game-account passwords
and Turtle credentials were unchanged. Do not restore an exposed password merely
to repeat the old setup.