如何破解excel宏密碼的方法
如何破解excel宏密碼的方法
在Excel中經(jīng)常需要設(shè)置密碼保護(hù)重要的數(shù)據(jù),但時(shí)間過(guò)后密碼就會(huì)容易忘記,這個(gè)時(shí)候就需要破解密碼了,接下來(lái)是學(xué)習(xí)啦小編為大家?guī)?lái)的如何破解excel宏密碼的方法,希望對(duì)你有用。
如何破解excel宏密碼的方法:
破解宏密碼步驟1:打開(kāi)需要破解的文件,并點(diǎn)開(kāi)需要輸入密碼的界面,如圖
破解宏密碼步驟2:使用EXCEL.EXE重新打開(kāi)一個(gè)工作簿。
破解宏密碼步驟3:打開(kāi)新工作簿的VBA代碼區(qū)域,并插入一個(gè)模塊。
破解宏密碼步驟4:插入如下代碼
Sub test()
Dim st, nd, th3, th4, th5, th6, th7, th8 As Variant
Dim ii, jj, kk, ll, mm, nn, oo, pp, qq As Integer
Dim PADN, PD, IJ, JK, PADNO, speed
speed = 0.005
st = Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")
nd = Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")
th3 = Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")
th4 = Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")
th5 = Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")
th6 = Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")
th7 = Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")
th8 = Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")
PADN = InputBox("How long the password is", "Guilin Hu", 4)
PADNO = CInt(PADN)
For IJ = 1 To 100
If Sheet1.Cells(IJ, 1) = "" Then
Sheet1.Cells(IJ, 1) = Now
Exit For
Else
End If
Next IJ
PauseTime = 2
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop
Finish = Timer
Select Case (PADNO)
Case 1
For ii = 0 To 61
PD = st(ii)
SendKeys PD
PauseTime = speed
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop
Finish = Timer
SendKeys "{enter}"
PauseTime = speed
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop
Finish = Timer
SendKeys "{enter}"
Next ii
Case 2
For ii = 0 To 61
For jj = 0 To 61
PD = st(ii) & nd(jj)
SendKeys PD
PauseTime = speed
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop
Finish = Timer
SendKeys "{enter}"
PauseTime = speed
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop
Finish = Timer
SendKeys "{enter}"
Next jj
Next ii
Case 3
For ii = 0 To 61
For jj = 0 To 61
For kk = 0 To 61
PD = st(ii) & nd(jj) & th3(kk)
SendKeys PD
PauseTime = speed
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop
Finish = Timer
SendKeys "{enter}"
PauseTime = speed
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop
Finish = Timer
SendKeys "{enter}"
Next kk
Next jj
Next ii
Case 4
For ii = 0 To 61
For jj = 0 To 61
For kk = 0 To 61
For ll = 0 To 61
PD = st(ii) & nd(jj) & th3(kk) & th4(ll)
SendKeys PD
PauseTime = speed
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop
Finish = Timer
SendKeys "{enter}"
PauseTime = speed
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop
Finish = Timer
SendKeys "{enter}"
Next ll
Next kk
Next jj
Next ii
Case 5
For ii = 0 To 61
For jj = 0 To 61
For kk = 0 To 61
For ll = 0 To 61
For mm = 0 To 61
PD = st(ii) & nd(jj) & th3(kk) & th4(ll) & th5(mm)
SendKeys PD
PauseTime = speed
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop
Finish = Timer
SendKeys "{enter}"
PauseTime = speed
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop
Finish = Timer
SendKeys "{enter}"
Next mm
Next ll
Next kk
Next jj
Next ii
Case 6
For ii = 0 To 61
For jj = 0 To 61
For kk = 0 To 61
For ll = 0 To 61
For mm = 0 To 61
For nn = 0 To 61
PD = st(ii) & nd(jj) & th3(kk) & th4(ll) & th5(mm) & th6(nn)
SendKeys PD
PauseTime = speed
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop
Finish = Timer
SendKeys "{enter}"
PauseTime = speed
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop
Finish = Timer
SendKeys "{enter}"
Next nn
Next mm
Next ll
Next kk
Next jj
Next ii
Case 7
For ii = 0 To 61
For jj = 0 To 61
For kk = 0 To 61
For ll = 0 To 61
For mm = 0 To 61
For nn = 0 To 61
For oo = 0 To 61
PD = st(ii) & nd(jj) & th3(kk) & th4(ll) & th5(mm) & th6(nn) & th7(oo)
SendKeys PD
PauseTime = speed
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop
Finish = Timer
SendKeys "{enter}"
PauseTime = speed
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop
Finish = Timer
SendKeys "{enter}"
Next oo
Next nn
Next mm
Next ll
Next kk
Next jj
Next ii
Case 8
For ii = 0 To 61
For jj = 0 To 61
For kk = 0 To 61
For ll = 0 To 61
For mm = 0 To 61
For nn = 0 To 61
For oo = 0 To 61
For pp = 0 To 61
PD = st(ii) & nd(jj) & th3(kk) & th4(ll) & th5(mm) & th6(nn) & th7(oo) & th8(pp)
SendKeys PD
PauseTime = speed
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop
Finish = Timer
SendKeys "{enter}"
PauseTime = speed
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop
Finish = Timer
SendKeys "{enter}"
Next pp
Next oo
Next nn
Next mm
Next ll
Next kk
Next jj
Next ii
End Select
For JK = 1 To 100
If Sheet1.Cells(JK, 2) = "" Then
Sheet1.Cells(JK, 2) = Now
Exit For
Else
End If
Next JK
End Sub
破解宏密碼步驟5:按F5執(zhí)行代碼,輸入密碼長(zhǎng)度。如果不知道密碼的長(zhǎng)度,就猜,第一次輸1,第二次輸2。。。依次試。
破解宏密碼步驟6:輸入密碼長(zhǎng)度后,點(diǎn)擊確定。并在2s內(nèi)將鼠標(biāo)的焦點(diǎn)點(diǎn)在最開(kāi)始要破解文件的密碼輸入框里邊。接下來(lái)的工作就是“靜候佳音”了。。哈哈。。
破解宏密碼步驟7:沒(méi)有破解不開(kāi)的密碼。主要的是你有時(shí)間就好!1位密碼破解最長(zhǎng)時(shí)間:62/(1/0.005)=0.31秒;2位數(shù)密碼破解最長(zhǎng)時(shí)間:62*62/(1/0.005)=19.22秒。。。依次類推:N位數(shù)密碼破解時(shí)間:(62)的N次方/(1/0.005)秒的時(shí)間。就看您的耐性了!破解完成之后就會(huì)自動(dòng)進(jìn)去VBA代碼模塊。
破解宏密碼步驟8:接下來(lái)就是修改別人的密碼了!進(jìn)去果斷點(diǎn)擊VBA工程屬性,。。。“干啥?”。。。。哈哈 改密!!
破解宏密碼步驟9:看哥的密碼改的!哈哈。。。