mirror of
https://github.com/Source2ZE/MovementUnlocker.git
synced 2026-09-27 20:57:04 +02:00
Compare commits
11 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ea3794248 | ||
|
|
b418365b5b | ||
|
|
6148f39ad3 | ||
|
|
a2a78ed01b | ||
|
|
d08776f5cf | ||
|
|
221a9de3b2 | ||
|
|
a2673ddd75 | ||
|
|
0193cd340a | ||
|
|
850d144232 | ||
|
|
b5807e27cf | ||
|
|
ce00eec29c |
4 changed files with 45 additions and 31 deletions
|
|
@ -4,26 +4,31 @@ on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: ${{ matrix.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-2022
|
- os: windows-latest
|
||||||
|
name: Windows
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
container: registry.gitlab.steamos.cloud/steamrt/sniper/sdk
|
name: SteamRT3
|
||||||
|
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@v4
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
path: MovementUnlocker
|
path: MovementUnlocker
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Checkout Metamod
|
- name: Checkout Metamod
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
repository: alliedmodders/metamod-source
|
repository: alliedmodders/metamod-source
|
||||||
ref: master
|
ref: master
|
||||||
|
|
@ -31,34 +36,35 @@ jobs:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Checkout HL2SDK
|
- name: Checkout HL2SDK
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
repository: alliedmodders/hl2sdk
|
repository: alliedmodders/hl2sdk
|
||||||
ref: cs2
|
ref: cs2
|
||||||
path: hl2sdk-cs2
|
path: hl2sdk-cs2
|
||||||
|
|
||||||
- name: Checkout AMBuild
|
- name: Checkout AMBuild
|
||||||
uses: actions/checkout@v4
|
if: matrix.os == 'windows-latest'
|
||||||
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
repository: alliedmodders/ambuild
|
repository: alliedmodders/ambuild
|
||||||
path: ambuild
|
path: ambuild
|
||||||
|
|
||||||
- name: Install AMBuild
|
- name: Install AMBuild
|
||||||
run: |
|
if: matrix.os == 'windows-latest'
|
||||||
cd ambuild && python setup.py install && cd ..
|
run: pip install setuptools && 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 --symbol-files --sdks cs2
|
python ../configure.py --enable-optimize --sdks cs2
|
||||||
ambuild
|
ambuild
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: ${{ runner.os }}
|
name: ${{ matrix.name }}
|
||||||
path: MovementUnlocker/build/package
|
path: MovementUnlocker/build/package
|
||||||
|
|
||||||
release:
|
release:
|
||||||
|
|
@ -69,15 +75,20 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v8
|
||||||
|
|
||||||
- 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 "./Linux/" ]; then
|
if [ -d "./SteamRT3/" ]; then
|
||||||
cd ./Linux/
|
cd ./SteamRT3/
|
||||||
tar -czf ../${{ github.event.repository.name }}-${version}-linux.tar.gz *
|
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 *
|
||||||
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(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__
|
||||||
|
|
@ -29,13 +29,13 @@
|
||||||
MovementUnlocker g_MovementUnlocker;
|
MovementUnlocker g_MovementUnlocker;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
const unsigned char *pPatchSignature = (unsigned char *)"\x76\x2A\xF2\x0F\x10\x4E\x2A\x41\x0F\x28\xD2\x0F\x28\xC1";
|
const unsigned char *pPatchSignature = (unsigned char *)"\x0F\x86\xAF\x2A\x2A\x2A\x0F\x57\xC0\x0F\x2E\xC2";
|
||||||
const char *pPatchPattern = "x?xxxx?xxxxxxx";
|
const char *pPatchPattern = "xxx???xxxxxx";
|
||||||
int PatchLen = 1;
|
|
||||||
#elif __linux__
|
|
||||||
const unsigned char * pPatchSignature = (unsigned char *)"\x0F\x87\x2A\x2A\x2A\x2A\x49\x8B\x7C\x24\x2A\x48\x85\xFF";
|
|
||||||
const char* pPatchPattern = "xx????xxxx?xxx";
|
|
||||||
int PatchLen = 6;
|
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";
|
||||||
|
int PatchLen = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// From https://git.botox.bz/CSSZombieEscape/sm-ext-PhysHooks
|
// From https://git.botox.bz/CSSZombieEscape/sm-ext-PhysHooks
|
||||||
|
|
@ -110,16 +110,19 @@ 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
|
||||||
*(unsigned char*)(pPatchAddress) = ((unsigned char*)"\xEB")[0];
|
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];
|
||||||
#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;
|
||||||
|
|
@ -151,7 +154,7 @@ const char *MovementUnlocker::GetLicense()
|
||||||
|
|
||||||
const char *MovementUnlocker::GetVersion()
|
const char *MovementUnlocker::GetVersion()
|
||||||
{
|
{
|
||||||
return "1.5";
|
return "2.0.1";
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *MovementUnlocker::GetDate()
|
const char *MovementUnlocker::GetDate()
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit a57b3095a6fc31a98b13e2d73ebb668dac4f1300
|
Subproject commit 20b3a014264b38908c4a5d4eb263ba2c488f3dc1
|
||||||
Loading…
Add table
Add a link
Reference in a new issue