• 读取swf里所有类定义


        public class test1 extends Sprite
        {
            public function test1()
            {
                test();
            }
            private function test():void {
                var loader:URLLoader=new URLLoader();
                loader.dataFormat=URLLoaderDataFormat.BINARY;
                loader.addEventListener(Event.COMPLETE,completeHandler);
                loader.load(new URLRequest("bank.swf"));
            }
            private function completeHandler(event:Event):void {
                var bytes:ByteArray=URLLoader(event.target).data;
                bytes.endian=Endian.LITTLE_ENDIAN;
                bytes.writeBytes(bytes,8);
                bytes.uncompress();
                bytes.position=Math.ceil(((bytes[0]>>>3)*4+5)/8)+4;
                while(bytes.bytesAvailable>2){
                    var head:int=bytes.readUnsignedShort();
                    var size:int=head&63;
                    if (size==63)size=bytes.readInt();
                    if (head>>6!=76)bytes.position+=size;
                    else {
                        head=bytes.readShort();
                        for(var i:int=0;i<head;i++){
                            bytes.readShort();
                            size=bytes.position;
                            while(bytes.readByte()!=0);
                            size=bytes.position-(bytes.position=size);
                            trace(bytes.readUTFBytes(size));
                        }
                    }
                }
            } 
        }
  • 相关阅读:
    晨考总结第二天
    晨考总结第一天
    常用的设计模式总结
    AOP底层原理剖析
    Spring AOP
    jstat统计输出说明
    zabbix 触发器匹配字符串告警
    hive部分常用函数
    nginx日志说明
    windwos文件句柄数限制
  • 原文地址:https://www.cnblogs.com/as3lib/p/2468643.html
Copyright © 2020-2023  润新知