Compare commits

..

No commits in common. "main" and "v1.2" have entirely different histories.
main ... v1.2

4 changed files with 31 additions and 45 deletions

View file

@ -4,31 +4,26 @@ on: [push, pull_request]
jobs:
build:
name: ${{ matrix.name }} Build
name: Build
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
os: [windows-2022, ubuntu-latest]
include:
- os: windows-latest
name: Windows
- os: windows-2022
- os: ubuntu-latest
name: SteamRT3
container: ghcr.io/source2ze/build-containers:steamrt3
- os: ubuntu-latest
name: SteamRT4
container: ghcr.io/source2ze/build-containers:steamrt4
container: registry.gitlab.steamos.cloud/steamrt/sniper/sdk
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v4
with:
path: MovementUnlocker
submodules: recursive
fetch-depth: 0
- name: Checkout Metamod
uses: actions/checkout@v7
uses: actions/checkout@v4
with:
repository: alliedmodders/metamod-source
ref: master
@ -36,35 +31,34 @@ jobs:
submodules: recursive
- name: Checkout HL2SDK
uses: actions/checkout@v7
uses: actions/checkout@v4
with:
repository: alliedmodders/hl2sdk
ref: cs2
path: hl2sdk-cs2
- name: Checkout AMBuild
if: matrix.os == 'windows-latest'
uses: actions/checkout@v7
uses: actions/checkout@v4
with:
repository: alliedmodders/ambuild
path: ambuild
- name: Install AMBuild
if: matrix.os == 'windows-latest'
run: pip install setuptools && cd ambuild && python setup.py install && cd ..
run: |
cd ambuild && python setup.py install && cd ..
- name: Build
working-directory: MovementUnlocker
shell: bash
run: |
mkdir build && cd build
python ../configure.py --enable-optimize --sdks cs2
python ../configure.py --enable-optimize --symbol-files --sdks cs2
ambuild
- name: Upload artifact
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}
name: ${{ runner.os }}
path: MovementUnlocker/build/package
release:
@ -75,20 +69,15 @@ jobs:
steps:
- name: Download artifacts
uses: actions/download-artifact@v8
uses: actions/download-artifact@v4
- name: Package
run: |
version=`echo $GITHUB_REF | sed "s/refs\/tags\///"`
ls -Rall
if [ -d "./SteamRT3/" ]; then
cd ./SteamRT3/
tar -czf ../${{ github.event.repository.name }}-${version}-steamrt3.tar.gz *
cd -
fi
if [ -d "./SteamRT4/" ]; then
cd ./SteamRT4/
tar -czf ../${{ github.event.repository.name }}-${version}-steamrt4.tar.gz *
if [ -d "./Linux/" ]; then
cd ./Linux/
tar -czf ../${{ github.event.repository.name }}-${version}-linux.tar.gz *
cd -
fi
if [ -d "./Windows/" ]; then

2
AMBuildScript generated
View file

@ -278,7 +278,7 @@ class MMSPluginConfig(object):
cxx.cxxincludes += [
os.path.join(context.currentSourcePath),
os.path.join(mms_core_path),
os.path.join(self.mms_root, 'third_party', 'khook', 'include'),
os.path.join(mms_core_path, 'sourcehook'),
]
defines = []

View file

@ -19,7 +19,7 @@
#include <stdio.h>
#include "MovementUnlocker.h"
#include "khook/memory.hpp"
#include <sh_memory.h>
#ifdef _WIN32
#include <Windows.h>
#elif __linux__
@ -29,13 +29,13 @@
MovementUnlocker g_MovementUnlocker;
#ifdef _WIN32
const unsigned char *pPatchSignature = (unsigned char *)"\x0F\x86\xAF\x2A\x2A\x2A\x0F\x57\xC0\x0F\x2E\xC2";
const char *pPatchPattern = "xxx???xxxxxx";
int PatchLen = 6;
#elif __linux__
const unsigned char * pPatchSignature = (unsigned char *)"\x76\x2A\xF3\x0F\x51\xC0\xF3\x0F\x7E\xDB\x49\x8B\x06";
const char* pPatchPattern = "x?xxxxxxxxxxx";
const unsigned char *pPatchSignature = (unsigned char *)"\x76\x2A\xF2\x0F\x10\x57\x2A\x0F\x28\x2A\xF3\x0F\x2A\x2A\x0F\x28\x2A";
const char *pPatchPattern = "x?xxxx?xx?xx??xx?";
int PatchLen = 1;
#elif __linux__
const unsigned char * pPatchSignature = (unsigned char *)"\x0F\x87\x2A\x2A\x2A\x2A\x49\x8B\x7D\x30\xE8\x2A\x2A\x2A\x2A\x66\x0F\xEF\xED";
const char* pPatchPattern = "xx????xxxxx????xxxx";
int PatchLen = 6;
#endif
// From https://git.botox.bz/CSSZombieEscape/sm-ext-PhysHooks
@ -110,19 +110,16 @@ bool MovementUnlocker::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxl
return false;
}
KHook::Memory::SetAccess((void*)pPatchAddress, PatchLen, KHook::Memory::READ | KHook::Memory::WRITE | KHook::Memory::EXECUTE);
SourceHook::SetMemAccess((void*)pPatchAddress, PatchLen, SH_MEM_READ | SH_MEM_WRITE | SH_MEM_EXEC);
#ifdef _WIN32
const char* patchBytes[] = {"\xE9", "\xB0", "\x00", "\x00", "\x00", "\x90"};
for (int i = 0; i < PatchLen; i++)
*(unsigned char*)(pPatchAddress + i) = ((unsigned char*)patchBytes[i])[0];
*(unsigned char*)(pPatchAddress) = ((unsigned char*)"\xEB")[0];
#elif __linux__
for (int i = 0; i < PatchLen; i++)
*(unsigned char*)(pPatchAddress + i) = ((unsigned char*)"\xEB")[0];
*(unsigned char*)(pPatchAddress + i) = ((unsigned char*)"\x90")[0];
#endif
KHook::Memory::SetAccess((void*)pPatchAddress, PatchLen, KHook::Memory::READ | KHook::Memory::EXECUTE);
SourceHook::SetMemAccess((void*)pPatchAddress, PatchLen, SH_MEM_READ | SH_MEM_EXEC);
META_CONPRINTF( "[Movement Unlocker] Successfully patched Movement Unlocker!\n" );
return true;
@ -154,7 +151,7 @@ const char *MovementUnlocker::GetLicense()
const char *MovementUnlocker::GetVersion()
{
return "2.0.1";
return "1.2";
}
const char *MovementUnlocker::GetDate()

@ -1 +1 @@
Subproject commit 20b3a014264b38908c4a5d4eb263ba2c488f3dc1
Subproject commit 22f699a941093d9d68c1f647c7c545ec346d0ee3