From 504f653c745c77547ecc31a87b0f2cb41eb01425 Mon Sep 17 00:00:00 2001 From: Vauff Date: Tue, 3 Oct 2023 19:45:05 -0400 Subject: [PATCH] Misc tweaks --- .gitattributes | 3 +++ MovementUnlocker.cpp | 11 ++++------- 2 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..11d78b3 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +AMBuilder linguist-generated=true +AMBuildScript linguist-generated=true +PackageScript linguist-generated=true \ No newline at end of file diff --git a/MovementUnlocker.cpp b/MovementUnlocker.cpp index 288ccbe..99fa03d 100644 --- a/MovementUnlocker.cpp +++ b/MovementUnlocker.cpp @@ -91,19 +91,16 @@ bool MovementUnlocker::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxl return false; } -#ifdef _WIN32 - SourceHook::SetMemAccess((void*)pPatchAddress, PatchLen, SH_MEM_READ | SH_MEM_WRITE | SH_MEM_EXEC); - *(unsigned char*)(pPatchAddress) = ((unsigned char*)"\xEB")[0]; - SourceHook::SetMemAccess((void*)pPatchAddress, PatchLen, SH_MEM_READ | SH_MEM_EXEC); -#elif __linux__ SourceHook::SetMemAccess((void*)pPatchAddress, PatchLen, SH_MEM_READ | SH_MEM_WRITE | SH_MEM_EXEC); +#ifdef _WIN32 + *(unsigned char*)(pPatchAddress) = ((unsigned char*)"\xEB")[0]; +#elif __linux__ for (int i = 0; i < PatchLen; i++) *(unsigned char*)(pPatchAddress + i) = ((unsigned char*)"\x90")[0]; - - SourceHook::SetMemAccess((void*)pPatchAddress, PatchLen, SH_MEM_READ | SH_MEM_EXEC); #endif + SourceHook::SetMemAccess((void*)pPatchAddress, PatchLen, SH_MEM_READ | SH_MEM_EXEC); META_CONPRINTF( "[Movement Unlocker] Successfully patched Movement Unlocker!\n" ); return true;