static bool cycript_;
MSHook(bool, _ZN7WebCore16MIMETypeRegistry29isSupportedJavaScriptMIMETypeERKNS_6StringE, const WebCore::String &mime) {
- _trace();
if (!StringEquals(mime, "text/cycript")) {
cycript_ = false;
return __ZN7WebCore16MIMETypeRegistry29isSupportedJavaScriptMIMETypeERKNS_6StringE(mime);
}
- _trace();
static void *handle(dlopen("/usr/lib/libcycript.dylib", RTLD_LAZY | RTLD_GLOBAL));
if (handle == NULL)
size_t length;
if (!StringGet(source, data, length)) {
- _trace();
return;
}
// iOS 2.x
MSHook(State, _ZN7WebCore13HTMLTokenizer15scriptExecutionERKNS_6StringENS0_5StateES3_i, void *_this, const WebCore::String &string, State state, const WebCore::String &url, int line) {
- _trace();
Cycriptify(string);
return __ZN7WebCore13HTMLTokenizer15scriptExecutionERKNS_6StringENS0_5StateES3_i(_this, string, state, url, line);
}
// iOS 4.x cdata
MSHook(void, _ZN7WebCore16ScriptSourceCodeC2ERKNS_6StringERKNS_4KURLEi, void *_this, const WebCore::String &source, const WebCore::KURL &url, int line) {
- _trace();
Cycriptify(source);
return __ZN7WebCore16ScriptSourceCodeC2ERKNS_6StringERKNS_4KURLEi(_this, source, url, line);
}
// iOS 4.x @src=
MSHook(const WebCore::String &, _ZN7WebCore12CachedScript6scriptEv, void *_this) {
- _trace();
const WebCore::String &script(__ZN7WebCore12CachedScript6scriptEv(_this));
string = const_cast<WebCore::String *>(&script);
Log(script);
// iOS 4.x @src=
MSHook(State, _ZN7WebCore13HTMLTokenizer15scriptExecutionERKNS_16ScriptSourceCodeENS0_5StateE, void *_this, void *source, State state) {
- _trace();
if (string != NULL) {
if (iOS4)
Cycriptify(*string, reinterpret_cast<int *>(source) + 3);