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

View File

@ -9,7 +9,7 @@ Ubuntu (and probably Debian) users can run this script:
sudo apt update && sudo apt install build-essential software-properties-common -y && sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && sudo apt update && sudo apt install gcc-snapshot -y && sudo apt update && sudo apt install libc6-dev gcc-6 g++-6 g++-6-multilib gdb -y && git clone --recursive https://github.com/nullifiedcat/cathook && cd cathook && make -j4 sudo apt update && sudo apt install build-essential software-properties-common -y && sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && sudo apt update && sudo apt install gcc-snapshot -y && sudo apt update && sudo apt install libc6-dev gcc-6 g++-6 g++-6-multilib gdb -y && git clone --recursive https://github.com/nullifiedcat/cathook && cd cathook && make -j4
``` ```
**Errors while installing?** **Errors while installing?**
`/usr/include/c++/5/string:38:28: fatal error: bits/c++config.h: No such file or directory` - You don't have g++6 or g++6 multilib installed correctly `/usr/include/c++/5/string:38:28: fatal error: bits/c++config.h: No such file or directory` - You don't have g++6 or g++6 multilib installed correctly

2
TODO
View File

@ -15,7 +15,7 @@ inspect shit
TTS TTS
noise spam noise spam
team name spam (pre round team name spam thing) team name spam (pre round team name spam thing)
insta taunt (taunts for like .5 ms and then you can do it again lithium has it) insta taunt (taunts for like .5 ms and then you can do it again lithium has it)
auto vacc auto vacc
namesteal namesteal
autovote autovote

24
attach
View File

@ -1,35 +1,35 @@
#!/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
inst=0 inst=0
fi fi
if [ ${#arr[@]} == 0 ]; then if [ ${#arr[@]} == 0 ]; then
echo tf2 isn\'t running! echo TF2 isn\'t running!
exit exit
fi fi
if [ $inst -gt ${#arr[@]} ] || [ $inst == ${#arr[@]} ]; then if [ $inst -gt ${#arr[@]} ] || [ $inst == ${#arr[@]} ]; then
echo wrong index! echo wrong index!
exit exit
fi 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,35 +1,35 @@
#!/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
inst=0 inst=0
fi fi
if [ ${#arr[@]} == 0 ]; then if [ ${#arr[@]} == 0 ]; then
echo tf2 isn\'t running! echo tf2 isn\'t running!
exit exit
fi fi
if [ $inst -gt ${#arr[@]} ] || [ $inst == ${#arr[@]} ]; then if [ $inst -gt ${#arr[@]} ] || [ $inst == ${#arr[@]} ]; then
echo wrong index! echo wrong index!
exit exit
fi 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" \
@ -38,4 +38,4 @@ gdb -n -q -batch \
-ex 'print (char *) $2' \ -ex 'print (char *) $2' \
-ex "catch syscall exit exit_group" \ -ex "catch syscall exit exit_group" \
-ex "continue" \ -ex "continue" \
-ex "backtrace" -ex "backtrace"

26
detach
View File

@ -1,37 +1,37 @@
#!/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
inst=0 inst=0
fi fi
if [ ${#arr[@]} == 0 ]; then if [ ${#arr[@]} == 0 ]; then
echo tf2 isn\'t running! echo TF2 isn\'t running!
exit exit
fi fi
if [ $inst -gt ${#arr[@]} ] || [ $inst == ${#arr[@]} ]; then if [ $inst -gt ${#arr[@]} ] || [ $inst == ${#arr[@]} ]; then
echo wrong index! echo wrong index!
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" \
-ex "set \$dlclose = (int(*)(void*)) dlclose" \ -ex "set \$dlclose = (int(*)(void*)) dlclose" \
-ex "set \$library = \$dlopen(\"$(realpath bin/libcathook.so)\", 6)" \ -ex "set \$library = \$dlopen(\"$(realpath bin/libcathook.so)\", 6)" \
-ex "print \$library" \ -ex "print \$library" \
-ex "sharedlibrary ." \ -ex "sharedlibrary ." \
-ex "call \$dlclose(\$library)" \ -ex "call \$dlclose(\$library)" \
-ex "call \$dlclose(\$library)" \ -ex "call \$dlclose(\$library)" \
-ex "detach" -ex "detach"
echo "Detached" echo "Detached"
else else
echo "not found!" echo "not found!"
fi fi

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

@ -29,10 +29,10 @@ CXXFLAGS += -DGIT_COMMIT_HASH="\"$(GIT_COMMIT_HASH)\"" -DGIT_COMMIT_DATE="\"$(GI
all: all:
mkdir -p $(TARGET_DIR) mkdir -p $(TARGET_DIR)
$(MAKE) $(TARGET) $(MAKE) $(TARGET)
.cpp.o: .cpp.o:
$(CXX) $(CXXFLAGS) -c $< -o $@ $(CXX) $(CXXFLAGS) -c $< -o $@
%.d: %.cpp %.d: %.cpp
$(CXX) -M $(CXXFLAGS) $< > $@ $(CXX) -M $(CXXFLAGS) $< > $@
@ -43,7 +43,7 @@ clean:
find src -type f -name '*.o' -delete find src -type f -name '*.o' -delete
find src -type f -name '*.d' -delete find src -type f -name '*.d' -delete
rm -rf ./bin rm -rf ./bin
ifneq ($(MAKECMDGOALS), clean) ifneq ($(MAKECMDGOALS), clean)
-include $(DEPENDS) -include $(DEPENDS)
endif endif

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

4
update
View File

@ -1,4 +1,6 @@
#!/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 && \
make -j4 make -j4