vb 谁帮我翻译一下这段代码
这是我从网上找的QQ堂的一种功能,请各位高手把从单击事件起翻译,其中几句我大概的知道了,以下是源代码:OptionExplicitPrivateDeclareFuncti...
这是我从网上找的QQ堂的一种功能,请各位高手把从单击事件起翻译,其中几句我大概的知道了,以下是源代码:
Option Explicit
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByVal lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Const PROCESS_ALL_ACCESS = &H1F0FFF
Private Sub Command1_Click()
Dim bb1 As String
Dim a As Long
Dim pid As Long
Dim Jubing As Long
a = FindWindow(vbNullString, "QQ堂 4.0 Beta1 Build1 ") '得到句柄函数
GetWindowThreadProcessId a, pid
Jubing = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
bb1 = "u"
WriteProcessMemory Jubing, &H5E6944, ByVal (bb1), 1, 0&
CloseHandle JubingEnd Sub
WriteProcessMemory Jubing, &H5E6944, ByVal (bb1), 1, 0& 这句是什么意思?
还有前面的Const PROCESS_ALL_ACCESS = &H1F0FFF是干吗的? 展开
Option Explicit
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByVal lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Const PROCESS_ALL_ACCESS = &H1F0FFF
Private Sub Command1_Click()
Dim bb1 As String
Dim a As Long
Dim pid As Long
Dim Jubing As Long
a = FindWindow(vbNullString, "QQ堂 4.0 Beta1 Build1 ") '得到句柄函数
GetWindowThreadProcessId a, pid
Jubing = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
bb1 = "u"
WriteProcessMemory Jubing, &H5E6944, ByVal (bb1), 1, 0&
CloseHandle JubingEnd Sub
WriteProcessMemory Jubing, &H5E6944, ByVal (bb1), 1, 0& 这句是什么意思?
还有前面的Const PROCESS_ALL_ACCESS = &H1F0FFF是干吗的? 展开
2个回答
2010-11-15
展开全部
a = FindWindow(vbNullString, "QQ堂 4.0 Beta1 Build1 ") '得到句柄函数
GetWindowThreadProcessId a, pid ’获取句柄对应的进程PID
Jubing = OpenProcess(PROCESS_ALL_ACCESS, False, pid) '打开该PID进程
bb1 = "u"
WriteProcessMemory Jubing, &H5E6944, ByVal (bb1), 1, 0& '向该进程内存&H5E6944位置上写入bb1变量内容
CloseHandle Jubing '关闭
End Sub
Const PROCESS_ALL_ACCESS = &H1F0FFF ’权限常数 打开进程时候用的
GetWindowThreadProcessId a, pid ’获取句柄对应的进程PID
Jubing = OpenProcess(PROCESS_ALL_ACCESS, False, pid) '打开该PID进程
bb1 = "u"
WriteProcessMemory Jubing, &H5E6944, ByVal (bb1), 1, 0& '向该进程内存&H5E6944位置上写入bb1变量内容
CloseHandle Jubing '关闭
End Sub
Const PROCESS_ALL_ACCESS = &H1F0FFF ’权限常数 打开进程时候用的
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询