Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to retrieve the password of a protected access database Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
retrieve the password of a protected access database 30-Jun-03
Category
Security
Language
Delphi 2.x
Views
183
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Sunish Issac 

The password of an access database can easily be retrieved using the function below

Answer:

I know there that there are many utilities out there costing $$ for removing the 
password of an access database. Here's how to implement it in Delphi.Please note 
that this method is not meant for a database with user-level security and work 
group information file. The idea is based on the file format of an access db. 

The password is stored from location $42 and encrypted using simple xoring. The 
following function does decryption. 
1   
2   function GetPassword(filename: string): string;
3   var
4     Stream: TFilestream;
5     buffer: array[0..12] of char;
6     str: string;
7   begin
8     try
9       stream := TFileStream.Create(filename, fmOpenRead);
10    except
11      ShowMessage('Could not open the file.Make sure that the file is not in use.');
12      exit;
13    end;
14    stream.Seek($42, soFromBeginning);
15    stream.read(buffer, 13);
16    stream.Destroy;
17  
18    str := chr(Ord(buffer[0]) xor $86);
19    str := str + chr(Ord(buffer[1]) xor $FB);
20    str := str + chr(Ord(buffer[2]) xor $EC);
21    str := str + chr(Ord(buffer[3]) xor $37);
22    str := str + chr(Ord(buffer[4]) xor $5D);
23    str := str + chr(Ord(buffer[5]) xor $44);
24    str := str + chr(Ord(buffer[6]) xor $9C);
25    str := str + chr(Ord(buffer[7]) xor $FA);
26    str := str + chr(Ord(buffer[8]) xor $C6);
27    str := str + chr(Ord(buffer[9]) xor $5E);
28    str := str + chr(Ord(buffer[10]) xor $28);
29    str := str + chr(Ord(buffer[11]) xor $E6);
30    str := str + chr(Ord(buffer[12]) xor $13);
31    Result := str;
32  end;


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC