From: Jay Freeman (saurik) Date: Wed, 29 Feb 2012 02:35:54 +0000 (+0000) Subject: Port WebCycript parser (CDATA only) to iOS 5.0. X-Git-Tag: v0.9.4004~4 X-Git-Url: https://git.saurik.com/cydget.git/commitdiff_plain/9bf8fbb996cf1ef669067bb622c0f5852c0e8e86 Port WebCycript parser (CDATA only) to iOS 5.0. --- diff --git a/LockScreen.mm b/LockScreen.mm index 9c1c4b5..a4b0e98 100644 --- a/LockScreen.mm +++ b/LockScreen.mm @@ -595,6 +595,12 @@ MSHook(State, _ZN7WebCore13HTMLTokenizer15scriptExecutionERKNS_16ScriptSourceCod return __ZN7WebCore13HTMLTokenizer15scriptExecutionERKNS_16ScriptSourceCodeENS0_5StateE(_this, source, state); } +// iOS 5.0 cdata +MSHook(void, _ZN7WebCore16ScriptSourceCodeC2ERKN3WTF6StringERKNS_4KURLERKNS1_12TextPositionINS1_14OneBasedNumberEEE, void *_this, const WebCore::String &source, const WebCore::KURL &url, void *position) { + Cycriptify(source); + return __ZN7WebCore16ScriptSourceCodeC2ERKN3WTF6StringERKNS_4KURLERKNS1_12TextPositionINS1_14OneBasedNumberEEE(_this, source, url, position); +} + /* Cydget:// Protocol {{{ */ @interface CydgetURLProtocol : NSURLProtocol { } @@ -894,6 +900,9 @@ static void $UIWebViewWebViewDelegate$webView$didClearWindowObject$forFrame$(UIW [NSURLProtocol registerClass:[CydgetCGIURLProtocol class]]; [WebView registerURLSchemeAsLocal:@"cydget-cgi"]; + MSImageRef JavaScriptCore(MSGetImageByName("/System/Library/PrivateFrameworks/JavaScriptCore.framework/JavaScriptCore")); + MSImageRef WebCore(MSGetImageByName("/System/Library/PrivateFrameworks/WebCore.framework/WebCore")); + if (!iOS4) { void (*_ZN3JSC6Parser5parseEPNS_12JSGlobalDataEPiPNS_7UStringE)(JSC::SourceCode **, JSC::JSGlobalData *, int *, JSC::UString *); dlset(_ZN3JSC6Parser5parseEPNS_12JSGlobalDataEPiPNS_7UStringE, "_ZN3JSC6Parser5parseEPNS_12JSGlobalDataEPiPNS_7UStringE"); @@ -921,6 +930,8 @@ static void $UIWebViewWebViewDelegate$webView$didClearWindowObject$forFrame$(UIW bool (*_ZN7WebCore16MIMETypeRegistry29isSupportedJavaScriptMIMETypeERKNS_6StringE)(const WebCore::String &); nlset(_ZN7WebCore16MIMETypeRegistry29isSupportedJavaScriptMIMETypeERKNS_6StringE, nl, 0); + if (_ZN7WebCore16MIMETypeRegistry29isSupportedJavaScriptMIMETypeERKNS_6StringE == NULL) + MSHookSymbol(_ZN7WebCore16MIMETypeRegistry29isSupportedJavaScriptMIMETypeERKNS_6StringE, "__ZN7WebCore16MIMETypeRegistry29isSupportedJavaScriptMIMETypeERKN3WTF6StringE", WebCore); if (_ZN7WebCore16MIMETypeRegistry29isSupportedJavaScriptMIMETypeERKNS_6StringE != NULL) MSHookFunction(_ZN7WebCore16MIMETypeRegistry29isSupportedJavaScriptMIMETypeERKNS_6StringE, MSHake(_ZN7WebCore16MIMETypeRegistry29isSupportedJavaScriptMIMETypeERKNS_6StringE)); @@ -951,17 +962,27 @@ static void $UIWebViewWebViewDelegate$webView$didClearWindowObject$forFrame$(UIW nlset(_ZN7WebCore6String6appendEPKtj, nl, 6); nlset(_ZN7WebCore6String8truncateEj, nl, 7); - MSImageRef JavaScriptCore(MSGetImageByName("/System/Library/PrivateFrameworks/JavaScriptCore.framework/JavaScriptCore")); - MSImageRef WebCore(MSGetImageByName("/System/Library/PrivateFrameworks/WebCore.framework/WebCore")); + void (*_ZN7WebCore16ScriptSourceCodeC2ERKN3WTF6StringERKNS_4KURLERKNS1_12TextPositionINS1_14OneBasedNumberEEE)(void *, const WebCore::String &, const WebCore::KURL &, void *); + msset(_ZN7WebCore16ScriptSourceCodeC2ERKN3WTF6StringERKNS_4KURLERKNS1_12TextPositionINS1_14OneBasedNumberEEE, WebCore); + if (_ZN7WebCore16ScriptSourceCodeC2ERKN3WTF6StringERKNS_4KURLERKNS1_12TextPositionINS1_14OneBasedNumberEEE != NULL) + MSHookFunction(_ZN7WebCore16ScriptSourceCodeC2ERKN3WTF6StringERKNS_4KURLERKNS1_12TextPositionINS1_14OneBasedNumberEEE, MSHake(_ZN7WebCore16ScriptSourceCodeC2ERKN3WTF6StringERKNS_4KURLERKNS1_12TextPositionINS1_14OneBasedNumberEEE)); if (_ZN7WebCore6String6appendEPKtj == NULL) msset(_ZN7WebCore6String6appendEPKtj, JavaScriptCore); + if (_ZN7WebCore6String6appendEPKtj == NULL) + MSHookSymbol(_ZN7WebCore6String6appendEPKtj, "__ZN3WTF6String6appendEPKtj", JavaScriptCore); if (_ZN7WebCore6String8truncateEj == NULL) msset(_ZN7WebCore6String8truncateEj, JavaScriptCore); + if (_ZN7WebCore6String8truncateEj == NULL) + MSHookSymbol(_ZN7WebCore6String8truncateEj, "__ZN3WTF6String8truncateEj", JavaScriptCore); msset(_ZNK7WebCore6String10charactersEv, WebCore); + msset(_ZN7WebCore6String29charactersWithNullTerminationEv, JavaScriptCore); + if (_ZN7WebCore6String29charactersWithNullTerminationEv == NULL) + MSHookSymbol(_ZN7WebCore6String29charactersWithNullTerminationEv, "__ZN3WTF6String29charactersWithNullTerminationEv", JavaScriptCore); + msset(_ZNK7WebCore6String6lengthEv, WebCore); }