X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/40b1517d56f509a5faebb5ab25988c1d2216e879..bc3080fdd24b9858d9c9dcbd3d8dd78ae010962a:/Trampoline.t.cpp diff --git a/Trampoline.t.cpp b/Trampoline.t.cpp index 1d7cf95..5b5fc4e 100644 --- a/Trampoline.t.cpp +++ b/Trampoline.t.cpp @@ -1,5 +1,5 @@ /* Cycript - Optimizing JavaScript Compiler/Runtime - * Copyright (C) 2009-2010 Jay Freeman (saurik) + * Copyright (C) 2009-2012 Jay Freeman (saurik) */ /* GNU Lesser General Public License, Version 3 {{{ */ @@ -32,6 +32,8 @@ static _finline void dlset(Baton *baton, Type_ &function, const char *name, void baton->dlerror(); } +// XXX: where you find this needs to be relative to CoreFoundation (or something) +// XXX: this needs to check if the framework is under PrivateFrameworks instead #define Framework(framework) \ "/System/Library/Frameworks/" #framework ".framework/" #framework @@ -66,10 +68,12 @@ void *Routine(void *arg) { void (*CYHandleServer)(pid_t); dlset(baton, CYHandleServer, "CYHandleServer", handle); + if (CYHandleServer == NULL) { + baton->dlerror(); + return NULL; + } - if (CYHandleServer != NULL) - CYHandleServer(baton->pid); - + CYHandleServer(baton->pid); return NULL; }