Solved

how to STOP an Internet connection

Posted on 2003-11-12
5
372 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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Comparing dates in Delphi. Greater than/ Less than 3 154
Convert a string into a TDateTime 5 61
control image tags in a string ? 12 133
DBCtrlGrid, Delphi, Scroll 7 15
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

810 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