Excel工作表保护密码破解方法:
wøkpbbs.3c3t.com2uÙ÷àóà±S
1\打开文件
wøkpbbs.3c3t.com2uÙ÷àóà±S
2\工具---宏----录制新宏---输入名字如:aa
wøkpbbs.3c3t.com2uÙ÷àóà±S
3\停止录制(这样得到一个空宏)
wøkpbbs.3c3t.com2uÙ÷àóà±S
4\工具---宏----宏,选aa,点编辑按钮
wøkpbbs.3c3t.com2uÙ÷àóà±S
5\删除窗口中的所有字符(只有几个),替换为下面的内容:(复制吧)
wøkpbbs.3c3t.com2uÙ÷àóà±S
6\关闭编辑窗口
wøkpbbs.3c3t.com2uÙ÷àóà±S
7\工具---宏-----宏,选AllInternalPasswords,运行,确定两次,等2分钟,再确定.OK,没有密码了!!内容如下:Public Sub AllInternalPasswords()
wøkpbbs.3c3t.com2uÙ÷àóà±S
' Breaks worksheet and workbook structure passwords. Bob McCormick
wøkpbbs.3c3t.com2uÙ÷àóà±S
' probably originator of base code algorithm modified for coverage
wøkpbbs.3c3t.com2uÙ÷àóà±S
' of workbook structure / windows passwords and for multiple passwords
wøkpbbs.3c3t.com2uÙ÷àóà±S
'
wøkpbbs.3c3t.com2uÙ÷àóà±S
' Norman Harker and JE McGimpsey 27-Dec-2002 (Version 1.1)
wøkpbbs.3c3t.com2uÙ÷àóà±S
' Modified 2003-Apr-04 by JEM: All msgs to constants, and
wøkpbbs.3c3t.com2uÙ÷àóà±S
' eliminate one Exit Sub (Version 1.1.1)
wøkpbbs.3c3t.com2uÙ÷àóà±S
' Reveals hashed passwords NOT original passwords
wøkpbbs.3c3t.com2uÙ÷àóà±S
Const DBLSPACE As String = vbNewLine & vbNewLine
wøkpbbs.3c3t.com2uÙ÷àóà±S
Const AUTHORS As String = DBLSPACE & vbNewLine & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
"Adapted from Bob McCormick base code by" & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
"Norman Harker and JE McGimpsey"
wøkpbbs.3c3t.com2uÙ÷àóà±S
Const HEADER As String = "AllInternalPasswords User Message"
wøkpbbs.3c3t.com2uÙ÷àóà±S
Const VERSION As String = DBLSPACE & "Version 1.1.1 2003-Apr-04"
wøkpbbs.3c3t.com2uÙ÷àóà±S
Const REPBACK As String = DBLSPACE & "Please report failure " & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
"to the microsoft.public.excel.programming newsgroup."
wøkpbbs.3c3t.com2uÙ÷àóà±S
Const ALLCLEAR As String = DBLSPACE & "The workbook should " & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
"now be free of all password protection, so make sure you:" & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
DBLSPACE & "SAVE IT NOW!" & DBLSPACE & "and also" & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
DBLSPACE & "BACKUP!, BACKUP!!, BACKUP!!!" & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
DBLSPACE & "Also, remember that the password was " & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
"put there for a reason. Don't stuff up crucial formulas " & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
"or data." & DBLSPACE & "Access and use of some data " & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
"may be an offense. If in doubt, don't."
wøkpbbs.3c3t.com2uÙ÷àóà±S
Const MSGNOPWORDS1 As String = "There were no passwords on " & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
"sheets, or workbook structure or windows." & AUTHORS & VERSION
wøkpbbs.3c3t.com2uÙ÷àóà±S
Const MSGNOPWORDS2 As String = "There was no protection to " & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
"workbook structure or windows." & DBLSPACE & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
"Proceeding to unprotect sheets." & AUTHORS & VERSION
wøkpbbs.3c3t.com2uÙ÷àóà±S
Const MSGTAKETIME As String = "After pressing OK button this " & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
"will take some time." & DBLSPACE & "Amount of time " & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
"depends on how many different passwords, the " & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
"passwords, and your computer's specification." & DBLSPACE & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
"Just be patient! Make me a coffee!" & AUTHORS & VERSION
wøkpbbs.3c3t.com2uÙ÷àóà±S
Const MSGPWORDFOUND1 As String = "You had a Worksheet " & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
"Structure or Windows Password set." & DBLSPACE & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
"The password found was: " & DBLSPACE & "$$" & DBLSPACE & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
"Note it down for potential future use in other workbooks by " & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
"the same person who set this password." & DBLSPACE & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
"Now to check and clear other passwords." & AUTHORS & VERSION
wøkpbbs.3c3t.com2uÙ÷àóà±S
Const MSGPWORDFOUND2 As String = "You had a Worksheet " & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
"password set." & DBLSPACE & "The password found was: " & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
DBLSPACE & "$$" & DBLSPACE & "Note it down for potential " & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
"future use in other workbooks by same person who " & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
"set this password." & DBLSPACE & "Now to check and clear " & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
"other passwords." & AUTHORS & VERSION
wøkpbbs.3c3t.com2uÙ÷àóà±S
Const MSGONLYONE As String = "Only structure / windows " & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
"protected with the password that was just found." & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
ALLCLEAR & AUTHORS & VERSION & REPBACK
wøkpbbs.3c3t.com2uÙ÷àóà±S
Dim w1 As Worksheet, w2 As Worksheet
wøkpbbs.3c3t.com2uÙ÷àóà±S
Dim i As Integer, j As Integer, k As Integer, l As Integer
wøkpbbs.3c3t.com2uÙ÷àóà±S
Dim m As Integer, n As Integer, i1 As Integer, i2 As Integer
wøkpbbs.3c3t.com2uÙ÷àóà±S
Dim i3 As Integer, i4 As Integer, i5 As Integer, i6 As Integer
wøkpbbs.3c3t.com2uÙ÷àóà±S
Dim PWord1 As String
wøkpbbs.3c3t.com2uÙ÷àóà±S
Dim ShTag As Boolean, WinTag As Boolean
wøkpbbs.3c3t.com2uÙ÷àóà±S
Application.ScreenUpdating = False
wøkpbbs.3c3t.com2uÙ÷àóà±S
With ActiveWorkbook
wøkpbbs.3c3t.com2uÙ÷àóà±S
WinTag = .ProtectStructure Or .ProtectWindows
wøkpbbs.3c3t.com2uÙ÷àóà±S
End With
wøkpbbs.3c3t.com2uÙ÷àóà±S
ShTag = False
wøkpbbs.3c3t.com2uÙ÷àóà±S
For Each w1 In Worksheets
wøkpbbs.3c3t.com2uÙ÷àóà±S
ShTag = ShTag Or w1.ProtectContents
wøkpbbs.3c3t.com2uÙ÷àóà±S
Next w1
wøkpbbs.3c3t.com2uÙ÷àóà±S
If Not ShTag And Not WinTag Then
wøkpbbs.3c3t.com2uÙ÷àóà±S
MsgBox MSGNOPWORDS1, vbInformation, HEADER
wøkpbbs.3c3t.com2uÙ÷àóà±S
Exit Sub
wøkpbbs.3c3t.com2uÙ÷àóà±S
End If
wøkpbbs.3c3t.com2uÙ÷àóà±S
MsgBox MSGTAKETIME, vbInformation, HEADER
wøkpbbs.3c3t.com2uÙ÷àóà±S
If Not WinTag Then
wøkpbbs.3c3t.com2uÙ÷àóà±S
MsgBox MSGNOPWORDS2, vbInformation, HEADER
wøkpbbs.3c3t.com2uÙ÷àóà±S
Else
wøkpbbs.3c3t.com2uÙ÷àóà±S
On Error Resume Next
wøkpbbs.3c3t.com2uÙ÷àóà±S
Do 'dummy do loop
wøkpbbs.3c3t.com2uÙ÷àóà±S
For i = 65 To 66: For j = 65 To 66: For k = 65 To 66
wøkpbbs.3c3t.com2uÙ÷àóà±S
For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66
wøkpbbs.3c3t.com2uÙ÷àóà±S
For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66
wøkpbbs.3c3t.com2uÙ÷àóà±S
For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126
wøkpbbs.3c3t.com2uÙ÷àóà±S
With ActiveWorkbook
wøkpbbs.3c3t.com2uÙ÷àóà±S
.Unprotect Chr(i) & Chr(j) & Chr(k) & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
wøkpbbs.3c3t.com2uÙ÷àóà±S
If .ProtectStructure = False And _
wøkpbbs.3c3t.com2uÙ÷àóà±S
.ProtectWindows = False Then
wøkpbbs.3c3t.com2uÙ÷àóà±S
PWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
wøkpbbs.3c3t.com2uÙ÷àóà±S
MsgBox Application.Substitute(MSGPWORDFOUND1, _
wøkpbbs.3c3t.com2uÙ÷àóà±S
"$$", PWord1), vbInformation, HEADER
wøkpbbs.3c3t.com2uÙ÷àóà±S
Exit Do 'Bypass all for...nexts
wøkpbbs.3c3t.com2uÙ÷àóà±S
End If
wøkpbbs.3c3t.com2uÙ÷àóà±S
End With
wøkpbbs.3c3t.com2uÙ÷àóà±S
Next: Next: Next: Next: Next: Next
wøkpbbs.3c3t.com2uÙ÷àóà±S
Next: Next: Next: Next: Next: Next
wøkpbbs.3c3t.com2uÙ÷àóà±S
Loop Until True
wøkpbbs.3c3t.com2uÙ÷àóà±S
On Error GoTo 0
wøkpbbs.3c3t.com2uÙ÷àóà±S
End If
wøkpbbs.3c3t.com2uÙ÷àóà±S
If WinTag And Not ShTag Then
wøkpbbs.3c3t.com2uÙ÷àóà±S
MsgBox MSGONLYONE, vbInformation, HEADER
wøkpbbs.3c3t.com2uÙ÷àóà±S
Exit Sub
wøkpbbs.3c3t.com2uÙ÷àóà±S
End If
wøkpbbs.3c3t.com2uÙ÷àóà±S
On Error Resume Next
wøkpbbs.3c3t.com2uÙ÷àóà±S
For Each w1 In Worksheets
wøkpbbs.3c3t.com2uÙ÷àóà±S
'Attempt clearance with PWord1
wøkpbbs.3c3t.com2uÙ÷àóà±S
w1.Unprotect PWord1
wøkpbbs.3c3t.com2uÙ÷àóà±S
Next w1
wøkpbbs.3c3t.com2uÙ÷àóà±S
On Error GoTo 0
wøkpbbs.3c3t.com2uÙ÷àóà±S
ShTag = False
wøkpbbs.3c3t.com2uÙ÷àóà±S
For Each w1 In Worksheets
wøkpbbs.3c3t.com2uÙ÷àóà±S
'Checks for all clear ShTag triggered to 1 if not.
wøkpbbs.3c3t.com2uÙ÷àóà±S
ShTag = ShTag Or w1.ProtectContents
wøkpbbs.3c3t.com2uÙ÷àóà±S
Next w1
wøkpbbs.3c3t.com2uÙ÷àóà±S
If ShTag Then
wøkpbbs.3c3t.com2uÙ÷àóà±S
For Each w1 In Worksheets
wøkpbbs.3c3t.com2uÙ÷àóà±S
With w1
wøkpbbs.3c3t.com2uÙ÷àóà±S
If .ProtectContents Then
wøkpbbs.3c3t.com2uÙ÷àóà±S
On Error Resume Next
wøkpbbs.3c3t.com2uÙ÷àóà±S
Do 'Dummy do loop
wøkpbbs.3c3t.com2uÙ÷àóà±S
For i = 65 To 66: For j = 65 To 66: For k = 65 To 66
wøkpbbs.3c3t.com2uÙ÷àóà±S
For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66
wøkpbbs.3c3t.com2uÙ÷àóà±S
For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66
wøkpbbs.3c3t.com2uÙ÷àóà±S
For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126
wøkpbbs.3c3t.com2uÙ÷àóà±S
.Unprotect Chr(i) & Chr(j) & Chr(k) & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
wøkpbbs.3c3t.com2uÙ÷àóà±S
If Not .ProtectContents Then
wøkpbbs.3c3t.com2uÙ÷àóà±S
PWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _
wøkpbbs.3c3t.com2uÙ÷àóà±S
Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
wøkpbbs.3c3t.com2uÙ÷àóà±S
MsgBox Application.Substitute(MSGPWORDFOUND2, _
wøkpbbs.3c3t.com2uÙ÷àóà±S
"$$", PWord1), vbInformation, HEADER
wøkpbbs.3c3t.com2uÙ÷àóà±S
'leverage finding Pword by trying on other sheets
wøkpbbs.3c3t.com2uÙ÷àóà±S
For Each w2 In Worksheets
wøkpbbs.3c3t.com2uÙ÷àóà±S
w2.Unprotect PWord1
wøkpbbs.3c3t.com2uÙ÷àóà±S
Next w2
wøkpbbs.3c3t.com2uÙ÷àóà±S
Exit Do 'Bypass all for...nexts
wøkpbbs.3c3t.com2uÙ÷àóà±S
End If
wøkpbbs.3c3t.com2uÙ÷àóà±S
Next: Next: Next: Next: Next: Next
wøkpbbs.3c3t.com2uÙ÷àóà±S
Next: Next: Next: Next: Next: Next
wøkpbbs.3c3t.com2uÙ÷àóà±S
Loop Until True
wøkpbbs.3c3t.com2uÙ÷àóà±S
On Error GoTo 0
wøkpbbs.3c3t.com2uÙ÷àóà±S
End If
wøkpbbs.3c3t.com2uÙ÷àóà±S
End With
wøkpbbs.3c3t.com2uÙ÷àóà±S
Next w1
wøkpbbs.3c3t.com2uÙ÷àóà±S
End If
wøkpbbs.3c3t.com2uÙ÷àóà±S
MsgBox ALLCLEAR & AUTHORS & VERSION & REPBACK, vbInformation, HEADER
wøkpbbs.3c3t.com2uÙ÷àóà±S
End Sub
wøkpbbs.3c3t.com2uÙ÷àóà±S