Slow down metamod load + fix memory flags

This commit is contained in:
Kenzzer 2025-08-14 11:42:27 +00:00
parent a88a34d46b
commit dd6d96deb5
No known key found for this signature in database
GPG Key ID: 64C3FD4332686DC1
2 changed files with 7 additions and 1 deletions

View File

@ -537,7 +537,7 @@ void SourceProvider::CacheUserMessages()
memcpy(orig_bytes, target, sizeof(orig_bytes));
/* Patch in relative jump to our Error() detour */
KHook::Memory::SetAccess(target, sizeof(orig_bytes), KHook::Memory::Flags::READ | KHook::Memory::Flags::EXECUTE | KHook::Memory::Flags::READ);
KHook::Memory::SetAccess(target, sizeof(orig_bytes), KHook::Memory::Flags::READ | KHook::Memory::Flags::EXECUTE | KHook::Memory::Flags::WRITE);
target[0] = IA32_JMP_IMM32;
*(int32_t*)&target[1] = (int32_t)(detour - (target + 5));

View File

@ -31,6 +31,9 @@
#include <cstring>
#include <cstdint>
#include <cstdlib>
#include <iostream>
#include <chrono>
#include <thread>
#include "loader.h"
#include "serverplugin.h"
@ -121,6 +124,9 @@ static const char *backend_names[] =
bool
mm_LoadMetamodLibrary(MetamodBackend backend, char *buffer, size_t maxlength)
{
std::cout << "Pausing 10 seconds to allow debugger to attach" << std::endl;
std::this_thread::sleep_for(std::chrono::seconds(10));
size_t len, temp_len;
char mm_path[PLATFORM_MAX_PATH * 2];