EXCEL密码清除(破解找回密码)——巧用宏代码

news/2024/10/30 13:38:37/

各位朋友估计都经历过excel 设置了密码,N久以后本以为这辈子都不会忘记的密码,真的忘记了。

唯一能做的就是破解,但网上各种破解工具又不可靠,各种担心,好不容易鼓起勇气决定下载破解软件,结果一次次中招,密码没有破解,自己中毒不浅。。。

只能自己想办法了!利用宏运行方式破解,真的很有效,运行中可能电脑会有两分钟无反应,千萬不要以为死机了哦,等一等!

步骤方法如下:

  1. 打开文件
  2. 工具—宏—-录制新宏—输入名字如:【W搞密码W】
  3. 停止录制(这样得到一个空宏)
  4. 工具—宏—-宏,选【W搞密码W】,点【编辑】按钮
  5. 删除窗口中的所有字符(只有几个),替换为下面的内容:(复制以下代码)
  6. 关闭编辑窗口
  7. 工具—宏—–宏,选【AllInternalPasswords】,【运行】,确定两次,注意看一下两次确定,会显示密码内容
    等2分钟,再确定.OK,没有密码了! !
    宏程序代码内容如下:

 Public 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 27-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 code 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 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. Don't stuff up crucial formulas " & _"or data." & DBLSPACE & "Access and use of some data " & _"may be an offense. If in doubt, don't."Const MSGNOPWORDS1 As String = "There were no passwords on " & _"sheets, or workbook structure or windows." & AUTHORS & VERSIONConst MSGNOPWORDS2 As String = "There was no protection 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 your computer's 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 future 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 & "Note 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." & _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, WinTag 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 MSGTAKETIME, 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 = 65 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(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 IfIf WinTag And Not ShTag ThenMsgBox MSGONLYONE, vbInformation, HEADERExit SubEnd IfOn Error Resume NextFor Each w1 In Worksheets'Attempt clearance with PWord1w1.Unprotect PWord1Next w1On Error GoTo 0ShTag = FalseFor Each w1 In Worksheets'Checks for all clear ShTag triggered to 1 if not.ShTag = ShTag Or w1.ProtectContentsNext w1If ShTag ThenFor Each w1 In WorksheetsWith 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 = 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(i5) & Chr(i6) & Chr(n)MsgBox Application.Substitute(MSGPWORDFOUND2, _"$$", PWord1), vbInformation, HEADER'leverage 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

 


http://www.ppmy.cn/news/265559.html

相关文章

excel 破解密码

新建宏,运行 Sub PasswordBreaker()Breaks worksheet password protection.Dim i As Integer, j As Integer, k As Integer Dim l As Integer, m As Integer, n As Integer Dim i1 As Integer, i2 As Integer, i3 As Integer Dim i4 As Integer, i5 As Integer, i6 …

Excel破解工作表保护密码

目录: 一、破解过程 1、新建一个EXCEL文件“BOOK1”,在工具栏空白位置,任意右击,选择Visual Basic项,弹出Visual Basic工具栏 2、在Visual Basic工具栏中,点击“录制”按钮,弹出“录制新宏”…

Excel密码保护破解代码

声明:本文图片、文章来源于网络,版权归原作者所有,如有侵权,请与我联系删除。 1、打开Excel表格中的Excel选项,选择自定义,得到如下画面: 2、然后在左边侧框栏中选择“查看宏”之后双击或者选择添加按钮&a…

Excel文件加密后忘记密码破解方法

最好使用VBA 工程密码破解方法 新建一个excel文档,然后打开,同时按Alt和F11,进入VBA界面 点击菜单上的插入,模块 在新的窗口粘贴以下代码: 1 Sub crack()

设计模式-02.经典设计原则-第二节[必读]

设计模式经典设计原则-第二节 依赖反转原则(DIP) 关于 SOLID 原则,我们已经学过单一职责、开闭、里式替换、接口隔离这四个原则。今天,我们再来学习最后一个原则:依赖反转原则。在前面,我们讲到&#xff…

9. GraalVM.云原生时代的Java虚拟机

JVM性能调优 1. GraalVM诞生的背景1.1 Java在微服务/云原生时代的困境1.1.1 事实1.1.2 矛盾 本文是按照自己的理解进行笔记总结,如有不正确的地方,还望大佬多多指点纠正,勿喷。 课程内容: 1、Java在云原生时代的困境及解决方案 …

计算机网络笔记:域名系统(DNS)

文章目录 1.域名系统概述2.互联网的域名结构3.域名服务器 1.域名系统概述 域名系统概述:互联网使用的命名系统,用来将便于人们使用的机器名字转换为IP地址。 域名系统的使用情况: 直接使用:许多应用层软件经常直接使用域名系统…

解锁门禁系统新姿势--人脸识别智能门禁或成社区安全的“关键先生”

一、传统门禁问题频现 现在的好多老旧小区门禁系统大多采用“刷卡”方式,持卡的人员在门禁装置刷卡后便可进出,在这个过程中门禁卡实际上扮演的是钥匙的角色。居民防范意识薄弱、物业管理松懈、缺乏法规支撑,看似简单的小区门禁制度&#xff…