mirror of
https://github.com/wiiu-env/WUMSLoader.git
synced 2026-09-27 04:17:03 -05:00
Implementation of InitBeforeRelocationDoneHook and SkipEntrypoint module options
This commit is contained in:
@@ -132,12 +132,19 @@ public:
|
||||
return this->export_name;
|
||||
}
|
||||
|
||||
bool isInitBeforeEntrypoint() const {
|
||||
return this->initBeforeEntrypoint;
|
||||
bool isSkipEntrypoint() const {
|
||||
return this->skipEntrypoint;
|
||||
}
|
||||
|
||||
void setInitBeforeEntrypoint(bool value) {
|
||||
this->initBeforeEntrypoint = value;
|
||||
bool isInitBeforeRelocationDoneHook() const {
|
||||
return this->initBeforeRelocationDoneHook;
|
||||
}
|
||||
|
||||
void setSkipEntrypoint(bool value) {
|
||||
this->skipEntrypoint = value;
|
||||
}
|
||||
void setInitBeforeRelocationDoneHook(bool value) {
|
||||
this->initBeforeRelocationDoneHook = value;
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -155,5 +162,6 @@ private:
|
||||
uint32_t startAddress = 0;
|
||||
uint32_t endAddress = 0;
|
||||
uint32_t entrypoint = 0;
|
||||
bool initBeforeEntrypoint = false;
|
||||
bool skipEntrypoint = false;
|
||||
bool initBeforeRelocationDoneHook = false;
|
||||
};
|
||||
|
||||
@@ -189,10 +189,15 @@ std::optional<ModuleData> ModuleDataFactory::load(std::string path, uint32_t *de
|
||||
if (key.compare("export_name") == 0) {
|
||||
DEBUG_FUNCTION_LINE("export_name = %s", value.c_str());
|
||||
moduleData.setExportName(value);
|
||||
} else if (key.compare("initBeforeEntrypoint") == 0) {
|
||||
} else if (key.compare("skipEntrypoint") == 0) {
|
||||
if (value.compare("true") == 0) {
|
||||
DEBUG_FUNCTION_LINE("initBeforeEntrypoint = %s", value.c_str());
|
||||
moduleData.setInitBeforeEntrypoint(true);
|
||||
DEBUG_FUNCTION_LINE("skipEntrypoint = %s", value.c_str());
|
||||
moduleData.setSkipEntrypoint(true);
|
||||
}
|
||||
} else if (key.compare("initBeforeRelocationDoneHook") == 0) {
|
||||
if (value.compare("true") == 0) {
|
||||
DEBUG_FUNCTION_LINE("initBeforeRelocationDoneHook = %s", value.c_str());
|
||||
moduleData.setInitBeforeRelocationDoneHook(true);
|
||||
}
|
||||
}
|
||||
if (key.compare("wums") == 0) {
|
||||
|
||||
@@ -71,7 +71,8 @@ bool ModuleDataPersistence::saveModuleData(module_information_t *moduleInformati
|
||||
module_data->startAddress = module.getStartAddress();
|
||||
module_data->endAddress = module.getEndAddress();
|
||||
module_data->entrypoint = module.getEntrypoint();
|
||||
module_data->initBeforeEntrypoint = module.isInitBeforeEntrypoint();
|
||||
module_data->skipEntrypoint = module.isSkipEntrypoint();
|
||||
module_data->initBeforeRelocationDoneHook = module.isInitBeforeRelocationDoneHook();
|
||||
|
||||
moduleInformation->number_used_modules++;
|
||||
|
||||
@@ -105,7 +106,8 @@ std::vector<ModuleData> ModuleDataPersistence::loadModuleData(module_information
|
||||
moduleData.setStartAddress(module_data->startAddress);
|
||||
moduleData.setEndAddress(module_data->endAddress);
|
||||
moduleData.setExportName(module_data->module_export_name);
|
||||
moduleData.setInitBeforeEntrypoint(module_data->initBeforeEntrypoint);
|
||||
moduleData.setSkipEntrypoint(module_data->skipEntrypoint);
|
||||
moduleData.setInitBeforeRelocationDoneHook(module_data->initBeforeRelocationDoneHook);
|
||||
|
||||
for (uint32_t j = 0; j < EXPORT_ENTRY_LIST_LENGTH; j++) {
|
||||
export_data_t *export_entry = &(module_data->export_entries[j]);
|
||||
|
||||
Reference in New Issue
Block a user