excel工作表密码破解方法.doc

上传人:小** 文档编号:576039 上传时间:2018-10-31 格式:DOC 页数:10 大小:627.13KB
返回 下载 相关 举报
excel工作表密码破解方法.doc_第1页
第1页 / 共10页
excel工作表密码破解方法.doc_第2页
第2页 / 共10页
点击查看更多>>
资源描述

《excel工作表密码破解方法.doc》由会员分享,可在线阅读,更多相关《excel工作表密码破解方法.doc(10页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。

1、|excel 工作表密码破解方法在日常工作中,大家有时会遇到过这样的情况:使用 Excel 编制的报表、表格、程序等,在单元格中设置了公式、函数等,为了防止其他人修改您的设置或者防止您自己无意中修改,您可能会使用 Excel 的工作表保护功能,但时间久了保护密码容易忘记,这该怎么办?有时您从网上下载的 Excel 格式的小程序,您想修改,但是作者加了工作表保护密码,怎么办?您只要按照以下步骤操作,Excel 工作表保护密码瞬间(稍微有点夸张) 即破!打开您需要破解的 Excel 文件,如图所示:|1、点击视图按钮依次录制宏2、输入名字入破解密码然后点确定3、查看宏然后编辑|4、出现下图窗口5、

2、删除窗口中的所有字符,替换为下面的内容;Option ExplicitPublic Sub AllInternalPasswords() Breaks worksheet and workbook structure passwords. Bob McCormick probably originator of base code algorithm modified for coverage of workbook structure / windows passwords and for multiple passwords Norman Harker and JE McGimpsey 2

3、7-Dec-2002 (Version 1.1) Modified 2003-Apr-04 by JEM: All msgs to constants, and eliminate one Exit Sub (Version 1.1.1) Reveals hashed passwords NOT original passwordsConst DBLSPACE As String = vbNewLine & vbNewLineConst AUTHORS As String = DBLSPACE & vbNewLine & _“Adapted from Bob McCormick base co

4、de by“ & _“Norman Harker and JE McGimpsey“|Const HEADER As String = “AllInternalPasswords User Message“Const VERSION As String = DBLSPACE & “Version 1.1.1 2003-Apr-04“Const REPBACK As String = DBLSPACE & “Please report failure “ & _“to the microsoft.public.excel.programming newsgroup.“Const ALLCLEAR

5、 As String = DBLSPACE & “The workbook should “ & _“now be free of all password protection, so make sure you:“ & _DBLSPACE & “SAVE IT NOW!“ & DBLSPACE & “and also“ & _DBLSPACE & “BACKUP!, BACKUP!, BACKUP!“ & _DBLSPACE & “Also, remember that the password was “ & _“put there for a reason. Dont stuff up

6、 crucial formulas “ & _“or data.“ & DBLSPACE & “Access and use of some data “ & _“may be an offense. If in doubt, dont.“Const MSGNOPWORDS1 As String = “There were no passwords on “ & _“sheets, or workbook structure or windows.“ & AUTHORS & VERSIONConst MSGNOPWORDS2 As String = “There was no protecti

7、on to “ & _“workbook structure or windows.“ & DBLSPACE & _“Proceeding to unprotect sheets.“ & AUTHORS & VERSIONConst MSGTAKETIME As String = “After pressing OK button this “ & _“will take some time.“ & DBLSPACE & “Amount of time “ & _“depends on how many different passwords, the “ & _“passwords, and

8、 your computers specification.“ & DBLSPACE & _“Just be patient! Make me a coffee!“ & AUTHORS & VERSIONConst MSGPWORDFOUND1 As String = “You had a Worksheet “ & _“Structure or Windows Password set.“ & DBLSPACE & _“The password found was: “ & DBLSPACE & “$“ & DBLSPACE & _“Note it down for potential fu

9、ture use in other workbooks by “ & _“the same person who set this password.“ & DBLSPACE & _“Now to check and clear other passwords.“ & AUTHORS & VERSIONConst MSGPWORDFOUND2 As String = “You had a Worksheet “ & _“password set.“ & DBLSPACE & “The password found was: “ & _DBLSPACE & “$“ & DBLSPACE & “N

10、ote it down for potential “ & _“future use in other workbooks by same person who “ & _“set this password.“ & DBLSPACE & “Now to check and clear “ & _|“other passwords.“ & AUTHORS & VERSIONConst MSGONLYONE As String = “Only structure / windows “ & _“protected with the password that was just found.“ &

11、 _ALLCLEAR & AUTHORS & VERSION & REPBACKDim w1 As Worksheet, w2 As WorksheetDim i As Integer, j As Integer, k As Integer, l As IntegerDim m As Integer, n As Integer, i1 As Integer, i2 As IntegerDim i3 As Integer, i4 As Integer, i5 As Integer, i6 As IntegerDim PWord1 As StringDim ShTag As Boolean, Wi

12、nTag As BooleanApplication.ScreenUpdating = FalseWith ActiveWorkbookWinTag = .ProtectStructure Or .ProtectWindowsEnd WithShTag = FalseFor Each w1 In WorksheetsShTag = ShTag Or w1.ProtectContentsNext w1If Not ShTag And Not WinTag ThenMsgBox MSGNOPWORDS1, vbInformation, HEADERExit SubEnd IfMsgBox MSGT

13、AKETIME, vbInformation, HEADERIf Not WinTag ThenMsgBox MSGNOPWORDS2, vbInformation, HEADERElseOn Error Resume NextDo dummy do loopFor i = 65 To 66: For j = 65 To 66: For k = 65 To 66For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66For i5 = 6

14、5 To 66: For i6 = 65 To 66: For n = 32 To 126With ActiveWorkbook.Unprotect Chr(i) & Chr(j) & Chr(k) & _|Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)If .ProtectStructure = False And _.ProtectWindows = False ThenPWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _Chr

15、(m) & Chr(i1) & Chr(i2) & Chr(i3) & _Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)MsgBox Application.Substitute(MSGPWORDFOUND1, _“$“, PWord1), vbInformation, HEADERExit Do Bypass all for.nextsEnd IfEnd WithNext: Next: Next: Next: Next: NextNext: Next: Next: Next: Next: NextLoop Until TrueOn Error GoTo 0End I

16、fIf WinTag And Not ShTag ThenMsgBox MSGONLYONE, vbInformation, HEADERExit SubEnd IfOn Error Resume NextFor Each w1 In WorksheetsAttempt clearance with PWord1w1.Unprotect PWord1Next w1On Error GoTo 0ShTag = FalseFor Each w1 In WorksheetsChecks for all clear ShTag triggered to 1 if not.ShTag = ShTag O

17、r w1.ProtectContentsNext w1If ShTag ThenFor Each w1 In Worksheets|With w1If .ProtectContents ThenOn Error Resume NextDo Dummy do loopFor i = 65 To 66: For j = 65 To 66: For k = 65 To 66For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66For i5

18、= 65 To 66: For i6 = 65 To 66: For n = 32 To 126.Unprotect Chr(i) & Chr(j) & Chr(k) & _Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)If Not .ProtectContents ThenPWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _Chr(i4) & Chr(

19、i5) & Chr(i6) & Chr(n)MsgBox Application.Substitute(MSGPWORDFOUND2, _“$“, PWord1), vbInformation, HEADERleverage finding Pword by trying on other sheetsFor Each w2 In Worksheetsw2.Unprotect PWord1Next w2Exit Do Bypass all for.nextsEnd IfNext: Next: Next: Next: Next: NextNext: Next: Next: Next: Next: NextLoop Until TrueOn Error GoTo 0End IfEnd WithNext w1End IfMsgBox ALLCLEAR & AUTHORS & VERSION & REPBACK, vbInformation, HEADEREnd Sub|6、查看宏,然后点击执行7、弹出以下 4 个窗口依次点确定。|8、最后一步确定后密码就已 经去除了。

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 教案示例

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知得利文库网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号-8 |  经营许可证:黑B2-20190332号 |   黑公网安备:91230400333293403D

© 2020-2023 www.deliwenku.com 得利文库. All Rights Reserved 黑龙江转换宝科技有限公司 

黑龙江省互联网违法和不良信息举报
举报电话:0468-3380021 邮箱:hgswwxb@163.com