Nitpicking

Signed-off-by: mpmjcvuut <mpmjcvuut@protonmail.ch>
This commit is contained in:
mpmjcvuut 2017-05-01 20:07:10 +01:00
parent ae80783ed3
commit d4e1c330e8
No known key found for this signature in database
GPG Key ID: CCF4A085CE587F53
11 changed files with 63 additions and 60 deletions

14
attach
View File

@ -1,6 +1,6 @@
#!/bin/bash #!/usr/bin/env bash
line=`pidof hl2_linux` line=$(pidof hl2_linux)
arr=($line) arr=($line)
inst=$1 inst=$1
if [ $# == 0 ]; then if [ $# == 0 ]; then
@ -8,7 +8,7 @@ if [ $# == 0 ]; then
fi fi
if [ ${#arr[@]} == 0 ]; then if [ ${#arr[@]} == 0 ]; then
echo tf2 isn\'t running! echo TF2 isn\'t running!
exit exit
fi fi
@ -19,17 +19,17 @@ fi
proc=${arr[$inst]} proc=${arr[$inst]}
echo Running instances: ${arr[@]} echo Running instances: "${arr[@]}"
echo Attaching to $proc echo Attaching to "$proc"
#sudo ./detach $inst bin/libcathook.so #sudo ./detach $inst bin/libcathook.so
if grep -q $(realpath bin/libcathook.so) /proc/$proc/maps; then if grep -q "$(realpath bin/libcathook.so)" /proc/"$proc"/maps; then
echo already loaded echo already loaded
exit exit
fi fi
echo loading $(realpath bin/libcathook.so) to $proc echo loading "$(realpath bin/libcathook.so)" to "$proc"
gdb -n -q -batch \ gdb -n -q -batch \
-ex "attach $proc" \ -ex "attach $proc" \
-ex "set \$dlopen = (void*(*)(char*, int)) dlopen" \ -ex "set \$dlopen = (void*(*)(char*, int)) dlopen" \

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/usr/bin/env bash
line=`pidof hl2_linux` line=$(pidof hl2_linux)
arr=($line) arr=($line)
inst=$1 inst=$1
if [ $# == 0 ]; then if [ $# == 0 ]; then
@ -19,17 +19,17 @@ fi
proc=${arr[$inst]} proc=${arr[$inst]}
echo Running instances: ${arr[@]} echo Running instances: "${arr[@]}"
echo Attaching to $proc echo Attaching to "$proc"
sudo ./detach $inst bin/libcathook.so sudo ./detach $inst bin/libcathook.so
if grep -q $(realpath bin/libcathook.so) /proc/$proc/maps; then if grep -q "$(realpath bin/libcathook.so)" /proc/"$proc"/maps; then
echo already loaded echo already loaded
exit exit
fi fi
echo loading $(realpath bin/libcathook.so) to $proc echo loading "$(realpath bin/libcathook.so)" to "$proc"
gdb -n -q -batch \ gdb -n -q -batch \
-ex "attach $proc" \ -ex "attach $proc" \
-ex "set \$dlopen = (void*(*)(char*, int)) dlopen" \ -ex "set \$dlopen = (void*(*)(char*, int)) dlopen" \

12
detach
View File

@ -1,6 +1,6 @@
#!/bin/bash #!/usr/bin/env bash
line=`pidof hl2_linux` line=$(pidof hl2_linux)
arr=($line) arr=($line)
inst=$1 inst=$1
if [ $# == 0 ]; then if [ $# == 0 ]; then
@ -8,7 +8,7 @@ if [ $# == 0 ]; then
fi fi
if [ ${#arr[@]} == 0 ]; then if [ ${#arr[@]} == 0 ]; then
echo tf2 isn\'t running! echo TF2 isn\'t running!
exit exit
fi fi
@ -17,10 +17,10 @@ if [ $inst -gt ${#arr[@]} ] || [ $inst == ${#arr[@]} ]; then
exit exit
fi fi
echo Running instances: ${arr[@]} echo Running instances: "${arr[@]}"
echo Detaching from ${arr[$1]} echo Detaching from "${arr[$1]}"
if grep -q $(realpath bin/libcathook.so) /proc/${arr[$1]}/maps; then if grep -q "$(realpath bin/libcathook.so)" /proc/"${arr[$1]}"/maps; then
gdb -n -q -batch \ gdb -n -q -batch \
-ex "attach ${arr[$1]}" \ -ex "attach ${arr[$1]}" \
-ex "set \$dlopen = (void*(*)(char*, int)) dlopen" \ -ex "set \$dlopen = (void*(*)(char*, int)) dlopen" \

View File

@ -1,14 +1,16 @@
if [ ! -d "~/.cathook" ]; then #!/usr/bin/env bash
mkdir ~/.cathook
if [ ! -d "$HOME/.cathook" ]; then
mkdir "$HOME"/.cathook
fi fi
if [ ! -f "~/.cathook/killsays.txt" ]; then if [ ! -f "$HOME/.cathook/killsays.txt" ]; then
cp res/killsays.txt ~/.cathook cp res/killsays.txt "$HOME"/.cathook
fi fi
if [ ! -f "~/.cathook/spam.txt" ]; then if [ ! -f "$HOME/.cathook/spam.txt" ]; then
cp res/spam.txt ~/.cathook cp res/spam.txt "$HOME"/.cathook
fi fi
echo Default killsay/spam files installed, EDIT THEM! echo "Default killsay/spam files installed, EDIT THEM!"
gnome-open ~/.cathook xdg-open "$HOME"/.cathook

View File

@ -1,4 +1,3 @@
#!/bin/bash #!/usr/bin/env bash
sudo ./detach $1 sudo ./detach "$1" && sudo ./attach "$1"
sudo ./attach $1

0
res/.gitignore vendored
View File

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/usr/bin/env bash
convert $1.png -depth 8 -format rgba $1.rgba convert "$1".png -depth 8 -format rgba "$1".rgba
mv $1.rgba $1 mv "$1".rgba "$1"
objcopy --input binary --output elf32-i386 --binary-architecture i386 $1 $1.o objcopy --input binary --output elf32-i386 --binary-architecture i386 "$1" "$1".o
mv $1.o bin/$1.o mv "$1".o bin/"$1".o

2
update
View File

@ -1,3 +1,5 @@
#!/usr/bin/env bash
git pull origin master && \ git pull origin master && \
git submodule update --remote --recursive && \ git submodule update --remote --recursive && \
make clean && \ make clean && \