Hosting Flash won't load swf ressources (xml, image, etc.)

别说谁变了你拦得住时间么 提交于 2019-11-30 15:41:45

I forgot to add the notify to my stream...

NPError NPN_GetURLNotifyProc(NPP instance, const char* url, const char* target, void* notifyData) {
    fprintf(stderr,"[D] NPN_GetURLNotifyProc:%p, url: %s, window: %s, data: %p\n", instance, url, target, notifyData);
    NPStream s;
    uint16 stype;

    memset(&s,0,sizeof(NPStream));
    s.url = strdup(url);
    s.notifyData = notifyData;

    fprintf(stderr, "NPP: %p URL: %s\n", instance, url);

    checkError("NPN_NewStream", pluginFuncs.newstream(instance,"text/html",&s,0,&stype));    
    writeStream(instance, &pluginFuncs, &s);

    checkError("NPN_DestroyStream", pluginFuncs.destroystream(instance,&s,NPRES_DONE));
    free((void*)s.url);
    pluginFuncs.urlnotify(instance, url, NPRES_DONE, notifyData);
    return 0;
}

I have now a standalone gtk application who can run compiled flash (swf). Hope it helps someone in the future. I recommend doing a plugin to read another plugin (aka Sniffer) to actually know which function is called ("and how things works") to have a decent log file to work with.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!