Exemplo n.º 1
0
 uint ReadFieldValue(HexField field)
 {
     if (field.Size == 2)
         return mdVM.Document.ReadUInt16(field.StartOffset);
     else if (field.Size == 4)
         return mdVM.Document.ReadUInt32(field.StartOffset);
     return 0;
 }
Exemplo n.º 2
0
 string GetStringsDescription(HexField field)
 {
     var s = ReadStringsHeap(field);
     if (!string.IsNullOrEmpty(s))
         return string.Format("{0} (#Strings Heap Offset)", s);
     return "#Strings Heap Offset";
 }
Exemplo n.º 3
0
 string GetDescription(Table table, HexField field)
 {
     var info = GetInfo(table, ReadFieldValue(field));
     if (string.IsNullOrEmpty(info))
         return string.Format("{0} RID", table);
     return string.Format("{0} ({1} RID)", info, table);
 }
Exemplo n.º 4
0
        string GetCodedTokenDescription(CodedToken codedToken, string codedTokenName, ColumnInfo col, HexField field)
        {
            MDToken token;
            if (!codedToken.Decode(ReadFieldValue(field), out token))
                return string.Format("Invalid {0} Coded Token", codedTokenName);

            var info = GetInfo(token.Table, token.Rid);
            if (string.IsNullOrEmpty(info))
                return string.Format("{0}: {1}[{2}], 0x{3:X8})", codedTokenName, token.Table, token.Rid, token.Raw);
            return string.Format("{0} ({1}: {2}[{3}], 0x{4:X8})", info, codedTokenName, token.Table, token.Rid, token.Raw);
        }
Exemplo n.º 5
0
 protected string ReadStringsHeap(HexField field)
 {
     var s = NumberVMUtils.ToString(mdVM.ReadStringsHeap(ReadFieldValue(field)), false);
     Debug.Assert(s.Length >= 2);
     if (s.Length < 2)
         return s;
     return s.Substring(1, s.Length - 2);
 }
Exemplo n.º 6
0
        string GetCodedTokenDescription(CodedToken codedToken, string codedTokenName, ColumnInfo col, HexField field)
        {
            MDToken token;
            if (!codedToken.Decode(ReadFieldValue(field), out token))
                return string.Empty;

            return string.Format("{0} Coded Token: {1}[{2}] (0x{3:X8})", codedTokenName, token.Table, token.Rid, token.Raw);
        }