CodeExplorer Posted January 13, 2013 Posted January 13, 2013 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?
Dreamer Posted January 13, 2013 Posted January 13, 2013 maybe this can help dont know http://vijaymukhi.com/documents/books/metadata/chap6.htm
0xd4d Posted January 14, 2013 Posted January 14, 2013 (edited) 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, 2013 by 0xd4d 3
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now