2020-05-03 10:21:05 +02:00
|
|
|
#pragma once
|
|
|
|
|
2022-02-04 16:25:44 +01:00
|
|
|
#include "plugin/PluginContainer.h"
|
2020-05-03 10:21:05 +02:00
|
|
|
#include <common/plugin_defines.h>
|
2022-02-04 16:25:44 +01:00
|
|
|
#include <memory>
|
2020-05-03 10:21:05 +02:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class PluginManagement {
|
|
|
|
public:
|
2022-01-27 12:47:33 +01:00
|
|
|
static void doRelocations(const std::vector<std::shared_ptr<PluginContainer>> &plugins, relocation_trampoline_entry_t *trampData, uint32_t tramp_size);
|
2020-05-03 12:30:15 +02:00
|
|
|
|
2021-12-15 17:09:30 +01:00
|
|
|
static void memsetBSS(const std::vector<std::shared_ptr<PluginContainer>> &plugins);
|
2020-05-03 10:21:05 +02:00
|
|
|
|
|
|
|
static void callInitHooks(plugin_information_t *pluginInformation);
|
|
|
|
|
2020-05-03 12:30:15 +02:00
|
|
|
static void PatchFunctionsAndCallHooks(plugin_information_t *gPluginInformation);
|
2020-05-03 10:21:05 +02:00
|
|
|
|
2022-01-27 12:47:33 +01:00
|
|
|
static bool doRelocation(const std::vector<std::shared_ptr<RelocationData>> &relocData, relocation_trampoline_entry_t *tramp_data, uint32_t tramp_length, uint32_t trampolineID);
|
2020-05-03 14:16:11 +02:00
|
|
|
|
2020-05-28 20:51:31 +02:00
|
|
|
static void unloadPlugins(plugin_information_t *pluginInformation, MEMHeapHandle pluginHeap, BOOL freePluginData);
|
2020-05-03 14:20:00 +02:00
|
|
|
|
2022-01-27 12:47:33 +01:00
|
|
|
static std::vector<std::shared_ptr<PluginContainer>>
|
|
|
|
loadPlugins(const std::vector<std::shared_ptr<PluginData>> &pluginList, MEMHeapHandle pHeader, relocation_trampoline_entry_t *trampoline_data, uint32_t trampoline_data_length);
|
2020-05-17 21:04:16 +02:00
|
|
|
|
|
|
|
static void RestorePatches(plugin_information_t *pluginInformation, BOOL pluginOnly);
|
2020-05-03 10:21:05 +02:00
|
|
|
};
|