破解excel密码宏程序代码_第1页
破解excel密码宏程序代码_第2页
破解excel密码宏程序代码_第3页
破解excel密码宏程序代码_第4页
破解excel密码宏程序代码_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、1. 将你要破解的excel文件关闭,切记一定要关闭呀!然后新建一个excel文件2. 打开新建的这个excel,按下alt+f11,打开vb界面,新建一个模块,如图所示3. 将代码复制到这个模块中,代码如下:private sub vbapassword() 你要解保护的excel文件路径filename = application.getopenfilename(excel文件(*.xls & *.xla & *.xlt),*.xls;*.xla;*.xlt, , vba破解)if dir(filename) = thenmsgbox 没找到相关文件,清重新设置。exit subelsef

2、ilecopy filename, filename & .bak 备份文件。end ifdim getdata as string * 5open filename for binary as #1dim cmgs as longdim dpbo as longfor i = 1 to lof(1)get #1, i, getdataif getdata = cmg= then cmgs = iif getdata = host then dpbo = i - 2: exit fornextif cmgs = 0 thenmsgbox 请先对vba编码设置一个保护密码., 32, 提示exi

3、t subend ifdim st as string * 2dim s20 as string * 1取得一个0d0a十六进制字串get #1, cmgs - 2, st取得一个20十六制字串get #1, dpbo + 16, s20替换加密部份机码for i = cmgs to dpbo step 2put #1, i, stnext加入不配对符号if (dpbo - cmgs) mod 2 0 thenput #1, dpbo + 1, s20end ifmsgbox 文件解密成功., 32, 提示close #1end sub4. 然后点击运行按钮,如图所示,绿色的小三角就是5. 你

4、会看到,打开了一个文件夹,找到我们要破解的这个文件,然后点击打开6. 稍等几分钟你就会看到破解成功的提示了1打开文件2工具-宏-录制新宏-输入名字如:aa3停止录制(这样得到一个空宏)4工具-宏-宏,选aa,点编辑按钮5删除窗口中的所有字符(只有几个),替换为下面的内容:(复制吧)6关闭编辑窗口7工具-宏-宏,选allinternalpasswords,运行,确定两次,等2分钟,再确定.ok,没有密码了!内容如下:public sub allinternalpasswords() breaks worksheet and workbook structure passwords. bob mc

5、cormick 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) reveal

6、s 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 mcgimpseyconst header as string = allinternalpasswords user messageconst version as string = dbls

7、pace & version 1.1.1 2003-apr-04const repback as string = dblspace & please report failure & _to the gramming newsgroup.const allclear as string = dblspace & the workbook should & _now be free of all password protection, so make sure you: & _dblspace & save it now! & dblspa

8、ce & and also & _dblspace & backup!, backup!, backup! & _dblspace & also, remember that the password was & _put there for a reason. dont stuff up 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

9、 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 & _wi

10、ll take some time. & dblspace & amount of time & _depends on how many different passwords, the & _passwords, and 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

11、. & 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 & _

12、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

13、/ 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 int

14、eger, 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 thenmsgb

15、ox 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 66fo

16、r 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

17、 = 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: nex

18、t: 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 worksheetsattempt clearance with pword1w1.unprotect pword1next w1on error goto 0shtag = falsefor each w1 in worksheetschec

19、ks 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) &

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论