public DebugIns(ABCFile abc, FlashReader input) : this(abc) { DebugType = input.ReadByte(); NameIndex = input.ReadInt30(); RegisterIndex = input.ReadByte(); Extra = input.ReadInt30(); }
public ASException(ABCFile abc, FlashReader input) : base(abc) { From = input.ReadInt30(); To = input.ReadInt30(); Target = input.ReadInt30(); ExceptionTypeIndex = input.ReadInt30(); VariableNameIndex = input.ReadInt30(); }
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); } }
public ASMetadata(ABCFile abc, FlashReader input) : this(abc) { NameIndex = input.ReadInt30(); Items.Capacity = input.ReadInt30(); for (int i = 0; i < Items.Capacity; i++) { var itemInfo = new ASItemInfo(abc, input); Items.Add(itemInfo); } }
public ASTrait(ABCFile abc, FlashReader input) : this(abc) { QNameIndex = input.ReadInt30(); byte bitContainer = input.ReadByte(); Kind = (TraitKind)(bitContainer & 0x0F); Attributes = (TraitAttributes)(bitContainer >> 4); Id = input.ReadInt30(); switch (Kind) { case TraitKind.Slot: case TraitKind.Constant: { TypeIndex = input.ReadInt30(); ValueIndex = input.ReadInt30(); if (ValueIndex != 0) { ValueKind = (ConstantKind)input.ReadByte(); } break; } case TraitKind.Method: case TraitKind.Getter: case TraitKind.Setter: { MethodIndex = input.ReadInt30(); Method.Trait = this; break; } case TraitKind.Class: { ClassIndex = input.ReadInt30(); break; } case TraitKind.Function: { FunctionIndex = input.ReadInt30(); break; } } if (Attributes.HasFlag(TraitAttributes.Metadata)) { MetadataIndices.Capacity = input.ReadInt30(); for (int i = 0; i < MetadataIndices.Capacity; i++) { int metadatumIndex = input.ReadInt30(); MetadataIndices.Add(metadatumIndex); } } }
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; } } }
public ASClass(ABCFile abc, FlashReader input) : base(abc) { ConstructorIndex = input.ReadInt30(); Constructor.IsConstructor = true; Constructor.Container = this; PopulateTraits(input); }
private void PopulateList <T>(List <T> list, Func <int, T> reader, int count = -1) { list.Capacity = (count < 0 ? _input.ReadInt30() : count); for (int i = 0; i < list.Capacity; i++) { T value = reader(i); list.Add(value); } }
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(); }
public LookUpSwitchIns(FlashReader input) : this() { DefaultOffset = input.ReadUInt24(); CaseOffsets.Capacity = (input.ReadInt30() + 1); for (int i = 0; i < CaseOffsets.Capacity; i++) { CaseOffsets.Add(input.ReadUInt24()); } }
public ASInstance(ABCFile abc, FlashReader input) : this(abc) { QNameIndex = input.ReadInt30(); SuperIndex = input.ReadInt30(); Flags = (ClassFlags)input.ReadByte(); if (Flags.HasFlag(ClassFlags.ProtectedNamespace)) { ProtectedNamespaceIndex = input.ReadInt30(); } InterfaceIndices.Capacity = input.ReadInt30(); for (int i = 0; i < InterfaceIndices.Capacity; i++) { int interfaceIndex = input.ReadInt30(); InterfaceIndices.Add(interfaceIndex); } ConstructorIndex = input.ReadInt30(); Constructor.IsConstructor = true; Constructor.Container = this; PopulateTraits(input); }
private void PopulateList <T>(List <T> list, Func <T> reader, T defaultValue) { list.Capacity = _input.ReadInt30(); if (list.Capacity > 0) { list.Add(defaultValue); for (int i = 1; i < list.Capacity; i++) { T value = reader(); list.Add(value); } } }
protected void PopulateTraits(FlashReader input) { Traits.Capacity = input.ReadInt30(); for (int i = 0; i < Traits.Capacity; i++) { var trait = new ASTrait(ABC, input); trait.IsStatic = IsStatic; if (trait.Kind == TraitKind.Method || trait.Kind == TraitKind.Getter || trait.Kind == TraitKind.Setter) { trait.Method.Container = this; } Traits.Add(trait); } }
public ASMethodBody(ABCFile abc, FlashReader input) : this(abc) { MethodIndex = input.ReadInt30(); Method.Body = this; MaxStack = input.ReadInt30(); LocalCount = input.ReadInt30(); InitialScopeDepth = input.ReadInt30(); MaxScopeDepth = input.ReadInt30(); int codeLength = input.ReadInt30(); Code = input.ReadBytes(codeLength); Exceptions.Capacity = input.ReadInt30(); for (int i = 0; i < Exceptions.Capacity; i++) { var exception = new ASException(abc, input); Exceptions.Add(exception); } PopulateTraits(input); }
public ASMethod(ABCFile abc, FlashReader input) : this(abc) { Parameters.Capacity = input.ReadInt30(); ReturnTypeIndex = input.ReadInt30(); for (int i = 0; i < Parameters.Capacity; i++) { var parameter = new ASParameter(abc, this); parameter.TypeIndex = input.ReadInt30(); Parameters.Add(parameter); } NameIndex = input.ReadInt30(); Flags = (MethodFlags)input.ReadByte(); if (Flags.HasFlag(MethodFlags.HasOptional)) { int optionalParamCount = input.ReadInt30(); for (int i = (Parameters.Count - optionalParamCount); optionalParamCount > 0; i++, optionalParamCount--) { ASParameter parameter = Parameters[i]; parameter.IsOptional = true; parameter.ValueIndex = input.ReadInt30(); parameter.ValueKind = (ConstantKind)input.ReadByte(); } } if (Flags.HasFlag(MethodFlags.HasParamNames)) { for (int i = 0; i < Parameters.Count; i++) { ASParameter parameter = Parameters[i]; parameter.NameIndex = input.ReadInt30(); } } }
public CallPropVoidIns(ABCFile abc, FlashReader input) : this(abc) { PropertyNameIndex = input.ReadInt30(); ArgCount = input.ReadInt30(); }
public NewArrayIns(FlashReader input) : this() { ArgCount = input.ReadInt30(); }
public NewObjectIns(FlashReader input) : this() { ArgCount = input.ReadInt30(); }
public CallMethodIns(ABCFile abc, FlashReader input) : this(abc) { MethodIndex = input.ReadInt30(); ArgCount = input.ReadInt30(); }
public GetLexIns(ABCFile abc, FlashReader input) : this(abc) { TypeNameIndex = input.ReadInt30(); }
public PushStringIns(ABCFile abc, FlashReader input) : this(abc) { ValueIndex = input.ReadInt30(); }
public ASScript(ABCFile abc, FlashReader input) : base(abc) { InitializerIndex = input.ReadInt30(); PopulateTraits(input); }
public HasNext2Ins(FlashReader input) : this() { ObjectIndex = input.ReadInt30(); RegisterIndex = input.ReadInt30(); }
public DebugLineIns(FlashReader input) : this() { LineNumber = input.ReadInt30(); }
public ConstructPropIns(ABCFile abc, FlashReader input) : this(abc) { PropertyNameIndex = input.ReadInt30(); ArgCount = input.ReadInt30(); }
public SetSlotIns(FlashReader input) : this() { SlotIndex = input.ReadInt30(); }
public DeletePropertyIns(ABCFile abc, FlashReader input) : this(abc) { PropertyNameIndex = input.ReadInt30(); }
public NewFunctionIns(ABCFile abc, FlashReader input) : this(abc) { MethodIndex = input.ReadInt30(); }
public ApplyTypeIns(FlashReader input) : this() { ParamCount = input.ReadInt30(); }
public NewClassIns(ABCFile abc, FlashReader input) : this(abc) { ClassIndex = input.ReadInt30(); }