我们在使用Access数据库时,有时忘记了密码,怎么办?网上的解密器不少,但我们要去找这样的解密器也很费时,如果你对程序的编写有一点基础,那么,让我们动手做一个专用解密器吧。 原理:首先,我们要了解Access数据库的加密方法。Access数据库的有效密码为13位,在不加密时,数据库的第67至79位为一固定的字符串,每位的ASCII码值分别为86,FB?EC?37,5D,44,9C,FA,C6,5E,28,E6,13。加密时,分别用密码的每一位与67至79位的字符的ASCII码值进行异或运算,得到的一个新字符串,将它写回67至79位。 知道了加密方法,解密就比较容易了。将67至79位的字符的ASCII码值分别与“86,FB,EC,37,5D,44,9C,FA,C6,5E,28,E6,13”进行异或运算,即可得到密码。 下面我们用VB编个小程序,来实现Access数据库的解密。请在窗体上放置一个通用对话框控件Commondialog1,其Firlter属性设为“Access数据库文件?.mdb”;文本框控件Text1,命令控件Command1,其Caption属性设为“取得密码”。代码如下: Option Explicit Private Sub Command1_Click?? Dim password As String Dim temp As Byte Dim source?12? As Byte Dim i As Integer source?0? = &H86 source?1? = &HFB source?2? = &HEC source?3? = &H37 source?4? = &H5D source?5? = &H44 source?6? = &H9C source?7? = &HFA source?8? = &HC6 source?9? = &H5E source?10? = &H28 source?11? = &HE6 source?12? = &H13 CommonDialog1.ShowOpen If CommonDialog1.FileName = ″″ Then Exit Sub Open CommonDialog1.FileName For Binary As #1 For i = 0 To 12 Get #1? 67 + i? temp If temp = source?i? Then Exit For password = password & Chr??temp Xor source?i??? Next Close #1 If Len?password? = 0 Then Text1.Text = ″该数据库没有加密!″ Else Text1.Text = ″该数据库的密码为:″ + password End If End Sub |
|站长邮箱|小黑屋|手机版|Office中国/Access中国
( 粤ICP备10043721号-1 )
GMT+8, 2025-4-3 13:55 , Processed in 0.132965 second(s), 16 queries .
Powered by Discuz! X3.3
© 2001-2017 Comsenz Inc.