This repository has been archived by the owner on Nov 11, 2017. It is now read-only.
forked from LWSS/Fuzion
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathload
executable file
·52 lines (39 loc) · 1.71 KB
/
load
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
echo "Hotpatcher is detected as a injector. It is recommended not to inject using Hotpatcher."
csgo_pid=$(pidof csgo_linux64)
if [ -z "$csgo_pid" ]; then
/bin/echo -e "\e[31mCS:GO needs to be open before you can inject...\e[0m"
exit 1
fi
if [ ! -d ".git" ]; then
/bin/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 /tmp/dumps # Make it as root
sudo chmod 000 /tmp/dumps # No permissions
if [ ! -f build_id ]; then
/bin/echo "Build ID not found. Please rebuild using the './build' script."
exit
fi
filename=$(cat build_id)
#Credit: Aixxe @ aixxe.net
if grep -q "$filename" /proc/"$csgo_pid"/maps; then
/bin/echo -e "\e[33mFuzion is already injected... Aborting...\e[0m"
exit
fi
echo "Injecting Build ID: $filename"
#https://www.kernel.org/doc/Documentation/security/Yama.txt
sudo echo "2" | sudo tee /proc/sys/kernel/yama/ptrace_scope # Only allows root to inject code. This is temp until reboot.
sudo cp "$filename" /"$filename"
input="$(
sudo hotpatcher -l $(pwd)/$filename.so $csgo_pid | tail -n 2 | head -n 1
)" # Only read the 2nd latest line of the output from hotpatcher
sudo rm /"$filename"
last_line="${input##*$'\n'}"
if [ "$last_line" != "Dll was injected at (nil)" ]; then
/bin/echo -e "\e[32mSuccessfully injected using Hotpatcher!\e[0m"
else
/bin/echo -e "\e[31mInjection failed, make sure you have compiled...\e[0m"
fi