mirror of
https://github.com/Source2ZE/MovementUnlocker.git
synced 2026-09-27 20:57:04 +02:00
Misc tweaks
This commit is contained in:
parent
d3747829aa
commit
504f653c74
2 changed files with 7 additions and 7 deletions
3
.gitattributes
vendored
Normal file
3
.gitattributes
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
AMBuilder linguist-generated=true
|
||||||
|
AMBuildScript linguist-generated=true
|
||||||
|
PackageScript linguist-generated=true
|
||||||
|
|
@ -91,19 +91,16 @@ bool MovementUnlocker::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxl
|
||||||
return false;
|
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);
|
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++)
|
for (int i = 0; i < PatchLen; i++)
|
||||||
*(unsigned char*)(pPatchAddress + i) = ((unsigned char*)"\x90")[0];
|
*(unsigned char*)(pPatchAddress + i) = ((unsigned char*)"\x90")[0];
|
||||||
|
|
||||||
SourceHook::SetMemAccess((void*)pPatchAddress, PatchLen, SH_MEM_READ | SH_MEM_EXEC);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
SourceHook::SetMemAccess((void*)pPatchAddress, PatchLen, SH_MEM_READ | SH_MEM_EXEC);
|
||||||
META_CONPRINTF( "[Movement Unlocker] Successfully patched Movement Unlocker!\n" );
|
META_CONPRINTF( "[Movement Unlocker] Successfully patched Movement Unlocker!\n" );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue