DELPHI AREA
MESSAGE BOARD
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Get Dialup Password [winXP]

 
   Reply to topic    DELPHI AREA Forum Index -> Delphi Programming
View previous topic :: View next topic  
Author Message
Mehdi
Member


Joined: 20 Oct 2004
Posts: 4

PostPosted: 20/10/04 19:35    Post subject: Get Dialup Password [winXP] Reply with quote

Hi Smile
what i can get Dialup password from windows XP Smile

tanX
Back to top
View user's profile Yahoo Messenger
Stefan
Junior Member


Joined: 27 Sep 2004
Posts: 61
Location: Netherlands

PostPosted: 20/10/04 20:54    Post subject: Reply with quote

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
View user's profile Send e-mail
Mehdi
Member


Joined: 20 Oct 2004
Posts: 4

PostPosted: 20/10/04 21:09    Post subject: Reply with quote

Hi,
tanX Stefan Smile
i'm searching EnumCachedPasswords() from google but not found your response about this from usenet.
could you send this for me :-/

(: tanX Smile
Back to top
View user's profile Yahoo Messenger
Stefan
Junior Member


Joined: 27 Sep 2004
Posts: 61
Location: Netherlands

PostPosted: 20/10/04 21:35    Post subject: Reply with quote

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
View user's profile Send e-mail
Mehdi
Member


Joined: 20 Oct 2004
Posts: 4

PostPosted: 21/10/04 10:21    Post subject: tanX Stefan Reply with quote

txnX Stefan Smile
Back to top
View user's profile Yahoo Messenger
Mehdi
Member


Joined: 20 Oct 2004
Posts: 4

PostPosted: 24/10/04 12:28    Post subject: Reply with quote

Hi
Stefan you code not work into winXp true
this code run only in win98 Smile
Back to top
View user's profile Yahoo Messenger
Stefan
Junior Member


Joined: 27 Sep 2004
Posts: 61
Location: Netherlands

PostPosted: 26/10/04 07:44    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send e-mail
Display posts from previous:   
   Reply to topic    DELPHI AREA Forum Index -> Delphi Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB 2.0.6 © 2001, 2002 phpBB Group