Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1057931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:56:51+00:00 2026-05-16T17:56:51+00:00

I have the following dump of delegate object: Name: MyEventHandler MethodTable: 132648fc EEClass: 1319e2b4

  • 0

I have the following dump of delegate object:

Name: MyEventHandler  
MethodTable: 132648fc  
EEClass: 1319e2b4  
Size: 32(0x20) bytes  
Fields:  
     MT    Field   Offset                 Type VT     Attr    Value Name  
790fd0f0  40000ff        4        System.Object  0 instance 014037a4 _target  
7910ebc8  4000100        8 ...ection.MethodBase  0 instance 00000000 _methodBase  
791016bc  4000101        c        System.IntPtr  1 instance 2ef38748 _methodPtr  
791016bc  4000102       10        System.IntPtr  1 instance        0 _methodPtrAux  
790fd0f0  400010c       14        System.Object  0 instance 00000000 _invocationList  
791016bc  400010d       18        System.IntPtr  1 instance        0 _invocationCount  

How can I get the name of the method, pointed by the delegate?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T17:56:51+00:00Added an answer on May 16, 2026 at 5:56 pm

    In my experience the suggestion offered by hakan doesn’t work. Here’s what I do.

    The output shows that the attached handler is a member of the object pointed to by _target. By dumping that you’ll get it’s method table.

    I have constructed a similar example, to illustrate:

    0:000> !do 02844de4 
    Name: System.EventHandler
    MethodTable: 0067afa4
    EEClass: 0052ef88
    Size: 32(0x20) bytes
     (C:\windows\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll)
    Fields:
          MT    Field   Offset                 Type VT     Attr    Value Name
    002e6d58  40000ff        4        System.Object  0 instance 02842d20 _target
    0058df70  4000100        8 ...ection.MethodBase  0 instance 00000000 _methodBase
    0058743c  4000101        c        System.IntPtr  1 instance   2cc060 _methodPtr
    0058743c  4000102       10        System.IntPtr  1 instance        0 _methodPtrAux
    002e6d58  400010c       14        System.Object  0 instance 00000000 _invocationList
    0058743c  400010d       18        System.IntPtr  1 instance        0 _invocationCount
    

    In this case, I’ll look at the object at 02842d20.

    0:000> !do 02842d20 
    Name: app.Foo
    MethodTable: 002c30bc
    EEClass: 002c13d4
    Size: 12(0xc) bytes
     (C:\workspaces\TestBench\app\bin\x86\Debug\app.exe)
    Fields:
    None
    

    So the target type is app.Foo. Let’s dump the methods for this type.

    0:000> !dumpmt -md 002c30bc
    EEClass: 002c13d4
    Module: 002c2c5c
    Name: app.Foo
    mdToken: 02000002  (C:\workspaces\TestBench\app\bin\x86\Debug\app.exe)
    BaseSize: 0xc
    ComponentSize: 0x0
    Number of IFaces in IFaceMap: 0
    Slots in VTable: 6
    --------------------------------------
    MethodDesc Table
       Entry MethodDesc      JIT Name
    002ec015   002e6cbc     NONE System.Object.ToString()
    002ec019   002e6cc4     NONE System.Object.Equals(System.Object)
    002ec029   002e6cf4     NONE System.Object.GetHashCode()
    005f4930   002e6d1c      JIT System.Object.Finalize()
    005f8238   002c30b4      JIT app.Foo..ctor()
    005f8270   002c30a8      JIT app.Foo.Bar(System.Object, System.EventArgs)
    

    Compare the values of the MethodDesc table with the original value of _methodPtr. No apparent match.

    _methodPtr points to a piece of code which either does a jmp to the address of the function in question or calls a fix-up routine, so the next step is to use the !u command on the value of _methodPtr. If we see a jmp instruction, we have the address and by using !u on that, we get the method.

    If, on the other hand, we see a call to clr!PrecodeFixupThunk we can get the MethodDesc by dumping the memory pointed to by _methodPtr like this

    0:000> dd 2cc060 
    002cc060  7e5d65e8 00005e6e 002c30a8 00000000
    002cc070  00000000 00000000 00000000 00000000
    002cc080  00000000 00000000 00000000 00000000
    

    we see something that looks like a method table entry in as the third DWORD. By comparing the value 002c30a8 with the method table above, we see that the name of the method is app.Foo.Bar.

    Since this is a constructed example, I know that I have found the method, I was looking for in this case.

    Actually it may be bit more complicated that the above example shows, as the fields are used differently depending on the actual usage of the event. However, in my experience the approach above will work in the general publisher/subscriber scenario.

    For more details on the implementation details check out the file comdelegate.cpp of the shared source CLI.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following dump: CREATE TABLE `testdata`.`carer` ( `ID` bigint(20) NOT NULL auto_increment,
gcc 4.4.3 c89 I have the following source code. And getting a stack dump
I have following situation: I have loged user, standard authentication with DB table $authAdapter
I have following string String str = replace :) :) with some other string;
I have following foreach-loop: using System.IO; //... if (Directory.Exists(path)) { foreach(string strFile in Directory.GetFiles(path,
I have following situation. A main table and many other tables linked together with
I have following table structure: Table: Plant PlantID: Primary Key PlantName: String Table: Party
I Have following code: Controller: public ActionResult Step1() { return View(); } [AcceptVerbs(HttpVerbs.Post)] public
I have following text in a file 23456789 When I tried to replace the
I have following Code Block Which I tried to optimize in the Optimized section

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.