- Home
- Technical Documentation
- 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
modsfolder. A copy loaded by the injector is tracked (swinject modslists the copies it loaded).