mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-12-06 18:08:31 +00:00
Slow down metamod load + fix memory flags
This commit is contained in:
parent
a88a34d46b
commit
dd6d96deb5
@ -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));
|
||||
|
||||
|
||||
@ -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];
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user