Add injector script

This commit is contained in:
8dcc 2023-07-19 20:13:24 +02:00
parent ddbb36d191
commit 603baef039
1 changed files with 20 additions and 0 deletions

20
inject.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
pid=$(pidof "hl_linux")
libpath=$(realpath "libhlcheat.so")
# 0x2 -> RTLD_NOW
sudo gdb -n -q -batch \
-ex "attach $pid" \
-ex "set \$dlopen = (void* (*)(char*, int))dlopen" \
-ex "set \$dlerror = (char* (*)(void))dlerror" \
-ex "call \$dlopen(\"$libpath\", 2)" \
-ex "call \$dlerror()" \
-ex "detach" \
-ex "quit"
# -ex "set \$dlclose = (int (*)(void*))dlclose" \
if [ $? -eq 0 ]; then
echo -e "\nhl-cheat loaded!"
fi