ContentRedirectionModule/src/main.cpp

46 lines
1.5 KiB
C++
Raw Normal View History

#include "FSADirReplacements.h"
#include "FSAFileReplacements.h"
2022-04-14 22:41:41 +02:00
#include "FSDirReplacements.h"
#include "FSFileReplacements.h"
#include "FileUtils.h"
#include "utils/logger.h"
#include <wums.h>
WUMS_MODULE_EXPORT_NAME("homebrew_content_redirection");
WUMS_USE_WUT_DEVOPTAB();
WUMS_INITIALIZE() {
initLogging();
DEBUG_FUNCTION_LINE("Patch functions");
2022-05-08 19:37:46 +02:00
for (uint32_t i = 0; i < fs_file_function_replacements_size; i++) {
if (!FunctionPatcherPatchFunction(&fs_file_function_replacements[i], nullptr)) {
OSFatal("homebrew_content_redirection: Failed to patch function");
}
}
for (uint32_t i = 0; i < fsa_file_function_replacements_size; i++) {
if (!FunctionPatcherPatchFunction(&fsa_file_function_replacements[i], nullptr)) {
OSFatal("homebrew_content_redirection: Failed to patch function");
}
}
2022-05-08 19:37:46 +02:00
for (uint32_t i = 0; i < fs_dir_function_replacements_size; i++) {
if (!FunctionPatcherPatchFunction(&fs_dir_function_replacements[i], nullptr)) {
OSFatal("homebrew_content_redirection: Failed to patch function");
}
}
for (uint32_t i = 0; i < fsa_dir_function_replacements_size; i++) {
if (!FunctionPatcherPatchFunction(&fsa_dir_function_replacements[i], nullptr)) {
OSFatal("homebrew_content_redirection: Failed to patch function");
}
}
2022-04-14 22:41:41 +02:00
DEBUG_FUNCTION_LINE("Patch functions finished");
deinitLogging();
}
WUMS_APPLICATION_STARTS() {
initLogging();
}
WUMS_APPLICATION_ENDS() {
clearFSLayer();
deinitLogging();
}