diff options
author | telans | 2019-08-09 21:42:11 +1200 |
---|---|---|
committer | telans | 2019-08-09 21:42:11 +1200 |
commit | 179205d3f39b561b69af0cd04495007770db09a8 (patch) | |
tree | eba763cef08de03d3500683aad2167375d1fdfcf | |
download | aur-179205d3f39b561b69af0cd04495007770db09a8.tar.gz |
initial upload
-rw-r--r-- | .SRCINFO | 26 | ||||
-rw-r--r-- | PKGBUILD | 54 | ||||
-rwxr-xr-x | build | 59 | ||||
-rwxr-xr-x | fuzion-load | 69 | ||||
-rwxr-xr-x | fuzion-unload | 47 |
5 files changed, 255 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..e6aa167e5a4c --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,26 @@ +pkgbase = fuzion-git + pkgdesc = Fuzion is a free-as-in-freedom CSGO cheat + pkgver = master + pkgrel = 1 + url = https://github.com/LWSS/Fuzion + arch = x86_64 + license = GPL3 + makedepends = git + makedepends = gcc + makedepends = sdl2 + makedepends = patchelf + depends = gdb + optdepends = cartographer-git: Load Fuzion hidden from /proc maps + source = git://github.com/LWSS/Fuzion.git + source = git://github.com/LWSS/imgui.git + source = fuzion-load + source = fuzion-unload + source = build + sha256sums = SKIP + sha256sums = SKIP + sha256sums = 6cbff5e6ef37e08a44e440f08bf6910eb508b6795c9cac102d18f7cd92a16174 + sha256sums = 87c41293afe0c1cfaad67b24144dc48b737011b92a9da4029768257711250cc8 + sha256sums = f6caf87a562b1aecd86bd80d17a0a3912f0095207f5416f873928cc7539e8e87 + +pkgname = fuzion-git + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..767267f055f1 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,54 @@ +# Maintainer: telans <telans@protonmail.com> + +pkgname=fuzion-git +_pkgname=Fuzion +pkgver=master +pkgrel=1 +pkgdesc="Fuzion is a free-as-in-freedom CSGO cheat" +arch=("x86_64") +url="https://github.com/LWSS/Fuzion" +license=("GPL3") +depends=("gdb") +makedepends=('git' + 'gcc' + 'sdl2' + 'patchelf') +optdepends=("cartographer-git: Load Fuzion hidden from /proc maps") +source=('git://github.com/LWSS/Fuzion.git' + 'git://github.com/LWSS/imgui.git' + 'fuzion-load' + 'fuzion-unload' + 'build') +sha256sums=('SKIP' + 'SKIP' + '6cbff5e6ef37e08a44e440f08bf6910eb508b6795c9cac102d18f7cd92a16174' + '87c41293afe0c1cfaad67b24144dc48b737011b92a9da4029768257711250cc8' + 'f6caf87a562b1aecd86bd80d17a0a3912f0095207f5416f873928cc7539e8e87') + +pkgver() { + cd "$_pkgname" + git describe --always --long --tags | sed -r 's/([^-]*-g)/r\1/;s/-/./g' +} + +build() { + cd "$_pkgname" + git submodule init + git config submodule.ImGUI.url "${_pkgname}/src/ImgGUI" + git submodule update + cd .. + ./build +} + +package() { + install -Dm755 fuzion-load "$pkgdir/usr/bin/fuzion-load" + install -Dm755 fuzion-unload "$pkgdir/usr/bin/fuzion-unload" + cd "$_pkgname" + install -Dm755 "build_id" "$pkgdir/usr/share/Fuzion/build_id" + if [ -f build_id_old ]; then + install -Dm755 "build_id_old" "$pkgdir/usr/share/Fuzion/build_id_old" + else + touch "$pkgdir/usr/share/Fuzion/build_id_old" + fi + _buildname="$(cat build_id)" + install -Dm755 "$_buildname" "$pkgdir/usr/lib/$_buildname" +} diff --git a/build b/build new file mode 100755 index 000000000000..594ea102c559 --- /dev/null +++ b/build @@ -0,0 +1,59 @@ +#!/usr/bin/env bash + +#TODO: check distro and packages +#Edited for PKGBUILD + +function echo_orange { + echo -e "\\e[33m$*\\e[0m" +} + +function echo_red { + echo -e "\\e[31m$*\\e[0m" +} + +cd Fuzion/ +cmake . || exit 1 + +if ! hash patchelf 2>/dev/null; then + echo_red -e "You need to install the \"patchelf\" command!\nUse your package manager to install it, or get source here:\nhttps://github.com/NixOS/patchelf" + exit 1 +fi + +rm build_id_hex +# Get a Random name from the build_names file. +BUILD_ID="fz_git-$(shuf -n 1 build_names)" + +# In case this file exists, get another one. ( checked it works ) +while [ -f "/usr/lib/${BUILD_ID}" ] || grep -q ${BUILD_ID} /proc/$(pidof csgo_linux64)/maps; do + BUILD_ID=$(shuf -n 1 build_names) +done + +# Hexify it and put it into build_id_hex +for (( i=0; i<${#BUILD_ID}; i++ )); do + printf '0x%x,\n' "'${BUILD_ID:$i:1}" >> build_id_hex +done +printf '0x0' >> build_id_hex + +make -j"$(grep -c "^processor" /proc/cpuinfo)" "$@" || exit 1 + +if [ -f build_id ]; then + filename=$(cat build_id) + rm "$filename" + if [ -f "/usr/lib/${filename}" ]; then + echo -e "Note: Old file found at /usr/lib/${filename}\n" + #sudo rm "/usr/lib/${filename}" + + fi + chmod 660 build_id + mv build_id build_id_old +fi + +echo $BUILD_ID > build_id +mv libFuzion.so "$BUILD_ID" + +strip -s -v "$BUILD_ID" +patchelf --set-soname "$BUILD_ID" "$BUILD_ID" || echo_orange "Warning: your patchelf version does not support \"--set-soname\"\nConsider building from source: https://github.com/NixOS/patchelf" + +chmod 400 build_id # Make the build_id read-only for safety. + +echo "Build Completed." diff --git a/fuzion-load b/fuzion-load new file mode 100755 index 000000000000..db5888fe3f56 --- /dev/null +++ b/fuzion-load @@ -0,0 +1,69 @@ +#!/usr/bin/env bash + +# Edited for PKGBUILD + +function echo_green { + echo -e "\\e[32m$*\\e[0m" +} + +function echo_orange { + echo -e "\\e[33m$*\\e[0m" +} + +function echo_red { + echo -e "\\e[31m$*\\e[0m" +} + +csgo_pid=$(pidof csgo_linux64) +if [ -z "$csgo_pid" ]; then + echo_red "CS:GO needs to be open before you can inject, exiting..." + exit 1 +fi + +if [ ! -d ".git" ]; then + echo "We have detected that you have downloaded Fuzion-master.zip from GitHub.com. This is the WRONG way to download! Please download Fuzion by cloning the Git repository: 'git clone --recursive https://github.com/LWSS/Fuzion.git'" +fi + +# 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 --mode=000 /tmp/dumps # Make it as root with no permissions + +filename="$(cat /usr/share/Fuzion/build_id)" + +# Credit: Aixxe @ aixxe.net +if grep -q "$filename" /proc/"$csgo_pid"/maps; then + echo_orange "Fuzion is already injected, aborting..." + exit +fi +echo "Injecting Build ID: $filename" + +# https://www.kernel.org/doc/Documentation/security/Yama.txt +echo "2" | sudo tee /proc/sys/kernel/yama/ptrace_scope # Only allows root to inject code. This is temporary until reboot. + +sudo killall -19 steam +sudo killall -19 steamwebhelper + +input="$( +sudo gdb -n -q -batch-silent \ + -ex "set logging on" \ + -ex "set logging file /dev/null" \ + -ex "set logging redirect on" \ + -ex "attach $csgo_pid" \ + -ex "set \$dlopen = (void*(*)(char*, int)) dlopen" \ + -ex "call \$dlopen(\"/usr/lib/$filename\", 1)" \ + -ex "detach" \ + -ex "quit" +)" + +sleep 1 +sudo killall -18 steamwebhelper +sudo killall -18 steam + +last_line="${input##*$'\n'}" + +if [ "$last_line" != "\$1 = (void *) 0x0" ]; then + echo_green "Successfully injected!" +else + echo_red "Injection failed, make sure you have compiled..." +fi diff --git a/fuzion-unload b/fuzion-unload new file mode 100755 index 000000000000..ddbc7eada7a8 --- /dev/null +++ b/fuzion-unload @@ -0,0 +1,47 @@ +#!/usr/bin/env bash + +# Credit: Aixxe @ aixxe.net +# Edited for PKGBUILD + +csgo_pid=$(pidof csgo_linux64) +filename="$(cat /usr/share/Fuzion/build_id)" +filename_old="$(cat /usr/share/Fuzion/build_id_old)" + +if [ -f /usr/share/Fuzion/build_id ]; then + if grep -q "$filename" /proc/"$csgo_pid"/maps; then + echo "unloading $filename" + sudo gdb -n -q -batch-silent \ + -ex "set logging on" \ + -ex "set logging file /dev/null" \ + -ex "set logging redirect on" \ + -ex "attach $csgo_pid" \ + -ex "set \$dlopen = (void*(*)(char*, int)) dlopen" \ + -ex "set \$dlclose = (int(*)(void*)) dlclose" \ + -ex "set \$library = \$dlopen(\"/usr/lib/$filename\", 6)" \ + -ex "call \$dlclose(\$library)" \ + -ex "call \$dlclose(\$library)" \ + -ex "detach" \ + -ex "quit" + fi +fi + +# "build_id_old" is used for unloading in case you rebuild while injected. +if [ -f /usr/share/Fuzion/build_id_old ]; then + if grep -q "$filename_old" /proc/"$csgo_pid"/maps; then + echo "unloading old file - $filename_old" + sudo gdb -n -q -batch-silent \ + -ex "set logging on" \ + -ex "set logging file /dev/null" \ + -ex "set logging redirect on" \ + -ex "attach $csgo_pid" \ + -ex "set \$dlopen = (void*(*)(char*, int)) dlopen" \ + -ex "set \$dlclose = (int(*)(void*)) dlclose" \ + -ex "set \$library = \$dlopen(\"/usr/lib/$filename_old\", 6)" \ + -ex "call \$dlclose(\$library)" \ + -ex "call \$dlclose(\$library)" \ + -ex "detach" \ + -ex "quit" + fi +fi + +echo "Done. See CS:GO Console." |