Solved

how to STOP an Internet connection

Posted on 2003-11-12
5
373 Views
Last Modified: 2010-04-05
Applications want to connect to internet by Dialup Modem almost use RASAPI32.DLL and RasDialA function.
How can I STOP an UNKNOWN connection BEFORE modem dialup ?

My Idea :
Hook function RasDialA in RASAPI32.DLL but unsuccessful because if a program was packed, it doesn't effect.

Who have an ideas ?
0
Comment
Question by:LeVuHoang
5 Comments
 
LVL 6

Accepted Solution

by:
DaFox earned 63 total points
ID: 9732737
Hi,

>> Hook function RasDialA in RASAPI32.DLL but unsuccessful because if a program was packed, it doesn't effect.

Just hook LoadLibrary and/or GetProcAddress to get notified when a process loads RasDial API. Or patch the IAT of the *running* process.

Markus
0
 

Assisted Solution

by:saienlyh
saienlyh earned 62 total points
ID: 9738984
function DisconnectActiveConnection: Boolean;

var

RasEntry: TRasEntry;

EntryInfoSize: Cardinal;

DeviceInfoSize: Cardinal;

RasGetEntryPropertiesResult: Integer;

begin

ZeroMemory(@RasEntry, SizeOf(TRasEntry));

RasEntry.dwSize := SizeOf(TRasEntry);

EntryInfoSize := SizeOf(TRasEntry);

RasGetEntryPropertiesResult := RasGetEntryProperties(nil,

MyActiveEntryName), @RasEntry, EntryInfoSize, nil, DeviceInfoSize);

if (RasGetEntryPropertiesResult = 0) then

Result := DisconnectDevice(StrPas(RasEntry.szDeviceName));

end;

 
0
 

Author Comment

by:LeVuHoang
ID: 9745995
thank you, but how to Hook LoadLibrary and disconnect BEFORE the connection finished
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question