文档库 最新最全的文档下载
当前位置:文档库 › excel表格破解密码的教程

excel表格破解密码的教程

excel表格破解密码的教程

excel表格破解密码教程:

破解密码步骤1:新建一个excel文件“book1”,在工具栏空白位置,任意右击,选择visual basic项,弹出visual basic 工具栏:

破解密码步骤2:在visual basic工具栏中,点击“录制”按钮,弹出“录制新宏”对话框,选择“个人宏工作簿”:破解密码步骤3:选择“个人宏工作簿”后按确定,弹出如下“暂停”按钮,点击停止:

破解密码步骤4:在visual basic工具栏中,点击“编辑”按钮:

破解密码步骤5:点击“编辑”按钮后,弹出如下图的编辑界面:

找到“vbaproject(personal.xls)-模块-模块1(也可能是模块n-其他数字)”

双击模块1-将右边代码内容清空

破解密码步骤6:复制“工作保护密码破解”代码到右边框中,点保存,然后关闭“book1”

破解密码步骤7:运行需要解密的“excel文件”,在visual basic工具栏中,点击“运行”按钮

破解密码步骤8:点击“运行”按钮后,弹出“宏”对话框,

点击运行“personal.xls!工作保护密码破解”这个宏

破解密码步骤9:运行“personal.xls!工作保护密码破解”这个宏后,

如下图示意就可以解除工作表的密码保护了

破解密码步骤10:(这个图,如果工作表中有多组不同密码,每解开一组,就会提示一次,也就说可能会出现几次)

破解密码步骤11:工作表保护密码破解(代码)

=========请复制以下内容=============

public sub 工作表保护密码破解()

const dblspace as string = vbnewline & vbnewline

const authors as string = dblspace & vbnewline & _

"作者:mccormick je mcgimpsey "

const header as string = "工作表保护密码破解"

const version as string = dblspace & "版本 version 1.1.1"

const repback as string = dblspace & ""

const zhengli as string = dblspace & " hfhzi3—戊冥整理"

const allclear as string = dblspace & "该工作簿中的工作表密码保护已全部解除!!" & dblspace & "请记得另保存" _ & dblspace & "注意:不要用在不当地方,要尊重他人的劳动成果!"

const msgnopwords1 as string = "该文件工作表中没有加密"

const msgnopwords2 as string = "该文件工作表中没有加密2"

const msgtaketime as string = "解密需花费一定时间,请耐心等候!" & dblspace & "按确定开始破解!"

const msgpwordfound1 as string = "密码重新组合为:" & dblspace & "

" & dblspace & _

"如果该文件工作表有不同密码,将搜索下一组密码并修改清除"

const msgpwordfound2 as string = "密码重新组合为:" & dblspace & "

" & dblspace & _

"如果该文件工作表有不同密码,将搜索下一组密码并解除"

const msgonlyone as string = "确保为唯一的?"

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 boolean

application.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

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 & zhengli, vbinformation, header

end sub

破解密码步骤12:是放在vbaproject(personal.xls)[个人宏工作簿]——[模块]中的,如上图是放在红色标号2[模块1]中看了excel表格破解密码的教程

相关文档
相关文档 最新文档