tools/exefs_plugins.py ran every plugin's init in one service run and refused them all when one was refused. Now a run
without inits lists the plugin modules, then each plugin runs in service runs of its own (TOTK_PLUGIN_ONLY, the others
stay loaded): a refused svc, a crash (the FATAL line is the reason), a timeout or a failed check refuses that plugin
alone, with its reason in plugins.status; the rest are built in. 4 plugins take 2.3 s.
At start, plugins_start compares each plugin right after its own init and takes its branches out of main's .text before
the next one, so each init sees the game's bytes, as in its service run. Only that init's aliases are flushed: the
start stays at 113 ms for Full Inventory Expansion + Quick Weapon Durability (107 ms before).
The installer's second lift keeps every plugin of the service runs in the layout when one is built: the records hold
that layout's addresses. A refused plugin stays loaded and never starts. A mod with a built plugin and a refused one,
used without its code, runs the built one (mods.c; --probe-mods case T).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After the design in #845 by itaskaev2. tools/exefs_plugins.py writes an accepted plugin's patch set
(recomp/patches.py plugin lines and hook sites, one ordered set mod_<hash> per plugin, several plugins
in one record told apart by their hooks) and a line per plugin of build-cache/plugins.status: built, or
refused with the first reason. It also checks the code the hooks reach (direct branches and calls from
the stubs, impls, callbacks and targets): no svc but OutputDebugString, imports only from a reviewed
list. The init's imports may now include malloc, free, memcpy, memmove and memset, because the init runs
again at every start and its heap blocks exist while the game runs.
The setup's lift step runs the plugin stage when a mod has exefs/subsdk*: a lift with the plugins, a
totk.exe of it in the compile step's folder, the service run, then the lift with the hook sites; a failed
stage warns (warn.plugins_skipped) and installs without the plugins. docs/mods.md describes what works,
what is refused and why, and the rebuild.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two service runs with other GetSystemTick values, the words that differ between them listed with what they point
into, and a check that refuses a plugin with a reason per broken rule: a refused run, svcs, GetInfo ids or imports
outside the reviewed lists, writes outside main's .text, and writes that are none of exlaunch's inline hooks
(b to a stur/bl impl/ldur/b/.quad stub whose trampoline is the original relocated plus b site+4), call-site rewrites
(bl to a function start of the plugin's lift) or replace hooks (b from a main function start, Orig trampoline found).
tests/exefs_plugins_test.py covers the layout with and without plugins and one bad record per rule.
After the design in #845 by itaskaev2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>