PROCESS_ALL_ACCESS根据英文,&H1F0FFF
可能是读取内存的权限的值,用来和某值位与或位或的
这方面没做过,vb也没学过,帮不料 请我吃饭我就告诉你!!要不~~~嘿嘿
小凡 发表于 2009-10-23 18:23 http://172.16.1.236:8080/images/common/back.gif
你懂个卵~~ 请你看电影就来 我不懂VB,但是我懂TVB 发源码上来看看 发源码上来看看
繁华落尽 发表于 2009-10-23 18:50 http://172.16.1.236:8080/images/common/back.gif
Option Explicit
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 WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByVal lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
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
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Const PROCESS_ALL_ACCESS As Long = &H1F0FFF
Public hProces1 As Long
Dim hwd As Long
Dim pid As Long
Dim hProcess As Long
Private Sub Form_Load()
hwd = FindWindow("***", "***")
If hwd = 0 Then
MsgBox "未启动游戏", vbOKOnly, "提示"
Unload Form1
End If
GetWindowThreadProcessId hwd, pid
hProcess = OpenProcess(PROCESS_ALL_ACCESS, 0, pid)
If hProcess = 0 Then
MsgBox "不能打开进程", vbOKOnly, "提示"
Unload Form1
End If
CloseHandle hProcess
End Sub
Private Sub Timer1_Timer()
Dim h As Long
hProcess = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
If hProcess Then
ReadProcessMemory hProcess, ByVal &H985614, h, 4, 0&
ReadProcessMemory hProcess, ByVal h + &H24, h, 4, 0&
ReadProcessMemory hProcess, ByVal h + &H260, h, 4, 0&
CloseHandle hProcess
End If
Label1.Caption = h
End Sub
具体功能是,提取某个地址的值,在VB中显示,我把具体游戏隐藏了, 也就是 h 的值传不了给 Label1.Caption,我给个具体值Label1.Caption是能显示的,应该不是传送问题。
怀疑是h没有值{:5_659:}
你懂个卵~~ 请你看电影就来
75600246 发表于 2009-10-23 18:29 http://172.16.1.236:8080/images/common/back.gif你咋知道我最喜欢看电影的~~~~~~~~~~yuan67yuan 。 你咋知道我最喜欢看电影的~~~~~~~~~~yuan67yuan 。
小凡 发表于 2009-10-23 21:55 http://172.16.1.236:8080/images/common/back.gif
天天晚上来我们宿舍,我还不知道你啊~
早看穿你了tutu (37)tu 编这段代码那么复杂。。
我编的没有那么复杂的。。你的程序编错了
页:
1
[2]