重写(或劫持)从浏览器中的 flash (swf) 文件发出的绝对 URL 请求 [英] Rewrite (or hijack) an absolute URL request made from a flash (swf) file in a browser

查看:28
本文介绍了重写(或劫持)从浏览器中的 flash (swf) 文件发出的绝对 URL 请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法重写(或劫持)从浏览器中的 flash (swf) 文件发出的绝对 URL 请求?

Is there a way to rewrite (or hijack) an absolute URL request made from a flash (swf) file in a browser?

例如

我有一个 Flash 应用程序正在请求 http://example.com/myImage.png

I have a flash application that is requesting http://example.com/myImage.png

Flash 应用程序中的代码无法更改,但我希望能够在请求图像时使用另一个 Flash 或一些 javascript 来编写该 URL - 类似于

The code in the flash application cannot be changed but I want to be able to either use another flash or some javascript to write that URL as the image is beging requested - to something like

example.com/myImage.png?u=123456

推荐答案

可以有机会在谈论 AS2 swf 时做到这一点.AVM1 允许这种肮脏的把戏,但 AVM2 不允许.

You could have a chance of doing it your are talking about an AS2 swf. The AVM1 is very permissive for that kind of dirty tricks, but AVM2 won't allow you.

因此,假设有一个 AS2 SWF,您可以编写一个包装 swf 来劫持 MovieClipLoader 或 loadMovie 或任何原始 swf 正在使用的东西(您可能需要对其进行反编译才能知道).

So, assuming an AS2 SWF, you could write a wrapper swf that hijacks either MovieClipLoader or loadMovie or whatever the original swf is using (you might have to decompile it to know).

劫持位相当直接,例如:

The hijacking bit would be rather straight forward, something like:

_global['MovieClipLoader'] = MyClass;

一旦 MyClass 收到调用,您可以添加所需的任何内容,然后进行实际调用.

Once MyClass gets the calls, you add whatever you want and then make the actual call.

话虽如此,我知道 _global 技巧适用于自定义类,但不确定它是否适用于 MovieClipLoader 等本机类.

Having said that, I know the _global trick works for custom classes, but not sure it does for native classes like MovieClipLoader.

对不起,这是我能想到的最好的:/

Sorry, that's the best I can come up with :/

胡安

这篇关于重写(或劫持)从浏览器中的 flash (swf) 文件发出的绝对 URL 请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆