| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 655 人关注过本帖
标题:【求助】用vb6做了一个获取游戏中数据(魔兽争霸)的软件,但是不起作用,各位 ...
只看楼主 加入收藏
zyf779403234
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2011-10-30
结帖率:0
收藏
 问题点数:0 回复次数:1 
【求助】用vb6做了一个获取游戏中数据(魔兽争霸)的软件,但是不起作用,各位来看看是怎么回事啊
程序代码:
Private Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByVal lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Dim dizhi As Long
Const STANDARD_RIGHTS_REQUIRED = &HF0000
Const SPECIFIC_RIGHTS_ALL = &HFFFF
Const STANDARD_RIGHTS_ALL = &H1F0000
Const PROCESS_ALL_ACCESS = &HFFF
Const PROCESS_VM_OPERATION = &H8&
Const PROCESS_VM_READ = &H10&
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 CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function GetCurrentProcess Lib "kernel32" () As Long

Private Sub Command2_Click()
End
End Sub

Private Sub Form_Load()
dizhi = &H9430190
End Sub

   Private Function ncnr(lpADDress As Long) As Integer
   Dim hwnd As Long      
   Dim pid As Long      
   Dim pHandle As Long  
   hwnd = FindWindow(vbNullString, "Warcraft III")
   GetWindowThreadProcessId hwnd, pid
   pHandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
   ReadProcessMemory pHandle, lpADDress, ByVal VarPtr(ncnr), 4, 0&
   CloseHandle hProcess
End Function

Private Sub Timer1_Timer()
On Error Resume Next
Dim s, objWMIService, colProcessList, objProcess
Dim mFind As Boolean
s = "war3.exe"
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name='" & s & "'")
For Each objProcess In colProcessList
mFind = True
Next
If mFind Then
Label1 = "游戏已经加载。 [War3.exe]"
Else
Label1 = "进程没有被找到。 [请运行War3.exe]"
End If
End Sub

Private Sub Timer2_Timer()
Label5 = ncnr(dizhi)
End Sub

请问我哪里有问题啊?
搜索更多相关主题的帖子: 魔兽争霸 软件 游戏 
2013-08-26 22:32
zyf779403234
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2011-10-30
收藏
得分:0 
没人吗??

努力学习vb中...
2013-08-27 19:53
快速回复:【求助】用vb6做了一个获取游戏中数据(魔兽争霸)的软件,但是不起作用 ...
数据加载中...
 
   



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

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