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