Skip to content

aowlspt_inject.h

Source: abi/aowlspt_inject.h — 307 lines, 18 file-scope functions.

What this header owns

Reproduced verbatim from the header's own banner comment — these notes are frequently the only written record of why the subsystem is shaped the way it is.

text
 aowlspt_inject.h — starting the game with the host inside it.

The client host is a native DLL and something has to put it in the game's
process. The usual answer in Unity modding is DLL hijacking: drop a fake
`winhttp.dll` or `version.dll` next to the executable, let the loader pick it
up, and forward every export to the real system copy. It works, and it has
two properties worth avoiding — it depends on the exact set of exports the
system DLL has on the machine it runs on, and it leaves a file in the install
that impersonates a Windows component.

This does it explicitly instead: start the process suspended, load the DLL
into it, resume. The game starts with the host already inside and nothing in
the install pretends to be something it is not.

The mechanism is the standard one, and the ordering is what matters:

  1. `CreateProcess` with CREATE_SUSPENDED. The process exists, its main
     thread has not run an instruction, and kernel32 is already mapped.
  2. Write the DLL path into the target with `VirtualAllocEx` +
     `WriteProcessMemory`.
  3. `CreateRemoteThread` at `LoadLibraryA`. This works because kernel32 is
     loaded at the same base address in every process in a session, so our
     `LoadLibraryA` and theirs are the same address.
  4. Wait for that thread, and read its exit code — which is the low 32 bits
     of the returned HMODULE. Zero means the load failed, and finding that
     out here rather than from a silent no-op later is the point of waiting.
  5. Resume the main thread.

Step 4 is the one people skip. Without it a failed injection looks exactly
like a successful one until the mods do not appear.

Constants

  • AOWLSPT_INJECT_H

Types

  • struct AowlLaunch

Functions

SignatureLine
int32_t aowl_launch_sizeof(void)57
void aowl_launch_new(void)59
void aowl_launch_free(void* p)63
uint32_t aowl_launch_pid(void* p)64
uint32_t aowl_launch_error(void* p)65
int32_t aowl_launch_injected(void* p)66
int32_t aowl_launch_start(void* handle, const char* exePath, const char* workDir, const char* cmdLine)71
int32_t aowl_launch_inject(void* handle, const char* dllPath)107
int32_t aowl_launch_resume(void* handle)166
void aowl_launch_kill(void* handle)175
void aowl_launch_close(void* handle)180
int32_t aowl_launch_alive(void* handle)188
uint64_t aowl_spawn(const char* exePath, const char* workDir, const char* cmdLine)201
uint64_t aowl_spawn_quiet(const char* exePath, const char* workDir, const char* cmdLine)234
int32_t aowl_spawn_alive(uint64_t handle)261
void aowl_spawn_kill(uint64_t handle)281
int32_t aowl_spawn_exit_code(uint64_t handle)293
int32_t aowl_launch_wait(void* handle, int32_t ms)300

aoughwl — self-hosted platform for things n stuff. Contact / Support on Discord for access to the private backends.