
Fix some visual issues and update c++/boost Co-authored-by: Stephen Martin <stephenmartinemail2003@gmail.com> Co-authored-by: Stephen Martin <93275421+STEVE4git@users.noreply.github.com>
48 lines
1.3 KiB
Bash
Executable File
48 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
[[ ! -z "$SUDO_USER" ]] && RUNUSER="$SUDO_USER" || RUNUSER="$LOGNAME"
|
|
RUNCMD="sudo -u $RUNUSER"
|
|
|
|
$RUNCMD bash ./scripts/updater true
|
|
$RUNCMD bash ./report-crash true
|
|
|
|
line=$(pgrep -u $RUNUSER hl2_linux)
|
|
arr=($line)
|
|
|
|
if [ $# == 1 ]; then
|
|
proc=$1
|
|
else
|
|
if [ ${#arr[@]} == 0 ]; then
|
|
echo TF2 isn\'t running!
|
|
exit
|
|
fi
|
|
proc=${arr[0]}
|
|
fi
|
|
|
|
echo Running instances: "${arr[@]}"
|
|
echo Attaching to "$proc"
|
|
|
|
#sudo ./detach $inst bin/libcathook.so
|
|
|
|
#if grep -q "$(realpath bin/libcathook.so)" /proc/"$proc"/maps; then
|
|
# echo already loaded
|
|
# exit
|
|
#fi
|
|
|
|
FILENAME="/tmp/.gl$(head /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c 6)"
|
|
|
|
cp "bin/libcathook.so" "$FILENAME"
|
|
|
|
echo loading "$FILENAME" to "$proc"
|
|
gdbbin="gdb"
|
|
$gdbbin -n -q -batch \
|
|
-ex "attach $proc" \
|
|
-ex "echo \033[1mCalling dlopen\033[0m\n" \
|
|
-ex "call ((void*(*)(const char*, int))dlopen)(\"$FILENAME\", 1)" \
|
|
-ex "echo \033[1mCalling dlerror\033[0m\n" \
|
|
-ex "call ((char*(*)(void))dlerror)()" \
|
|
-ex "continue" \
|
|
-ex "backtrace"
|
|
|
|
rm $FILENAME
|