forked from LWSS/Fuzion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uload
executable file
·48 lines (43 loc) · 1.54 KB
/
uload
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
#!/usr/bin/env bash
# Credit: Aixxe @ aixxe.net
csgo_pid=$(pidof csgo_linux64)
filename=$(cat build_id)
filename_old=$(cat build_id_old)
if [ -f 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"
sudo rm "/usr/lib/${filename}"
fi
fi
# "build_id_old" is used for unloading in case you rebuild while injected.
if [ -f 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"
sudo rm "/usr/lib/${filename_old}"
fi
fi
echo "Done. See CS:GO Console."