Extract Win98 Internet password

Source: Internet
Author: User
Unit unit1;

Interface

Uses
Windows, sysutils, classes, forms, shellapi, controls, stdctrls;

Type
Tform1 = Class (tform)
Groupbox1: tgroupbox;
ListBox: tlistbox;
Label1: tlabel;
Label2: tlabel;
Procedure label1click (Sender: tobject );
Procedure formshow (Sender: tobject );
Private
{Private Declarations}
Public
HMIP: thandle;
End;

VaR
Form1: tform1;

Const
Count: integer = 0;

Function wnetenumcachedpasswords (LP: lpstr; W: word; B: byte; PC: pchar; DW: DWORD): word; stdcall;

Implementation

{$ R *. DFM}
Function wnetenumcachedpasswords (LP: lpstr; W: word; B: byte; PC: pchar; DW: DWORD): word; External MIP name 'wnetenumcachedpassword ';

Type
Pwinpassword = ^ twinpassword;
Twinpassword = record
Entrysize: word;
Resourcesize: word;
Passwordsize: word;
Entryindex: byte;
Entrytype: byte;
Passwordc: Char;
End;

VaR
Winpassword: twinpassword;

Function addpassword (winpassword: pwinpassword; DW: DWORD): longbool; stdcall;
VaR
Password: string;
PC: array [0 .. $ ff] of char;
Begin
INC (count );

Move (winpassword. passwordc, PC, winpassword. resourcesize );
PC [winpassword. resourcesize]: = #0;
Chartooem (PC, PC );
Password: = strpas (PC );

Move (winpassword. passwordc, PC, winpassword. passwordsize + winpassword. resourcesize );
Move (PC [winpassword. resourcesize], PC, winpassword. passwordsize );
PC [winpassword. passwordsize]: = #0;
Chartooem (PC, PC );
Password: = password + ':' + strpas (PC );

Form1.listbox. Items. Add (password );
Result: = true;
End;

Procedure tform1.label1click (Sender: tobject );
Begin
ShellExecute (getshorttopwindow, 'open', 'HTTP: // www.utilmind.com ', nil, nil, 0 );
End;

Procedure tform1.formshow (Sender: tobject );
Begin
If wnetenumcachedpasswords (nil, 0, $ ff, @ addpassword, 0) <> 0 then
Begin
Application. MessageBox ('can't load passwords: user is not logon. ', 'error', mb_ OK or mb_iconwarning );
Application. Terminate;
End
Else
If Count = 0 then
ListBox. Items. Add ('no passwords found ...');
End;

End.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.