commit
4c74176fe0
46
attach-user
Executable file
46
attach-user
Executable file
@ -0,0 +1,46 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
user=$USER
|
||||||
|
|
||||||
|
if [ "$#" == 1 ]; then
|
||||||
|
user=$1
|
||||||
|
fi
|
||||||
|
|
||||||
|
proc="0"
|
||||||
|
|
||||||
|
for pid in $(pidof hl2_linux)
|
||||||
|
do
|
||||||
|
if sudo -H -u $user kill -0 $pid
|
||||||
|
then
|
||||||
|
proc=$pid
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
if [ "$proc" == "0" ]
|
||||||
|
then
|
||||||
|
echo "TF2 for $user is not running"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo Attaching to "$proc"
|
||||||
|
|
||||||
|
FILENAME=$(realpath "bin/libcathook.so")
|
||||||
|
|
||||||
|
echo loading "$FILENAME" to "$proc"
|
||||||
|
|
||||||
|
sudo killall -19 steam
|
||||||
|
sudo killall -19 steamwebhelper
|
||||||
|
|
||||||
|
sudo gdb -n -q -batch \
|
||||||
|
-ex "attach $proc" \
|
||||||
|
-ex "set \$dlopen = (void*(*)(char*, int)) dlopen" \
|
||||||
|
-ex "call \$dlopen(\"$FILENAME\", 1)" \
|
||||||
|
-ex "call dlerror()" \
|
||||||
|
-ex 'print (char *) $2' \
|
||||||
|
-ex "detach" \
|
||||||
|
-ex "quit"
|
||||||
|
|
||||||
|
sudo killall -18 steamwebhelper
|
||||||
|
sudo killall -18 steam
|
12
src/headshake.cpp
Normal file
12
src/headshake.cpp
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
/*
|
||||||
|
* headshake.cpp
|
||||||
|
*
|
||||||
|
* Created on: Aug 2, 2017
|
||||||
|
* Author: nullifiedcat
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
const std::vector<float> headshake_pitch_deltas = {
|
||||||
|
-0.2, 0.8, -1.7, 0.8, -0.8, 0.19, -0.99, 1.9
|
||||||
|
};
|
12
src/headshake.hpp
Normal file
12
src/headshake.hpp
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
/*
|
||||||
|
* headshake.hpp
|
||||||
|
*
|
||||||
|
* Created on: Aug 2, 2017
|
||||||
|
* Author: nullifiedcat
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -156,6 +156,7 @@ powerup_type GetPowerupOnPlayer(CachedEntity* player) {
|
|||||||
|
|
||||||
// A function to tell if a player is using a specific weapon
|
// A function to tell if a player is using a specific weapon
|
||||||
bool HasWeapon(CachedEntity* ent, int wantedId) {
|
bool HasWeapon(CachedEntity* ent, int wantedId) {
|
||||||
|
if (CE_BAD(ent)) return false;
|
||||||
// Create a var to store the handle
|
// Create a var to store the handle
|
||||||
int *hWeapons;
|
int *hWeapons;
|
||||||
// Grab the handle and store it into the var
|
// Grab the handle and store it into the var
|
||||||
@ -172,6 +173,7 @@ bool HasWeapon(CachedEntity* ent, int wantedId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool HasDarwins(CachedEntity* ent) {
|
bool HasDarwins(CachedEntity* ent) {
|
||||||
|
if (CE_BAD(ent)) return false;
|
||||||
// Check if player is sniper
|
// Check if player is sniper
|
||||||
if (CE_INT(ent, netvar.iClass) != tf_sniper) return false;
|
if (CE_INT(ent, netvar.iClass) != tf_sniper) return false;
|
||||||
// Check if player is using darwins, 231 is the id for darwins danger sheild
|
// Check if player is using darwins, 231 is the id for darwins danger sheild
|
||||||
|
Reference in New Issue
Block a user