[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Problem reading REG_BINARY data from the registry

Posted on 2004-04-27
2
Medium Priority
?
1,271 Views
Last Modified: 2007-12-19
Hi Friends,

I am having some problems in reading the REG_BINARY data from windows registry. I want to retrive the password of a SMTP account. Please see the code segemnt.

buf: Array[0..255] of char;
csSMTPPassword : string;

Registry.OpenKey('\Software\Microsoft\Internet Account Manager\Accounts\00000001')
Registry.ReadBinaryData('SMTP Password2', buf, Sizeof(buf));
csSMTPPassword :=  buf;


But I am receiving junk values in csSMTPPassword. What might be the reason

regards,
Partha
0
Comment
Question by:perthg
[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
2 Comments
 
LVL 17

Assisted Solution

by:geobul
geobul earned 375 total points
ID: 10928016
Hi,

1. The password might be encrypted

2. Try the following (the size of the buffer is not fixed):

buf: array of char;
ASize : integer;
csSMTPPassword : string;

Registry.OpenKey('\Software\Microsoft\Internet Account Manager\Accounts\00000001');
ASize := Registry.GetDataSize('SMTP Password2');
SetLength(buf,ASize);
Registry.ReadBinaryData('SMTP Password2', buf, ASize);
csSMTPPassword :=  buf;

Regards, Geo
0
 
LVL 11

Accepted Solution

by:
shaneholmes earned 375 total points
ID: 10928378
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

649 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