goldsrc-cheat/inject.sh

19 lines
591 B
Bash
Raw Normal View History

2023-07-19 14:13:24 -04:00
#!/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" \
2023-07-19 14:31:02 -04:00
echo -e "\nDone."