Rewrite (or hijack) an absolute URL request made from a flash (swf) file in a browser

喜夏-厌秋 提交于 2019-12-25 03:34:15

问题


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

Eg

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

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


回答1:


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.

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;

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

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 :/

Juan



来源:https://stackoverflow.com/questions/2826086/rewrite-or-hijack-an-absolute-url-request-made-from-a-flash-swf-file-in-a-br

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