From e37c4ac9292fb30962ae94c95f5d7747243df266 Mon Sep 17 00:00:00 2001 From: "S.B" <30941141+s-b-repo@users.noreply.github.com> Date: Fri, 17 Oct 2025 21:49:00 +0200 Subject: [PATCH 1/5] Update README.md --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 565c674f2cf..313f0a267d3 100644 --- a/README.md +++ b/README.md @@ -80,9 +80,23 @@ Counter-Strike 2 blocks LoadLibrary injection method, so you have to use a manua #### Linux You can simply run the following script in the directory containing **libOsiris.so**: +``` +# Using gdb with explicit PID +sudo gdb -batch -n -q -p -ex "call (void*)dlopen(\"$PWD/libOsiris.so\", 2)" - sudo gdb -batch-silent -p $(pidof cs2) -ex "call (void*)dlopen(\"$PWD/libOsiris.so\", 2)" +# Using ptrace injector (if available) +sudo injectso "$PWD/libOsiris.so" +# Using LD_PRELOAD on fresh launch instead of live injection +LD_PRELOAD="$PWD/libOsiris.so" ./cs2 + +# Using gdb with run + preload +sudo gdb -batch -n -q --args ./cs2 -ex "set environment LD_PRELOAD=$PWD/libOsiris.so" -ex run + +# Using `dlopen` with absolute path +sudo gdb -batch -n -q -p $(pidof cs2) -ex "call (void*)dlopen(\"$(realpath libOsiris.so)\", 2)" + +``` However, this injection method might be detected by VAC as gdb is visible under **TracerPid** in `/proc/$(pidof cs2)/status` for the duration of the injection. ## FAQ From 445414b96e7ab40724433edceff77c68574cff48 Mon Sep 17 00:00:00 2001 From: "S.B" <30941141+s-b-repo@users.noreply.github.com> Date: Sat, 18 Oct 2025 17:55:09 +0200 Subject: [PATCH 2/5] Update README.md --- README.md | 55 +++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 45 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 313f0a267d3..87001e69349 100644 --- a/README.md +++ b/README.md @@ -80,21 +80,56 @@ Counter-Strike 2 blocks LoadLibrary injection method, so you have to use a manua #### Linux You can simply run the following script in the directory containing **libOsiris.so**: + ``` -# Using gdb with explicit PID -sudo gdb -batch -n -q -p -ex "call (void*)dlopen(\"$PWD/libOsiris.so\", 2)" -# Using ptrace injector (if available) -sudo injectso "$PWD/libOsiris.so" +And the `.so` file is located in: + +``` +build/Source/libOsiris.so +``` -# Using LD_PRELOAD on fresh launch instead of live injection -LD_PRELOAD="$PWD/libOsiris.so" ./cs2 +--- + +### **Live Injection Methods** + +#### 1. **Using GDB with explicit PID** +``` +sudo gdb -batch -n -q -p -ex "call (void*)dlopen(\"$PWD/build/Source/libOsiris.so\", 2)" +``` + +#### 2. **Using ptrace injector (if available)** +``` +sudo injectso "$PWD/build/Source/libOsiris.so" +``` + +#### 3. **Using GDB with absolute path** +``` +sudo gdb -batch -n -q -p $(pidof cs2) -ex "call (void*)dlopen(\"$(realpath build/Source/libOsiris.so)\", 2)" +``` + +#### 4. **Using GDB with silent mode** +``` +sudo gdb -batch-silent -p $(pidof cs2) -ex "call (void*)dlopen(\"$PWD/build/Source/libOsiris.so\", 2)" +``` + +--- + +### **Launch-Time Injection Methods** + +#### 5. **Using LD_PRELOAD on fresh launch** +``` +LD_PRELOAD="$PWD/build/Source/libOsiris.so" ./cs2 +``` + +#### 6. **Using GDB with run + preload** +``` +sudo gdb -batch -n -q --args ./cs2 -ex "set environment LD_PRELOAD=$PWD/build/Source/libOsiris.so" -ex run +``` -# Using gdb with run + preload -sudo gdb -batch -n -q --args ./cs2 -ex "set environment LD_PRELOAD=$PWD/libOsiris.so" -ex run +--- -# Using `dlopen` with absolute path -sudo gdb -batch -n -q -p $(pidof cs2) -ex "call (void*)dlopen(\"$(realpath libOsiris.so)\", 2)" +Let me know if you'd like a script to wrap these into a menu or automate detection of the `cs2` PID. ``` However, this injection method might be detected by VAC as gdb is visible under **TracerPid** in `/proc/$(pidof cs2)/status` for the duration of the injection. From 35ccc8ee9289aea06a9769dbbfdef9d2c9c6ea5e Mon Sep 17 00:00:00 2001 From: "S.B" <30941141+s-b-repo@users.noreply.github.com> Date: Sat, 18 Oct 2025 17:56:35 +0200 Subject: [PATCH 3/5] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 87001e69349..913298ab0d9 100644 --- a/README.md +++ b/README.md @@ -84,10 +84,9 @@ You can simply run the following script in the directory containing **libOsiris. ``` And the `.so` file is located in: - ``` build/Source/libOsiris.so -``` + --- @@ -113,8 +112,6 @@ sudo gdb -batch -n -q -p $(pidof cs2) -ex "call (void*)dlopen(\"$(realpath build sudo gdb -batch-silent -p $(pidof cs2) -ex "call (void*)dlopen(\"$PWD/build/Source/libOsiris.so\", 2)" ``` ---- - ### **Launch-Time Injection Methods** #### 5. **Using LD_PRELOAD on fresh launch** @@ -131,9 +128,12 @@ sudo gdb -batch -n -q --args ./cs2 -ex "set environment LD_PRELOAD=$PWD/build/So Let me know if you'd like a script to wrap these into a menu or automate detection of the `cs2` PID. +``` ``` However, this injection method might be detected by VAC as gdb is visible under **TracerPid** in `/proc/$(pidof cs2)/status` for the duration of the injection. +sudo gdb -batch-silent -p $(pidof cs2) -ex "call (void*)dlopen(\"$PWD/build/Source/libOsiris.so\", 2)" + ## FAQ ### Where are the settings stored on disk? From bba3e6982b7edc564a7fda326ab46437dbde496c Mon Sep 17 00:00:00 2001 From: "S.B" <30941141+s-b-repo@users.noreply.github.com> Date: Sat, 18 Oct 2025 18:00:12 +0200 Subject: [PATCH 4/5] Update README.md --- README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/README.md b/README.md index 913298ab0d9..7b7b5ab9d69 100644 --- a/README.md +++ b/README.md @@ -124,12 +124,6 @@ LD_PRELOAD="$PWD/build/Source/libOsiris.so" ./cs2 sudo gdb -batch -n -q --args ./cs2 -ex "set environment LD_PRELOAD=$PWD/build/Source/libOsiris.so" -ex run ``` ---- - -Let me know if you'd like a script to wrap these into a menu or automate detection of the `cs2` PID. - -``` -``` However, this injection method might be detected by VAC as gdb is visible under **TracerPid** in `/proc/$(pidof cs2)/status` for the duration of the injection. sudo gdb -batch-silent -p $(pidof cs2) -ex "call (void*)dlopen(\"$PWD/build/Source/libOsiris.so\", 2)" From 199a6fa38981d08cdaeb5f37040bd37bbd52a4f3 Mon Sep 17 00:00:00 2001 From: "S.B" <30941141+s-b-repo@users.noreply.github.com> Date: Sat, 18 Oct 2025 18:03:02 +0200 Subject: [PATCH 5/5] Create linux-inject.py --- linux-inject.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 linux-inject.py diff --git a/linux-inject.py b/linux-inject.py new file mode 100644 index 00000000000..0f120aed725 --- /dev/null +++ b/linux-inject.py @@ -0,0 +1,31 @@ +import os +import subprocess + +# Define the path to the shared object +lib_path = os.path.join(os.getcwd(), "build/Source/libOsiris.so") + +# Try to get the PID of the cs2 process +try: + pid = subprocess.check_output(["pidof", "cs2"]).decode().strip() +except subprocess.CalledProcessError: + pid = None + +# Define the menu options +menu = { + "1": f"sudo gdb -batch -n -q -p -ex \"call (void*)dlopen(\\\"{lib_path}\\\", 2)\"", + "2": f"sudo injectso \"{lib_path}\"", + "3": f"LD_PRELOAD=\"{lib_path}\" ./cs2", + "4": f"sudo gdb -batch -n -q --args ./cs2 -ex \"set environment LD_PRELOAD={lib_path}\" -ex run", + "5": f"sudo gdb -batch -n -q -p {pid if pid else ''} -ex \"call (void*)dlopen(\\\"$(realpath {lib_path})\\\", 2)\"", + "6": f"sudo gdb -batch-silent -p {pid if pid else ''} -ex \"call (void*)dlopen(\\\"{lib_path}\\\", 2)\"" +} + +# Display the menu +print("Injection Method Menu:\n") +for key, command in menu.items(): + print(f"{key}. {command}") + +if pid: + print(f"\nDetected cs2 PID: {pid}") +else: + print("\ncs2 process not detected. Please start cs2 or replace manually.")