Inheritance: IMemberSignature
コード例 #1
0
ファイル: BlobHeap.cs プロジェクト: Chemiculs/AsmResolver
        public IMemberSignature ReadMemberRefSignature(uint sig, IGenericParametersProvider provider)
        {
            IMemberSignature signature = null;
            using (BinaryReader reader = GetBlobReader(sig))
            {

                byte flag = reader.ReadByte();

                if (flag == 0x6)
                {
                    FieldSignature fieldsignature = new FieldSignature();
                    fieldsignature.ReturnType = ReadTypeReference(reader, (ElementType)reader.ReadByte(), null);
                    signature = fieldsignature;
                }
                else
                {
                    MethodSignature methodsignature = new MethodSignature();

                    if ((flag & 0x20) != 0)
                    {
                        methodsignature.HasThis = true;
                        flag = (byte)(flag & -33);
                    }
                    if ((flag & 0x40) != 0)
                    {
                        methodsignature.ExplicitThis = true;
                        flag = (byte)(flag & -65);
                    }
                    if ((flag & 0x10) != 0)
                    {
                        uint genericsig = ReadCompressedUInt32(reader);
                    }
                    methodsignature.CallingConvention = (MethodCallingConvention)flag;

                    //if ((flag & 0x10) != 0x0)
                    //{
                    //    uint num2 = ReadCompressedUInt32();
                    //
                    //    List<GenericParameter> generics = new List<GenericParameter>();
                    //    for (int i = 0; i < num2; i++)
                    //    {
                    //    }
                    //
                    //}

                    uint num3 = ReadCompressedUInt32(reader);
                    methodsignature.ReturnType = ReadTypeReference(reader, (ElementType)ReadCompressedUInt32(reader), provider);//ReadTypeSignature((uint)stream.Position);
                    if (num3 != 0)
                    {
                        ParameterReference[] parameters = new ParameterReference[num3];
                        for (int i = 0; i < num3; i++)
                        {
                            parameters[i] = new ParameterReference() { ParameterType = ReadTypeReference(reader, (ElementType)ReadCompressedUInt32(reader), provider) };
                        }
                        methodsignature.Parameters = parameters;
                    }
                    signature = methodsignature;

                }
            }
            return signature;
        }
コード例 #2
0
 public override void ClearCache()
 {
     signature = null;
     genericparams = null;
     declaringType = null;
     name = null;
 }
コード例 #3
0
ファイル: MethodReference.cs プロジェクト: Rex-Hays/GNIDA
 public override void LoadCache()
 {
     base.LoadCache();
     _signature = Signature;
     _name = Name;
 }
コード例 #4
0
ファイル: MethodReference.cs プロジェクト: Rex-Hays/GNIDA
 public override void ClearCache()
 {
     _signature = null;
     _name = null;
 }
コード例 #5
0
 public override void ClearCache()
 {
     signature     = null;
     declaringType = null;
     name          = null;
 }
コード例 #6
0
ファイル: BlobHeap.cs プロジェクト: Rex-Hays/GNIDA
        public IMemberSignature ReadMemberRefSignature(uint sig, IGenericContext context)
        {
            IMemberSignature signature = null;
            BlobSignatureReader reader;
            if (TryGetBlobReader(sig, context, out reader))
            {
                using (reader)
                {
                    byte flag = reader.ReadByte();

                    if (flag == 0x6)
                    {
                        FieldSignature fieldsignature = new FieldSignature();
                        fieldsignature.ReturnType = reader.ReadTypeReference((ElementType)reader.ReadByte());
                        signature = fieldsignature;
                    }
                    else
                    {
                        MethodSignature methodsignature = new MethodSignature();

                        if ((flag & 0x20) != 0)
                        {
                            methodsignature.HasThis = true;
                            flag = (byte)(flag & -33);
                        }
                        if ((flag & 0x40) != 0)
                        {
                            methodsignature.ExplicitThis = true;
                            flag = (byte)(flag & -65);
                        }
                        if ((flag & 0x10) != 0)
                        {
                            int genericsig = NETGlobals.ReadCompressedInt32(reader);
                            if (!context.IsDefinition)
                            {
                                AddMissingGenericParameters(context.Method, genericsig - 1);
                            }
                        }
                        methodsignature.CallingConvention = (MethodCallingConvention)flag;

                        uint paramCount = NETGlobals.ReadCompressedUInt32(reader);
                        methodsignature.ReturnType = reader.ReadTypeReference();

                        ParameterReference[] parameters = new ParameterReference[paramCount];
                        for (int i = 0; i < paramCount; i++)
                        {
                            parameters[i] = new ParameterReference() { ParameterType = reader.ReadTypeReference((ElementType)reader.ReadByte()) };
                        }
                        methodsignature.Parameters = parameters;

                        signature = methodsignature;
                    }
                }
            }
            return signature;
        }