| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1539 人关注过本帖
标题:求代码如何利用vb实现映像劫持
只看楼主 加入收藏
tlwed
该用户已被删除
收藏
 问题点数:0 回复次数:8 
求代码如何利用vb实现映像劫持
提示: 作者被禁止或删除 内容自动屏蔽
搜索更多相关主题的帖子: 映像 代码 
2008-06-08 11:11
hxfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:5810
专家分:118
注 册:2005-4-7
收藏
得分:0 
什么叫映像劫持?劫持键盘信息吗?

2008-06-08 11:17
tlwed
该用户已被删除
收藏
得分:0 
提示: 作者被禁止或删除 内容自动屏蔽
2008-06-08 12:17
tlwed
该用户已被删除
收藏
得分:0 
提示: 作者被禁止或删除 内容自动屏蔽
2008-06-08 12:18
hxfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:5810
专家分:118
注 册:2005-4-7
收藏
得分:0 
原理是不是修改注册表啊?

2008-06-08 14:31
tlwed
该用户已被删除
收藏
得分:0 
提示: 作者被禁止或删除 内容自动屏蔽
2008-06-08 14:56
hxfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:5810
专家分:118
注 册:2005-4-7
收藏
得分:0 
转自BAIDU,看看对楼主有什么帮助没有



给一个注册表通用处理函数给你
设置或获取对应路径键值即可
'模块代码声明
'==================================================
'注册表操作声明
Public Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Public Declare Function RegEnumValue Lib "advapi32.dll" Alias "RegEnumValueA" (ByVal hKey As Long, ByVal dwIndex As Long, ByVal lpValueName As String, lpcbValueName As Long, ByVal lpReserved As Long, lpType As Long, lpData As Byte, lpcbData As Long) As Long
Public Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Public Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Public Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long
Public Declare Function RegEnumKeyEx Lib "advapi32.dll" Alias "RegEnumKeyExA" (ByVal hKey As Long, ByVal dwIndex As Long, ByVal lpName As String, lpcbName As Long, ByVal lpReserved As Long, ByVal lpClass As String, lpcbClass As Long, lpftLastWriteTime As Any) As Long
Public Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
Public Declare Function RegDeleteValue Lib "advapi32.dll" Alias "RegDeleteValueA" (ByVal hKey As Long, ByVal lpValueName As String) As Long
Public Declare Function RegDeleteKey Lib "advapi32.dll" Alias "RegDeleteKeyA" (ByVal hKey As Long, ByVal lpSubKey As String) As Long

Public Const HKEY_CLASSES_ROOT = &H80000000
Public Const HKEY_CURRENT_USER = &H80000001
Public Const HKEY_LOCAL_MACHINE = &H80000002
Public Const HKEY_USERS = &H80000003
Private Const REG_SZ = 1&
Private Const REG_EXPAND_SZ = 2&
Private Const REG_BINARY = 3&
Private Const REG_DWORD = 4&
Private Const ERROR_SUCCESS = 0&
'==================================================

'================================
'注册表操作函数
'================================


'读取注册表字符串键值
Public Function GetString(hKey As Long, strPath As String, strValue As String)
Dim keyhand As Long
Dim lResult As Long
Dim strBuf As String
Dim lDataBufSize As Long
Dim intZeroPos As Integer
Dim lValueType As Long 'new add
RegOpenKey hKey, strPath, keyhand
lResult = RegQueryValueEx(keyhand, strValue, 0&, lValueType, ByVal 0&, lDataBufSize)
If lValueType = REG_SZ Or lValueType = REG_EXPAND_SZ Then
strBuf = String(lDataBufSize, " ")
lResult = RegQueryValueEx(keyhand, strValue, 0&, lValueType, ByVal strBuf, lDataBufSize)
If lResult = ERROR_SUCCESS Then
intZeroPos = InStr(strBuf, Chr$(0))
If intZeroPos > 0 Then
GetString = left$(strBuf, intZeroPos - 1)
Else: GetString = strBuf
End If
End If
End If
End Function

'写入注册表字符串键值
Public Sub SetString(hKey As Long, strPath As String, strValue As String, strdata As String)
Dim keyhand As Long
RegCreateKey hKey, strPath, keyhand
RegSetValueEx keyhand, strValue, 0, REG_SZ, ByVal strdata, Len(strdata)
RegCloseKey keyhand
End Sub

'读取注册表 DWORD 键值
Function GetDword(ByVal hKey As Long, ByVal strPath As String, ByVal strValueName As String) As Long
Dim lResult As Long
Dim lValueType As Long
Dim lBuf As Long
Dim lDataBufSize As Long
Dim r As Long
Dim keyhand As Long

r = RegOpenKey(hKey, strPath, keyhand)

' Get length/data type
lDataBufSize = 4

lResult = RegQueryValueEx(keyhand, strValueName, 0&, lValueType, lBuf, lDataBufSize)

If lResult = ERROR_SUCCESS Then
If lValueType = REG_DWORD Then
GetDword = lBuf
End If
'Else
' Call errlog("GetDWORD-" & strPath, False)
End If

r = RegCloseKey(keyhand)
End Function

'写入注册表 DWORD 键值
Function SetDword(ByVal hKey As Long, ByVal strPath As String, ByVal strValueName As String, ByVal lData As Long)
Dim keyhand As Long
RegCreateKey hKey, strPath, keyhand
RegSetValueEx keyhand, strValueName, 0&, REG_DWORD, lData, 4
RegCloseKey keyhand
End Function

'读取注册表二进制键值
Function GetBinary(ByVal hKey As Long, ByVal strPath As String, ByVal strValueName As String) As Long
Dim lResult As Long
Dim lValueType As Long
Dim lBuf As Long
Dim lDataBufSize As Long
Dim r As Long
Dim keyhand As Long

r = RegOpenKey(hKey, strPath, keyhand)

' Get length/data type
lDataBufSize = 4

lResult = RegQueryValueEx(keyhand, strValueName, 0&, lValueType, lBuf, lDataBufSize)

If lResult = ERROR_SUCCESS Then
If lValueType = REG_BINARY Then
GetBinary = lBuf
End If
End If

r = RegCloseKey(keyhand)
End Function

'写入注册表二进制键值
Function SetBinary(ByVal hKey As Long, ByVal strPath As String, ByVal strValueName As String, ByVal lData As Long, ByVal BitNumber As Long)
Dim keyhand As Long
RegCreateKey hKey, strPath, keyhand
RegSetValueEx keyhand, strValueName, 0&, REG_BINARY, lData, BitNumber
RegCloseKey keyhand
End Function

'删除一个注册表键值
Public Function DeleteValue(ByVal hKey As Long, ByVal strPath As String, ByVal strValue As String)
Dim keyhand As Long
RegOpenKey hKey, strPath, keyhand
RegDeleteValue keyhand, strValue
RegCloseKey keyhand
End Function

'创建一个主键
Public Function CreateKey(ByVal hKey As Long, ByVal strKey As String)
Dim keyhand&
RegCreateKey hKey, strKey, keyhand
RegCloseKey keyhand&
End Function


'================
代码应用示例
比如获取QQ安装的路径
因为QQ目录的注册表键值是string值的
所以用GetString
GetString(HKEY_LOCAL_MACHINE, "SOFTWARE\TENCENT\QQ", "Install")

如 msgbox GetString(HKEY_LOCAL_MACHINE, "SOFTWARE\TENCENT\QQ", "Install")

2008-06-08 14:59
tlwed
该用户已被删除
收藏
得分:0 
提示: 作者被禁止或删除 内容自动屏蔽
2008-06-08 15:05
Noh4ck
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2008-8-17
收藏
得分:0 
说说这段代码的格式
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\rav.exe" /v debugger /t REG_SZ /d C:\windows\system32\cmd.exe /f

在vb中好像不能用啊
2008-08-17 19:56
快速回复:求代码如何利用vb实现映像劫持
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.021196 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved