diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 538fdbc1..a3cae64e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -202,7 +202,7 @@ jobs: sudo mkdir -p $HOME/.millennium/ext/data/cache/lib/tmp cd $HOME/.millennium/ext/data/cache/lib/tmp sudo ar -x ../libpython3.11.a - sudo gcc -m32 -shared -o ../libpython3.11.so *.o + sudo gcc -m32 -shared -o ../libpython3.11.8.so *.o cd $HOME/.millennium/ext/data/cache/lib sudo rm -rf tmp diff --git a/src/main.cc b/src/main.cc index 15dc4e1a..ba457e89 100644 --- a/src/main.cc +++ b/src/main.cc @@ -133,11 +133,13 @@ extern "C" pid_t pid = getpid(); Logger.Log("Hooked main() with PID: {}", pid); + std::string homeDirectory = std::getenv("HOME"); + /** * Since this isn't an executable, and is "preloaded", the kernel doesn't implicitly load dependencies, so we need to manually. * libpython3.11.so.1.0 should already be in $PATH, so we can just load it from there. */ - if (!dlopen("/home/shadow/.millennium/ext/data/cache/lib/libpython3.11.8.so", RTLD_LAZY | RTLD_GLOBAL)) + if (!dlopen(fmt::format("{}/.millennium/ext/data/cache/lib/libpython3.11.8.so", homeDirectory).c_str(), RTLD_LAZY | RTLD_GLOBAL)) { LOG_ERROR("Failed to load python libraries: {},\n\nThis is likely because it was not found on disk, try reinstalling Millennium.", dlerror()); }