What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » Pathcou - TrackPopupMenuEx

Pathcou - TrackPopupMenuEx
Author: Message:
Patchou
Messenger Plus! Creator
*****

Avatar

Posts: 8607
Reputation: 201
43 / Male / Flag
Joined: Apr 2002
RE: Pathcou - TrackPopupMenuEx
To answer your first question (and your email), my guess is that you cannot subclass TrackPopupMenuEx() when Plus! is loaded because of the way you're searching for the function location in the import table.

Using PIMAGE_THUNK_DATA.u1.Function, works fine as long as you're the only one who tries to subclass a function. As Messenger Plus! replaces the function pointer for its own, your search returns nothing and your subclass fails. To prevent that from happening, I suggest that you simply search for the function based on its name and not its address in memory.

Getting the name of an imported function is simple. Messenger Plus! does it this way:
code:
PIMAGE_THUNK_DATA pThunk
  = (PIMAGE_THUNK_DATA)( (PBYTE) hmodCaller + pImportDesc->FirstThunk );

//... iterate every function

PIMAGE_IMPORT_BY_NAME pImportName
  = (PIMAGE_IMPORT_BY_NAME)((PBYTE)hmodCaller + pThunkName->u1.AddressOfData);

if(!(IMAGE_SNAP_BY_ORDINAL(pThunkName->u1.Ordinal)) && pImportName->Name)
{
   /** Add code to make sure this is a pointer to a string **/

   /** Compare pImportName->Name to the known name of the function. If there's a match, proceed with the subclass like you do by searching with a pointer, however, make sure you chain the subclass properly by getting the current function address from the table and not the original function pointer. **/
}


Hope it helps :)
Patchou

This post was edited on 06-14-2005 at 08:34 PM by Patchou.
[Image: signature2.gif]
06-14-2005 08:28 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Pathcou - TrackPopupMenuEx - by TazDevil on 06-11-2005 at 02:33 PM
RE: Pathcou - TrackPopupMenuEx - by absorbation on 06-11-2005 at 03:12 PM
RE: Pathcou - TrackPopupMenuEx - by Dempsey on 06-11-2005 at 03:25 PM
RE: Pathcou - TrackPopupMenuEx - by Stigmata on 06-11-2005 at 03:33 PM
RE: Pathcou - TrackPopupMenuEx - by Dempsey on 06-11-2005 at 03:34 PM
RE: Pathcou - TrackPopupMenuEx - by TazDevil on 06-11-2005 at 03:41 PM
RE: Pathcou - TrackPopupMenuEx - by Dempsey on 06-11-2005 at 04:03 PM
RE: Pathcou - TrackPopupMenuEx - by TazDevil on 06-11-2005 at 04:07 PM
RE: Pathcou - TrackPopupMenuEx - by Dempsey on 06-11-2005 at 04:19 PM
RE: Pathcou - TrackPopupMenuEx - by TazDevil on 06-11-2005 at 04:27 PM
RE: Pathcou - TrackPopupMenuEx - by Stigmata on 06-11-2005 at 04:42 PM
RE: Pathcou - TrackPopupMenuEx - by TazDevil on 06-11-2005 at 05:26 PM
RE: Pathcou - TrackPopupMenuEx - by TazDevil on 06-14-2005 at 04:58 PM
RE: Pathcou - TrackPopupMenuEx - by Patchou on 06-14-2005 at 08:28 PM
RE: Pathcou - TrackPopupMenuEx - by TheBlasphemer on 06-14-2005 at 09:22 PM
THANKS A MILLION - by TazDevil on 06-15-2005 at 06:38 AM
RE: Pathcou - TrackPopupMenuEx - by RaceProUK on 06-15-2005 at 07:29 PM
RE: Pathcou - TrackPopupMenuEx - by TazDevil on 06-15-2005 at 11:10 PM
RE: Pathcou - TrackPopupMenuEx - by Patchou on 06-16-2005 at 04:48 PM
RE: Pathcou - TrackPopupMenuEx - by TazDevil on 06-17-2005 at 01:00 AM
RE: Pathcou - TrackPopupMenuEx - by Patchou on 06-17-2005 at 05:44 AM
RE: Pathcou - TrackPopupMenuEx - by TazDevil on 06-17-2005 at 08:45 AM
RE: Pathcou - TrackPopupMenuEx - by RaceProUK on 06-17-2005 at 01:55 PM
RE: Pathcou - TrackPopupMenuEx - by TazDevil on 06-17-2005 at 02:27 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On