mirror of
https://github.com/Source2ZE/MovementUnlocker.git
synced 2026-09-27 20:57:04 +02:00
Compare commits
No commits in common. "main" and "v1.6" have entirely different histories.
4 changed files with 30 additions and 41 deletions
|
|
@ -4,31 +4,26 @@ on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: ${{ matrix.name }} Build
|
name: Build
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
container: ${{ matrix.container }}
|
container: ${{ matrix.container }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
os: [windows-2022, ubuntu-latest]
|
||||||
include:
|
include:
|
||||||
- os: windows-latest
|
- os: windows-2022
|
||||||
name: Windows
|
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
name: SteamRT3
|
container: registry.gitlab.steamos.cloud/steamrt/sniper/sdk
|
||||||
container: ghcr.io/source2ze/build-containers:steamrt3
|
|
||||||
- os: ubuntu-latest
|
|
||||||
name: SteamRT4
|
|
||||||
container: ghcr.io/source2ze/build-containers:steamrt4
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v7
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
path: MovementUnlocker
|
path: MovementUnlocker
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Checkout Metamod
|
- name: Checkout Metamod
|
||||||
uses: actions/checkout@v7
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: alliedmodders/metamod-source
|
repository: alliedmodders/metamod-source
|
||||||
ref: master
|
ref: master
|
||||||
|
|
@ -36,35 +31,34 @@ jobs:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Checkout HL2SDK
|
- name: Checkout HL2SDK
|
||||||
uses: actions/checkout@v7
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: alliedmodders/hl2sdk
|
repository: alliedmodders/hl2sdk
|
||||||
ref: cs2
|
ref: cs2
|
||||||
path: hl2sdk-cs2
|
path: hl2sdk-cs2
|
||||||
|
|
||||||
- name: Checkout AMBuild
|
- name: Checkout AMBuild
|
||||||
if: matrix.os == 'windows-latest'
|
uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v7
|
|
||||||
with:
|
with:
|
||||||
repository: alliedmodders/ambuild
|
repository: alliedmodders/ambuild
|
||||||
path: ambuild
|
path: ambuild
|
||||||
|
|
||||||
- name: Install AMBuild
|
- name: Install AMBuild
|
||||||
if: matrix.os == 'windows-latest'
|
run: |
|
||||||
run: pip install setuptools && cd ambuild && python setup.py install && cd ..
|
cd ambuild && python setup.py install && cd ..
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
working-directory: MovementUnlocker
|
working-directory: MovementUnlocker
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mkdir build && cd build
|
mkdir build && cd build
|
||||||
python ../configure.py --enable-optimize --sdks cs2
|
python ../configure.py --enable-optimize --symbol-files --sdks cs2
|
||||||
ambuild
|
ambuild
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.name }}
|
name: ${{ runner.os }}
|
||||||
path: MovementUnlocker/build/package
|
path: MovementUnlocker/build/package
|
||||||
|
|
||||||
release:
|
release:
|
||||||
|
|
@ -75,20 +69,15 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v8
|
uses: actions/download-artifact@v4
|
||||||
|
|
||||||
- name: Package
|
- name: Package
|
||||||
run: |
|
run: |
|
||||||
version=`echo $GITHUB_REF | sed "s/refs\/tags\///"`
|
version=`echo $GITHUB_REF | sed "s/refs\/tags\///"`
|
||||||
ls -Rall
|
ls -Rall
|
||||||
if [ -d "./SteamRT3/" ]; then
|
if [ -d "./Linux/" ]; then
|
||||||
cd ./SteamRT3/
|
cd ./Linux/
|
||||||
tar -czf ../${{ github.event.repository.name }}-${version}-steamrt3.tar.gz *
|
tar -czf ../${{ github.event.repository.name }}-${version}-linux.tar.gz *
|
||||||
cd -
|
|
||||||
fi
|
|
||||||
if [ -d "./SteamRT4/" ]; then
|
|
||||||
cd ./SteamRT4/
|
|
||||||
tar -czf ../${{ github.event.repository.name }}-${version}-steamrt4.tar.gz *
|
|
||||||
cd -
|
cd -
|
||||||
fi
|
fi
|
||||||
if [ -d "./Windows/" ]; then
|
if [ -d "./Windows/" ]; then
|
||||||
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(self.mms_root, 'third_party', 'khook', 'include'),
|
os.path.join(mms_core_path, 'sourcehook'),
|
||||||
]
|
]
|
||||||
|
|
||||||
defines = []
|
defines = []
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "MovementUnlocker.h"
|
#include "MovementUnlocker.h"
|
||||||
#include "khook/memory.hpp"
|
#include <sh_memory.h>
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
#elif __linux__
|
#elif __linux__
|
||||||
|
|
@ -29,13 +29,13 @@
|
||||||
MovementUnlocker g_MovementUnlocker;
|
MovementUnlocker g_MovementUnlocker;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
const unsigned char *pPatchSignature = (unsigned char *)"\x0F\x86\xAF\x2A\x2A\x2A\x0F\x57\xC0\x0F\x2E\xC2";
|
const unsigned char *pPatchSignature = (unsigned char *)"\x0F\x86\xB8\x2A\x2A\x2A\xF3\x0F\x58\xD4";
|
||||||
const char *pPatchPattern = "xxx???xxxxxx";
|
const char *pPatchPattern = "xxx???xxxx";
|
||||||
int PatchLen = 6;
|
int PatchLen = 6;
|
||||||
#elif __linux__
|
#elif __linux__
|
||||||
const unsigned char * pPatchSignature = (unsigned char *)"\x76\x2A\xF3\x0F\x51\xC0\xF3\x0F\x7E\xDB\x49\x8B\x06";
|
const unsigned char * pPatchSignature = (unsigned char *)"\x0F\x87\x2A\x2A\x2A\x2A\xF3\x0F\x10\x3D\x2A\x2A\x2A\x2A\xF3\x0F\x11\xBD";
|
||||||
const char* pPatchPattern = "x?xxxxxxxxxxx";
|
const char* pPatchPattern = "xx????xxxx????xxxx";
|
||||||
int PatchLen = 1;
|
int PatchLen = 6;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// From https://git.botox.bz/CSSZombieEscape/sm-ext-PhysHooks
|
// From https://git.botox.bz/CSSZombieEscape/sm-ext-PhysHooks
|
||||||
|
|
@ -110,19 +110,19 @@ bool MovementUnlocker::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxl
|
||||||
return false;
|
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
|
#ifdef _WIN32
|
||||||
const char* patchBytes[] = {"\xE9", "\xB0", "\x00", "\x00", "\x00", "\x90"};
|
const char* patchBytes[] = {"\xE9", "\xB9", "\x00", "\x00", "\x00", "\x90"};
|
||||||
|
|
||||||
for (int i = 0; i < PatchLen; i++)
|
for (int i = 0; i < PatchLen; i++)
|
||||||
*(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*)"\xEB")[0];
|
*(unsigned char*)(pPatchAddress + i) = ((unsigned char*)"\x90")[0];
|
||||||
#endif
|
#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" );
|
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 "2.0.1";
|
return "1.6";
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *MovementUnlocker::GetDate()
|
const char *MovementUnlocker::GetDate()
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit 20b3a014264b38908c4a5d4eb263ba2c488f3dc1
|
Subproject commit a57b3095a6fc31a98b13e2d73ebb668dac4f1300
|
||||||
Loading…
Add table
Add a link
Reference in a new issue