| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1487 人关注过本帖
标题:送大家代码Access 95/97 Password Revealer
只看楼主 加入收藏
haolongo
Rank: 2
等 级:论坛游民
帖 子:6
专家分:39
注 册:2013-1-19
结帖率:0
收藏
已结贴  问题点数:10 回复次数:2 
送大家代码Access 95/97 Password Revealer
accpass.zip (3.48 KB)
Access 95/97 Password Revealer  

When you set a password in Access 95/97 database, the password is encrypted with simple XOR operation.
The following code snippet shows how you can easily reveal this password:
'Access 95/97 Password Revealer
'Copyright (c) Nir Sofer 2002
'
'Web site: http://nirsoft.
'
'This small utility instantly recovers the database password of
'Microsoft Access files (mdb files)
'It works only with Access 95 or 97.
'

Private Function XorPassword(Bytes As Variant) As String
    Dim XorBytes()      As Variant
    Dim strPassword     As String
    Dim intIndex        As Integer
    Dim CurrChar        As String * 1
   
    XorBytes = Array(&H86, &HFB, &HEC, &H37, &H5D, &H44, &H9C, &HFA, &HC6, &H5E, &H28, _
&HE6, &H13, &HB6, &H8A, &H60, &H54, &H94)
    strPassword = vbNullString
    intIndex = 0
   
    Do
        
    'Get a character from the password by doing a XOR with the
    'appropriate value in XorBytes array.
        CurrChar = Chr$(Bytes(intIndex + &H42) Xor XorBytes(intIndex))
        'If we get a Null character, get out of the loop.
        If Asc(CurrChar) = 0 Then Exit Do
        'Add the password character to the accumulated password string.
        strPassword = strPassword & CurrChar
        intIndex = intIndex + 1
    Loop Until intIndex = 17
   
    XorPassword = strPassword
End Function

Private Function GetAccessPassword(strFilename As String) As String
    Dim intFileNum      As Integer
    Dim Bytes(&H100)    As Byte
   
    intFileNum = FreeFile
    'Open the Access filename
    Open strFilename For Binary As #intFileNum
   
    'Read first 256 bytes
    Get #intFileNum, , Bytes
   
    'Get the password from the XorPassword function
    GetAccessPassword = XorPassword(Bytes)
    Close #intFileNum
End Function

Private Sub cmdBrowse_Click()
    On Error GoTo canceled
    OpenDialog.Flags = cdlOFNExplorer Or cdlOFNFileMustExist Or cdlOFNHideReadOnly
    OpenDialog.ShowOpen
    txtFilename.Text = OpenDialog.FileName
    Exit Sub
canceled:
End Sub

Private Sub cmdExit_Click()
    End
End Sub

Private Sub cmdGetPassword_Click()
    Dim strFilename     As String
   
    strFilename = Trim$(txtFilename.Text)
    If Len(strFilename) = 0 Then
        MsgBox "You must select a filename !", vbOKOnly Or vbInformation
    ElseIf Len(Dir(strFilename)) = 0 Then
        MsgBox "The filename does not exist !", vbOKOnly Or vbInformation
    Else
        txtPassword.Text = GetAccessPassword(strFilename)
    End If
End Sub


 

搜索更多相关主题的帖子: only set Copyright Microsoft following 
2013-01-28 19:21
yuccn
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:何方
等 级:版主
威 望:167
帖 子:6815
专家分:42393
注 册:2010-12-16
收藏
得分:10 
这个是vb的吧

我行我乐
公众号:逻辑客栈
我的博客:
https://blog.yuccn. net
2013-02-04 12:28
liushihuo
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2013-2-21
收藏
得分:0 
看起来真像是VB的
2013-02-28 17:51
快速回复:送大家代码Access 95/97 Password Revealer
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.067682 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved