Skip to content

Commit dd6d96d

Browse files
committed
Slow down metamod load + fix memory flags
1 parent a88a34d commit dd6d96d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

core/provider/source/provider_source.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ void SourceProvider::CacheUserMessages()
537537
memcpy(orig_bytes, target, sizeof(orig_bytes));
538538

539539
/* Patch in relative jump to our Error() detour */
540-
KHook::Memory::SetAccess(target, sizeof(orig_bytes), KHook::Memory::Flags::READ | KHook::Memory::Flags::EXECUTE | KHook::Memory::Flags::READ);
540+
KHook::Memory::SetAccess(target, sizeof(orig_bytes), KHook::Memory::Flags::READ | KHook::Memory::Flags::EXECUTE | KHook::Memory::Flags::WRITE);
541541
target[0] = IA32_JMP_IMM32;
542542
*(int32_t*)&target[1] = (int32_t)(detour - (target + 5));
543543

loader/loader.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
#include <cstring>
3232
#include <cstdint>
3333
#include <cstdlib>
34+
#include <iostream>
35+
#include <chrono>
36+
#include <thread>
3437

3538
#include "loader.h"
3639
#include "serverplugin.h"
@@ -121,6 +124,9 @@ static const char *backend_names[] =
121124
bool
122125
mm_LoadMetamodLibrary(MetamodBackend backend, char *buffer, size_t maxlength)
123126
{
127+
std::cout << "Pausing 10 seconds to allow debugger to attach" << std::endl;
128+
std::this_thread::sleep_for(std::chrono::seconds(10));
129+
124130
size_t len, temp_len;
125131
char mm_path[PLATFORM_MAX_PATH * 2];
126132

0 commit comments

Comments
 (0)