Neverhood original DSETUPE attach and setup path (2026-11-13)
SETUP/DSETUPE.DLL!iDirectXSetup is ordinal 3, RVA 0x34b0, a three-DWORD stdcall (HWND, ANSI source directory, DWORD flags) with signed EAX result and ret 0x0c. The ordinary non-Japanese Win9x DSETUP wrapper reaches this implementation after loading the DLL during process attach. DSETUPE's own attach requires ThunkConnect32 with dsetup6e.dll, before its export can run. The current handler returns TRUE without connecting that thunk. This is a concrete source-level gap, not an observed runtime failure or permission to manufacture DirectX success. NO_NATIVE_RESULT; original installation, first room and gameplay remain OPEN.
This continues the DSETUP wrapper trace and the original Install trace. Evidence: scratch/runs/20261113-neverhood-dsetupe-2320/. No production file was edited; incoming WIP was preserved. All edges below are static original-code obligations conditional on reaching the indicated branch. No original instruction, dialog, driver or child was executed.
Identity and recovery lifecycle
Verified all 130 seals in the sealed2220/2140 manifests before reuse. One HTTP request recovered only ISO bytes 650446848–650492927, total 651438080, from https://archive.org/download/neverhood_202508/Neverhood.iso. Before parsing, admission required 206, exact Content-Range: bytes 650446848-650492927/651438080, declared and actual length 46080, absent/identity Content-Encoding, and full SHA-256 bdb0ec0953570355b9d6995f8c70e067bd314911090acf32fbe9883f33875945. fetch.py, http.json, member.json preserve recipe and receipt. No DIRECTX duplicate, further dependency, full ISO or media under /home was recovered.
supervise.py starts a separate recovery child under Popen.wait(timeout=1200) before recovery begins. The child makes its HTTP request with a 30-second timeout, then waits for cooperative stop. The supervising process kills and waits on deadline and removes the RAM member in finally; it also owns the append-only board watcher. An actual short-deadline negative control killed and reaped a sleeping subprocess with exit -9, recorded in deadline-control.json. This establishes the timeout/kill/wait mechanism without claiming a background PID persisted unobserved.
The live member was /dev/shm/neverhood-dsetupe-2320.dll. Every retained window was compared directly with the full admitted member before stopping. Recovery child 1832774 actually exited 0; watcher 1832775 actually exited -15; supervisor returned 0 through the observed exec session. stop-receipt.json records finally deletion and deadline_fired=false. No ongoing deadline process is claimed. 25 windows totaling 9998 bytes remain in windows.json, with exact bytes, file offsets, lengths and individual hashes; these are bounded selected windows, not a retained DLL. pe.json retains parsed metadata, not a source/media archive.
Addresses are preferred VAs at 0x10000000, independently of the wrapper DLL's identical preferred base. Real loading must relocate each module separately. PE entry is 0x10004930, exported application DllMain 0x100046b0. No TLS directory or delay-import directory is present. .data raw size is 0x1600, virtual size 0x84f8; globals above RVA 0xa600 occupy the initially zero-filled tail. Module, path, flags, dialog, cancellation and result globals subsequently mutate and cannot be replaced by immutable inventory values.
The other exports are DllMain ordinal 1/RVA 0x46b0, iDirectXDeviceDriverSetup ordinal 2/RVA 0x3950, and data export thk3216_ThunkData32 ordinal 4/RVA 0x9578. None is a PE export forwarder. A data export is not a callable installation entry.
PE attach: first API and exact thunk connection
The loader's three-DWORD callback frame enters 0x10004930, not exported DllMain. Optional callback pointer 0x100114f4 is initially zero in the BSS. Conditional calls through it at 0x10004965/49f1 are CRT plumbing; SETUP95 supplies no installation callback argument. For successful process attach:
| Original edge | Concrete boundary |
|---|---|
| 0x10004998 → 0x100047e0 | CRT initialization must return nonzero before application DllMain. Earliest ordinary attach API is GetVersion at 0x100047ed, through IAT 0x10012340. |
| 0x10004816–4837 | Conditional GetModuleHandleA / GetProcAddress check; CRT environment selection, not a DirectX version result. The pointed-to names at 0x100095fc/95f4 and deeper helper are outside retained windows; no additional dependency is inferred. |
| 0x1000483f → 0x10005150 | HeapCreate(0,0x1000,0) at 0x10005159 stores private heap handle 0x100114e0. This helper itself does not test the return. |
| 0x10004879 → 0x10004f80 | Lock initialization helper, TlsAlloc, zeroed 0x74-byte allocation, TlsSetValue, per-thread initialization and GetCurrentThreadId. TlsAlloc=-1, allocation failure or failed TlsSetValue return FALSE. Internal lock/allocation/environment bodies remain bounded unknowns. |
| 0x1000488c onward | GetCommandLineA and environment/CRT file/codepage/initializer helpers. Failed required command/environment pointers trigger cleanup and FALSE. The complete CRT closure is not claimed. |
| 0x100049b0 → 0x100046b0 | Application DllMain stores hModule at 0x100103bc, then calls 0x100046cc → 0x100046f4 on the notification route. |
The helper at 0x100046f4 inserts two arguments and jumps 0x10004700 → 0x10008058 → IAT 0x10012338 (ThunkConnect32). Its exact six arguments, in callee order, are:
(0x10009578, "thk3216_ThunkData16", "dsetup6e.dll", "dsetupe.dll", hModule, reason).
The string thk3216_ThunkData16 is inline data at 0x10004705; linear disassembly there is not executable code. Both DLL basenames are retained in selected data. The outer helper preserves the return address while inserting the table/name arguments. The import must clean six DWORDs; with the return address that is 28 bytes of guest stack advance in the current handler convention.
If ThunkConnect32 returns zero, DllMain returns FALSE at 0x100046d9. For process attach only, nonzero connection then calls DisableThreadLibraryCalls(hModule) at 0x100046e2; its BOOL is ignored and DllMain returns TRUE at 0x100046ef. Other notification reasons still pass through connection; PE entry performs distinct detach/thread CRT work. Loader TRUE is not the exported setup result.
ThunkData32 begins LS01 at 0x10009578. The shared indirect call pointer at 0x10004719 initially contains 0x1000959c, with another pointer at 0x1000471d to 0x100095bc; those selected data blocks initially contain CC padding. A meaningful connection must supply the real cross-mode machinery. Simply returning TRUE leaves no demonstrated target implementation.
The bounded path proves calls to selector 1 at 0x1000478f and selector 2 at 0x10004739. Two other generated stubs (selectors 0/3) are present in the retained thunk window; their existence is inventory, not proof they execute on this closure. Selector 1 narrows its first argument to a WORD, maps the EBP+12 pointer through SMapLS_IP_EBP_12, calls through [0x10004719] at 0x100047a2, sign-extends AX, unmaps, and returns ret 8. Selector 2 narrows its first argument, maps pointer arguments at EBP+12/+16/+20/+24, pushes the remaining four DWORDs, calls the same target at 0x1000476a, joins the returned DX:AX value into EAX, unmaps and returns ret 0x24. Actual callee operations, cross-mode execution, module resolution and results inside dsetup6e.dll remain unknown. That member was not recovered.
Export entry, source paths and configuration
The wrapper's sealed call 0x1000122c → [wrapper 0x10006060] forwards (HWND, source setup directory, 0x10000a3f) for ordinary Win9x; it can OR 0x80 for existing-install state. DSETUPE 0x100034b0 reads all three arguments and proves the matching ABI with ret 0x0c at 0x10003845. Zero flags default to 0xa3f. Any bit of 0xa27 expands to all of 0xa27, and 0x1000 is always ORed; the ordinary flags become 0x10001a3f. No input/result is supplied by this investigation.
The first API inside the export is GetVersionExA at 0x100034eb, with OSVERSIONINFOA size 0x94. Its BOOL is unchecked. Exact platform 1/major 4/minor 0/low build WORD 950 sets 0x1000fa0c=1, otherwise zero. This is an equality used in later component-copy decisions, distinct from the wrapper's pre-release classification. GetWindowsDirectoryA and GetSystemDirectoryA populate separate global paths. A nonempty source argument is copied verbatim to 0x10010148. Missing/empty source instead uses GetModuleHandleA(NULL), GetModuleFileNameA and GetShortPathNameA via 0x100038d0, then removes the executable basename. The supplied Neverhood source path selects the direct-copy branch.
Helpers 0x10003890/3850 remove/add trailing backslashes using CharNextA. The system path also builds a VMM32\ path. **0x100035f4 → 0x100033d0** opens **HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion**, queries **ProgramFilesDir** into a 0x104-byte buffer and closes the key. Failure of either registry call returns FALSE and makes the export return **-9** before any dialog. On success it appends \directx, attempts CreateDirectoryA, appends \setup, attempts CreateDirectoryA again, appends \, then calls GetShortPathNameA into the supplied output buffer. Those CreateDirectory/GetShortPathName results are not checked before it returns TRUE. Thus even the setup preflight mutates directories; registry-query success does not prove usable output paths.
The export checks source directory attributes and optional source + DirectX child attributes. The two-attempt logic can return -8 for missing/invalid source. Original audio bit 0x8 and display bit 0x10 additionally check **source + DIRECTX\ + selected driver directory + Audio\msdsound.inf / Display\msddraw.inf**, returning **-7** for missing paths or a directory in place of the file. These bits are set by the ordinary flags. The driver-directory selector **0x10001520** chooses DRIVERS\, DRVSJ\, or DRVSNEC\ through locale and Japanese keyboard checks. Ordinary non-Japanese selection is DRIVERS\; availability is unobserved. The entire caller-supplied directory is not silently replaced by a guessed media mount.
After storing normalized flags at 0x100090f4, clearing selected state and setting a wait cursor, DialogBoxParamA at 0x1000382f receives (hModule, resource 100, original HWND, DLGPROC 0x100015e0, 0). Its raw EAX is preserved through the epilogue and returned to DSETUP. A dialog-creation -1 therefore propagates; it is not converted to success. No extra callback argument or callback setter is demonstrated.
WM_INITDIALOG stores the dialog HWND, escapes system-directory backslashes via 0x10002420, and calls 0x10002350. That helper opens source + directx.siz through the cdecl file-open helper 0x10004c60, reads up to ten lines with 0x10004ba0, parses numeric prefixes with 0x10004af0, and adds 200000 to the first entry when the file opened. Missing file zeroes ten DWORDs instead. These values are not an externally imposed resource budget. The selected CRT stream wrappers are retained; their deeper open/read/locking implementations are outside this closure.
The next local gate 0x10003310 literally returns 1. This is original member code, not an injected success stub; it does not validate DirectX installation. The callback builds component paths, backs up an existing Windows-directory wininit.ini via GetTempFileNameA/CopyFileA, and posts WM_COMMAND 1000. Its unreachable gate-failure arm would set result -6 and post completion 1009; the retained unconditional gate does not select it.
Command 1000 → 0x1000181f tests flags & 0x1227 (true for ordinary flags), updates status and pumps messages, then calls 0x10001880 → 0x10002450(HWND,flags). That function first tries source + DIRECTX\directx.inf, then source + directx.inf through 0x10004c60. If neither opens it invokes original error helper 0x10001440 with string 9004, Can't open DIRECTX.INF, and returns -7. The error helper suppresses its MessageBoxIndirectA when the prior SetErrorMode has bit 1; its title is string 9000, DirectX Setup. No prompt response is assumed.
The INF loop reads lines through 0x10004ba0 and selects exact section headers using lstrcmpA and component flag masks. It includes DirectX, Direct3D, DirectDraw, DirectSound, DirectPlay, DirectInput and setup sections. 0x1000268a → 0x100026e0 reads selected records and reaches parser 0x100027f0 and copy/version helper 0x10002c10. Those deeper record-parser/copy bodies are explicit unknown branches here; no INF contents were fetched, so no actual record list, file version decision, installed bytes, delayed rename or reboot result is claimed. The outer loop returns a negative error or boolean 0/1 based on selected record outcomes, then stores that in global 0x10009104. Negative result posts completion directly; otherwise it advances to command 1001.
Driver, INF thunk, cancellation and return boundaries
The original command table at 0x100020b8 supplies these targets. Each stage conditionally performs work and posts the next stage; these are internal posted commands, not visible menu answers:
| Command | Selected original work / next boundary |
|---|---|
| 1001 → 0x100018d7 | If flags &0x110, calls iDirectXDeviceDriverSetup 0x10003950 for MEDIA, then posts 1002. |
| 1002 → 0x1000199b | If flags &0x108, calls the same driver helper for Display, then posts 1004. |
| 1003 | Table target is the callback default return; no hidden work inferred. |
| 1004 → 0x10001a5f | If flags &0x200, deletion-list helper 0x10003320 and d3d.inf through 0x100033b0; posts 1005. |
| 1005 → 0x10001b6f | If bit 1, ddraw.inf through 0x100033b0; posts 1006. |
| 1006 → 0x10001c19 | If bit 2, dsound.inf through 0x100033b0; posts 1007. |
| 1007 → 0x10001cc3 | Also tests bit 2; dinput.inf through 0x100033b0; posts 1008. Preserve the original mask, rather than substituting an expected component flag. |
| 1008 → 0x10001d6d | If bit 0x20, DirectPlay-related deletion/INF work through the same helper; conditional older-file version/removal work follows before posting 1009. Deeper version/deletion helpers remain unknown. |
| 1009 → 0x10002080 | Sets completion/cursor state and EndDialog(HWND, [0x10009104]) at 0x100020a1. |
The driver helper is independently exported with five-DWORD stdcall (ret 0x14 at 0x10003d40); it is now a demonstrated conditional internal call, not merely another export name. It prepares Windows INF/system paths and conditional MEDIA/Display metadata via helpers 0x10003e50/3fb0/3d50, whose bodies are outside this closure. At 0x10003d1a → 0x10004739, it passes nine arguments into thunk selector 2, including HWND, class/source/INF/system pointers, metadata DWORDs and flags OR 0x80000000. Its returned joined DX:AX value is returned to the callback. A nonzero driver-helper result sets global setup result to 1; that does not prove driver installation succeeded inside the unrecovered 16-bit module.
The INF helper 0x100033b0 checks completion/cancellation state and calls 0x100033c3 → 0x1000478f, selector 1, with (HWND, INF pathname). The callback ignores this helper's returned value for those registration stages. Strings and UI labels saying “Registering” therefore do not establish actual registration. The thunk's callee operation remains unknown; do not rename it CreateProcess, WinExec, ShellExecute or an observed install API based on labels alone.
During protected driver work 0x100090ec=1, Cancel ID2 merely sets deferred cancellation 0x100090e8. The driver stage subsequently sends the Cancel command synchronously when that flag is set. Otherwise ID2 displays the original MessageBoxA(MB_YESNO=4) using strings 10014/10015: Yes continues; IDNO=7 selects abort. The abort branch restores/deletes the saved wininit.ini paths as appropriate, marks completion and ends the dialog with -12. No answer is supplied here. The status helper writes control 1010 and pumps PeekMessage/GetMessage/TranslateMessage/DispatchMessage; actual resource layout and rendering are not established by these calls.
The export returns the modal result unchanged. The wrapper saves it, optionally performs its own component registry work for nonnegative results, then restores the signed return; prior2140's caller accepts raw 0/1/-12 in the record executor and handles cancellation/restart later. Early local export results -9/-8/-7, INF -7, actual EndDialog values, and DialogBox -1 remain separate boundaries. No test result here substitutes for those originals.
There is no direct CreateProcess/WinExec/ShellExecute import or demonstrated child launch in this bounded closure. This does not exclude a child launched by the 16-bit thunk target, another unexpanded helper or later SETUP95 Play. No child command, child wait or exit code has been established. The concrete next native dependency is ThunkConnect32's dsetup6e.dll/ThunkData16 contract and the selector-1/2 targets; it precedes assuming the UI/config/driver route works. The duplicate media entry or an API-name inventory cannot close it.
Actual source gap, verification and remaining work
At the pinned source revision plus relevant incoming diff, src/09a7-handlers-dispatch.wat:4331 implements ThunkConnect32 using only two register stores: EAX=1 and ESP+=28. It performs no connection, DLL load or target mutation. All ten imported SMapLS_IP_EBP_8/12/16/20/24 and SUnMap counterparts are absent by name from src/api_table.json; that is a source-table fact, not an observed import-binding failure. The generic module loader, aliases or actual environment could determine the first runtime stop. No attempt was made to execute it. The unsuffixed DirectXSetup handler still returns zero and cannot satisfy this original export/thunk contract.
Existing DLL callback, version, registry, short-path, file and modal handlers provide relevant primitives. Their existence does not establish the original CRT, nested loader, real cross-mode connection, output buffers, message dispatch, config selection or persistence composing correctly. Source checks deliberately cover the concrete no-binding handler and name gaps, rather than treating all 116 imported function names as exercised coverage. No production repair or success spoof was introduced.
113 live static checks, 87 post-removal checks, 4 pure source checks, 9 byte/custody negative controls and 3 source negative controls pass. Checks include 28 exact rel32 edges, 14 selected IAT calls, export/frame/cleanup identities, original thunk data and selected command table. Controls reject HTTP status/range/encoding/length/hash changes, changed attach displacement, wrong setup cleanup, changed thunk pointer and changed completion target. Source controls reject altered return, cleanup and hypothetical binding body. These checks parse bytes/text only; no CPU, Machine, guest, VM, WASM, native, browser or game execution occurs.
Git is the source archive: git-start.txt, source-pins.json, relevant.patch, owned-doc.patch, new-helpers.patch, patch checks and artifact hashes preserve exact Git identity and relevant incoming/owned hunks without snapshots. Only this note is committed. Docs diffcheck and strict main pull/push are the publication checks; full build/runtime tests are excluded by the authorized static-only scope.
Bounded closure stops at the CRT internals, selected INF record/copy/version helpers and 16-bit thunk target. Japanese/NEC selection, zero/empty source, directory/registry failures, deferred cancellation, dialog creation error and notification/detach arms remain explicit conditional paths. Further work requires separate authorization for the exact dsetup6e dependency and its ABI/data, or for an original runtime with full media and observed choices/results. Original installation, first frame, first room and gameplay remain OPEN; NO_NATIVE_RESULT. No box was created: ID none, state NOT_CREATED, expiry null, box stop receipt N/A. No full build, worker, capacity/reserve work or general cleanup occurred. Ownership is released after docs-only publication; this single-task worker stops.