Exemplo n.º 1
0
        public ASMultiname(ASConstantPool pool, FlashReader input)
            : this(pool)
        {
            Kind = (MultinameKind)input.ReadByte();
            switch (Kind)
            {
            case MultinameKind.QName:
            case MultinameKind.QNameA:
            {
                NamespaceIndex = input.ReadInt30();
                NameIndex      = input.ReadInt30();
                break;
            }

            case MultinameKind.RTQName:
            case MultinameKind.RTQNameA:
            {
                NameIndex = input.ReadInt30();
                break;
            }

            case MultinameKind.RTQNameL:
            case MultinameKind.RTQNameLA:
            {
                /* No data. */
                break;
            }

            case MultinameKind.Multiname:
            case MultinameKind.MultinameA:
            {
                NameIndex         = input.ReadInt30();
                NamespaceSetIndex = input.ReadInt30();
                break;
            }

            case MultinameKind.MultinameL:
            case MultinameKind.MultinameLA:
            {
                NamespaceSetIndex = input.ReadInt30();
                break;
            }

            case MultinameKind.TypeName:
            {
                QNameIndex           = input.ReadInt30();
                TypeIndices.Capacity = input.ReadInt30();
                for (int i = 0; i < TypeIndices.Capacity; i++)
                {
                    int typeIndex = input.ReadInt30();
                    TypeIndices.Add(typeIndex);
                }
                break;
            }
            }
        }
Exemplo n.º 2
0
 public ASNamespaceSet(ASConstantPool pool, FlashReader input)
     : this(pool)
 {
     NamespaceIndices.Capacity = input.ReadInt30();
     for (int i = 0; i < NamespaceIndices.Capacity; i++)
     {
         int namespaceIndex = input.ReadInt30();
         NamespaceIndices.Add(namespaceIndex);
     }
 }
Exemplo n.º 3
0
 public ASNamespace(ASConstantPool pool, FlashReader input)
     : base(pool)
 {
     Kind = (NamespaceKind)input.ReadByte();
     if (!Enum.IsDefined(typeof(NamespaceKind), Kind))
     {
         throw new InvalidCastException($"Invalid namespace kind for value {Kind:0x00}.");
     }
     NameIndex = input.ReadInt30();
 }
Exemplo n.º 4
0
        public ABCFile(byte[] data)
            : this()
        {
            _initialLength = data.Length;
            _input         = new FlashReader(data);

            ushort minor = _input.ReadUInt16();
            ushort major = _input.ReadUInt16();

            Version = new Version(major, minor);
            Pool    = new ASConstantPool(this, _input);

            PopulateList(Methods, ReadMethod);
            PopulateList(Metadata, ReadMetadata);
            PopulateList(Instances, ReadInstance);
            PopulateList(Classes, ReadClass, Instances.Count);
            PopulateList(Scripts, ReadScript);
            PopulateList(MethodBodies, ReadMethodBody);
        }
Exemplo n.º 5
0
 public ASNamespaceSet(ASConstantPool pool)
     : base(pool)
 {
     NamespaceIndices = new List <int>();
 }
Exemplo n.º 6
0
 public ASNamespace(ASConstantPool pool)
     : base(pool)
 {
 }
Exemplo n.º 7
0
 public ASMultiname(ASConstantPool pool)
     : base(pool)
 {
     TypeIndices = new List <int>();
 }