PECompact 2
API Hook Plug-ins


TranslateAPIAddressToHookAddress

FARPROC TranslateAPIAddressToHookAddress(FARPROC pAPI);                                    

This function requests that the API hook plug-in check to see if the API whose function is at the address given by pAPI has a hook procedure associated with it. If so, the hook procedure address should be returned. If not, the pAPI parameter should be returned. Do not return NULL.

Since there can be multiple API hooks, you must invoke the next TranslateAPIAddressToHookAddress in the chain, as provided to the Initialize function. The return value from the call up the chain should be compared to known API address to which a hook should be applied.

pAPI is the address of the API that should be translated in a hook address, if necessary.