Commit Graph

55 Commits

Author SHA1 Message Date
Maschell
3943357dd7 Implement WUPS_LOADER_HOOK_VSYNC hook 2020-08-12 18:30:21 +02:00
Maschell
40dc54a07f Add RELEASE_FORGROUND and ACQUIRED_FOREGROUND hooks 2020-08-12 18:30:21 +02:00
Maschell
47945e0dc0 Actually read the target process from the plugin while function patching 2020-08-12 18:30:21 +02:00
Maschell
586ed091d7 Use the function patcher module for the plugin function patches 2020-08-12 18:30:21 +02:00
Maschell
df577e526c Init default return value in WUPSGetPluginDataForContainerHandles 2020-08-12 18:30:21 +02:00
Maschell
55092a1afa Fix check for NULL-pointer in WUPSGetLoadedPlugins 2020-08-12 18:30:21 +02:00
Maschell
7fc917da40 Use libfunctionpatcher for non-plugin function patches 2020-08-12 18:30:21 +02:00
Maschell
f31e29feb5 Check the module information struct version 2020-08-12 18:30:21 +02:00
Maschell
e91616fcff Get module_information_t pointer from args instead of "guessing" it 2020-08-12 18:30:21 +02:00
Maschell
bed3f7920b Use definitions from WUMS if possible 2020-08-12 18:30:21 +02:00
Maschell
32d635a512 Don't clear the .bss section anymore, call the wut init functions only once, except the devop one 2020-08-12 18:30:21 +02:00
Maschell
d4c4e7c669 Remove the elfio reader from the PluginData class, use it when it's needed 2020-08-12 18:30:21 +02:00
Maschell
0943f7f57b Adjust the setter the PluginContainer to use const values 2020-08-12 18:30:21 +02:00
Maschell
4c7fec9737 Fix setting the trampolineID 2020-08-12 18:30:21 +02:00
Maschell
3e30e5bbd1 Use alloc/free from memorymapping module if possible 2020-08-12 18:30:21 +02:00
Maschell
4c0b5f3480 Adopt to new chnages of WUMS 2020-08-12 18:30:21 +02:00
Maschell
2eff20d195 elfio: use delete instead of free 2020-08-12 18:30:21 +02:00
Maschell
850ee0a433 Add flush after patching the functions 2020-08-12 18:30:21 +02:00
Maschell
c79cdd04ed Update module_defines.h to match latest SetupPayload version 2020-08-12 18:30:21 +02:00
Maschell
25929e84fa Use libkernel for a KernelCopy instead register own kernel functions. 2020-08-12 18:30:21 +02:00
Maschell
b6aeb71846 OSReceiveMessage hook: Only look into the message if the result is true 2020-08-12 18:30:21 +02:00
Maschell
c084e114e9 Organize imports and format code 2020-08-12 18:30:21 +02:00
Maschell
8050bb7e44 Make sure to use plugins only in proccess 2 and 15. 2020-08-12 18:30:21 +02:00
Maschell
0406081e1a Build with WiiUModuleSystem, export a bunch of useful functions to control the backend 2020-08-12 18:30:21 +02:00
Maschell
b04c28a0a3 Allow direct access to plugin data buffers 2020-08-12 18:30:21 +02:00
Maschell
a9405954f6 Adopt module_defines to be compatible to the latest SetupPayload 2020-08-12 18:30:21 +02:00
Maschell
7556dab6e9 Add option to delete or not delete the actual plugin data when unloading plugins 2020-08-12 18:30:21 +02:00
Maschell
fe68f7fa00 Make sure to restore patches before unloading plugins 2020-08-12 18:30:21 +02:00
Maschell
0177dfd604 Add callDeinitHooks and RestorePatches to the PlugingManagement 2020-08-12 18:30:21 +02:00
Maschell
d983a77f94 Addned functions to load plugin meta information from a path or buffer 2020-08-12 18:30:21 +02:00
Maschell
6117a332b7 Fix logging of std::string 2020-08-12 18:30:21 +02:00
Maschell
5580ea9882 Remove debug logs 2020-08-12 18:30:21 +02:00
Maschell
7514e00d68 Improve logging 2020-08-12 18:30:21 +02:00
Maschell
5d306ba833 Add support for loading a list of plugin data on the next application change 2020-08-12 18:30:21 +02:00
Maschell
54534a9445 Add PluginDataPersistence 2020-08-12 18:30:21 +02:00
Maschell
8350766c40 Add missing copy constructors 2020-08-12 18:30:21 +02:00
Maschell
2c1c356450 Free trampolin data when unloading plugins 2020-08-12 18:30:21 +02:00
Maschell
3aac0a821e Add missing import 2020-08-12 18:30:21 +02:00
Maschell
fddd8842f2 Move global variables into a own file 2020-08-12 18:30:21 +02:00
Maschell
be84c8b48f Improve logging 2020-08-12 18:30:21 +02:00
Maschell
d9e57ecc9d Move loadPlugins function to PluginManagement 2020-08-12 18:30:21 +02:00
Maschell
492dcacaad Add a function to unload all plugins from memory in the PluginManagement 2020-08-12 18:30:21 +02:00
Maschell
dd9b32a1f6 Add the PluginHeapHandle as an argument instead of using the global variable 2020-08-12 18:30:21 +02:00
Maschell
cc4b9b4594 Fix calculating the size needed to store the plugins in memory. 2020-08-12 18:30:21 +02:00
Maschell
bbf68181ec Refactor loading plugins 2020-08-12 18:30:21 +02:00
Maschell
8dd161b177 Even more formatting 2020-08-12 18:30:21 +02:00
Maschell
59f361f7de Formatting 2020-08-12 18:30:21 +02:00
Maschell
fae8be334f Save the address of memory allocated on the plugin heap 2020-08-12 18:30:21 +02:00
Maschell
f31da6e1e5 Fix logic behin calling hooks, improve logging when calling hooks. 2020-08-12 18:30:21 +02:00
Maschell
10b118db00 Call the CRT hooks at each application start, not just once. 2020-08-12 18:30:21 +02:00