From 603baef039fb53a6d7339835a7bead65489f8cfd Mon Sep 17 00:00:00 2001 From: 8dcc <8dcc.git@gmail.com> Date: Wed, 19 Jul 2023 20:13:24 +0200 Subject: [PATCH] Add injector script --- inject.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 inject.sh diff --git a/inject.sh b/inject.sh new file mode 100755 index 0000000..4916038 --- /dev/null +++ b/inject.sh @@ -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