mirror of
https://github.com/Source2ZE/MovementUnlocker.git
synced 2026-09-27 20:57:04 +02:00
Compare commits
2 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ea3794248 | ||
|
|
b418365b5b |
2 changed files with 9 additions and 9 deletions
2
AMBuildScript
generated
2
AMBuildScript
generated
|
|
@ -278,7 +278,7 @@ class MMSPluginConfig(object):
|
||||||
cxx.cxxincludes += [
|
cxx.cxxincludes += [
|
||||||
os.path.join(context.currentSourcePath),
|
os.path.join(context.currentSourcePath),
|
||||||
os.path.join(mms_core_path),
|
os.path.join(mms_core_path),
|
||||||
os.path.join(mms_core_path, 'sourcehook'),
|
os.path.join(self.mms_root, 'third_party', 'khook', 'include'),
|
||||||
]
|
]
|
||||||
|
|
||||||
defines = []
|
defines = []
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "MovementUnlocker.h"
|
#include "MovementUnlocker.h"
|
||||||
#include <sh_memory.h>
|
#include "khook/memory.hpp"
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
#elif __linux__
|
#elif __linux__
|
||||||
|
|
@ -33,9 +33,9 @@ const unsigned char *pPatchSignature = (unsigned char *)"\x0F\x86\xAF\x2A\x2A\x2
|
||||||
const char *pPatchPattern = "xxx???xxxxxx";
|
const char *pPatchPattern = "xxx???xxxxxx";
|
||||||
int PatchLen = 6;
|
int PatchLen = 6;
|
||||||
#elif __linux__
|
#elif __linux__
|
||||||
const unsigned char * pPatchSignature = (unsigned char *)"\x0F\x87\x2A\x2A\x2A\x2A\xF3\x0F\x10\x25\x2A\x2A\x2A\x2A\xF3\x0F\x11\xA5\x2A\x2A\x2A\x2A\x48\x89\xDE";
|
const unsigned char * pPatchSignature = (unsigned char *)"\x76\x2A\xF3\x0F\x51\xC0\xF3\x0F\x7E\xDB\x49\x8B\x06";
|
||||||
const char* pPatchPattern = "xx????xxxx????xxxx????xxx";
|
const char* pPatchPattern = "x?xxxxxxxxxxx";
|
||||||
int PatchLen = 6;
|
int PatchLen = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// From https://git.botox.bz/CSSZombieEscape/sm-ext-PhysHooks
|
// From https://git.botox.bz/CSSZombieEscape/sm-ext-PhysHooks
|
||||||
|
|
@ -110,7 +110,7 @@ bool MovementUnlocker::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxl
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SourceHook::SetMemAccess((void*)pPatchAddress, PatchLen, SH_MEM_READ | SH_MEM_WRITE | SH_MEM_EXEC);
|
KHook::Memory::SetAccess((void*)pPatchAddress, PatchLen, KHook::Memory::READ | KHook::Memory::WRITE | KHook::Memory::EXECUTE);
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
const char* patchBytes[] = {"\xE9", "\xB0", "\x00", "\x00", "\x00", "\x90"};
|
const char* patchBytes[] = {"\xE9", "\xB0", "\x00", "\x00", "\x00", "\x90"};
|
||||||
|
|
@ -119,10 +119,10 @@ bool MovementUnlocker::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxl
|
||||||
*(unsigned char*)(pPatchAddress + i) = ((unsigned char*)patchBytes[i])[0];
|
*(unsigned char*)(pPatchAddress + i) = ((unsigned char*)patchBytes[i])[0];
|
||||||
#elif __linux__
|
#elif __linux__
|
||||||
for (int i = 0; i < PatchLen; i++)
|
for (int i = 0; i < PatchLen; i++)
|
||||||
*(unsigned char*)(pPatchAddress + i) = ((unsigned char*)"\x90")[0];
|
*(unsigned char*)(pPatchAddress + i) = ((unsigned char*)"\xEB")[0];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SourceHook::SetMemAccess((void*)pPatchAddress, PatchLen, SH_MEM_READ | SH_MEM_EXEC);
|
KHook::Memory::SetAccess((void*)pPatchAddress, PatchLen, KHook::Memory::READ | KHook::Memory::EXECUTE);
|
||||||
META_CONPRINTF( "[Movement Unlocker] Successfully patched Movement Unlocker!\n" );
|
META_CONPRINTF( "[Movement Unlocker] Successfully patched Movement Unlocker!\n" );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -154,7 +154,7 @@ const char *MovementUnlocker::GetLicense()
|
||||||
|
|
||||||
const char *MovementUnlocker::GetVersion()
|
const char *MovementUnlocker::GetVersion()
|
||||||
{
|
{
|
||||||
return "1.12";
|
return "2.0.1";
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *MovementUnlocker::GetDate()
|
const char *MovementUnlocker::GetDate()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue