X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/3370d0c0f21a43223efe9ae0f76e67f04a332781..8fab8594db1ad0dd8d0cfe1270993d5aa49215f5:/Select.cpp?ds=sidebyside diff --git a/Select.cpp b/Select.cpp index f15ab06..fc49e7c 100644 --- a/Select.cpp +++ b/Select.cpp @@ -29,7 +29,7 @@ #include -extern "C" void CYHandleServer(pid_t pid) { +extern "C" void CYHandleServer(pid_t pid, char *data, size_t size) { Dl_info addr; if (dladdr(reinterpret_cast(&CYHandleServer), &addr) == 0) return; @@ -60,13 +60,15 @@ extern "C" void CYHandleServer(pid_t pid) { void *handle(dlopen(library, RTLD_LOCAL | RTLD_LAZY)); if (handle == NULL) { - syslog(LOG_ERR, "dlopen() -> %s", dlerror()); + strlcpy(data, dlerror(), size); return; } void *symbol(dlsym(handle, "CYHandleServer")); - if (symbol == NULL) + if (symbol == NULL) { + strlcpy(data, dlerror(), size); return; + } reinterpret_cast(symbol)(pid); }