Rewrite the connect() socket function
How can I produce my own connect socket function? Some links are usefull.
[73 byte] By [
pman] at [2007-11-9 23:52:15]

# 1 Re: Rewrite the connect() socket function
"pman" <cabasm@lycos.com> wrote:
>
>How can I produce my own connect socket function? Some links are usefull.
Hello!
If you want before and after real connect() execute some other code (for
example handshaking, session key generation, etc.), you can create DLL
with name winsock.dll for Windows, but old dll rename to different name for
example - winsockorig.dll. And you can rewrite connect() function in winsock.dll,
and
if you want perform real connection you can call connect() function from
winsockorig.dll (LoadLibrary(...); GetProcedureAddress(..); etc.). This
method was implemented in SSL/TLS software by Russian company New Adam Ltd
- www.adam.ru.
It's a simpliest way to rewrite connect(), but it OS-dependent and require
changing OS library - that is no good idea. Also there is way to write own
NDIS driver - you can find info in MSDN DDK related sections for Windows.
In UNIX world this problem is more complex, because for Linux or BSD you
can either change source code, or write network module. For Sun Solaris
you can implement STREAMS driver, for HP-UX and IBM AIX you can get driver
development kits only by direct contact to representative of HP or AIX.
Best regards,
Nikolay Stanchenko
Brainbench MVP in Internet Security