| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 973 人关注过本帖
标题:关于游戏外挂接受按键的问题
取消只看楼主 加入收藏
husiwen
Rank: 9Rank: 9Rank: 9
等 级:蜘蛛侠
威 望:2
帖 子:227
专家分:1125
注 册:2010-5-23
结帖率:100%
收藏
已结贴  问题点数:10 回复次数:2 
关于游戏外挂接受按键的问题
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) 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 ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Const PROCESS_ALL_ACCESS = &H1F0FFF

Private Sub Command1_Click()
If Command1.Caption = "启动" Then
    Timer1.Enabled = True
    Command1.Caption = "关闭"
   
Else
    Timer1.Enabled = False
    Command1.Caption = "启动"
    Label1.Caption = "外挂关闭"
End If
End Sub

Private Sub Timer1_Timer()
Dim aa As Long
Dim pid As Long
Dim aa2 As Long
Dim hp As Long
Dim py As Long
aa = FindWindow(vbNullString, "element client")
If aa Then
    Label1.Caption = "外挂开启"
Else
    Label1.Caption = "连接游戏失败"
End If
GetWindowThreadProcessId aa, pid
aa2 = OpenProcess(PROCESS_ALL_ACCESS, False, pid)

ReadProcessMemory aa2, ByVal &H9CFFE0 + &H1C, py, 4, 0&
ReadProcessMemory aa2, ByVal py + &H24, py, 4, 0&
ReadProcessMemory aa2, ByVal py + &H260, hp, 4, 0&

Label2.Caption = hp
if hp<2000 then
    sendkeys "1"
endif
End Sub
'红色部分是当血量低于2000时。。我游戏中点击1来回血。。可是这个1在游戏聊天框中可以出现。。却不会自己用药物。。请问有什么方法来代替sendkeys的功能。。使其在游戏中能得到实现
搜索更多相关主题的帖子: 外挂 游戏 
2010-08-03 14:53
husiwen
Rank: 9Rank: 9Rank: 9
等 级:蜘蛛侠
威 望:2
帖 子:227
专家分:1125
注 册:2010-5-23
收藏
得分:0 
回复 楼主 husiwen
这和sendkeys是一个原理的吧。。试过无效
2010-08-03 20:08
husiwen
Rank: 9Rank: 9Rank: 9
等 级:蜘蛛侠
威 望:2
帖 子:227
专家分:1125
注 册:2010-5-23
收藏
得分:0 
回复 5楼 东海一鱼
怎么处理啊。。才接触api。。很多都不懂
2010-08-04 00:58
快速回复:关于游戏外挂接受按键的问题
数据加载中...
 
   



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

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