| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 376 人关注过本帖
标题:[求助]编程问题
取消只看楼主 加入收藏
浪漫无限
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2007-5-13
收藏
 问题点数:0 回复次数:1 
[求助]编程问题

下面这些是一网络游戏外挂代码,由于小第刚接触VB,所以想请教高手,如何制作成品。另外对其中
MsgBox "Window not found!"这句不明白,望高手指点迷津。在这先谢谢了


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 hwnd As Long
Dim ProcessID As Long
Dim ProcessHandle As Long

hwnd = FindWindow(vbNullString, "QQTang 0.10 Beta6 Build12") '获取窗口句柄
If (hwnd = 0) Then
MsgBox "Window not found!"
Exit Sub
End If

GetWindowThreadProcessId hwnd, ProcessID '获取进程ID
ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS, False, ProcessID) '打开进程
If (ProcessHandle = 0) Then
MsgBox "Couldn't get a process handle!"
Exit Sub
End If

'下面为写内存主要代码
WriteProcessMemory ProcessHandle, &H40000, ByVal ("1"), 1, ByVal 0& '写内存
CloseHandle ProcessHandle '关闭进程
End Sub

搜索更多相关主题的帖子: 网络游戏 color 如何 制作 
2007-05-13 10:13
浪漫无限
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2007-5-13
收藏
得分:0 
MsgBox:这个窗口在哪,我没有找到,另外想问下这有什么作用?
2007-05-13 12:25
快速回复:[求助]编程问题
数据加载中...
 
   



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

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