Page 2 of 2 FirstFirst 12
Results 41 to 43 of 43

Thread: API CallBacks Using an Object's Procedure

  1. #41
    New Member
    Join Date
    Feb 2026
    Posts
    2

    Re: API CallBacks Using an Object's Procedure

    Hello, I am the original author of GetClassProcAddress.
    I recently developed a small IDE plugin, and accidentally came across this thread while searching for data. I noticed you are discussing how to retrieve function addresses in class modules – I once spent quite a bit of time figuring this out myself. If you'd like me to offer any advice, please feel free to let me know.
    Funny enough, since I developed this technology around 15 or 16 years ago, some details are a bit fuzzy now. However, when I write small programs for my own use, I still use iSucClass.cls (implemented with GetClassProcAddress) for subclassing. So I still remember the core technical principles, and I have my original blog post that can help jog my memory.
    I'm really glad to register on this forum for the first time, and also found such a comprehensive WinAPI declaration library!

  2. #42

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    10,909

    Re: API CallBacks Using an Object's Procedure

    Quote Originally Posted by nbdld View Post
    Hello, I am the original author of GetClassProcAddress.
    I recently developed a small IDE plugin, and accidentally came across this thread while searching for data. I noticed you are discussing how to retrieve function addresses in class modules – I once spent quite a bit of time figuring this out myself. If you'd like me to offer any advice, please feel free to let me know.
    Funny enough, since I developed this technology around 15 or 16 years ago, some details are a bit fuzzy now. However, when I write small programs for my own use, I still use iSucClass.cls (implemented with GetClassProcAddress) for subclassing. So I still remember the core technical principles, and I have my original blog post that can help jog my memory.
    I'm really glad to register on this forum for the first time, and also found such a comprehensive WinAPI declaration library!
    I appreciate your offer, but I believe it's all figured out in the above, with, hopefully, self-explanatory comments for anyone's edification. Also, it's not quite as simple as getting the address of a class procedure. There's also the issue of 'implicit' arguments on the stack when calling a class's procedure, which is all discussed in the above ... specifically in the thunk included in the above.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  3. #43
    New Member
    Join Date
    Feb 2026
    Posts
    2

    Re: API CallBacks Using an Object's Procedure

    good job

    I still roughly remember the situation being like this:
    Retrieving the address isn’t the hard part. What you get from the vtable is the address of a jump table – it’s a jmp class.xxx instruction.
    You can read the value of this class.xxx and then fetch the exact final address.
    However, you can’t call it directly due to the presence of implicit parameters. You have to construct a dedicated forwarding function through a thunk.
    A small piece of advice:
    From my experience, it’s best to store this thunk function in a module-level array variable.

    byebye

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width