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