`
seya
  • 浏览: 361821 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

How to extract Flex 1.5 MXML controls ActionScript source code

阅读更多

How to extract Flex 1.5 MXML controls ActionScript source code

Sometime is very useful to have control implementation source code at hand. This article describe how to retrieve it. One of possible solutions is to see the source code under Flex Builder debugger.

Let's look at mx_debug.swc file (in my case the path is "C:\Program Files\Macromedia\Flex\lib\frameworks_debug\mx_debug.swc"). SWC is Flash component file, seems like internally it is plain ZIP archive (starts with magic PK and understandable by ZIP extractors). After unzipping mx_debug.swc content we will find "Library.swd" file inside. SWD files are debugging files containing necessary code information. Probably (?) Flex Builder debugger uses this information to provide control source code during debugging process.

Open "Library.swd" file content in plain text or binary editor, e.g. in Notepad, you'll see our controls source code inside. Unfortunately I didn't find SWD files extractor, so created simple one (swd.zip). It's chunky but works fine at least with "Library.swd".

  • Copy "swd.js" file to certain directory on your PC, (e.g. C:\Temp).
  • Copy "Library.swd" file to the same folder.
  • Open command-line prompt and set appropriate current directory, (in our case it's C:\Temp).
  • Execute the following command-line

     C:\Temp>cscript swd.js Libary.swd

  • Wait for few minutes (of course C++/C# or Java implementation will make this in seconds, but perfomance is not the key in this case). As result it will create 452 files under C:\Temp folder.  


Other interesting places to see source code
  • "C:\Documents and Settings\<User>\Application Data\Macromedia\Flex Builder 1.5\Configuration\Objects\MXML\WEB-INF\flex\"
  • "C:\Documents and Settings\<User>\Local Settings\Application Data\Macromedia\Flash MX 2004\en\Configuration\Classes\"
  • "C:\Program Files\Macromedia\Flash MX 2004\en\First Run\Classes\"
  • "C:\Program Files\Macromedia\Flex\lib\system_classes\"
  • "C:\Program Files\Macromedia\Flex\lib\frameworks\mx.swc"
  • "C:\Program Files\Macromedia\Flex\lib\frameworks_debug\mx_debug.swc"
  • "C:\Program Files\Macromedia\Flex\resources\flexforflash\FlexforFlash.zip"
  • "C:\Program Files\Macromedia\Flex Builder 1.5\Configuration\Objects\MXML\WEB-INF\flex\system_classes\"
Debugger friends
Related products
  • Macromedia Flex 1.5
  • Macromedia Flex Builder 1.5
  • Macromedia Flash MX Professional 2004
Downloads
  • SWD source code extractor - swd.zip (1,2 KB)
Flex 2 source code

How to extract Flex 2 source code? Now only Flex 2 Beta 2 released. There is rumor that with final Flex 2 release Adobe will publish source code for some MXML components, probably it will be around framework.swc, and possible chart.swc libraries, but I don't know, it's just my assumption.

There are also amusing packages like "playerglobal.swc" (player runtime), "enterprise.swc" (FES - mx.data.* packages), "rpc.swc" (remoting stuff, mx.messaging.*, mx.rpc.*), "automation.swc" etc. Probably "playerglobal", "enterprise" or "rpc" packages source code will not be published at all for security, money or other reasons.

Good news is that it's possible (after some spelunking with Flex Builder binaries) extract ABC (ActionScript byte code???) code for all components described in these libraries and then extract disassembled IL code. Not all classes are disassembled at this moment on my side. Also there is no AS3 decompiler (to create pure AS code). Nevertheless disassembled information is very useful and helps me to understand Flex 2 platform. Also I am not going to publish this tools and techniques at all. Probably it's question of time and someone else will create SWF decompiler tool for new Flash platform. Thanks. Vadim.

 

转自:http://blog.csai.cn/user1/265/archives/2007/14491.html

分享到:
评论

相关推荐

    flex入门教程,主要介绍了mxml和ActionScript的简单应用

    Flex是Adobe公司开发的一种用于构建富互联网应用程序(RIA)的技术框架,它主要基于ActionScript和MXML两种语言。本教程是针对Flex初学者设计的,旨在帮助他们理解并掌握Flex的基础知识,包括MXML和ActionScript的...

    Flex(MXML+AS)实现的计算器

    在这个“Flex(MXML+AS)实现的计算器”项目中,开发者使用了MXML来设计计算器的界面,而ActionScript则用于实现计算器的各种数学运算功能,包括加、减、乘、除以及开根号和幂运算。 首先,我们来看计算器的界面设计...

    flex的mxml语言基础

    总的来说,Flex项目由MXML和ActionScript协同完成,MXML负责界面展示,ActionScript负责逻辑处理。命名空间作为类的组织方式,避免了类名冲突。掌握MXML的基础知识,对于高效开发Flex应用至关重要。通过深入学习和...

    About-MXML.zip_flex_mxml

    在Flex框架中,MXML和ActionScript共同构成了强大的开发工具,使得开发者能够创建出交互性强、视觉效果丰富的Web应用程序。 MXML的起源和特点: MXML最初由Macromedia公司在2004年推出,后来随着Adobe收购...

    flex-MXML语法

    flex -MXML语法,介绍flex 的 mxml的基本语法构成,适合一般学习者使用

    The Essential Guide to Flex 2 with ActionScript 3.0 源代码

    After learning how to install and becoming familiar with the basics of the Flex Builder 2 software, you will explore in depth how ActionScript 3.0 interacts with Flexs powerful XML-like design ...

    flex中的mxml语法

    pdf格式的flex的mxml语法,适合想学习flex的新手

    The Essential Guide to Flex 2 with ActionScript 3.0-part 1

    side code. * Learn how states can smoothly transition your application interfaces between different data displays. &lt;br&gt;Put quite simply, this book is all youll need to master Flex 2 and ...

    The Essential Guide to Flex 2 with ActionScript 3.0-part 2

    side code. * Learn how states can smoothly transition your application interfaces between different data displays. &lt;br&gt;Put quite simply, this book is all youll need to master Flex 2 and ...

    MXML语法关于flexview

    在FlexView中,MXML通常结合ActionScript一起使用,提供了强大的功能来创建丰富的互联网应用程序(RIA)。 ### MXML命名规范 1. **大小写敏感**:MXML区分大小写,包括文件名、类名以及属性名。 2. **文件扩展名**...

    FLEX inspire_source_code.zip

    《深入解析FLEX inspire_source_code》 在信息技术领域,FLEX作为一个强大的富互联网应用程序(Rich Internet Application,简称RIA)开发框架,曾广泛应用于创建交互性强、用户体验优良的应用程序。本次我们有幸...

    精通Flex 3.0——基于ActionScript 3.0实现_源代码

    《精通Flex 3.0——基于ActionScript 3.0实现》一书源代码。 Flex 3.0 ActionScript 3.0源代码 Flex 3.0源代码。 --------------------------- 第1篇 Flex技术概述 第1章 Flex概述 3 1.1 Flex简介 3 1.2 Flex...

    Flex4 Declarations in ActionScript

    Flex4允许开发者在ActionScript中使用声明式语法,这扩展了ActionScript的功能,使其能与MXML一起工作。通过在ActionScript类中声明变量和属性,我们可以创建组件实例、设置属性并处理事件,无需像传统面向对象编程...

    flex 3.0 actionscript 2.0

    1. **Flex SDK**:Flex 3.0 包含了Flex编译器和Flex框架库,开发者可以使用SDK中的MXML和ActionScript来构建用户界面。它支持CSS样式表,使得UI设计更加灵活和可定制化。 2. **MXML**:MXML是一种标记语言,类似于...

    as3 flex mxml调用.as文件例子

    在本文中,我们将深入探讨如何在ActionScript 3 (AS3) 和 Flex 框架中使用MXML来调用`.as`文件中的类。Flex是Adobe开发的一个开源框架,用于构建富互联网应用程序(RIA),它结合了MXML和AS3,提供了声明式和编程式...

    《Flex入门》及ActionScript 3.0 语言

    Flex是用于构建富互联网应用程序(RIA)的开源框架,它结合了强大的MXML标记语言和ActionScript 3.0编程语言,为开发者提供了创建交互式、高性能的Web应用的能力。 ActionScript 3.0是Flex中的主要编程语言,相较于...

    Adobe提供的Flex解析Json的ActionScript包

    Adobe Flex是一种开源的框架,主要用于构建富互联网应用程序(RIA),它使用ActionScript编程语言和MXML标记语言。在处理数据交换时,特别是与服务器进行异步通信时,JSON(JavaScript Object Notation)格式因其轻...

    精通flex3.0源码基于Actionscript3实现

    《精通Flex 3.0:基于ActionScript 3实现》是一本深度探索Flex 3.0框架源码的专业书籍,其核心是通过ActionScript 3这一强大的编程语言来揭示Flex开发的内在机制。这本书旨在帮助开发者提升对Flex的掌握程度,从而...

    flex开发入门 actionscript

    2. **编写Flex代码**:使用MXML(Flex的标记语言)和ActionScript编写应用程序的界面和逻辑。 3. **编译项目**:Flex项目会被编译成SWF文件,该文件可以在浏览器中运行。 4. **调试项目**:使用Flex Builder提供的...

Global site tag (gtag.js) - Google Analytics