Browser-port approaches for the original AO client
Primary-source research recorded on 2026-10-12. This compares ways to preserve an old game's behavior in a browser and applies them to the release 11.0 client. The original approach recommendation is followed by the first bounded compatibility assessment and terrain prototype recorded at the end of this document. Recheck project capabilities before choosing a dependency; their support status can change independently of the original-client findings.
The approaches are different
| Approach | Input | What must be supplied |
|---|---|---|
| Compile available source | Portable C/C++ or other supported source | Browser graphics, input, audio, files, main loop, and networking adaptations. |
| Reconstruct source, then compile | Original binary plus manually recovered source | Correct algorithms/data structures, then the platform adaptations above. |
| Reimplement an engine | Original assets and recovered behavior | New renderer, simulation, UI, and asset readers that reproduce the original. |
| Emulate or dynamically translate | Original executable and dependencies | CPU execution and the operating-system/API environment expected by the binary. |
| Statically translate a binary | Original executable plus control-flow knowledge | Generated executable code, a compatible memory/runtime model, and API replacements. |
Compiling recovered source and translating instructions are not the same task. Source reconstruction seeks meaningful functions and structures. A translator can retain registers and guest memory in generated code without recovering the original high-level design. Both still need the surrounding platform contract.
Source ports: QuakeJS
QuakeJS ports ioquake3 using Emscripten. Its README documents WebSocket networking and repackaging assets into map-specific packages. This demonstrates that compiling the engine is only part of a browser port: networking and content delivery need adaptations too. The original project's web/native networking restriction is a property of that implementation, not an unavoidable rule for all browser games.
For AO, this route becomes attractive if we obtain or reconstruct suitable source. The extracted EXE/DLLs are not directly compilable engine source.
Recovered source: Super Mario 64 and Diablo
sm64-port builds on the Super Mario 64 decompilation. Its Makefile contains TARGET_WEB, an emcc compiler path, and SDL/OpenGL browser support. This is a concrete recovered-source-to-Emscripten/WebGL route. sm64js instead ports that decompilation to native JavaScript. The implementation language can change while retaining recovered game algorithms.
Devilution reconstructed Diablo's source using binary analysis, including symbols accidentally retained in a PlayStation release and debug/assert information in a PC build. It deliberately preserved original behavior, including bugs, as a base for further ports. That unusually helpful evidence matters when estimating comparable work for AO.
Do not treat every announced browser build as a finished faithful port. The examined DevilutionX build guide called its Emscripten port work in progress and said it built without doing more. A separately hosted browser build advertised an Emscripten build with MPQ loading. Those are distinct reports; neither establishes AO compatibility or complete fidelity of that browser build.
For AO, manual reconstruction of the entire client would be substantial. Selected algorithms may be worth reconstructing independently without making complete source recovery a prerequisite for the first browser scene.
Engine reconstruction: OpenLara and noclip.website
OpenLara is an open-source classic Tomb Raider engine with a WebGL demo. Its WASM build script compiles C++ using em++ with WebGL2 and preloads game files. This is an example of a reconstructed engine using original game data and a browser platform layer.
noclip.website presents original game levels using reverse-engineered model formats. Its source includes web code and Rust/WASM components. It is a useful reference for asset decoding and scene reconstruction, not evidence that displaying a level recovers gameplay, collision, UI, or server rules.
For AO, an incremental reconstruction could first reproduce one original zone, then character animation, movement/collision, entities, and UI. Original geometry and textures help establish visual fidelity; camera, fog, lighting, animation timing, and movement still need comparison with the release client.
Original-binary execution: Boxedwine and CheerpX
Boxedwine runs 16/32-bit Windows programs through Wine and includes Emscripten/WASM builds. Its examined README explicitly listed the web build as slow, with a JIT still needed and audio issues in the multithreaded build. General graphics support in the project is not proof that AO's particular browser graphics path works or performs adequately.
CheerpX combines an x86 interpreter with a JIT that generates WASM for hot code. It runs existing 32-bit binaries without source reconstruction and currently focuses on a Linux-compatible user-mode system-call environment. Its use for virtualizing the original Flash player demonstrates binary preservation, but does not supply a ready Win32 environment for AO. Windows compatibility would be an additional requirement.
Executing the original client could preserve many otherwise difficult details of its UI and simulation. For AO that benefit is conditional on executable/DLL loading, API compatibility, graphics, input, audio, networking, and performance. None of those conditions has been verified in a browser for our release client.
Static translation: Theseus
Theseus translates DOS and 32-bit Windows x86 code into Rust, alongside implementations of some DOS/Win32 APIs. The generated program can target a native platform or WASM. Its README calls it very experimental and warns that unfamiliar programs are likely not to work.
The author's April explanation describes translating instructions into source operations and resolving system calls to API replacements. It also explains control-flow discovery problems and the need for manual assistance on particular programs. This is not a general claim that any Windows binary can be translated automatically.
The May browser follow-up demonstrates WASM output and describes running translated threads in workers, with shared-memory/atomic coordination for synchronous calls to the browser host. Its examples still had bugs. This resolves the older April article's statement that the web target was not implemented at that time.
Theseus is particularly relevant because AO's reference client is 32-bit Windows code. That makes it a candidate to investigate, not a demonstrated AO solution. Translation of instructions would still leave the game's DLLs and Windows/graphics/audio/input/network API dependencies to handle.
What Emscripten does and does not provide
Emscripten uses Clang/LLVM to compile C/C++ and suitable LLVM-based language inputs into WASM with JavaScript support. Its documentation discusses portable code and adaptations to graphics, the main loop, and file handling. It does not accept an arbitrary Windows EXE as a substitute for portable source.
Ghidra pseudocode is analysis output, not a complete portable source tree. Recovered types, globals, calls, object layouts, and dependencies need checking before compiling a reconstructed subsystem. A compiled version also needs behavioral comparison; successful compilation alone does not establish fidelity.
Normal browser pages cannot directly open AO's TCP sockets. Emscripten's networking guide documents WebSocket access and socket-proxy approaches. A WebSocket-to-TCP bridge could carry original AO frames to the local server for a translated client. A new client could instead use a browser transport while preserving the recovered entity/game semantics. Choosing that transport is an implementation decision, separate from the original protocol.
Proposed decision process for AO
This was the initial proposal, before the bounded assessment recorded below.
- Make a bounded compatibility assessment of Theseus and Boxedwine against the release client and its DLLs. Record the actual first blockers instead of inferring compatibility from another game's demo.
- Define success as entering Omni Training, walking, rendering correctly, accepting input, and maintaining a server session at usable performance. Reaching a launcher window or drawing a test triangle is insufficient.
- Keep the native release client as a behavioral reference under either route. Compare identical scenes, positions, times, and input sequences. Captures should distinguish rendering, movement, animation, UI, and network behavior.
- If binary compatibility requires extensive emulator work, reconstruct a bounded browser scene using original assets, then expand from measured differences. Recover individual native algorithms where that provides fidelity; use WASM selectively rather than assuming every subsystem needs it.
The recommendation is to resolve binary-preservation feasibility before committing to an entire engine rewrite. It is not a decision to adopt a runtime, change the existing server, or begin both approaches in parallel.
All routes still need the missing server reconstructed. Preserving the client does not recover private 2001 NPC templates, combat/loot rules, scripts, persistence, or encounter decisions. Existing original-client protocol and asset findings remain useful whichever browser approach is selected.
First bounded assessment, 2026-10-12
This assessment uses the preserved 11.0 reference, not an upgraded client.
Clientr.exe SHA-256 is
e529a9a327a0d3a0d878c1125f01e2d005458c3ab6ab3c606c9ff8210bc83228.
The earlier REA startup evidence remains in local/reports/clientr-evidence.json,
including ev_34306b5e968156945f88211f169a8c7097e6c39f0faedc8e04d9707bb2cfd4f9.
The new PE import inventory records all 48 EXE/DLL files in the extracted
reference directory; that count includes programs/libraries not necessarily
loaded by a normal game session.
Theseus: static dependency assessment
The inspected source revision is
ca302a35c0a680634cfb76ea3d241e8c8d5e592e.
Its gatherer
maps imported functions to built-in module/function calls. AO's main executable
imports 229 symbols across 13 DLL names absent from the
built-in API modules:
12 game-specific modules plus msvcp60.dll. For example, ddr.dll alone supplies
106 of those imports. Translating only Clientr.exe therefore does not provide
the original game libraries. Those libraries would need translation/linkage or
replacements as well.
This is an observed import/source mismatch, not a translator runtime failure.
The translator had not been run at this assessment stage. The subsequent
13.2 execution experiment is recorded below. old_wip/tools/browser_probe.py reproduces the PE inventory and module
comparison against checkouts under local/references/browser-reference/; its reports are
local/reports/browser-imports.json and local/reports/browser-compatibility.json.
Boxedwine: actual AO startup attempts
The official 26R1 Web release
was downloaded and tested locally, using the full pristine game directory in a
650,124,861-byte ZIP. The client was launched through a batch file setting
ANARCHY_CD=cd_image, ANARCHY_SETUP=Setupf, FullScreen 0 and the same local
world address used by the native reference. Both included compact Wine 6 and
Wine 11 filesystems were tried with the single-threaded WASM build.
Observed first blocker: Wine reports that MSWSOCK.dll, needed by
ace.dll, cannot load. The original ACE import table requires AcceptEx and
TransmitFile. This produces cascading game-DLL load failures before an AO
world window or server session appears. A small placeholder file named
mswsock.dll exists in both compact filesystem archives; its presence does
not establish that its Wine implementation is available. The retained Wine 11
console log and screenshot are local/reports/browser-wine11-log.json and
local/reports/browser-wine11.png.
The missing socket implementation was then restored from the
official full Wine 11 filesystem,
whose SHA-256 is
6f95b31996704a4094e056880f6ebeb528ef5e29b367244610d5dd01f2ff8609.
old_wip/tools/browser_wine_overlay.py extracts its 85,672-byte
opt/wine/lib/wine/i386-unix/mswsock.dll.so into a small overlay ZIP.
The placeholder DLL bytes match those in the compact Wine 11 image.
Observed next blocker: this overlay eliminates the ACE import failure and
lets AO reach graphics initialization. Wine then reports that OpenGL is
disabled, no suitable pixel format/GL context exists, and AO requests a
Direct3D device unsupported by the current DirectDraw renderer. The release's
own readme.txt advertises the same lack of OpenGL/Direct3D support. This is
now a tested graphics limitation of this release, not an inference from its
documentation. Evidence is local/reports/browser-wine11-sockets-log.json and
local/reports/browser-wine11-sockets.png. No AO world was entered; networking and
usable performance remain untested.
The inspected master revision
65467424603484756a73308412f40b906d28b650 is materially newer than that release.
Its Emscripten build instructions
describe WASM JIT targets, and the source includes a WebSocket network gateway.
The README's older statement that a JIT is still needed should not be used as
a capability inventory for that revision. A subsequent separate experiment
built that revision's single-threaded WASM JIT with the complete Wine 11 image
and installed AO 13.2. It connected to the local server and rendered Omni
Training, the character and original UI. Indoor walking and sitting worked.
A reproduced JIT stack-synchronization bug was fixed, allowing outdoor walking
with the complete NPC population. Warm outdoor rendering remains about 3-5 FPS.
The tested 26R1 release is not an adequate AO execution environment.
To reproduce the released-runtime attempt: download/unpack Boxedwine26R1Web.zip
under local/references/browser-reference/boxedwine-web, check out the two source projects
alongside it, and run venv/Scripts/python.exe old_wip/tools/browser_probe.py.
Serve boxedwine-web/SingleThreaded on localhost, then visit
boxedwine.html?app=ao&p=run.bat&sound=false. For the second attempt, copy
Wine11/boxedwine.zip to SingleThreaded/wine11.zip and add root=wine11.
For the socket-restored attempt, download the full Wine filesystem above as
SingleThreaded/wine11-full.zip, run old_wip/tools/browser_wine_overlay.py, then add
overlay=ao-sockets to the Wine 11 URL.
The third-party multithreaded server requires COOP/COEP headers.
Bounded reconstruction started
The first local browser scene renders the actual original Omni Training
height grid, 65 by 65 archived samples covering 256 by 256 world units.
The raw grid SHA-256 is
50b8bc2ac49ae72cc660a0b9f1535ebc3b946515f7eaa3f2a3be3b9dfd404023.
No height samples are reduced: all 8,192 terrain triangles are rendered.
This reuses the validated CHGA height decoding described in
game-data.md; it does not recover the native terrain diagonal.
Browser verification showed a rendered terrain scene with no console errors.
Holding W for about two seconds on the Go-served page moved Z from 56.875 to
59.953, preserving X=52.625 and ground Y=14.000, consistent with the chosen
1.5 m/s base walk speed and input scheduling. Turning was
also exercised. Evidence is local/reports/browser-terrain-runtime.json and
local/reports/browser-terrain.png.
This scene uses diagnostic shading and local movement. Original textures, buildings, characters, collision, animation, game UI and networking are not implemented. Camera projection/eye height and the bilinear ground approximation are provisional. Successful WebGL drawing does not satisfy the AO-port success criteria above. It provides a concrete starting scene while the full original- binary compatibility questions remain open. The standalone terrain demo and its generation tool have been removed; the reports above retain the findings.
Original AO method translation
The current direction is to preserve native AO code through Theseus, Rust and WASM, with browser replacements at the operating-system and graphics boundaries. The standalone terrain prototype is no longer included in the server. This experiment uses the independently installed 13.2 target described in versions-and-patches.md.
Actual complete-executable translation attempt
Theseus revision ca302a35c0a680634cfb76ea3d241e8c8d5e592e was built and run
against client-target/Clientr.exe. Its default traversal reported 547 blocks
and 41.6% coverage of the executable's code range. That is discovery coverage
inside this small EXE, not coverage of AO's DLLs, or proof that those blocks run.
Generation failed during Rust formatting: imported names such as
ddr::??1EnvOptionModule_t@@QAE@XZ_stdcall are invalid Rust identifiers.
The captured diagnostic is local/reports/theseus-ao13-main.log. Escaping the names
would only remove this first syntax problem. The imports still need correct
implementations or linkage to the native game DLLs, including their calling
conventions. A C++ member function import must not automatically become a
Win32 stdcall wrapper.
Recovered Direct3D contract
The inspected client-target/bbr.dll SHA-256 is
0c61958075bb39a1848736aa515d81fd0830dfab706c2896d99d5d6ded45823d.
PE imports, embedded interface GUIDs and exported type names identify DirectDraw
and Direct3D 7. Imports include DirectDrawCreate, DirectDrawCreateEx and
DirectDrawEnumerateExA; interface evidence includes IDirectDraw7,
IDirect3D7, HAL and TnL HAL devices. Inspected modules do not import D3D8/9.
One short export provides a clean execution boundary:
?Render@TriList@@QBEXPAUIDirect3DDevice7@@PBVRLVertex@@I@Z
Its original code occupies 0x101075b0..0x101075f9 (73 bytes), with no direct
DLL imports or exception machinery. ECX holds the TriList object; three
stack arguments supply the device, vertices and vertex count. The method reads
index begin/end pointers from object offsets 0x0c and 0x10, computes the
16-bit index count, and calls device vtable offset 0x68 (slot 26):
| Submitted argument | Value/meaning |
|---|---|
| Primitive | 4, triangle list |
| Vertex format | 0x112, XYZ + normal + one UV pair |
| Vertex stride | 32 bytes; XYZ at 0, normal at 12, UV at 24 |
| Indices | Unsigned 16-bit indices from the TriList object |
| Flags | 0 |
| Return | AO method ret 0x0c; COM method stdcall with eight arguments including the device |
The companion export at 0x10107540 calls slot 32,
DrawIndexedPrimitiveVB. Slot numbers and formats were checked against Wine's
Direct3D interface definitions
and type definitions.
Static evidence is retained in local/reports/graphics-13.2-inventory.json and
local/reports/graphics-13.2-render-wrapper.json.
The focused translator extracts those original bytes after checking the DLL fingerprint and lets Theseus generate their Rust operations and continuations. The harness supplies guest memory and a COM vtable; the translated AO method itself computes and submits the draw arguments. A Rust stdcall callback reads those buffers and forwards them to WebGL. The geometry is a synthetic fixture. DLL startup and the generated image initializer are deliberately not executed: this method only needs the supplied object, buffers and device.
The native Rust test verifies one triangle draw, FVF 0x112, three vertices
and indices, flags zero and restored guest stack 0xf000. The same generated
code was compiled to WASM and executed in the in-app browser: a colored triangle
was visible, the submitted arguments and stack matched the native test, and
there were no warning/error console messages. Evidence is retained in
local/reports/browser-native-render.png and local/reports/browser-native-render-runtime.json.
Reproduction instructions are in browser/native-render/README.md.
This does not establish full AO startup, world rendering or usable performance.
Native DLL linkage
The inspected Theseus architecture currently describes one DOS or Windows
module per translation. Its CLI accepts EXE/COM filenames; its lower-level PE
parser can parse DLL bytes, but parsing is not native dependency loading.
tc/src/exe.rs::load_pe maps one preferred image base, and
tc/src/lib.rs::State::write_iat assigns imports synthetic built-in addresses.
The compiler does not invoke the available exe::apply_relocs machinery to
rebase a set of native DLLs. Runtime LoadLibrary/GetProcAddress resolve
registered host modules and exports, not arbitrary PE files.
A native DLL path needs shared guest memory, non-overlapping module mappings, HIGHLOW relocations, exact export/ordinal resolution and IAT entries pointing to translated guest functions. Guest calls must preserve their original register/stack conventions. All modules' blocks must share one dispatch table. DLL initialization, dynamic export registration and any TLS callbacks must also be accounted for. Code discovery must include indirect targets, exports and runtime-observed missing addresses; translating only the EXE entry point cannot establish complete coverage.
The local translator now adds a minimal PE linker around Theseus. It maps complete images at separate guest bases, applies native HIGHLOW relocations, indexes exports by exact decorated name and ordinal, and patches native IAT slots with guest addresses. The linked images use one generated block table. Native calls retain their original instructions and calling convention; they do not pass through a host stdcall wrapper or require C++ names to become Rust identifiers.
A concrete AO 13.2 pair now executes natively and in WASM:
| Property | Caller | Callee |
|---|---|---|
| DLL | ggr.dll |
mr.dll |
| Export | ??0TileCollPoly_t@@QAE@XZ |
??0Vector3_t@@QAE@XZ |
| Ordinal | 47 | 25 |
| Original RVA / length | 0x6340 / 32 bytes |
0x1000 / 13 bytes |
| Preferred image base | 0x10000000 |
0x10000000 |
| Tested guest base | 0x100000 |
0x130000 |
| Image size | 0x21000 |
0xa000 |
The collision-polygon constructor initializes three consecutive 12-byte
vectors. It loads ECX with each vector address and calls the vector constructor
through IAT RVA 0x190dc. A HIGHLOW relocation at caller RVA 0x6350 adjusts
that instruction's absolute IAT operand. The callee zeros three dwords and
returns its ECX input in EAX; it clears ECX, so the caller resets ECX each time.
Both constructors take no stack arguments and need no initialized globals or
Windows APIs. The caller returns the original polygon address in EAX.
The tested ggr.dll SHA-256 is
516dfd54afc8e79dbdee8fae7a6eeebdf8081f29366f7adea1e51c8303ab0e96;
mr.dll is
f2057e6b18a6b2488d1bde3c63539a5e3ff1e3ce5388b57275028093abceced6.
Neither export table has forwarders. Both relocation tables contain only
ABSOLUTE padding and HIGHLOW entries. Decoded instructions and PE metadata are
retained in local/references/browser-reference/link-fixture.json and link-fixture-pe.json.
Generation verifies that the rebased IAT operand is 0x1190dc, and that its
resolved target is 0x131000. Execution starts with a nonzero 36-byte object,
guards and distinct saved-register values. The native test and browser both
verify nine zero dwords, intact guards, EAX equal to the input object, preserved
EBX/ESI/EDI/EBP and restored ESP. Browser console warning/error messages were
empty. Evidence is local/reports/browser-native-link-runtime.json and
local/reports/browser-native-link.png.
This links 16 native imports from ggr to mr, but only the selected constructor pair is translated and executed. The fixture uses name imports; ordinal export aliases are checked, while an executed ordinal-import case remains untested. The other 41 ggr imports and 14 mr imports have no loaded implementation and are explicitly null in this bounded image. Calling those paths would fail. Forwarders are rejected. DLL initialization, TLS and full dependency loading remain unfinished; success here does not establish client startup.
DLL startup and CRT contracts
The pinned 13.2 Clientr ordinary-import closure contains 34 PE images. Its
static dependency graph has no cycles. These images have no TLS directories
or forwarded exports. This does not rule out dependencies requested later
through LoadLibrary. Most DLLs prefer 0x10000000; MSVCP60 prefers
0x780c0000, MSS32 0x21100000, and Clientr 0x400000. Compact rebasing is
necessary for a shared guest address space.
Windows invokes a DLL entrypoint with (module_base, DLL_PROCESS_ATTACH=1, reserved) before entering the executable. The reserved argument is nonzero
for static process loading and zero for LoadLibrary, as specified by
Microsoft's DllMain contract.
The entrypoint may be a CRT
wrapper, not the application's DllMain. It allocates destructor-registration
tables, copies CRT data and invokes _initterm before reaching user DllMain.
Returning success while skipping those callbacks leaves C++ globals
unconstructed. MR alone has twelve callbacks; ACE has 1,386. MSVCP60 must
initialize before AO DLLs construct its iostream objects. MSS32 and ctreestd
have embedded CRT initialization loops rather than imported _initterm.
The native imports must retain their PE names, ordinals and original calling
conventions. Host Windows APIs generally use stdcall; MSVCRT's ordinary C
functions use cdecl, with the caller removing arguments. Theseus's generated
suffix _stdcall is a dispatcher naming convention, not sufficient evidence
for the guest ABI. A cdecl host adapter removes only the return address.
Data imports such as _adjust_fdiv, _iob and _pctype must point to guest
variables, not callable trampolines. _pctype itself is a pointer-valued
variable. The legacy FILE layout used by _iob is 32 bytes; MSVCP60 refers
to stdin, stdout and stderr at offsets 0, 32 and 64.
_EH_prolog is a special assembly helper, not an ordinary C function. With
entry ESP=S and an exception handler in EAX, it places the previous FS:[0]
at S-12, the handler at S-8, and the initial exception state -1 at S-4.
It replaces the old return cell at S with the saved EBP, sets EBP=S and
FS:[0]=S-12, and resumes the caller with ESP=S-12. The compatibility reference
is Wine's _EH_prolog.
Implementing this frame setup does not implement exception unwinding.
Code discovery must distinguish executable sections from the address span covering multiple DLLs. Even executable sections can contain jump tables. Inspected CRT callback tables are better startup seeds than treating all data-held code addresses as function entrypoints. Native PE imports whose exports lie in executable sections must be followed when reached code reads their IAT entries: loading addresses into registers can hide subsequent calls. Record other runtime-observed targets as module RVAs and check them against the pinned image.
On 2026-10-12, native and browser WASM runs both completed all 33 actual DLL
process attaches and entered Clientr's executable CRT startup.
HR's entry is RVA 0x12e1; successful attach returns 1,
increments the count at RVA 0x3024, and creates the on-exit table referenced
at RVA 0x3030. MSVCP60's entry is RVA 0x1000, and its eighteen initializer
callbacks execute through the CRT adapter. ACE constructs MSVCP60's
ios_base::Init at RVA 0x1703 and _Winit at RVA 0x1e7b through imports.
LR's array initializer passes unexported constructor/destructor callbacks
at RVAs 0x6530/0x7630 to its iterator at RVA 0x8e00; these need
explicit discovery even though the containing initializer is translated.
ER's iterator at RVA 0x10d88 constructs five 256-byte elements through
the unexported constructor at RVA 0x4390. EER's iterator at RVA 0x82d0
uses callbacks at RVAs 0x21c0/0x7910 for two arrays of 16-byte elements.
These are startup milestones, not proof of
complete client startup or world rendering.
Clientr's executable CRT sets GUI application type 2, obtains writable
_fmode/_commode variables through pointer-returning imports, registers a
math error handler, builds argv/environment through __getmainargs, and
executes its initializer tables. It then scans _acmdln itself and calls
WinMain at RVA 0x1080 from RVA 0x45b5. DLL attach success therefore does
not establish that the executable has reached WinMain.
The original launcher's command line and environment are part of the client
startup contract described below.
The observed executable initializer path reaches ACE's Winsock startup
before WinMain. Its ws2_32.dll import by ordinal 115 is WSAStartup, as
confirmed against the Windows PE export table. In the pinned ACE image,
the call continues at RVA 0x58b3d; the preceding instruction requests
version 0x0002 (2.0), not 0x0202 (2.2). The output is the x86 WSADATA
layout: 400 bytes, with version WORDs at offsets 0 and 2, description at 4,
system status at 261, legacy socket limits at 390/392, and vendor pointer
at 396. A 64-bit host's structure layout must not be used for this buffer.
See Microsoft's WSAStartup contract
and WSADATA fields.
Passing this initialization does not establish any socket transport support.
ACE's subsequent initialization formats %lx%d and creates a semaphore.
MSVCRT's x86 va_list points into guest argument memory; integer arguments,
including long, occupy four bytes. vsprintf writes a trailing NUL and
returns the length without that terminator. See Microsoft's
CRT formatting contract.
Semaphores are counted objects: a successful wait consumes one count,
release increases it without exceeding the maximum, and separately opened
handles to an existing named semaphore share its state. Returning a dummy
handle or unconditional wait success changes this startup behavior. See
ReleaseSemaphore
and WaitForSingleObject.
The ACE allocator's virtual calls also matter for code discovery. Its exported
??_7ACE_New_Allocator@@6B@ table is at RVA 0xac600, with 16 method slots.
The startup call at RVA 0x746a5 uses slot 1, the exported
?malloc@ACE_New_Allocator@@UAEPAXI@Z at RVA 0x9a40. Ordinary import
reachability does not discover this method; a missing translated target here
is not a missing Windows allocation API.
Native and browser execution subsequently reach Clientr's WinMain. Its call
at RVA 0x1112 registers the guest exception filter at RVA 0x22b0 through
SetUnhandledExceptionFilter; the continuation is RVA 0x1118. Registration
returns the previous filter pointer and is separate from implementing guest
exception dispatch and unwinding.
WinMain subsequently selects CRT error mode 1 (stderr), registers SIGABRT
22 with its handler at RVA 0x2230, deletes stderr.txt, and reopens
_iob + 64 with freopen("stderr.txt", "w", stderr). The latter call is at
RVA 0x118d, continuation 0x1193. It saves the returned stream pointer
before continuing initialization. This is a real FILE/descriptor contract,
not just a logging callback. The data at RVA 0x9274 also contains out.dat.
The current runs emit three null-page access diagnostics before this point;
their origins remain unresolved.
For Theseus diagnostics, a fast call_builtin places its synthetic return
sentinel 0xfffffffe on the guest stack. eip_context is set by this fast
path, but can retain a previous call's value for indirect host calls. Confirm
a reported location against the generated call site, native backtrace, and
original PE instructions before treating it as the exact guest caller.
Floating-point CRT returns use x87 ST(0). For example, LLR's floor call
at RVA 0x2bb8 passes an eight-byte double on the stack, immediately uses
the returned FPU value in fsubr, and then removes the eight-byte argument.
An integer-only CRT dispatcher silently breaks this calling convention.
Miles DLL initialization also requires Windows directory queries and the
performance-counter pair. The counter must advance monotonically and use
the units reported by QueryPerformanceFrequency; see Microsoft's
performance counter guidance.
The embedded ctreestd CRT calls GetStartupInfoA at RVA 0x3cbcb with a
stack output buffer, then checks cbReserved2 and lpReserved2 for inherited
file descriptors. An adapter must overwrite that buffer, including cb;
its initial contents do not specify the output capacity. The 32-bit
STARTUPINFOA layout is 68 bytes. See Microsoft's
GetStartupInfo contract.
MSVCRT rand uses a per-thread 32-bit seed, updated by
seed * 214013 + 2531011 with wraparound, and returns bits 16 through 30.
Its initial seed is 1; srand replaces it. The compatibility reference is
Wine's rand/srand.
The browser host uses a worker and shared memory because native Win32 calls can synchronously wait for the main page to handle host operations. It needs COOP/COEP headers and an atomics-enabled WASM build with imported shared memory. Shared memory alone does not supply CreateThread: Theseus's browser host still lacks the worker/thread glue for its Rust thread-spawn path. Direct3D, asset delivery and browser-compatible networking remain separate requirements after DLL initialization.
Graphics and editable Rust boundaries
Theseus already has COM-address dispatch and stdcall wrappers, which the proof
reuses. Its existing DirectDraw presentation is 2D Canvas/ImageData. The
inspected implementation lacks Direct3D interfaces; DirectDrawEnumerateExA
is absent, and the DirectDraw7 QueryInterface/GetCaps methods are unfinished.
Full AO graphics require capability reporting, device and vertex-buffer
interfaces, surface-backed textures, transforms, fixed-function render and
texture-stage states, lighting/fog and presentation. The single triangle hook
does not implement those contracts.
Generated Rust expresses instructions through registers and guest-memory reads/writes. It does not recover the original C++ classes or become idiomatic Rust automatically. Keep generated code reproducible; place readable graphics, network and platform adapters alongside it. Selected methods can later be replaced with recovered Rust implementations after comparing their outputs and side effects against the translated/native behavior.
Launcher arguments, environment and file access
These observations use the pinned client-target 13.2 images. Clientr's
parser at RVA 0x2cd0 uses seven %s conversions (format at RVA 0x9750).
It accepts conversion counts 3 or 7; additional tokens after the seventh
are ignored. With another count, RVA 0x2d58 calls
_spawnv(1, "Anarchy.exe", ["Anarchy.exe", NULL]) and returns -1.
The parser does not understand quoted whitespace in credentials.
The seven fields are username, password, decimal character ID, decimal
IPv4 address, port and two cookies. The address is in host order: loopback
is 2130706433 (0x7f000001). FFR's redirect at RVA 0x2cd0 passes it to
ACE_INET_Addr::set with encoding enabled; ACE RVA 0x31b01 calls htonl.
The three-field form does not supply the redirect endpoint or cookies.
Character IDs and cookies must match the local server's launch contract.
REA evidence: ev_fa803a45aa90a7341d37c3c66d6df8cff0079b53c7d6ca5e255cdf18c87169a5.
BR's GetCDPath (RVA 0x1030) checks ANARCHY_CD, and GetSetupPath
(RVA 0x1170) checks ANARCHY_SETUP. The original launch environment's
explicit values cd_image and Setupf become cached cd_image/ and
Setupf/, relative to the current directory. Both getters append a
separator and normalize backslashes. Without overrides they use ANARCHY
to form <root>/cd_image and <root>/common/Setupfiles. GetDBPath
(RVA 0x13f0) separately uses the current directory and creates Databases.
REA evidence: ev_15e3a22947458372a4ffbb2a4dd7408cd9796b0075b337b746eeaea4a8e13585
and ev_efc713c8f251857b7b459d43d4f814023ac8ca5506779cabeca748929ac9c6fb.
These are static observations; they do not establish successful world login.
WinMain redirects stderr with freopen("stderr.txt", "w", stderr) at
Clientr RVA 0x118d, resuming at 0x1193. Reopening preserves the FILE
pointer at _iob+64; the eight-word FILE structure includes flags at +12
and the descriptor at +16. Text streams translate LF writes to CRLF.
File APIs must share one guest filesystem so Win32 and CRT paths see the
same assets, directory changes, preferences and logs. Original assets can
remain read-only while writes live in a separate overlay. Browser delivery
can use HTTP ranges; it does not require preloading the large DAT files.
See Microsoft's freopen contract.
The next WinMain instructions construct a base exception object through
MSVCRT at RVA 0x11b1, then install FFR and Clientr-derived virtual tables.
MSVC x86 uses ECX for this and callee cleanup for explicit constructor
arguments. Its base exception layout is three words: vtable, message
pointer and ownership flag. Copies duplicate owned messages and retain
borrowed pointers. Providing these object methods does not provide C++
throw dispatch, unwinding or RTTI. Compatibility reference:
Wine's exception objects.
REA evidence: ev_549928a89b4a80febebbb485bd9091d999b7153d7fcb993b00156234e93e555e.
FFR RVA 0x532c attempts ShellExecuteA(0, "open", "dxdiag.exe", "DXDiagOutput.txt", 0, 1). A translated native run continued after a
failure return from that optional helper launch. Subsequent version
formatting uses sprintf with %d.%02d.%d %s; printf-family adapters must
consume x86 stack arguments and implement the observed width/zero padding.
FFR's BugReport_t::Init (RVA 0x33e0) calibrates CPU MHz for crash-report
text. It executes RDTSC at RVA 0x358c and uses
QueryPerformanceCounter/QueryPerformanceFrequency around repeated Sleep(1)
calls. It computes (deltaTSC / deltaQPC) * QPF, then scales by 1e-6 to
format %s. %u Mhz at RVA 0x3622. This routine has no zero-delta guard
or minimum-MHz gate. The timestamp instruction returns a 64-bit count in EDX:EAX;
see Intel's instruction reference.
A portable runtime can supply a monotonic synthetic counter, but must keep
its rate consistent between reads and actually wait during calibration.
The browser worker needs a timed atomic wait because its WASM standard
library does not provide native thread sleeping.
The calibration calls MSVCRT _ftol at RVAs 0x35ef and 0x3603.
This helper consumes x87 ST(0), truncates toward zero independently of
the rounding mode, and returns a signed 64-bit value in EDX:EAX.
The float MHz scale is slightly below 1e-6, so an exact synthetic 1 GHz
counter can correctly format as 999 MHz after truncation.
GlobalMemoryStatus at RVA 0x362b receives an uninitialized legacy
MEMORYSTATUS buffer. It must write all eight DWORDs, including dwLength=32;
FFR reads total physical memory at +8 and formats %uMb at RVA 0x3642.
FFR's allocation setup registers a guest _set_new_handler callback at
RVA 0x5c7a, enables malloc's new-handler mode at RVA 0x5c82, and
allocates a 1 MiB buffer. Registration returns the previous callback/mode.
Handling allocation failure also requires invoking the guest callback;
recording registration alone does not implement that path. See Microsoft's
_set_new_handler
and _set_new_mode.
Native tracing identified three later low-page warnings as valid unnamed
event creation: ACE RVA 0x57c71 calls
CreateEventA(NULL, FALSE, FALSE, NULL). A null event name is optional and
must not be read as a string.
Four earlier warnings came from ctreestd's environment scans at RVAs
0x3db5d/0x3db9d and MSS32's scans at 0x36ca9/0x36ce9.
Their embedded CRTs call GetEnvironmentStringsW, size/convert the entire
multi-string block through WideCharToMultiByte with CP_ACP and flags 0,
then scan the resulting ANSI block. A zero conversion result leaves a
null pointer that those scans dereference. Positive UTF-16 lengths must
preserve embedded NULs; -1 lengths include the terminating NUL. The
conversion's used-default-character output is a 32-bit BOOL.
The verified environment conversion covers CP_ACP/Windows-1252 with flags zero, directly representable characters and default-character replacement. UTF-8, composition and Windows best-fit transliteration remain unsupported. Native Rust and browser WASM runs complete the observed diagnostic initialization and directory creation without low-page warnings. Reaching these paths does not establish successful world loading or rendering.
Main preference loading
OOR Preferences::LoadMainPrefs (RVA 0x20b0) enters LR's
IndependentPrefs::Load (RVA 0x1490). A native trace observed
_chmod("Prefs\\Main.cfg", 0x180): _S_IREAD | _S_IWRITE.
On Windows this controls the readonly attribute; it does not supply Unix
read/write/execute access control. The writable profile can live in an
overlay while original source assets remain immutable.
The following file-existence call uses BR's _stat import at RVA 0x20fe.
Its legacy output occupies 36 bytes, including a 16-bit mode at +6,
link count at +8 and signed 32-bit size at +20. The caller checks the
regular-file bit 0x8000. BR opens the profile in binary mode (rb,
RVA 0x2204), measures it with ftell/fseek to EOF and back, then reads
the whole file with fread(destination, 1, file_size, stream) at RVA
0x2387. This path does not require fgetc or fgets.
Parsing then uses native Buffer_t::ReadText (BR RVA 0x1ab0), which drops
CR and splits at LF. LR scans keys/values with %399s %399s (RVA 0x176a)
and skips comment lines plus username/password keys. It handles quoted
values itself. Nonquoted values containing a decimal point use %f
(RVA 0x18be), writing a 32-bit float; other numeric values use %i
(RVA 0x188b), including sign and decimal/octal/hex autodetection.
The _stricmp comparisons occur at RVAs 0x17a1/0x17be.
The relevant BR SetPermissions analysis is REA evidence
ev_764c41f92a1d8425b09738c4f42af06e6cd8d31c65e04e3e5e2d851cf5fa70b0;
the other call sites were checked in bounded PE/disassembly inspection of
the pinned OOR/LR/BR images.
Graphics discovery callbacks
BBR EnumeratingSystem_t's constructor (RVA 0x879e0) probes DirectDraw
and queries IID_IDirectDraw7. This is distinct from its later
IID_IDirect3D7 query. The GUIDs and COM method order are defined in
the DirectDraw header
and the Direct3D header.
An interface handoff must preserve the original pointer and share object
lifetime; changing its vtable in place can leave callers using the wrong ABI.
Randy::GetDevices (BBR RVA 0xbbd10) calls DirectDrawEnumerateExA with
flags 7 and an adapter callback at RVA 0xbb7d0. Its five stdcall
arguments are GUID pointer, description, name, context and monitor handle.
The default adapter has a null GUID. The callback creates DirectDraw7,
reads DDCAPS of size 0x17c and tests DDCAPS2_CANRENDERWINDOWED
(0x80000) at offset +8. Null optional capability outputs must be skipped.
The adapter then enumerates display modes through BBR RVA 0xbbca0:
stdcall (DDSURFACEDESC2*, context). It reads width at +12, height at +8
and RGB bit count at +84. Later selection keeps resolutions at least
640 by 480 with compatible color depth. A 32-bit 800 by 600 descriptor
survives these observed checks. DDSURFACEDESC2 is 124 bytes in this ABI.
After querying Direct3D7, the adapter invokes EnumDevices at vtable slot 3.
BBR's device callback (RVA 0xbbb60) takes description, name,
D3DDEVICEDESC7* and context, cleaning 16 stack bytes. The descriptor is
236 bytes. It reads deviceGUID at +196 to classify HAL versus T&L HAL and
the W-buffer capability bit 0x40000 at +68. These are different from
DirectDraw's adapter GUID and windowed-rendering flag. A missing W-buffer
bit does not exclude the device here. Capability layouts are defined in
d3dcaps.h.
Discovery alone does not establish that device creation or rendering works.
These call sites were checked in the pinned BBR image, SHA-256
0c61958075bb39a1848736aa515d81fd0830dfab706c2896d99d5d6ded45823d,
with bounded PE/disassembly inspection. REA constructor evidence is
ev_f3344e489870c04edd133c7facf5dd39c9d80bd240a65f63ff86b6d1a2fa06e6.
Callback addresses passed as arguments must be explicit translation seeds;
following only direct calls does not discover these functions.
Window creation and frame callbacks
Clientr registers its window procedure at RVA 0x31b0. It is a
four-argument stdcall thunk forwarding to RVA 0x31e0; that handler adds
the global app object as a fifth argument. RegisterClassA success is a
nonzero class atom, as specified by
Microsoft.
The initial CreateWindowExA at RVA 0x2f5d deliberately has zero dimensions.
The following SetWindowPos uses flags 5 (NOSIZE | NOZORDER), so it only
moves the window. A zero-sized initial canvas does not establish a failed
preference parse; later renderer initialization must size the window.
AO verifies write access in its root using test.txt before continuing.
Clientr also registers cdecl frame callbacks at RVAs 0x43f0, 0x43f6
and 0x43fc through AFCM::RegisterMessageModule. These six-byte IAT-jump
thunks target AAR's timer, DDR's action-view and CCR's font-system frame
functions. They require translation seeds even though the startup helper
passes them before the frame loop starts.
SystemParametersInfoA calls with actions 0x11 and 0x56 request screen
saver and display power-off settings. Their return values are ignored on
this startup path. A runtime without these host operations can return
BOOL false and a Win32 error; it need not change the host's global settings.
See the API contract.
Clientr calls SetFocus at RVA 0x2c96 before applying display settings.
It treats a null return as an error and requests the exception text
Failed to set focus to the game window. Windows specifies that SetFocus
returns the previous focus handle, so null can also mean successful first
focus. The existing host's single window is created active; its guest focus
state must reflect that policy rather than using an unconditional null
stub or echoing every requested handle. Supporting hidden/no-activate
styles would require corresponding host activation behavior. See
SetFocus.
FFR's TextException_t::ThrowIt (RVA 0x5ef0, throw call 0x6031) throws
a pointer to its singleton. The first _CxxThrowException argument points
to a stack slot containing that pointer, not directly to the exception
object. Dereference it once before inspecting error code +12 or its
MSVC basic_string message pointer +20 and length +24. ThrowInfo resides
at FFR RVA 0xeb40. This observation does not implement C++ unwinding.
The windowed branch of BBR SetDisplayMode (RVA 0x2780) sets GWL_STYLE
(-16) to 0x00ca0000, reads GWL_EXSTYLE (-20) and GWL_STYLE, adjusts the
window rectangle, then calls MoveWindow. This is where the initial
zero-sized window obtains the configured drawable dimensions. SetWindowLongA
returns the previous value, including zero on successful replacement;
GetWindowLongA must read that same state. See
SetWindowLongA.
The canvas host has no Win32 nonclient frame, so its rectangle adjustment
preserves the requested drawable area. Native Windows caption/menu layout
is not modeled by that hook.
ApplyDisplaySettings also invokes OOR's virtual thunks at RVAs 0x41c0
(SetErrorHandler, vtable slot 13) and 0x41fc (SetDisplayMode, slot 3).
They forward through imports to BBR. FFR supplies a separate cdecl
error callback at RVA 0x5ed0; that registered callback needs its own
translation seed.
Renderer initialization creates another DirectDraw object after adapter enumeration. The enumeration object can still be alive. Each object needs its own state and reference count, with its DirectDraw/DirectDraw7/Direct3D7 interface aliases sharing that lifetime. A process-wide singleton prevents the client from entering this observed renderer path.
DirectDraw7 GetDeviceIdentifier receives DDDEVICEIDENTIFIER2: 1072 bytes in the x86 SDK layout, description at +512, driver version at +1024, device GUID at +1048 and WHQL level at +1064. The tail includes padding. Hardware IDs and certification fields can be zero when unknown; they must not identify a real GPU that the bridge has not queried. See DDDEVICEIDENTIFIER2.
The observed windowed path creates a primary surface, queries its pixel
format, and creates a second surface before its clipper. BBR RVA 0xbb2b1
creates the clipper, 0xbb333 binds HWND through clipper slot 8, and
0xbb342 attaches it to the primary surface through surface slot 28.
The caller then releases its clipper reference at 0xbb34b; the surface
must retain its own reference. Binding the window and owning this object
does not by itself implement GetClipList or arbitrary region clipping.
Device7 startup and default textures
These observations use client-target/bbr.dll from the pinned 13.2 image
set, SHA256 0c61958075bb39a1848736aa515d81fd0830dfab706c2896d99d5d6ded45823d.
The translator reads every image from client-target and rejects hash
mismatches before translating. Compact runtime addresses are assigned by the
linker; the RVAs below remain relative to the original DLL.
After attaching the depth surface to the color render target, Randy's
initializer calls Direct3D7 CreateDevice. The resulting device owns references
to its Direct3D interface and render target. BBR's capability object constructor
at RVA 0xbcbf0 queries DirectDraw7 GetCaps, then Device7 GetCaps at 0xbcca6.
Surface attachments likewise retain the attached surface until the parent
releases it.
Device7 GetCaps receives a 236-byte D3DDEVICEDESC7 without a size prefix.
BBR reads line RasterCaps at +0x0c and triangle RasterCaps at +0x44. Only when
both contain WBUFFER (0x40000) does it select ZENABLE=2; otherwise it uses
ordinary ZENABLE=1. TextureFilterCaps is at +0x60, simultaneous texture count
is a WORD at +0xba, and the device GUID starts at +0xc4. Texture dimension
limits occupy DWORDs +0x7c through +0x88. These offsets were checked against
the local x86 DirectX SDK headers and the pinned constructor assembly
(REA evidence ev_c970d015303eb1c3808378ddb1cd58777ae184b899e6fe882c9984eb3446e328).
Initial render-state assignments include CULLMODE=3, ZENABLE=1,
ZWRITEENABLE=1, ZFUNC=4, SRCBLEND=5 and DESTBLEND=6. The cache constructor
at 0xdb600 then queries many render states and texture stage states 1-24
on stages 0-7. Getter outputs must be written and preserve previous setters;
returning a successful HRESULT without output is insufficient.
The next operation creates a 16x16 default texture. EnumTextureFormats invokes
BBR callback RVA 0xb5680, stdcall (DDPIXELFORMAT*, context), returning with
eight argument bytes removed. This callback compares all 32 descriptor bytes.
The requested format 10 is ARGB4444; ARGB8888 is an accepted preferred fallback
with DWORDs [32, 0x41, 0, 32, 0xff0000, 0xff00, 0xff, 0xff000000].
Skipping enumeration leaves the selected format zero and fails with 0xc8770bdb.
Texture creation obtains Direct3D through Device7 GetDirect3D, queries its
DirectDraw7 interface, and stores a 20-byte D3DX record with surface
SetPrivateData under GUID 684b06f3-ebae-11d2-81f4-00c04f68f299.
The record contains size, flags, original width, original height and mip count.
Surface7 Lock receives a 124-byte descriptor; writable pixel storage is returned
at +0x24. The client writes white texels and calls Unlock(null). The observed
startup then queries the render target descriptor and issues a rectangular clear.
OOR's display vtable at RVA 0x5214 contains thirteen six-byte import thunks
at 0x41c0 through 0x4208. In particular, 0x41d2 forwards to
D3DDisplaySystem_t::Clear(ARect const*, int, DisplaySystem_t::CopyFlag_e).
These remain indirect translation entry points even though their targets
are native imports already resolved by the linker.
Later startup locks a rectangular surface region. The returned pixel pointer
must advance by top * pitch + left * bytes_per_pixel, while the descriptor
keeps the full surface pitch and dimensions. Unlock takes the matching RECT
pointer, rather than the pixel pointer used by older surface interfaces.
See DirectDraw7 Lock,
Unlock
and the compatible descriptor behavior in
Wine surface_lock.
BBR RVA 0x3e90 is another indirect display method: a thiscall routine with
no stack arguments that obtains Randy's back buffer and restores queued
dirty rectangles from a saved surface through Surface7 Blt, slot 5,
with DDBLT_WAIT (0x1000000). It then advances the rectangle queue and clears
the next entry. This behavior is observed in the pinned function's assembly
and decompilation (REA evidence
ev_c01344caef95bd6c77f03cef6d9b2c4e940049b029a87c223f271ac71a4a1a3b).
The windowed renderer copies its separate back buffer into the primary surface
with Blt. Presentation must therefore work when the primary surface has no
attached flip buffer; an attachment-only presentation path silently drops
these frames.
The following windowed startup path calls DirectDraw7 WaitForVerticalBlank.
Browser rendering needs a virtual frame-pacing equivalent; a timer delay
does not observe a physical Windows display's vertical blank. The blocking
begin/end flags are 1 and 4. Flag 2 requests event notification and requires
separate Win32 event semantics, which the current bridge does not provide.
Clientr subsequently queries GetWindowRect at RVA 0x3080. Its rectangle
is in screen coordinates and must use the origin retained by MoveWindow,
rather than returning the origin-zero client rectangle. The virtual window
has no native caption or resize borders, so both rectangles share its drawable
width and height.
Clientr then loads icon resource 120 and changes its class's GCL_HICON
property (-14) with SetClassLongA at RVA 0x30cd (return address 0x30d3).
The class retains the icon handle supplied to RegisterClassA; replacing it
returns the previous handle. This metadata update does not require a browser
favicon or another visible window.
Clientr next calls AFCM StartExecutingPrograms and FrameProcess. An indirect
callback at RVA 0x2a60 loads the instance at global RVA 0x9cac into ECX
and jumps to 0x2a70. When a buffered payload is present, that method adds
a trailing zero and calls AFCM Send with two integer routing values and the
buffer pointer. It clears the pending length and alternates between two
256-byte buffers at instance offsets +0x38 and +0x138. The callback thunk
has no stack arguments and requires its own translation entry
(REA method evidence ev_9e632923750b63053982d0eb4c44300eecc5ade744b5f57308f8e9b4413b6ed8).
CCR exports another no-argument cdecl frame callback at RVA 0x62c0,
InputConverterModule_t::FramePreProcess. It obtains InputConfig_t through
its singleton getter at 0x3550 and calls the instance FramePreProcess
method at 0x4a00. The scheduler invokes the callback indirectly, so the
export also needs a translation entry
(REA evidence ev_dd3c4e18efbc35bee085b5fbf259a855dd873dcca1a0ac0712ba1c6176ae5945).
CCR's input frame path also reaches the MSVCRT getenv import. On Windows,
names compare without regard to ASCII case and the result points into the
CRT-owned environment storage. Missing names return null. The environment
must exist before DLL initialization, independently of whether __getmainargs
has run; __getmainargs can expose the same zero-terminated pointer table.
See MSVCRT getenv.
The paired input FrameProcess callback is CCR RVA 0x62d0. It clears
the DWORD at global RVA 0x3e030, obtains InputConfig_t and calls its
instance FrameProcess at 0x4bb0. CCR exposes these two frame phases
as separate private static cdecl exports
(REA evidence ev_8ecf346637d56e4b54c0a6075908441db851cad7932c6a1f85e44dd25b61d5aa).
The following observed callback is CCR's DragAndDrop_t::FramePreProcess,
RVA 0x8ad0; its paired FrameProcess is 0x8ae0. The pinned DLL exports
provide a useful discovery boundary for scheduler callbacks: methods named
FramePreProcess, FrameProcess or FramePostProcess with MSVC suffixes
@@CAXXZ, @@KAXXZ or @@SAXXZ are static cdecl void(void), with private,
protected or public access respectively. These exports can be seeded as
a group after confirming their addresses lie in executable image ranges.
Module initialization is another scheduler message phase. CCR exports
InputConfigModule_t::InitialiseMessage at RVA 0x3540; its native path
creates the InputConfig_t singleton only when absent, allocating 0x1b8 bytes.
The callback uses the same static cdecl void(void) decoration. InitialiseMessage
exports therefore belong to the indirect scheduler discovery set too
(REA evidence ev_a49ce7698a8ed72430373179ce94258b6b552735df454774dfa567e06e3de80a).
The browser bridge renders in a worker-owned WebGL2 OffscreenCanvas. D3D row vector matrices upload as transposes; clip depth 0..w becomes -w..w. Readback rows must flip from bottom-up to top-down before writing DirectDraw pixels, and ARGB8888 surfaces require red/blue conversion from WebGL RGBA bytes. Clear rectangles use top-left D3D coordinates, unlike WebGL scissor coordinates. DirectDraw presentation is opaque: a D3D clear color with zero alpha must still display its RGB value. Guest alpha bytes remain available to texture operations, but the final canvas copy must not apply source-over alpha blending.
The current Device7 drawing path is still a diagnostic: triangle lists with
FVF 0x112 (XYZ, normal, UV; 32-byte stride), UV coloring, and depth testing.
Textures, lighting, general render-state application and complete initial
Direct3D state defaults remain unfinished. State setters retain values for
the native startup cache; unset states currently read as zero. Unsupported
device operations fail explicitly. Passing this startup boundary is not yet
evidence of a playable AO scene.
NR startup calls GetLocalTime and GetSystemTime consecutively (guest return
addresses 0xd9636b and 0xd96375). Both write a 16-byte SYSTEMTIME:
eight WORDs containing year, month, weekday, day, hour, minute, second and
milliseconds. The browser runtime uses UTC for both, consistent with its
zero timezone offset and CRT clock policy; it does not inherit the host's
local timezone.
Database record file locks
In pinned client-target/ctreestd.dll (SHA-256
727ef5cc050ee5fc519e5f9a0cc2bb819a54f5eed0aac990d97a678b427b3fd5),
the routine at RVA 0x10d0..0x1219 seeks to a record offset, calls
LockFile(handle, offset, 0, length, 0), performs ReadFile or WriteFile,
then calls UnlockFile with the same range if locking succeeded. Failed
locks invoke a helper with argument 0x32 and retry up to 3000 times.
This is native client database I/O, rather than a game-server protocol lock
(REA evidence ev_f10c97c317890eef166a553ec4e457cf04da185a2e3d0af05b390d38fa0ff41f).
The Win32 contract combines low/high DWORDs into 64-bit offsets and lengths. Exclusive ranges cannot overlap, including locks requested by their existing owner. I/O through the owning handle is permitted; other handles cannot access a locked range. Unlocking requires the original range, and closing the handle releases its locks. See LockFile and UnlockFile. The browser runtime coordinates file handles within one client worker; these locks do not coordinate separate browser workers or native clients.
FFR's resource-manager vtable at RVA 0xe510 and resource-database vtable
at 0xe540 contain six-byte FF 25 <IAT address> jump methods. The first
entries are native functions at 0x7860 and 0x7830; the remaining entries
forward into PPR and HHR. In particular, RVA 0xd01e jumps through IAT slot
0xe3ec to HHR's ResourceDatabase_t::GetDbObject(const Identity_t&),
while 0xd024 forwards the overload taking a DbObject_t* through 0xe3e8.
The runtime reaches the identity overload after database record I/O. These
local jump methods need translation even when their imported target functions
have already been translated. This mapping was checked against the pinned
FFR PE's raw code, IAT and .rdata pointers (SHA-256
ce23256643e4a7c04007409bbc1ab9c1818de7c2cb9d24bd58196e56ab436c38).
FFR registers the filename-registry database type 1000010 with a native
factory at RVA 0x6f00 (DbObject_t::Register call at 0x6f70). The factory
allocates 28 bytes, forwards its two arguments into constructor 0xac10,
and returns the object. Its seven-entry vtable at 0xe600 points to
0xb2d0, 0xb2d0, 0xad60, 0xad70, 0xb2d0, 0xb2e0, 0xac50.
The reader at 0xad70 calls DbObject_t::ReadBlob, requires version 1,
then reads nested counts, numeric IDs and length-prefixed filename bytes
through BinaryStream. It rejects filename lengths over 79 bytes. Factories
and these virtual reader methods need translation independently of the
registration routine. REA evidence:
ev_20ca52e9c721f01cdf36a586c8eae8758d8cd8884959597c488a308440d9200b,
ev_7aedefd594e87e4cd7d7697a32ec3ad224d9a6c70051ca7f30b468e7202f3cab,
ev_93223775f9b979daa8ee09cba0e53cec6c8bf193efe42f7d519e50813a84b6ff,
ev_c44fa41a27944909da8885a8e1727c789d857a3d0b09952e5f1b46be95b2ce0f.
CR's BinaryStream dispatches through four stored function pointers, without
a C++ vtable: block read at object +0, block write at +4, byte get at +8 and
byte put at +12. The memory constructor at RVA 0x1170 installs readmem
(0x1c60), writemem (0x1d90), bgetc (0x1c40) and bputc (0x1d50).
The file constructor at 0x1240 installs readfile (0x1ba0), writefile
(0x1ec0), bgetcfile (0x1cc0) and bputcfile (0x1e10). Indirect
discovery must retain these handler entries as well as the constructors.
The runtime reaches writemem after creating the filename-registry object.
Its write cursor is at +0x14, capacity limit at +0x1c, and logical end at
+0x20; writes beyond capacity call overflow rather than silently truncating.
This was inspected in client-target/cr.dll, SHA-256
ea4b87a20b4700dc71b216024e44c536deb24be07ed41e0301bcc07fe50db3d6.
REA evidence: ev_e0ed4fbeaae26082038e9dd8f5d57f04a78786c00958da6f83b50f39a5bd3b95,
ev_b37cdffbfa01c8c926303d4d9b56dbb96b7cf26b3169098449c15493acd4029e,
ev_9ac64c3d697a52f5a131393c86ba118b27afd0dc040026a1fe95e2a5733445c3.
PPR's ResourceManager_t::SetPrefCallback at RVA 0x2080 registers integer
change callbacks for GroundTextureQuality (0x2060) and
OtherTextureQuality (0x2070) with IndependentPrefs_t. Registration
requests immediate notification. Both callbacks are cdecl functions with two
arguments: they ignore the first and copy the second into native globals at
0x18bd4 and 0x18bd0, respectively. This preference callback path is another
indirect entry requirement beyond module initialization and frame processing.
Pinned PPR SHA-256:
c0287692f30405ecd22014b01f481e0178a3e44737297bf66fb507200bfe2ccf.
REA evidence: ev_c6976bc5587fb6f968987344051d1e590773093768c12ca1bff90aabf06761a5,
ev_976d1fa9b163c00055d393f450c4657ef9895a99ff1174cdb3e14f92469dc955,
ev_64da9dd6a606ab1d9527610afb76118cff6e358af3ebba0d31d4e9cf89a4e1c0.
PPR's ResourceWorker_t::open(void*) at RVA 0xdf00 sets the running byte
at 0x18c1c to 1, then calls vtable slot 0x5c with ten arguments
(0, 1, 0, 0, -1, 0, 0, 0, 0, 0). Its vtable begins at 0x13350;
slot 0x5c contains thunk 0x1165a, which forwards through the IAT to
ACE_Task_Base::activate. The task's own close and svc entries are
0xdf30 and 0xdf40, and its inherited wait thunk is 0x11654.
This startup path requests one native resource worker. Executing these
entries requires thread behavior in addition to ordinary import resolution.
The open routine was decompiled (REA evidence
ev_2e525dd6d9e2ad9e7a3bb699615039f4b6b1d633e72bf5d65e0c74b6bd8ec97b);
the vtable slots and IAT forwarding were checked directly in the pinned PPR PE.
After entering ACE_Task_Base::activate, the runtime reaches ACE's protected
virtual ACE_Thread_Manager::spawn_i at RVA 0x8aff0 (mapped guest address
0x49aff0). Its identity is supplied by the pinned ACE PE's named export
?spawn_i@ACE_Thread_Manager@@MAEHP6APAXPAX@Z0JPAKPAPAXJH0IPAVACE_Task_Base@@@Z.
This observation establishes entry into the native spawn path; it does not
establish that a worker thread has been created successfully.
The spawn path next invokes unnamed ACE method 0x8e4b0, which enters a
critical section, obtains the list head at object +8, updates the linked
list and count at +0x18, then leaves the critical section and returns the
node. When the pool needs more nodes it calls virtual slot 0x14 first.
The surrounding private method-table region at RVAs 0xafd88..0xafda4
contains 0x8e790, 0x8e400, 0x8e4b0, 0x3450, 0x8e540, 0x8e5c0,
0x8e6d0, 0x8e770; slot 0x14 therefore reaches 0x8e5c0.
These are raw code/table observations. Interpreting the object as a thread
descriptor free-list allocator is an inference from its role in spawn_i;
the template class name has not been recovered.
The native resource-worker spawn path reaches MSVCRT _beginthreadex from
ACE_OS::thr_create at RVA 0x55e00, with guest return address 0x465edf.
This call is a cdecl function with six 32-bit arguments: security attributes,
stack size, entry address, entry parameter, creation flags and thread-ID
output pointer. The new thread's entry uses stdcall with one argument and
returns an unsigned exit code. Success returns a real thread handle; failure
returns zero. A zero creation flag starts execution immediately, while
CREATE_SUSPENDED requires a later resume. The caller closes the handle.
See MSVCRT thread creation.
The thread needs its own CPU context, stack, TEB/FS base and TLS, while sharing process memory and synchronization state. The existing native host launcher does not provide a browser worker launcher. See native thread contracts for the ACE entry adapter, lock ordering and shared-WASM requirements. Resource-worker execution must be verified before treating resource loading or world rendering as working.
Live browser viewport size
The browser canvas fills the viewport and renders one pixel per CSS pixel.
The private Prefs/Main.cfg receives the canvas dimensions before the guest
starts. The browser build accepts modes below the original 640x480 filter;
native mode selection is unchanged. The original UI keeps its pixel size,
so very small viewports can clip controls rather than scaling them.
ResizeObserver publishes the latest width and height through an atomic
request. browser_resize_frame consumes it on the game worker before
Clientr's sub_28002D20 starts the next frame. It preserves guest registers,
flags and x87 state, coalesces resize events, and defers while a D3D scene is
active. JavaScript never changes the worker-owned backing canvas directly.
The resize updates the desktop surface, CPU drawing surface, Randy's color
and depth buffers, viewport and camera aspect, sprite clipping, and UI bounds.
Old dirty rectangles are discarded before they can blit outside smaller
buffers. The status bar follows the bottom edge; the equipment panel follows
the right edge and rebuilds its tile grid while preserving the backing
SpriteInfo_t address retained by text widgets. Inventory, map and chat retain
their placement rules. Native Direct3D device slot 8 now implements
SetRenderTarget, retaining the replacement before releasing the old target
and preserving the viewport.
The readable layout bridge is client/runtime/browser_resolution.c. Its guest
object layout comes from these 14.9.1 symbols (addresses in the lifted tree):
| Responsibility | Symbol |
|---|---|
| Display and CPU drawing surface | BBR sub_25002770, sub_250B0850 |
| Back/depth buffers | BBR sub_250D6010 |
| Camera viewport | BBR sub_250A5F40, sub_250DF8D0 |
| Dirty rectangle queues | BBR sub_250041F0, sub_250B0B00 |
| Status bar | DDR sub_2B081C40 |
| Equipment panel | DDR sub_2B03AAF0, sub_2B03B110 |
| Window tile storage | CCR sub_270181E0 |
| Inventory, map, chat placement | DDR sub_2B03E740, sub_2B07D180, sub_2B004560 |
Focused checks:
make -C client -f Makefile.linux build/linux/browser-resolution build/linux/devices
client/build/linux/browser-resolution
client/build/linux/devices /tmp/devices.rgb
make -C client -f Makefile.wasm build/wasm/browser-resolution.js build/wasm/web/devices-test.html build/wasm/web/storage-test.html
toolchains/emsdk/node/24.19.0_64bit/bin/node client/build/wasm/browser-resolution.js
Run the two HTML tests through a server with the same cross-origin isolation headers as the game. Full-client validation must also cover odd dimensions, portrait startup, repeated grow/shrink, resizing during loading, and movement with inventory/map open. Frame capture reports retain actual backing pixel dimensions. Wait for the full build to exit successfully before copying a matching JS/WASM pair into a test server or publishing it.
The optimized client was checked in Chromium with portrait startup at 391x845 and repeated live sizes from 319x239 through 2560x1440, across Newland, Lush Fields and Bronto Burger. Inventory, map and equipment stayed open during resizing; turning, walking and server updates continued. A captured PNG confirmed the requested 1373x773 backing size. Native build/device checks and the WASM request, storage and WebGL device checks passed. Firefox/macOS and Windows were not run for this change.