X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/9d79cefcbed6e10f562709ad1b6ec9ac085cd3eb..e82a5a057d600ab513a14673fbc9ed477ad266c3:/Mach/Inject.cpp diff --git a/Mach/Inject.cpp b/Mach/Inject.cpp index c629939..840dc63 100644 --- a/Mach/Inject.cpp +++ b/Mach/Inject.cpp @@ -35,8 +35,12 @@ #include "Pooling.hpp" #include "Trampoline.t.hpp" +extern "C" void CYHandleServer(pid_t); + void InjectLibrary(pid_t pid) { - const char *library(CY_LIBRARY); + Dl_info addr; + _assert(dladdr(reinterpret_cast(&CYHandleServer), &addr) != 0); + const char *library(addr.dli_fname); mach_port_t self(mach_task_self()), task; _krncall(task_for_pid(self, pid, &task));