找回密码
 入住遨海湾
搜索
网站解决方案专享优惠-3折上云
查看: 1368|回复: 0

EXCEL工作表保护密码破解ZT

[复制链接]
发表于 2008-7-22 15:58:00 | 显示全部楼层 |阅读模式

登录后查才能浏览下载更多咨询,有问题联系QQ:3283999

您需要 登录 才可以下载或查看,没有账号?入住遨海湾

×
两天前在公司上班网上Q时,见到久违的工作一族的姑姑,她一份重要的工作报表密码遗失...于是我在网上找破解密码的软件,这破解的软件倒是很多,但都不适用,于是...继续搜索。想想念了三年的计算机,学到了什么...真是惭愧无言... 我的工作大部份也是做报表,是公司车辆的信息报表。重要的报表时常有密码保护,与报表密切联系的工作一族很需要知道这些知识,无疑这可以给我们的工作带来方便。 在网上找到了这份破解代码,成功破解了,但不能找到原表的密码,这是最遗憾的。还有破解的表的安全系数会低点。对工作报表一族超级无敌有用!! 方法:7 \' t, F. `# |. v. U 1\打开文件 " \! v" {" r: w8 d& \2\工具---宏----录制新宏---输入名字如:aa / m5 }. p1 K4 K5 \3\停止录制(这样得到一个空宏)5 }- {, O1 {1 M% H& t* A 4\工具---宏----宏,选aa,点编辑按钮3 v( U; h" q" a0 R+ d+ N 5\删除窗口中的所有字符(只有几个),替换为下面的内容复制吧) 4 }) p7 t4 [$ }# X& \6\关闭编辑窗口 5 i* R/ W/ v" Z5 G) A% F7\工具---宏-----宏,选AllInternalPasswords,运行,确定两次,等2分钟,再确定.OK,没有密码了!!4 `9 i4 `' v r3 h 内容如下: 9 c7 }9 x- K8 {; ]( kPublic Sub AllInternalPasswords() * _ S. ^ g" F' Breaks worksheet and workbook structure passwords. Bob McCormick 2 U# S w7 H, {6 n& P- [# } ' probably originator of base code algorithm modified for coverage . k' u" h& n$ F4 Z, n3 l* h7 F; O ' of workbook structure / windows passwords and for multiple passwords . [6 ~9 z- i6 m0 Q6 ?% Y ' 4 m7 C I5 F! Q' Norman Harker and JE McGimpsey 27-Dec-2002 (Version 1.1) 8 `. O7 N2 t& I' Modified 2003-Apr-04 by JEM: All msgs to constants, and ) M% n7 Y0 \2 `9 c ' eliminate one Exit Sub (Version 1.1.1) " ^- e) v& L( S( y4 v' Reveals hashed passwords NOT original passwords 6 ]" s) R, C, E% s0 |8 t Const DBLSPACE As String = vbNewLine & vbNewLine 9 x" M4 ?7 |' @* Z8 x6 u( pConst AUTHORS As String = DBLSPACE & vbNewLine & _ . h" {. W- }' n2 G K"Adapted from Bob McCormick base code by" & _ # n m# E; N; @" A "Norman Harker and JE McGimpsey" 8 v* ?# z9 y& n. [% G) E Const HEADER As String = "AllInternalPasswords User Message" ! ~2 c0 I* _7 ]+ B a Const VERSION As String = DBLSPACE & "Version 1.1.1 2003-Apr-04" / l3 I V. N$ _& S% T; M3 J Const REPBACK As String = DBLSPACE & "lease report failure " & _ $ {. x3 {$ C- ^- e "to the microsoft.public.excel.programming newsgroup." # m* L2 O( k/ EConst ALLCLEAR As String = DBLSPACE & "The workbook should " & _ ' z b( }* W& o! y* q"now be free of all password protection, so make sure you:" & _ 4 q$ P6 D. I% _ \" L5 c5 J2 i1 F DBLSPACE & "SAVE IT NOW!" & DBLSPACE & "and also" & _ : t. z$ S- F3 ^4 NDBLSPACE & "BACKUP!, BACKUP!!, BACKUP!!!" & _ : r9 K. C: c! U& i5 L' c4 P% ~/ P DBLSPACE & "Also, remember that the password was " & _ + @: ~- j6 ?8 f"put there for a reason. Don't stuff up crucial formulas " & _ & \% b. A1 ]* D: w4 ^5 H3 n "or data." & DBLSPACE & "Access and use of some data " & _ . |" G( d/ I* x- l. q"may be an offense. If in doubt, don't." 5 ?$ l% `0 f5 jConst MSGNOPWORDS1 As String = "There were no passwords on " & _ 3 S' H7 E7 F/ K7 p' o"sheets, or workbook structure or windows." & AUTHORS & VERSION ( z& R) t8 d1 xConst MSGNOPWORDS2 As String = "There was no protection to " & _ ( S* S" j8 h; {; T"workbook structure or windows." & DBLSPACE & _ & m8 X/ u- E/ L: b' w"roceeding to unprotect sheets." & AUTHORS & VERSION 0 m- w+ g0 Y1 a$ K1 ~ Const MSGTAKETIME As String = "After pressing OK button this " & _ 9 D: d$ p& ^7 q+ i7 U4 I# N- M0 r! S"will take some time." & DBLSPACE & "Amount of time " & _ , r- R# E `% q3 _ "depends on how many different passwords, the " & _ $ h- B& `9 M" @/ @! ^( v- M"passwords, and your computer's specification." & DBLSPACE & _ ) s: Q# V3 ?) F( Z- g# Y "Just be patient! Make me a coffee!" & AUTHORS & VERSION ' @& k4 Z' M& y# m1 O0 D3 JConst MSGPWORDFOUND1 As String = "You had a Worksheet " & _ $ X3 S. W6 f* \. e"Structure or Windows Password set." & DBLSPACE & _ / R$ y+ `7 O( k! M" B2 I3 j"The password found was: " & DBLSPACE & "$$" & DBLSPACE & _ 9 Z8 c, R) \' k% ~$ v: p8 I+ }+ l"Note it down for potential future use in other workbooks by " & _ # L5 [; H' o4 j3 t/ }+ E3 a. ^( @ "the same person who set this password." & DBLSPACE & _ ! d |" X" [% a! Q; v3 ^6 K "Now to check and clear other passwords." & AUTHORS & VERSION " R1 U+ ~7 l7 c( M F0 { Const MSGPWORDFOUND2 As String = "You had a Worksheet " & _ ! m' ]( c& |* @) F; U0 M"password set." & DBLSPACE & "The password found was: " & _ $ P/ f; T. R- P5 ]! f! ~% a- }DBLSPACE & "$$" & DBLSPACE & "Note it down for potential " & _ * H0 T" w; N2 [1 Y/ L) `* Z9 S"future use in other workbooks by same person who " & _ ' n# \$ k* W' N( H6 b# F# r: X' E "set this password." & DBLSPACE & "Now to check and clear " & _ / ]0 X$ e( [" M. j7 b. _1 b" a; q "other passwords." & AUTHORS & VERSION 7 O0 G& e; h# i ` C/ x9 p `- |+ Y Const MSGONLYONE As String = "Only structure / windows " & _ 8 ]& y4 ]6 Y0 }. L; {4 }1 u, Y0 _( v "protected with the password that was just found." & _ 0 I* ]5 k# ^- J4 I% p5 a' C! w ALLCLEAR & AUTHORS & VERSION & REPBACK 8 R, U8 v: V& @% d+ k Dim w1 As Worksheet, w2 As Worksheet 9 C- Y6 b9 V5 [ Dim i As Integer, j As Integer, k As Integer, l As Integer 1 C' k) z9 B4 v. I1 T( A8 aDim m As Integer, n As Integer, i1 As Integer, i2 As Integer - j2 h+ X2 C" g% H Dim i3 As Integer, i4 As Integer, i5 As Integer, i6 As Integer , W" Z8 O* b4 \Dim PWord1 As String 2 I; S7 W) [7 O! W: ?9 k Dim ShTag As Boolean, WinTag As Boolean + Z, V& w" g4 ~' l( F; R: I0 ~8 b1 [' ^! e# _ Application.ScreenUpdating = False ' U2 E& B# b8 n/ s( cWith ActiveWorkbook 7 _9 c3 |+ H& z9 y bWinTag = .ProtectStructure Or .ProtectWindows ( X" X- t' c) F/ f End With 0 h4 O" m+ |- I" XShTag = False . _; L7 t& O: G2 |/ e0 l8 rFor Each w1 In Worksheets " A% s$ T$ y4 E8 `* d$ B ShTag = ShTag Or w1.ProtectContents - P. A" p% e$ G3 {: D Next w1 J, ?: T9 k* R1 f/ B" f8 Y If Not ShTag And Not WinTag Then , O$ O, S7 f9 h4 k! D2 i3 S5 T; X MsgBox MSGNOPWORDS1, vbInformation, HEADER 8 l) y+ x9 `" V0 K- e1 t( i+ K2 P Exit Sub ) f6 \& N/ m+ @7 S End If 7 m) w' q. D) |+ A1 j& WMsgBox MSGTAKETIME, vbInformation, HEADER ' c2 j& ?$ E0 ~& Z! H7 tIf Not WinTag Then 3 R" R1 G- ~( @' Z( nMsgBox MSGNOPWORDS2, vbInformation, HEADER * X) b3 _* |* |: i: wElse * J; G' T9 ~; b- N* L: oOn Error Resume Next : m- R6 x: l. k U( x6 R# _ Do 'dummy do loop ) ]# v- x; @3 R4 {! R For i = 65 To 66: For j = 65 To 66: For k = 65 To 66 & G) g( H; y" F/ R6 G; S; UFor l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66 1 B( H% r, Z: {4 B% DFor i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66 9 g7 j4 g3 C+ o7 D; z" M7 u# R* G For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126 ' ~0 l l" M! ~. V0 t# I With ActiveWorkbook 7 {- n0 ?# _* R$ p+ D .Unprotect Chr(i) & Chr(j) & Chr(k) & _ Z8 O) ]. j8 G' e5 XChr(l) & Chr(m) & Chr(i1) & Chr(i2) & _ " }9 [6 ^- Z" UChr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n) ( _9 [2 I/ t7 XIf .ProtectStructure = False And _ & {4 y' v1 a6 q.ProtectWindows = False Then & x" E5 ]9 S* W& } PWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _ 0 U1 m1 L8 J: i2 j Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _ / X6 Z* s2 U$ H, L4 @Chr(i4) & Chr(i5) & Chr(i6) & Chr(n) 2 k& @2 M& }0 c* P0 jMsgBox Application.Substitute(MSGPWORDFOUND1, _ % n& X6 S/ o6 E "$$", PWord1), vbInformation, HEADER 8 l- ]& b6 c; L4 |* xExit Do 'Bypass all for...nexts 2 H5 H. G1 L! B- F, `9 K# G6 S End If % B; z* [# H1 t' |! u. A2 j8 d End With 4 y- N! A; T/ O5 @ WNext: Next: Next: Next: Next: Next 7 G- a2 C; \% @- k2 L( K Next: Next: Next: Next: Next: Next 7 W8 z$ s8 i4 K) W+ h7 FLoop Until True " @: }0 z; d" t( a8 @# X9 O" U' | On Error GoTo 0 * L$ j6 ~. q, ^1 B* VEnd If 2 \6 ]% g7 |6 YIf WinTag And Not ShTag Then " T/ g5 _/ ~& u5 p- w/ [* nMsgBox MSGONLYONE, vbInformation, HEADER ! [* V2 p$ C2 F! w- f. ~8 jExit Sub D7 L# b5 U2 R3 @1 C% P# X2 n& PEnd If , K* T7 g) m$ T; a- W8 gOn Error Resume Next , r1 q0 D' z; U9 l4 a0 h: pFor Each w1 In Worksheets 5 r6 u9 X/ s4 a; B'Attempt clearance with PWord1 1 _. Q. l! P. y. T, R: Iw1.Unprotect PWord1 ) a4 {9 [ g6 U% U8 w& r7 l% TNext w1 # z4 E: G. x. O0 F( V+ k( v( P0 _ On Error GoTo 0 % o$ g; _+ [- n ShTag = False / h! w% k' G4 P- n0 m For Each w1 In Worksheets s* Q7 ^4 n) A" H'Checks for all clear ShTag triggered to 1 if not. % a3 E; f, M$ a! d( X ShTag = ShTag Or w1.ProtectContents + k% \' j! K. C+ J$ q7 c Next w1 ; p$ K6 s/ d+ F% I If ShTag Then ( {% Z% u5 e* Y, ]% m$ @For Each w1 In Worksheets 8 [9 j+ @- |5 G6 J0 T: BWith w1 0 P+ f1 R& R+ y5 v4 S3 U: Z If .ProtectContents Then . u; g/ `* R' w1 d% ?. } On Error Resume Next 6 N4 k D, p1 ~! QDo 'Dummy do loop ! ^0 j U; q% Q1 x9 ~/ V5 F0 oFor i = 65 To 66: For j = 65 To 66: For k = 65 To 66 @( c4 j9 Y4 U8 Q; jFor l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66 : t4 P: r! q* f5 t$ w: _For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66 0 `7 J7 x5 {9 ?5 S$ N9 X8 B! ^ For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126 % q# H; Z, b3 _.Unprotect Chr(i) & Chr(j) & Chr(k) & _ 9 p" k) P# c8 Q/ u; N* FChr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _ 5 O6 R9 I4 S8 s& r Chr(i4) & Chr(i5) & Chr(i6) & Chr(n) ; i9 O7 n, D0 V9 B% `If Not .ProtectContents Then # }, u q: p7 R2 PPWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _ 4 J$ _6 W4 Q: I0 T% t* F- c Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _ 9 ?5 B2 Q( m$ C/ o Chr(i4) & Chr(i5) & Chr(i6) & Chr(n) 5 \, f$ M; \' G1 Q' Z' ]( E MsgBox Application.Substitute(MSGPWORDFOUND2, _ - ?: B' A4 i0 I) W L$ V"$$", PWord1), vbInformation, HEADER : N9 H- i: Q7 n4 ~8 X! F; p* m 'leverage finding Pword by trying on other sheets 7 N9 g0 c9 K% T0 \" {# l M# Q For Each w2 In Worksheets ) f9 u: I# p8 {0 Q8 Rw2.Unprotect PWord1 - `" ^* X) ?* b0 _ Next w2 3 r- c' K: K/ K' P Exit Do 'Bypass all for...nexts : {8 E7 V% p. R$ T End If & J8 [, G! W- u( ^Next: Next: Next: Next: Next: Next ) W: y( w- R1 C' Q9 x! K' u Next: Next: Next: Next: Next: Next ! ^8 [5 q" u5 J7 F v) E3 TLoop Until True 0 ]7 s8 e- l/ y3 ]9 W* C: GOn Error GoTo 0 6 {7 ]' e2 `! \9 s6 g# G" \9 EEnd If ) k) q+ [9 A0 U _- e End With , s' W8 S$ C q) _ z# ^( xNext w1 ( d: z$ r- w- u% M8 W4 F" AEnd If " C2 U# E6 ^% IMsgBox ALLCLEAR & AUTHORS & VERSION & REPBACK, vbInformation, HEADER 8 C: b5 P% V/ ~! }8 @6 \! zEnd Sub j2 |# d2 I# \9 g3 V, D / {# }* N' ~2 O- f& c V) d今天解决的大问题!!
遨海湾-心灵的港湾 www.aosea.com
您需要登录后才可以回帖 登录 | 入住遨海湾

本版积分规则

网站解决方案专享优惠-3折上云

QQ|手机版|小黑屋|遨海湾超级社区

GMT+8, 2025-2-19 07:13

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表