🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #8002

Re: Hooking Winsock Functions

#8002
From: Remy Lebeau (TeamB)
Date: Mon, 06 Dec 2004 08:14
29 lines
2537 bytes
"KR" <kr@nospamme.net> wrote in message
news:pan.2004.12.04.14.44.41.939127@nospamme.net...

> No driver needed.  Do a google search on "api hooking" and
> "dll injection".  Can be complicated, but not as much as
> writing a driver (plus there are tools to simplify this).

Using API hooking is much more complicated, not to mentio more dangerous,
than using a driver.  The NDIS architecture is specifically designed for
allowing such hooking.  API hooking, on the other hand, is a programming
hack, it is not the offcial way to approach this issue.

> Most winsock-intercepting programs (firewalls, etc) use this
> method I think, and don't resort to installing drivers.

That is completely wrong.  They do take the driver approach.  For one thing,
it is much easier to install and uninstall.  Just install a single file onto
the machine and set up a few official config values so that WinSock loads
the driver.  Using API hooking, on the other hand, you have to use a global
DLL hook that is installed into every process, altering that process's
memory in order to redirect the function calls to new memory that the DLL
owns.  That can be VERY dangerous, not to mention that it triggers
anti-virus protections because it is virus-like behavior to alter a
program's memory.  Second, it is much more accurate and reliable from a
programming standpoint to use a driver than hooking API calls anyway.


Gambit
Technical Details
Message-ID: <41b414db$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.multikabel.nl!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <4198c26d@newsgroups.borland.com> <pan.2004.12.04.14.44.41.939127@nospamme.net>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,65f5aa4e8e0f93de
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4198c26d@newsgroups.borland.com> <pan.2004.12.04.14.44.41.939127@nospamme.net>
Subject: Re: Hooking Winsock Functions
Date: Mon, 6 Dec 2004 00:14:41 -0800
Lines: 31
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <41b414db$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1102320859 68.69.17.41 (6 Dec 2004 00:14:19 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.multikabel.nl!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail