Jump to content
View in the app

A better way to browse. Learn more.

Tuts 4 You

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to get the real method from MethodTyPar

Featured Replies

Posted
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?

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 by 0xd4d

  • Author

Thank you 0xd4d


It worked!


 


Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.