internal Property(PEReader buff) { flags = buff.ReadUInt16(); name = buff.GetString(); typeBlobIx = buff.GetBlobIx(); tabIx = MDTable.Property; }
internal FieldMarshal(PEReader buff) { Contract.Requires(buff != null); parentIx = buff.GetCodedIndex(CIx.HasFieldMarshal); ntIx = buff.GetBlobIx(); tabIx = MDTable.FieldMarshal; }
internal FieldDef(PEReader buff) : base(null, null, null) { flags = buff.ReadUInt16(); name = buff.GetString(); sigIx = buff.GetBlobIx(); tabIx = MDTable.Field; }
internal MethodSpec(PEReader buff) : base(null) { parentIx = buff.GetCodedIndex(CIx.MethodDefOrRef); instIx = buff.GetBlobIx(); tabIx = MDTable.MethodSpec; this.unresolved = true; }
internal UnresolvedTypeSpec(PEReader buff, int i) : base(0) { Contract.Requires(buff != null); blobIx = buff.GetBlobIx(); Row = (uint)i + 1; this.unresolved = true; }
internal static string[] GetFeatureNames(PEReader buff, MDTable tabIx, MDTable mapTabIx, ClassDef theClass, uint classIx) { buff.SetElementPosition(mapTabIx, 0); uint start = 0; uint i = 0; for (; (i < buff.GetTableSize(tabIx)) && (start == 0); i++) { if (buff.GetIndex(MDTable.TypeDef) == classIx) { start = buff.GetIndex(tabIx); } } if (start == 0) { return(null); } uint end; if (i < buff.GetTableSize(mapTabIx)) { uint junk = buff.GetIndex(MDTable.TypeDef); end = buff.GetIndex(tabIx); } else { end = buff.GetTableSize(tabIx); } if (tabIx == MDTable.Event) { theClass.eventIx = start; } else { theClass.propIx = start; } string[] names = new string[end - start]; buff.SetElementPosition(tabIx, start); for (i = start; i < end; i++) { uint junk = buff.ReadUInt16(); names[i] = buff.GetString(); if (tabIx == MDTable.Event) { junk = buff.GetCodedIndex(CIx.TypeDefOrRef); } else { junk = buff.GetBlobIx(); } } return(names); }
internal MethodDef(PEReader buff) : base(null) { rva = buff.ReadUInt32(); implFlags = buff.ReadUInt16(); methFlags = buff.ReadUInt16(); name = buff.GetString(); sigIx = buff.GetBlobIx(); parIx = buff.GetIndex(MDTable.Param); tabIx = MDTable.Method; }
internal static void GetFieldRefs(PEReader buff, uint num, ClassRef parent) { for (int i = 0; i < num; i++) { uint flags = buff.ReadUInt16(); string name = buff.GetString(); uint sigIx = buff.GetBlobIx(); if ((flags & (uint)FieldAttr.Public) == (uint)FieldAttr.Public) { if (parent.GetField(name) == null) { //Console.WriteLine(parent.NameString()); buff.currentClassScope = parent; FieldRef fRef = new FieldRef(parent, name, buff.GetFieldType(sigIx)); buff.currentClassScope = null; parent.AddToFieldList(fRef); } } } }
internal static void Read(PEReader buff, TableRow[] sigs) { for (int i = 0; i < sigs.Length; i++) { uint sigIx = buff.GetBlobIx(); uint tag = buff.FirstBlobByte(sigIx); if (tag == LocalSig.LocalSigByte) { sigs[i] = new LocalSig(sigIx); } else if (tag == Field.FieldTag) { sigs[i] = new Signature(sigIx); } else { sigs[i] = new CalliSig(sigIx); } sigs[i].Row = (uint)i + 1; } }
internal static void GetMethodRefs(PEReader buff, uint num, ClassRef parent) { for (int i = 0; i < num; i++) { uint rva = buff.ReadUInt32(); ushort implFlags = buff.ReadUInt16(); ushort methFlags = buff.ReadUInt16(); string name = buff.GetString(); uint sigIx = buff.GetBlobIx(); uint parIx = buff.GetIndex(MDTable.Param); if (IsPublicOrProtected(methFlags)) { MethodRef mRef = new MethodRef(parIx, name, sigIx); // changed mRef.SetParent(parent); //Console.WriteLine(parent.NameString()); MethSig mSig = buff.ReadMethSig(mRef, name, sigIx); //mSig.name = name; mRef.SetSig(mSig); // changed parent.AddToMethodList(mRef); } } }
internal static void ReadMember(PEReader buff, TableRow[] members) { Contract.Requires(buff != null); Contract.Requires(members != null); for (int i = 0; i < members.Length; i++) { uint parenIx = buff.GetCodedIndex(CIx.MemberRefParent); string memName = buff.GetString(); uint sigIx = buff.GetBlobIx(); if (buff.FirstBlobByte(sigIx) == Field.FieldTag) // got a field members[i] = new FieldRef(parenIx, memName, sigIx); else members[i] = new MethodRef(parenIx, memName, sigIx); } }