8 Commits
Author SHA1 Message Date
HetCreep a06688e85b Degrade instead of crashing when the IL2CPP interop assemblies are missing (#1338)
* Degrade instead of crashing when the interop assemblies are missing

OnInvokeMethod references interop types (UnityEngine.Application/LogType) in its body. The CLR JIT-compiles the whole method before running any of it, so when the interop assemblies cannot be resolved the method throws FileNotFoundException at JIT time -- before its own try is entered -- and the exception escapes into the native runtime-invoke detour and crashes the process with nothing logged.

Move the interop-referencing call into its own SetupUnityLogging method called inside the try. OnInvokeMethod then JITs without the interop assemblies present, the missing-interop failure is caught, and the loader degrades (logs and continues) so the game runs unmodded. Set unhook at the top of the try so the detour fires exactly once even on failure.

* Condense the interop-degrade comments and reword the fatal log

Per review: trim the JIT-bypass comments to one line each and change
the fatal message to "Unable to execute IL2CPP chainloader, no plugins
will be loaded".
2026-06-11 11:54:22 +02:00
aldelaro5 544f909a80 Revert "Merge pull request #960 from aldelaro5/metaplugins" (#995)
This reverts commit 2a61b61497, reversing
changes made to 6b38cee127.
2024-09-24 20:25:56 +02:00
ManlyMarco cbd70eb2f0 Automatically load all interop assemblies before loading plugins (#777)
Assemblies are often loaded on the il2cpp side but not on the mono side, causing confusion when using reflection.
This will load all interop assemblies right before plugins are loaded, which should mostly avoid these issues at a low time cost of around 40ms.
2024-09-08 15:45:19 +02:00
aldelaro5 d44b93ba93 Use the IL2CPPChainLoader instance for il2cpp to preserve compatibility 2024-09-01 22:56:30 -04:00
aldelaro5 e9337e9982 Revert the removal of the il2cpp chainloader instance 2024-09-01 17:35:53 -04:00
aldelaro5 bfc539bd74 Address code review round 2 2024-08-25 12:03:33 -04:00
js6pak 0d2cbe61bf Add chainloader events 2022-08-24 21:55:09 +02:00
ghorsington f7857c7994 Restructure project names and folder layout 2022-08-14 17:19:09 +03:00