VB编程破解Windows屏幕保护密码
2008-02-23 07:02:41来源:互联网 阅读 ()
懂得其加密原理后,便不难编程破解我的屏幕保护密码(即上网密码)了。本人用VB6.0编制了一读取注册表中ScrrenSave_Data值的函数GetBinaryValue(Entry As String),读出其值为31 43 41 33 33 43 35 35 33 34 32 31 00,去掉其结束标志00,把余下字节转换为对应的ASCII字符,并把每两个字符组成一16进制数:1C A3 3C 55 34 21,显然,密码为6位,将其与前6字节密钥逐一异或后便得出密码的ASCII码(16进制值):54 4D 4A 48 53 48,对应的密码明文为TMJHSH,破解成功!用它拔号一试,呵,立刻传来Modem欢快的叫声。
附VB源程序:(程序中使用了窗体Form1,文本框Text1,命令按钮Command1)
1、窗体代码:
Option Explicit
Dim Cryptograph As String
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim CryptographStr(32) As Integer
Dim PWstr As String
Dim PassWord As String
Private Sub Command1_Click()
PWstr = ""
PassWord = ""
Text1.Text =""
Cryptograph = GetBinaryValue("ScreenSave_Data")
k = Len(Cryptograph)
For j = 1 To k - 1
For i = 32 To 126
If Mid(Cryptograph, j, 1) = Chr(i) Then
CryptographStr(j) = i
End If
Next i
Next j
i = (k - 1) / 2 '密码位数为(h-1)/2,根据位数选择解密过程。
Select Case i
Case 16
GoTo 16
Case 15
GoTo 15
Case 14
GoTo 14
Case 13
GoTo 13
Case 12
GoTo 12
Case 11
GoTo 11
Case 10
GoTo 10
Case 9
GoTo 9
Case 8
GoTo 8
Case 7
GoTo 7
Case 6
GoTo 6
Case 5
GoTo 5
Case 4
GoTo 4
Case 3
GoTo 3
Case 2
GoTo 2
Case 1
GoTo 1
Case Else
End
End Select
16: PWstr = PWstr & Chr(("&H" & Chr(CryptographStr(31)) & Chr(CryptographStr(32))) Xor &H5F)
15: PWstr = PWstr & Chr(("&H" & Chr(CryptographStr(29)) & Chr(CryptographStr(30))) Xor &H97)
14: PWstr = PWstr & Chr(("&H" & Chr(CryptographStr(27)) & Chr(CryptographStr(28))) Xor &H95)
13: PWstr = PWstr & Chr(("&H" & Chr(CryptographStr(25)) & Chr(CryptographStr(26))) Xor &H54)
12: PWstr = PWstr & Chr(("&H" & Chr(CryptographStr(23)) & Chr(CryptographStr(24))) Xor &HF8)
11: PWstr = PWstr & Chr(("&H" & Chr(CryptographStr(21)) & Chr(CryptographStr(22))) Xor &H47)
10: PWstr = PWstr & Chr(("&H" & Chr(CryptographStr(19)) & Chr(CryptographStr(20))) Xor &H8C)
9: PWstr = PWstr & Chr(("&H" & Chr(CryptographStr(17)) & Chr(CryptographStr(18))) Xor &H7A)
8: PWstr = PWstr & Chr(("&H" & Chr(CryptographStr(15)) & Chr(CryptographStr(16))) Xor &H1B)
7: PWstr = PWstr & Chr(("&H" & Chr(CryptographStr(13)) & Chr(CryptographStr(14))) Xor &HA1)
6: PWstr = PWstr & Chr(("&H" & Chr(CryptographStr(11)) & Chr(CryptographStr(12))) Xor &H69)
5: PWstr = PWstr & Chr(("&H" & Chr(CryptographStr(9)) & Chr(CryptographStr(10))) Xor &H67)
4: PWstr = PWstr & Chr(("&H" & Chr(CryptographStr(7)) & Chr(CryptographStr(8))) Xor &H1D)
3: PWstr = PWstr & Chr(("&H" & Chr(CryptographStr(5)) & Chr(CryptographStr(6))) Xor &H76)
2: PWstr = PWstr & Chr(("&H" & Chr(CryptographStr(3)) & Chr(CryptographStr(4))) Xor &HEE)
1: PWstr = PWstr & Chr(("&H" & Chr(CryptographStr(1)) & Chr(CryptographStr(2))) Xor &H48)
For i = i To 1 Step -1 '所得PWstr的值为密码的倒序列,将其倒置便得出密码。
PassWord = PassWord & Mid(PWstr, i, 1)
Next i
Text1.Text = PassWord '在文本框内显示密码。
End Sub
2、模块代码:
Option Explicit
Const ERROR_SUCCESS = 0&
Const ERROR_BADDB = 1009&
Const ERROR_BADKEY = 1010&
Const REG_EXPAND_SZ = 2&
Const REG_BINARY = 3&
Const KEY_QUERY_VALUE = &H1&
Const KEY_ENUMERATE_SUB_KEYS = &H8&
Const KEY_NOTIFY = &H10&
Const READ_CONTROL = &H20000
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash