首页 > 编程知识 正文

办公软件excel表格,wps撤销工作表保护默认密码是多少

时间:2023-05-05 06:00:31 阅读:146505 作者:700

您忘记WPS2017电子表格/Excel文件保护密码了吗? 直言不讳地进入正题。

妹妹忘记了考勤表的保护密码,要发上个月的工资,着急坏了,向万能的哥哥求助!

我模糊地记得密码有10位,但不是数字。 在急用的前提下,用工具暴力破解密码完全来不及。

仔细想想,Excel文件的秘密密码应该是使用弱加密算法直接存储在文件中的。 我想了两种方法:

使用十六进制编辑器,检查Excel文件本身以确定是否找到注册密码的位置

2、使用VBA解码

出于程序员的本能,我决定先试试VBA的方法。

wps 2017个人版没有VBA功能。 必须首先安装VBA支持。 我在以下位置下载了VBA安装包:

VBA7.0.1590ForWPS

下载完成后,检查毒药,表示安全。 开始安装。 不说明安装步骤。

安装完成后,在WPS表单中打开要解密的Excel文件,从“开发工具-记录新宏”菜单中记录新宏,然后直接关闭。

从菜单“开发工具-宏”中打开宏管理器,编辑刚刚记录的新宏,删除所有代码,然后输入以下代码:

optionexplicitpublicsuballinternalpasswords (' breaksworksheetandworkbookstructurepasswords.bob McCormick ' probablyoriginatior rcoverage'ofweb ructure/windowspasswordsandformultiplepasswords ' ' normanharkerandjemcgimpsey 27-dec-2002 (版本1.1 ) () () ) ) ) ww SGStoconstants,and ' eliminateoneexitsub (版本1.1.1 ) )。 ' revealshashedpasswordsnotoriginalpasswordsconstdblspaceasstring=vbnewlinevbnewlineconstauthorsasstring=dblspacevbnewline edstrine ' normanharkerandjemcgimpsey ' constheaderasstring=' allinternalpasswordsusermessage ' conns ords ring=dbl space '1.版本bl space ' pleasereportfailure ' _ ' tothemicrosoffice ws group.' constallclearasstring=dbl space ' theworkbookshould ' _ ' 备份! 备份!' _ DBLSPACE 'Also, rememberthatthepasswordwas ' _ putthereforareason.don ' tstuffupcrucialformulas ' _ ' or data.' dbl space ' accesssanduse marate don ' t.' constmsgnopwords1asstring=' therewerenopasswordson ' _ ' sheets,orworkbookstructureorwindows.' authorsversiors

AUTHORS & VERSION Const 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 & VERSION Const 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 & VERSION Const 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 & VERSION Const MSGONLYONE As String = "Only structure / windows " & _ "protected with the password that was just found." & _ ALLCLEAR & AUTHORS & VERSION & REPBACK Dim w1 As Worksheet, w2 As Worksheet Dim i As Integer, j As Integer, k As Integer, l As Integer Dim m As Integer, n As Integer, i1 As Integer, i2 As Integer Dim i3 As Integer, i4 As Integer, i5 As Integer, i6 As Integer Dim PWord1 As String Dim ShTag As Boolean, WinTag As BooleanApplication.ScreenUpdating = False With ActiveWorkbook WinTag = .ProtectStructure Or .ProtectWindows End With ShTag = False For Each w1 In Worksheets ShTag = ShTag Or w1.ProtectContents Next w1 If Not ShTag And Not WinTag Then MsgBox MSGNOPWORDS1, vbInformation, HEADER Exit Sub End If MsgBox MSGTAKETIME, vbInformation, HEADER If Not WinTag Then MsgBox MSGNOPWORDS2, vbInformation, HEADER Else On Error Resume Next Do 'dummy do loop For i = 65 To 66: For j = 65 To 66: For k = 65 To 66 For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66 For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66 For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126 With 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 Then PWord1 = 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, HEADER Exit Do 'Bypass all for...nexts End If End With Next: Next: Next: Next: Next: Next Next: Next: Next: Next: Next: Next Loop Until True On Error GoTo 0 End If If WinTag And Not ShTag Then MsgBox MSGONLYONE, vbInformation, HEADER Exit Sub End If On Error Resume Next For Each w1 In Worksheets 'Attempt clearance with PWord1 w1.Unprotect PWord1 Next w1 On Error GoTo 0 ShTag = False For Each w1 In Worksheets 'Checks for all clear ShTag triggered to 1 if not. ShTag = ShTag Or w1.ProtectContents Next w1 If ShTag Then For Each w1 In Worksheets With w1 If .ProtectContents Then On Error Resume Next Do 'Dummy do loop For i = 65 To 66: For j = 65 To 66: For k = 65 To 66 For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66 For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66 For 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 Then PWord1 = 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 sheets For Each w2 In Worksheets w2.Unprotect PWord1 Next w2 Exit Do 'Bypass all for...nexts End If Next: Next: Next: Next: Next: Next Next: Next: Next: Next: Next: Next Loop Until True On Error GoTo 0 End If End With Next w1 End If MsgBox ALLCLEAR & AUTHORS & VERSION & REPBACK, vbInformation, HEADER End Sub关闭宏编辑窗口,通过菜单“开发工具-宏”打开宏管理器并运行AllInternalPasswords

此时会弹出对话框,无视并点确定
弹出第二个对话框,继续无视并点确定
神奇的事情发生了,密码出现在第三个对话框中,拿出纸笔抄录一下:

密码成功能回,希望能撤销密码保护的朋友,请自行百度。


版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。