Keep track of acquired RPLs and release them on exit

This commit is contained in:
Maschell
2022-10-05 20:08:49 +02:00
parent ea65654607
commit 0e56538cb1
6 changed files with 71 additions and 15 deletions

View File

@@ -1,9 +1,10 @@
#pragma once
#include "plugin/PluginContainer.h"
#include <coreinit/dynload.h>
#include <forward_list>
#include <map>
#include <memory>
#include <vector>
#include <wums/defines/relocation_defines.h>
class PluginManagement {
@@ -12,9 +13,16 @@ public:
static void callInitHooks(const std::vector<std::unique_ptr<PluginContainer>> &plugins);
static bool doRelocations(const std::vector<std::unique_ptr<PluginContainer>> &plugins, relocation_trampoline_entry_t *trampData, uint32_t tramp_size);
static bool doRelocations(const std::vector<std::unique_ptr<PluginContainer>> &plugins,
relocation_trampoline_entry_t *trampData,
uint32_t tramp_size,
std::map<std::string, OSDynLoad_Module> &usedRPls);
static bool doRelocation(const std::vector<std::unique_ptr<RelocationData>> &relocData, relocation_trampoline_entry_t *tramp_data, uint32_t tramp_length, uint32_t trampolineID);
static bool doRelocation(const std::vector<std::unique_ptr<RelocationData>> &relocData,
relocation_trampoline_entry_t *tramp_data,
uint32_t tramp_length,
uint32_t trampolineID,
std::map<std::string, OSDynLoad_Module> &usedRPls);
static bool DoFunctionPatches(const std::vector<std::unique_ptr<PluginContainer>> &plugins);