diff --git a/.gitignore b/.gitignore index 5c70d044..bfded36a 100755 --- a/.gitignore +++ b/.gitignore @@ -285,3 +285,5 @@ scripts/updater-preferences /modules/*/ !/modules/readme.md !/modules/CMakeLists.txt + +scripts/partybypass-preferences diff --git a/attach b/attach index 2881a4b0..35e0bcfb 100755 --- a/attach +++ b/attach @@ -1,6 +1,7 @@ #!/usr/bin/env bash sudo ./scripts/auto-updater +sudo ./scripts/attach-partybypass $1 line=$(pidof hl2_linux) arr=($line) inst=$1 diff --git a/attach-gdb b/attach-gdb index 2ecca801..a98fd7e0 100755 --- a/attach-gdb +++ b/attach-gdb @@ -1,6 +1,7 @@ #!/usr/bin/env bash sudo ./scripts/auto-updater +sudo ./scripts/attach-partybypass $1 line=$(pidof hl2_linux) arr=($line) inst=$1 diff --git a/attach-libnamed.sh b/attach-libnamed.sh index 09f5aeec..2b01035a 100755 --- a/attach-libnamed.sh +++ b/attach-libnamed.sh @@ -4,6 +4,7 @@ # https://github.com/LWSS/Fuzion/commit/a53b6c634cde0ed47b08dd587ba40a3806adf3fe sudo ./scripts/auto-updater +sudo ./scripts/attach-partybypass $1 line=$(pidof hl2_linux) arr=($line) inst=$1 diff --git a/scripts/attach-partybypass b/scripts/attach-partybypass new file mode 100755 index 00000000..08e22b20 --- /dev/null +++ b/scripts/attach-partybypass @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +if [ ! -f ./scripts/partybypass-preferences ]; then + while true; do + read -p "Do you want to enable the proprietary partybypass library? y/n " yn + case $yn in + [Yy]* ) echo true > ./scripts/partybypass-preferences; break;; + [Nn]* ) echo false > ./scripts/partybypass-preferences; exit;; + * ) echo "Please answer y or n.";; + esac + done +fi +if [ `cat ./scripts/partybypass-preferences` == "true" ]; then + line=$(pidof hl2_linux) + arr=($line) + inst=$1 + if [ $# == 0 ]; then + inst=0 + fi + + if [ ${#arr[@]} == 0 ]; then + echo TF2 isn\'t running! + exit + fi + + if [ $inst -gt ${#arr[@]} ] || [ $inst == ${#arr[@]} ]; then + echo wrong index! + exit + fi + + proc=${arr[$inst]} + + # pBypass for crash dumps being sent + # You may also want to consider using -nobreakpad in your launch options. + sudo rm -rf /tmp/dumps # Remove if it exists + sudo mkdir /tmp/dumps # Make it as root + sudo chmod 000 /tmp/dumps # No permissions + + FILENAME="/tmp/.gl$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 6 | head -n 1)" + + cp "./lib/libpartybypass-linux.so" "$FILENAME" + + gdb -n -q -batch \ + -ex "attach $proc" \ + -ex "set \$dlopen = (void*(*)(char*, int)) dlopen" \ + -ex "call \$dlopen(\"$FILENAME\", 1)" \ + -ex "detach" \ + -ex "quit" > /dev/null 2>&1 + + rm $FILENAME + echo -e "\n\033[1;34mPartybypass injected.\033[0m" && exit 0 +fi diff --git a/src/hacks/FollowBot.cpp b/src/hacks/FollowBot.cpp index 19f5504c..2ec426f5 100644 --- a/src/hacks/FollowBot.cpp +++ b/src/hacks/FollowBot.cpp @@ -405,24 +405,26 @@ static void cm() if (navtarget) { - if (follow_target) - navtarget = 0; - breadcrumbs.clear(); - auto ent = ENTITY(navtarget); - static Timer navtimer{}; - if (CE_GOOD(ent) && navtimer.test_and_set(800)) + if (!follow_target) { - if (nav::navTo(ent->m_vecOrigin(), 8, true, false)) - navinactivity.update(); + breadcrumbs.clear(); + auto ent = ENTITY(navtarget); + static Timer navtimer{}; + if (CE_GOOD(ent) && navtimer.test_and_set(800)) + { + if (nav::navTo(ent->m_vecOrigin(), 8, true, false)) + navinactivity.update(); + } + if (navinactivity.check(15000)) + navtarget = 0; + nb::task::current_task = nb::task::followbot; + return; } - if (navinactivity.check(15000)) + else + { navtarget = 0; - nb::task::current_task = nb::task::followbot; - return; - } - if (!navtarget && follow_target) - { - nav::clearInstructions(); + nav::clearInstructions(); + } } // last check for entity before we continue