-
Notifications
You must be signed in to change notification settings - Fork 496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TuxHook2: cross-platform NetHook2 port #1082
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the best thing that happened this year so far 😎
Resources/TuxHook2/inject.sh
Outdated
@@ -0,0 +1,10 @@ | |||
#!/bin/bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#!/usr/bin/env sh
, from what I see you don't use any bash extensions. POSIX compatibility ftw!
I'd also append set -eu
.
Resources/TuxHook2/inject.sh
Outdated
@@ -0,0 +1,10 @@ | |||
#!/bin/bash | |||
STEAM_PID=$(ps -C steam -o pid= | head -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not pidof steam
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dunno, i'm no bash expert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also forgot to add passing PID by argument...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And other processes (srcds et al)?
Resources/TuxHook2/readme.md
Outdated
### Windows | ||
~~Net~~TuxHook is capable of self injecting and ejecting from running instances of Steam, so there's no requirement to use a separate loader such as winject. | ||
### Linux | ||
Use supplied inject.sh to inject ~~Net~~TuxHook into running steam process. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably mention that gdb is required.
Initial thoughts:
|
|
Here's CI config, took me a while to get it working: nethook2:
name: NetHook2 on ${{ matrix.os }}
strategy:
matrix:
os: [ windows-latest, ubuntu-latest ]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup developer command prompt (Windows)
if: matrix.os == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: win32
- name: Install dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install -y g++-multilib libc++-11-dev libc++abi-11-dev
- name: Create build directory
run: mkdir Resources/TuxHook2/build
- name: Generate make file (Windows)
if: matrix.os == 'windows-latest'
working-directory: Resources/TuxHook2/build/
run: cmake -A Win32 ../
- name: Generate make file (Linux)
if: matrix.os == 'ubuntu-latest'
working-directory: Resources/TuxHook2/build/
run: cmake ../
- name: Build NetHook2
working-directory: Resources/TuxHook2/build/
run: |
cmake --build . --target deps --config Release
cmake --build . --config Release
- name: Tar files (Linux)
if: matrix.os == 'ubuntu-latest'
working-directory: Resources/TuxHook2/build/
run: tar -cvf NetHook2-Linux.tar inject.sh *.so
- name: Upload NetHook2 (Linux)
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
with:
name: NetHook2-Linux
path: Resources/TuxHook2/build/NetHook2-Linux.tar
- name: Upload NetHook2 (Windows)
uses: actions/upload-artifact@v3
if: matrix.os == 'windows-latest'
with:
name: NetHook2
path: 'Resources/TuxHook2/build/Release/*.dll' things to do:
|
…se pidof instead of ps
If you ask me, it was ok for an april fools joke, but i'm weird. |
Here be dragons