[Patcher] Plugin Loader

Added a plugin loader which can be enabled with allow_plugins in the config.
This commit is contained in:
Adrian
2023-07-16 18:25:50 +01:00
committed by Radosław Gliński
parent 6e86eacf5a
commit 91f976e524
8 changed files with 355 additions and 11 deletions

View File

@@ -48,6 +48,8 @@ DEFINE_bool(
"finding/stress testing with the JIT",
"CPU");
DECLARE_bool(allow_plugins);
static const uint8_t xe_xex2_retail_key[16] = {
0x20, 0xB1, 0x85, 0xA5, 0x9D, 0x28, 0xFD, 0xC3,
0x40, 0x58, 0x3F, 0xBB, 0x08, 0x96, 0xBF, 0x91};
@@ -1073,6 +1075,11 @@ bool XexModule::LoadContinue() {
}
}
// Disable write protection if plugins are enabled
if (cvars::allow_plugins && !cvars::writable_code_segments) {
OVERRIDE_bool(writable_code_segments, true);
}
// Setup memory protection.
for (uint32_t i = 0, page = 0; i < sec_header->page_descriptor_count; i++) {
// Byteswap the bitfield manually.