Posted January 13, 201312 yr tablesinfo[0x2B].Name = "MethodTyPar";tablesinfo[0x2B].names = new String[] { "Number", "Method", "Bound", "Name" };tablesinfo[0x2B].type = Types.MethodTyPar;tablesinfo[0x2B].ctypes = new Types[] { Types.UInt16, Types.Method, Types.TypeDefOrRef, Types.String };How to get the real method from MethodTyPar ? Used for methods with generic parameters.Seems that I should get it from "Method" but how?
January 13, 201312 yr maybe this can help dont know http://vijaymukhi.com/documents/books/metadata/chap6.htm
January 14, 201312 yr You're reading some old ass code. MD Table 2Bh is MethodSpec and it has two columns, not four, see here. The MethodSpec.Method column is an index into the Method or MemberRef table (I.e. it's a MethodDefOrRef coded token). Which table this is depends on the low N number of bits. Since it's a MethodDefOrRef coded token, only 1 bit is used (i.e,. N = 1). If the coded token is 10h, then we have 10h & 1 == 0, so it's table Method. Index is 10h >> N (N = 1) which is index 8. 11h = index 8 in MemberRef table. You can see what I do in dnlib here. Follow the call to readerModule.ResolveMethodDefOrRef(). Edited January 14, 201312 yr by 0xd4d
Create an account or sign in to comment