2020-05-03 10:21:05 +02:00
|
|
|
#pragma once
|
|
|
|
|
2022-02-04 16:25:44 +01:00
|
|
|
#include "plugin/PluginContainer.h"
|
2024-08-04 16:42:24 +02:00
|
|
|
#include "plugin/PluginLoadWrapper.h"
|
2022-10-05 20:08:49 +02:00
|
|
|
#include <coreinit/dynload.h>
|
|
|
|
#include <map>
|
2022-02-04 16:25:44 +01:00
|
|
|
#include <memory>
|
2023-11-04 15:32:45 +01:00
|
|
|
#include <set>
|
2022-05-14 14:00:20 +02:00
|
|
|
#include <wums/defines/relocation_defines.h>
|
2020-05-03 10:21:05 +02:00
|
|
|
|
|
|
|
class PluginManagement {
|
|
|
|
public:
|
2024-03-24 07:40:58 +01:00
|
|
|
static std::vector<PluginContainer> loadPlugins(
|
2024-08-04 16:42:24 +02:00
|
|
|
const std::vector<PluginLoadWrapper> &pluginDataList,
|
2023-11-04 15:32:45 +01:00
|
|
|
std::vector<relocation_trampoline_entry_t> &trampolineData);
|
2020-05-03 12:30:15 +02:00
|
|
|
|
2024-03-24 07:40:58 +01:00
|
|
|
static void callInitHooks(const std::vector<PluginContainer> &plugins);
|
2020-05-03 10:21:05 +02:00
|
|
|
|
2024-03-24 07:40:58 +01:00
|
|
|
static bool doRelocations(const std::vector<PluginContainer> &plugins,
|
2023-11-04 15:32:45 +01:00
|
|
|
std::vector<relocation_trampoline_entry_t> &trampData,
|
2022-10-05 20:08:49 +02:00
|
|
|
std::map<std::string, OSDynLoad_Module> &usedRPls);
|
2020-05-03 10:21:05 +02:00
|
|
|
|
2024-03-24 07:40:58 +01:00
|
|
|
static bool doRelocation(const std::vector<RelocationData> &relocData,
|
2023-11-04 15:32:45 +01:00
|
|
|
std::vector<relocation_trampoline_entry_t> &trampData,
|
2022-10-05 20:08:49 +02:00
|
|
|
uint32_t trampolineID,
|
|
|
|
std::map<std::string, OSDynLoad_Module> &usedRPls);
|
2020-05-03 10:21:05 +02:00
|
|
|
|
2024-03-24 07:40:58 +01:00
|
|
|
static bool DoFunctionPatches(std::vector<PluginContainer> &plugins);
|
2020-05-03 14:16:11 +02:00
|
|
|
|
2024-03-24 07:40:58 +01:00
|
|
|
static bool RestoreFunctionPatches(std::vector<PluginContainer> &plugins);
|
2020-05-03 10:21:05 +02:00
|
|
|
};
|