From 6d164123b2d84d9e4b77b97205f21d38ef4b889d Mon Sep 17 00:00:00 2001 From: StackOverflowExcept1on <109800286+StackOverflowExcept1on@users.noreply.github.com> Date: Fri, 30 Aug 2024 15:54:57 +0300 Subject: [PATCH] add linux support looks like Microsoft fixed `hostfxr_initialize_for_runtime_config` --- .github/workflows/ci.yml | 18 +++++++++++++++++- Bootstrapper/build.sh | 7 +++++++ DemoApplication/build.sh | 3 +++ RuntimePatcher/build.sh | 3 +++ _build.sh | 16 ++++++++++++++++ _run.sh | 11 +++++++++++ 6 files changed, 57 insertions(+), 1 deletion(-) create mode 100755 Bootstrapper/build.sh create mode 100755 DemoApplication/build.sh create mode 100755 RuntimePatcher/build.sh create mode 100755 _build.sh create mode 100755 _run.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a45f6c..a39ed0e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,23 @@ on: workflow_dispatch: jobs: - build: + linux-build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Build project + run: ./_build.sh + + - name: Run project + run: ./_run.sh + + windows-build: runs-on: windows-latest steps: diff --git a/Bootstrapper/build.sh b/Bootstrapper/build.sh new file mode 100755 index 0000000..e9e622b --- /dev/null +++ b/Bootstrapper/build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +set -ex + +mkdir -p build && cd build + +cmake .. +cmake --build . --config Release diff --git a/DemoApplication/build.sh b/DemoApplication/build.sh new file mode 100755 index 0000000..df7aabd --- /dev/null +++ b/DemoApplication/build.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +set -ex +dotnet publish -c Release -r linux-x64 -p:PublishDir="$(pwd)/dist" --self-contained diff --git a/RuntimePatcher/build.sh b/RuntimePatcher/build.sh new file mode 100755 index 0000000..f7ee41a --- /dev/null +++ b/RuntimePatcher/build.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +set -ex +dotnet publish -c Release -p:PublishDir="$(pwd)/dist" diff --git a/_build.sh b/_build.sh new file mode 100755 index 0000000..e85cb1a --- /dev/null +++ b/_build.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +set -ex + +npm install + +cd Bootstrapper +./build.sh +cd .. + +cd DemoApplication +./build.sh +cd .. + +cd RuntimePatcher +./build.sh +cd .. diff --git a/_run.sh b/_run.sh new file mode 100755 index 0000000..d260a66 --- /dev/null +++ b/_run.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -ex + +sudo sysctl kernel.yama.ptrace_scope=0 +./DemoApplication/dist/DemoApplication & +npm start -- inject \ +DemoApplication \ +Bootstrapper/build/libBootstrapper.so \ +RuntimePatcher/dist/RuntimePatcher.runtimeconfig.json \ +RuntimePatcher/dist/RuntimePatcher.dll \ +"RuntimePatcher.Main, RuntimePatcher" "InitializePatches"