Beispiel #1
0
        public IThunk ReadThunk(ThunkType type)
        {
            if (!Enum.IsDefined(typeof(ThunkType), type))
            {
                throw new InvalidDataException();
            }

            switch (type)
            {
            case ThunkType.ADJUSTOR:
                return(new ADJUSTOR(ctx, Header, this));

            case ThunkType.NOTYPE:
                return(new NOTYPE(ctx, Header, this));

            case ThunkType.PCODE:
                return(new PCODE(ctx, Header, this));

            case ThunkType.VCALL:
                return(new VCALL(ctx, Header, this));

            default:
                throw new NotImplementedException($"Thunk '{type}' not implemented yet");
            }
        }
Beispiel #2
0
        public override void Read()
        {
            var r = CreateReader();

            ParentOffset = r.ReadUInt32();
            Parent       = r.ReadSymbol(Module, ParentOffset);

            End = r.ReadUInt32();

            NextOffset = r.ReadUInt32();
            Next       = r.ReadSymbol(Module, NextOffset);

            Offset      = r.ReadUInt32();
            Segment     = r.ReadUInt16();
            ThunkLength = r.ReadUInt16();
            ThunkType   = r.ReadEnum <ThunkType>();
            Name        = r.ReadSymbolString();
            Thunk       = r.ReadThunk(ThunkType);
        }
 public TLThunk(ThunkType thunkType, string mangledName, SwiftName module, SwiftClassType classType, ulong offset)
     : base(CoreCompoundType.Thunk, mangledName, module, classType, offset)
 {
     Thunk = thunkType;
 }