DeltaLoaderDocs
  1. Home
  2. Technical Documentation
  3. Assembly loading

Assembly loading

How a mod binary is loaded into the game process.

Stormworks is a native program, and mods are native DLLs, not .NET assemblies. Loading is done with the Windows LoadLibraryW function by the injector. The DLL's entry point (DllMain, defined by SW_MOD) starts the mod thread and runs the checks.

  • Unloading calls the export swmod_shutdown() and then frees the DLL, after all hooks are removed and no game thread is inside a callback.
  • The launcher copies the DLL into the game's mods folder. A copy loaded by the injector is tracked (swinject mods lists the copies it loaded).

Documentation for game build 1.15.26. Found a mistake? Open an issue.