[英]Is there a way to inspect a SWF to see what RSLs it uses?
我正在調查一個Flex應用程序的問題,該應用程序試圖從意外URL下載(至少)一個Flex框架RSL。 我無法重現該問題,但是對於我的mxmlc
構建配置中的RSL規范的某些方面,我也不確定。
考慮到所有這些,能夠檢查列出RSL依賴項的SWF文件以准確查看存在哪些依賴項以及與之相關聯的URL將很有幫助。
有沒有這樣做的方法? 我已經嘗試過Adobe的SWF調查器,但沒有發現明顯的地方可以找到這種依賴關系。 (我猜它們是由mxmlc
生成的代碼處理的,而不是由Flash Player本地生成的,因此它們沒有列為SWF的屬性嗎?)
該應用程序是使用/針對Flex 4.6,FWIW構建的。
我尚未找到以自動化方式執行此操作的工具,但是我發現通過研究SWF的反匯編版本(使用Adobe的SWF Investigator工具可以找到)來查找信息非常容易。
為此,請將指定RSL依賴關系的SWF加載到SWF Investigator中,然后在“ SWF Disassembler”選項卡上查看反匯編的代碼(最簡單的方法是使用“ Open with text view ...”按鈕來彈出外部編輯器)。
RSL依賴關系在SWF的info()
函數的定義中指定,該塊以類似以下內容的開頭:
function info():Object /* disp_id=0 method_id=57 nameIndex = 75 */
跨域RSL依賴關系在cdRsls
屬性中列出,其他在rsls
屬性中列出。 這些列表中填充了許多RSLData
對象,很容易看到將RSLData構造函數的參數壓入堆棧。 例如,以下部分添加了兩個可能的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]
底部的newarray [2]
行似乎表明它們代表同一文件的兩個可能位置(即備用URL)。 如果提供了單個URL,則將創建一個RSLData對象,並在newarray [1]
行中添加。
該代碼對應於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>
最后,作為參考,這是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.