[C++] WINSOCK send hook.
I see a few people looking for information on winsock and WINAPI hooks in general.
Well, heres an easily modifiable inline hook, or trampoline hook.
It works quite simply by replacing the 5 byte preamble at the start of the target function (NOTE: in pre win-xp sp2 systems this will be 3 bytes, and not five, so that would need to be changed) with a jump to our function, doing whatever we need to do then jump back to the original code. However, because we’re replacing that preamble, for things to work we have to add those commands in our hook function.
Heres another breif example. I have a TV Card, made by winfast, it came with one of those remote controls. I wrote this to hook the monitor program and send keystrokes once button presses have been detected from the remote control:
[TV CARD HOOK] C – Source Code