terminated = true;
} else return false;
+ if (data == NULL)
+ return false;
+
if (_ZNK7WebCore6String6lengthEv != NULL)
length = (*_ZNK7WebCore6String6lengthEv)(&string);
else if (terminated)
static void Cycriptify(const WebCore::String &source, int *psize = NULL) {
if (!cycript_)
return;
+ cycript_ = false;
const UChar *data;
size_t length;
return __ZN7WebCore16ScriptSourceCodeC2ERKNS_6StringERKNS_4KURLEi(_this, source, url, line);
}
-// iOS 4.x @src=
+// iOS 4.x+5.0 @src=
MSHook(const WebCore::String &, _ZN7WebCore12CachedScript6scriptEv, void *_this) {
const WebCore::String &script(__ZN7WebCore12CachedScript6scriptEv(_this));
string = const_cast<WebCore::String *>(&script);
return __ZN7WebCore16ScriptSourceCodeC2ERKN3WTF6StringERKNS_4KURLERKNS1_12TextPositionINS1_14OneBasedNumberEEE(_this, source, url, position);
}
+// iOS 5.0 @src=
+MSHook(void, _ZN7WebCore13ScriptElement13prepareScriptERKN3WTF12TextPositionINS1_14OneBasedNumberEEENS0_17LegacyTypeSupportE, void *_this, void *position, int legacy) {
+ string = NULL;
+ return __ZN7WebCore13ScriptElement13prepareScriptERKN3WTF12TextPositionINS1_14OneBasedNumberEEENS0_17LegacyTypeSupportE(_this, position, legacy);
+}
+
+void (*_ZNK7WebCore13ScriptElement21isScriptTypeSupportedENS0_17LegacyTypeSupportE)(void *_this, int legacy);
+
+// iOS 5.0 @src=
+MSHook(void, _ZN7WebCore13ScriptElement13executeScriptERKNS_16ScriptSourceCodeE, void *_this, void *source) {
+ if (string != NULL) {
+ _ZNK7WebCore13ScriptElement21isScriptTypeSupportedENS0_17LegacyTypeSupportE(_this, 0);
+ Cycriptify(*string, reinterpret_cast<int *>(source) + 3);
+ string = NULL;
+ }
+
+ return __ZN7WebCore13ScriptElement13executeScriptERKNS_16ScriptSourceCodeE(_this, source);
+}
+
/* Cydget:// Protocol {{{ */
@interface CydgetURLProtocol : NSURLProtocol {
}
if (_ZN7WebCore16ScriptSourceCodeC2ERKN3WTF6StringERKNS_4KURLERKNS1_12TextPositionINS1_14OneBasedNumberEEE != NULL)
MSHookFunction(_ZN7WebCore16ScriptSourceCodeC2ERKN3WTF6StringERKNS_4KURLERKNS1_12TextPositionINS1_14OneBasedNumberEEE, MSHake(_ZN7WebCore16ScriptSourceCodeC2ERKN3WTF6StringERKNS_4KURLERKNS1_12TextPositionINS1_14OneBasedNumberEEE));
+ void (*_ZN7WebCore13ScriptElement13prepareScriptERKN3WTF12TextPositionINS1_14OneBasedNumberEEENS0_17LegacyTypeSupportE)(void *, void *, int);
+ msset(_ZN7WebCore13ScriptElement13prepareScriptERKN3WTF12TextPositionINS1_14OneBasedNumberEEENS0_17LegacyTypeSupportE, WebCore);
+ if (_ZN7WebCore13ScriptElement13prepareScriptERKN3WTF12TextPositionINS1_14OneBasedNumberEEENS0_17LegacyTypeSupportE != NULL)
+ MSHookFunction(_ZN7WebCore13ScriptElement13prepareScriptERKN3WTF12TextPositionINS1_14OneBasedNumberEEENS0_17LegacyTypeSupportE, MSHake(_ZN7WebCore13ScriptElement13prepareScriptERKN3WTF12TextPositionINS1_14OneBasedNumberEEENS0_17LegacyTypeSupportE));
+
+ msset(_ZNK7WebCore13ScriptElement21isScriptTypeSupportedENS0_17LegacyTypeSupportE, WebCore);
+
+ void (*_ZN7WebCore13ScriptElement13executeScriptERKNS_16ScriptSourceCodeE)(void *, void *);
+ msset(_ZN7WebCore13ScriptElement13executeScriptERKNS_16ScriptSourceCodeE, WebCore);
+ if (_ZN7WebCore13ScriptElement13executeScriptERKNS_16ScriptSourceCodeE != NULL)
+ MSHookFunction(_ZN7WebCore13ScriptElement13executeScriptERKNS_16ScriptSourceCodeE, MSHake(_ZN7WebCore13ScriptElement13executeScriptERKNS_16ScriptSourceCodeE));
+
if (_ZN7WebCore6String6appendEPKtj == NULL)
msset(_ZN7WebCore6String6appendEPKtj, JavaScriptCore);
if (_ZN7WebCore6String6appendEPKtj == NULL)