| View previous topic :: View next topic |
| Author |
Message |
Mehdi Member
Joined: 20 Oct 2004 Posts: 4
|
Posted: 20/10/04 19:35 Post subject: Get Dialup Password [winXP] |
|
|
Hi
what i can get Dialup password from windows XP
tanX |
|
| Back to top |
|
 |
Stefan Junior Member
Joined: 27 Sep 2004 Posts: 61 Location: Netherlands
|
Posted: 20/10/04 20:54 Post subject: |
|
|
Hi,
Try the EnumCachedPasswords() routine in MPR.dll.
It is undocumented but that should retreive all of the cached passwords in Windows. Do a google search for it, I posted something about that a couple of years back on usenet, so that should still be there...
Cheers,
Stefan |
|
| Back to top |
|
 |
Mehdi Member
Joined: 20 Oct 2004 Posts: 4
|
Posted: 20/10/04 21:09 Post subject: |
|
|
Hi,
tanX Stefan
i'm searching EnumCachedPasswords() from google but not found your response about this from usenet.
could you send this for me :-/
(: tanX  |
|
| Back to top |
|
 |
Stefan Junior Member
Joined: 27 Sep 2004 Posts: 61 Location: Netherlands
|
Posted: 20/10/04 21:35 Post subject: |
|
|
Hmm, I can't seem to find it anymore either.
tada:
| Code: |
unit Unit1;
interface
uses
Windows, SysUtils, Classes, Forms, ShellAPI, Controls, StdCtrls, Dialogs;
type
TForm1 = class(TForm)
Button1: TButton;
SaveDialog1: TSaveDialog;
ListBox: TListBox;
procedure Label1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
hMPR: 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 mpr name 'WNetEnumCachedPasswords';
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.FormShow(Sender: TObject);
begin
if WNetEnumCachedPasswords(nil, 0, $FF, @AddPassword, 0) <> 0 then
begin
Application.Terminate;
end
else
if Count = 0 then
ListBox.Items.Add('No password found');
end; |
|
|
| Back to top |
|
 |
Mehdi Member
Joined: 20 Oct 2004 Posts: 4
|
Posted: 21/10/04 10:21 Post subject: tanX Stefan |
|
|
txnX Stefan  |
|
| Back to top |
|
 |
Mehdi Member
Joined: 20 Oct 2004 Posts: 4
|
Posted: 24/10/04 12:28 Post subject: |
|
|
Hi
Stefan you code not work into winXp true
this code run only in win98  |
|
| Back to top |
|
 |
Stefan Junior Member
Joined: 27 Sep 2004 Posts: 61 Location: Netherlands
|
Posted: 26/10/04 07:44 Post subject: |
|
|
Could be that it is pre-NT code only... I'm not sure, I never really did anything with it except play around on my Win95 (it was I believe) desktop  |
|
| Back to top |
|
 |
|