-
Notifications
You must be signed in to change notification settings - Fork 41
/
uload
executable file
·38 lines (30 loc) · 881 Bytes
/
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
#!/bin/bash
# Credit: Aixxe @ aixxe.net
dota_pid=$(pidof dota2)
filename="libMcDota.so"
fullpath="$(pwd)/$filename"
echo $fullpath
sudo killall -19 steam
sudo killall -19 steamwebhelper
if grep -q "$filename" "/proc/$dota_pid/maps"; then
#Send signal SIGXCPU, which will signal McDota to get ready for unloading.
kill -24 "$dota_pid"
echo "Unloading..."
sudo gdb -n -q -batch-silent \
-ex "set logging on" \
-ex "set logging file /dev/null" \
-ex "set logging redirect on" \
-ex "attach $dota_pid" \
-ex "set \$dlopen = (void*(*)(char*, int)) dlopen" \
-ex "set \$dlclose = (int(*)(void*)) dlclose" \
-ex "set \$library = \$dlopen(\"$filename\", 6)" \
-ex "call \$dlclose(\$library)" \
-ex "call \$dlclose(\$library)" \
-ex "call \$dlclose(\$library)" \
-ex "detach" \
-ex "quit"
fi
sleep 0.2
sudo killall -18 steamwebhelper
sudo killall -18 steam
echo "Done."