Solved

how to STOP an Internet connection

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now