简体   繁体   English

有没有一种方法可以检查SWF以查看其使用的RSL?

[英]Is there a way to inspect a SWF to see what RSLs it uses?

I'm investigating an issue with a Flex app that is attempting to download (at least) one of the Flex framework RSLs from an unexpected URL. 我正在调查一个Flex应用程序的问题,该应用程序试图从意外URL下载(至少)一个Flex框架RSL。 I'm unable to reproduce the issue, but I'm also a bit uncertain about some aspects of the RSL specification in my mxmlc build configuration. 我无法重现该问题,但是对于我的mxmlc构建配置中的RSL规范的某些方面,我也不确定。

Given all that, it would be helpful to be able to inspect the SWF file that lists the RSL dependencies to see exactly what dependencies are present, and the URLs associated therewith. 考虑到所有这些,能够检查列出RSL依赖项的SWF文件以准确查看存在哪些依赖项以及与之相关联的URL将很有帮助。

Is there a method for doing so? 有没有这样做的方法? I've tried Adobe's SWF Investigator, but I didn't see any obvious place where such dependencies are called out. 我已经尝试过Adobe的SWF调查器,但没有发现明显的地方可以找到这种依赖关系。 (I guess they're handled by code generated by mxmlc rather than natively by Flash Player, so they aren't listed as attributes of the SWF?) (我猜它们是由mxmlc生成的代码处理的,而不是由Flash Player本地生成的,因此它们没有列为SWF的属性吗?)

The app is built with/against Flex 4.6, FWIW. 该应用程序是使用/针对Flex 4.6,FWIW构建的。

I haven't located a tool to do this in an automated fashion, but I've found that it's easy enough to find the information by studying the disassembled version of a SWF, available using Adobe's SWF Investigator tool . 我尚未找到以自动化方式执行此操作的工具,但是我发现通过研究SWF的反汇编版本(使用Adobe的SWF Investigator工具可以找到)来查找信息非常容易。

To do so, load a SWF that specifies RSL dependencies into SWF Investigator, then view the disassembled code on the 'SWF Disassembler' tab (easiest to pop open an external editor using the 'Open with text view...' button). 为此,请将指定RSL依赖关系的SWF加载到SWF Investigator中,然后在“ SWF Disassembler”选项卡上查看反汇编的代码(最简单的方法是使用“ Open with text view ...”按钮来弹出外部编辑器)。

The RSL dependencies are specified in the definition of the SWF's info() function, a block beginning with something like this: RSL依赖关系在SWF的info()函数的定义中指定,该块以类似以下内容的开头:

 function info():Object /* disp_id=0 method_id=57 nameIndex = 75 */

Cross-domain RSL dependencies are listed in a cdRsls property, and others in an rsls property. 跨域RSL依赖关系在cdRsls属性中列出,其他在rsls属性中列出。 These lists are populated with a number of RSLData objects, and it's easy to see the parameters to the RSLData constructor being pushed onto the stack. 这些列表中填充了许多RSLData对象,很容易看到将RSLData构造函数的参数压入堆栈。 For example, the following section adds two possible URLs to retrieve the Flex 4.6 'framework' library: 例如,以下部分添加了两个可能的URL来检索Flex 4.6“框架”库:

   13   findpropstrict  mx.core::RSLData //nameIndex = 6
   15   pushstring      "http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/framework_4.6.0.23201.swz"
   18   pushstring      "http://fpdownload.adobe.com/pub/swz/crossdomain.xml"
   21   pushstring      "abd49354324081cebb8f60184cf5fee81f0f9298e64dbec968c96d68fe16c437"
   24   pushstring      "SHA-256"
   27   pushtrue        
   28   pushtrue        
   29   pushstring      "default"
   31   constructprop   mx.core::RSLData (7) //nameIndex = 6
   34   findpropstrict  mx.core::RSLData //nameIndex = 6
   36   pushstring      "framework_4.6.0.23201.swz"
   39   pushstring      ""
   41   pushstring      "abd49354324081cebb8f60184cf5fee81f0f9298e64dbec968c96d68fe16c437"
   44   pushstring      "SHA-256"
   47   pushtrue        
   48   pushtrue        
   49   pushstring      "default"
   51   constructprop   mx.core::RSLData (7) //nameIndex = 6
   54   newarray        [2]

The newarray [2] line at the bottom appears to indicate that these represent two possible locations for the same file (ie, a fallback URL). 底部的newarray [2]行似乎表明它们代表同一文件的两个可能位置(即备用URL)。 If a single URL was provided, there would be a single RSLData object created, and a newarray [1] line. 如果提供了单个URL,则将创建一个RSLData对象,并在newarray [1]行中添加。

This code corresponds to the following definitions from the standard flex-config.xml file bundled with the Flex SDK: 该代码对应于Flex SDK随附的标准flex-config.xml文件中的以下定义:

  <!-- Framework SWC -->
<runtime-shared-library-path>
    <path-element>libs/framework.swc</path-element>
    <rsl-url>http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/framework_4.6.0.23201.swz</rsl-url>
    <policy-file-url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</policy-file-url>
    <rsl-url>framework_4.6.0.23201.swz</rsl-url>
    <policy-file-url></policy-file-url>
</runtime-shared-library-path>

Finally, for reference, here is the signature of the constructor for the RSLData class, to see what parameters the values correspond to: 最后,作为参考,这是RSLData类的构造函数的签名,以查看值对应于哪些参数:

public function RSLData(rslURL:String = null, 
                        policyFileURL:String = null, 
                        digest:String = null, 
                        hashType:String = null, 
                        isSigned:Boolean = false, 
                        verifyDigest:Boolean = false,
                        applicationDomainTarget:String = "default")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM