Prepare for public partybypass

This commit is contained in:
TotallyNotElite 2019-01-02 21:37:04 +01:00
parent 5f6a1e305f
commit ca9c861e15
6 changed files with 73 additions and 15 deletions

2
.gitignore vendored
View File

@ -285,3 +285,5 @@ scripts/updater-preferences
/modules/*/
!/modules/readme.md
!/modules/CMakeLists.txt
scripts/partybypass-preferences

1
attach
View File

@ -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

View File

@ -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

View File

@ -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

51
scripts/attach-partybypass Executable file
View File

@ -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

View File

@ -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