Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how to STOP an Internet connection

Posted on 2003-11-12
5
Medium Priority
?
378 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 6

Accepted Solution

by:
DaFox earned 252 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 248 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

705 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