简体   繁体   中英

Hooking a 64 bit process from 32 bit app

I'm using SetWindowHookEx to load a DLL into another process, but I need to be able to hook into both 32 and 64 bit processes. I guess I need two separate DLLs for that, but can I do it without creating two versions of the "launcher" app? I need to pass a DLL handle to SetWindowsHookEx , but I can't use LoadLibrary to get it.

Use an out of process COM+ object to host the DLL. You can call 64 bit code from 32 bit using this method, so that way most of the launcher code stays the same except for an if statement where you decide to load either a 32 or 64 bit COM+ object. The object can be coded to load the appropriate version of the DLL into the process, one for 64 bit processes and one for 32 bit.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM