Signatures are stored in the metadata Blob heap. In most cases, they are indexed by a column in some table -- Field.Signature, Method.Signature, MemberRef.Signature, etc. However, there are two cases that require a metadata token for a signature that is not indexed by any metadata table. The StandAloneSig table fulfils this need. It has just one column, that points to a Signature in the Blob heap.
상속: TableBase
예제 #1
0
파일: MethodData.cs 프로젝트: higepon/mona
 private void ReadLocalVars()
 {
     this.LocalVarSig = this.data.idxm.GetTable(this.LocalVarSigTok) as StandAloneSigTable;
     if (this.LocalVarSig == null) return;
     int ad = this.data.idxm.BlobOffset + this.LocalVarSig.Signature;
     DoubleInt dataSize = Util.GetDataSize(this.data.data, ad);
     ad += dataSize.A;
     ad++;
     DoubleInt count = Util.GetDataSize(this.data.data, ad);
     ad += count.A;
     this.LocalVars = new ArrayList();
     for (int i = 0; i < count.B; i++)
     {
         TypeData ds = this.data.idxm.ReadType(ad);
         this.LocalVars.Add(ds);
         ad += ds.Size;
     }
 }
예제 #2
0
파일: MethodData.cs 프로젝트: higepon/mona
 private void Parse(PEData data, TableBase m)
 {
     this.data = data;
     this.table = m;
     this.Flags = this.Size = this.MaxStack = this.CodeSize = this.LocalVarSigTok = 0;
     this.ilCodes = null;
     this.ilAddr = 0;
     this.LocalVarSigTok = 0;
     this.LocalVarSig = null;
     this.LocalVars = null;
     this.ImplMap = null;
     this.Kind = this.DataSize = 0;
     this.EHTable = null;
     this.ReadSignature();
     int ad = this.RVA;
     if (ad == 0) return;
     int h = this.data.data[ad];
     if ((h & 3) ==(int) CorILMethod.TinyFormat)
     {
         this.CodeSize = h >> 2;
         ad++;
     }
     else
     {
         h = Util.GetInt16(this.data.data, ad);
         this.Flags = h & 0xfff;
         this.Size =(h >> 12) * 4;
         ad += 2;
         this.MaxStack = Util.GetInt16(this.data.data, ad);
         ad += 2;
         this.CodeSize = Util.GetInt32(this.data.data, ad);
         ad += 4;
         this.LocalVarSigTok = Util.GetInt32(this.data.data, ad);
         ad += 4;
         this.ReadLocalVars();
     }
     this.ilAddr = ad;
     ad += this.CodeSize;
     if ((this.Flags &(int) CorILMethod.MoreSects) == 0) return;
     /// More Sections
     int pad = 4 -(ad & 3);
     if (pad < 4) ad += pad;
     int end = ad;
     this.Kind = this.data.data[ad++];
     bool isFat =(this.Kind &(int) CorILMethod_Sect.FatFormat) != 0;
     if (!isFat)
     {
         this.DataSize = this.data.data[ad];
     }
     else
     {
         this.DataSize = Util.GetInt24(this.data.data, ad);
     }
     ad += 3;
     end += this.DataSize;
     this.EHTable = new ArrayList();
     while (ad < end)
     {
         ExceptionHandlingClauses ex = new ExceptionHandlingClauses();
         if (!isFat)
         {
             ex.Flags = Util.GetInt16(data.data, ad);
             ad += 2;
             ex.TryOffset = Util.GetInt16(data.data, ad);
             ad += 2;
             ex.TryLength = data.data[ad++];
             ex.HandlerOffset = Util.GetInt16(data.data, ad);
             ad += 2;
             ex.HandlerLength = data.data[ad++];
         }
         else
         {
             ex.Flags = Util.GetInt32(data.data, ad);
             ad += 4;
             ex.TryOffset = Util.GetInt32(data.data, ad);
             ad += 4;
             ex.TryLength = Util.GetInt32(data.data, ad);
             ad += 4;
             ex.HandlerOffset = Util.GetInt32(data.data, ad);
             ad += 4;
             ex.HandlerLength = Util.GetInt32(data.data, ad);
             ad += 4;
         }
         if (ex.Flags ==(int) COR_ILEXCEPTION_CLAUSE.EXCEPTION)
         {
             ex.ClassToken = Util.GetInt32(data.data, ad);
         }
         else
         {
             ex.FilterOffset = Util.GetInt32(data.data, ad);
         }
         ad += 4;
         this.EHTable.Add(ex);
     }
 }