From: Jay Freeman (saurik) Date: Mon, 20 Jan 2014 10:29:23 +0000 (-0800) Subject: Try to CYON pointers as the address of their value. X-Git-Tag: v0.9.500~27 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/0d64cb32c6d51eac037c39bdb21a68ebdd69ee5e?ds=inline Try to CYON pointers as the address of their value. --- diff --git a/Execute.cpp b/Execute.cpp index 1c8983c..61acaf2 100644 --- a/Execute.cpp +++ b/Execute.cpp @@ -1248,13 +1248,18 @@ static JSValueRef Pointer_callAsFunction_toCYON(JSContextRef context, JSObjectRe JSObjectRef Array(CYGetCachedObject(context, CYJSString("Array_prototype"))); JSObjectRef toCYON(CYCastJSObject(context, CYGetProperty(context, Array, toCYON_s))); return CYCallAsFunction(context, toCYON, _this, count, arguments); - } else try { - CYPool pool; - return CYCastJSValue(context, pool.strcat("&", CYPoolCCYON(pool, context, CYGetProperty(context, _this, cyi_s)), NULL)); - } catch (const CYException &e) { + } else if (internal->type_->type_ == NULL) pointer: { char string[32]; sprintf(string, "%p", internal->value_); return CYCastJSValue(context, string); + } try { + JSValueRef value(CYGetProperty(context, _this, cyi_s)); + if (JSValueIsUndefined(context, value)) + goto pointer; + CYPool pool; + return CYCastJSValue(context, pool.strcat("&", CYPoolCCYON(pool, context, value), NULL)); + } catch (const CYException &e) { + goto pointer; } } CYCatch(NULL) }