找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 170|回复: 0

怪物列表

[复制链接]

1793

主题

457

回帖

0

积分

管理员

积分
0
发表于 2013-9-11 08:09:24 | 显示全部楼层 |阅读模式
VERSION 5.00
Begin VB.Form Form1
   Caption         =   "怪物扫描仪"
   ClientHeight    =   4335
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   8325
   LinkTopic       =   "Form1"
   ScaleHeight     =   4335
   ScaleWidth      =   8325
   StartUpPosition =   2  '屏幕中心
   Begin VB.TextBox Text2
      Height          =   375
      Left            =   840
      TabIndex        =   3
      Text            =   "&H911b24"
      Top             =   360
      Width           =   1095
   End
   Begin VB.TextBox Text1
      Height          =   375
      Left            =   1320
      TabIndex        =   2
      Text            =   "Text1"
      Top             =   4560
      Width           =   4095
   End
   Begin VB.ListBox List1
      Height          =   3300
      Left            =   120
      TabIndex        =   1
      Top             =   960
      Width           =   8055
   End
   Begin VB.CommandButton Command1
      Caption         =   "扫描"
      Height          =   375
      Left            =   2160
      TabIndex        =   0
      Top             =   360
      Width           =   1215
   End
   Begin VB.Label Label1
      AutoSize        =   -1  'True
      Caption         =   "基址:"
      Height          =   180
      Left            =   360
      TabIndex        =   4
      Top             =   480
      Width           =   540
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim hwd As Long
Dim pid As Long
Dim base As Long
Dim renxaddr As Long    '人物坐标X
Dim renyaddr As Long    '人物坐标Y

Private Sub Command1_Click()
Dim pro As Long
Dim h As Long
Dim gmax As Long
Dim gfirst As Long
Dim gbase As Long
Dim gid As Long, ghp As Long, gmaxhp As Long
Dim h2 As Long
Dim gx As Single
Dim gy As Single
Dim gwx As Long
Dim gwy As Long
Dim renx As Single
Dim reny As Single
Dim gjx As Long
Dim gjy As Long
Dim jl As Long
Dim xx As Long
Dim yy As Long
Dim gname As Long
Dim gnamebyte(65) As Byte
pro = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
If pro Then
  ReadProcessMemory pro, ByVal base, h2, 4, 0&   '这三条代码读取获得经验值
  ReadProcessMemory pro, ByVal h2 + &H24, h2, 4, 0&
  ReadProcessMemory pro, ByVal h2 + renxaddr, renx, 4, 0&   '人物坐标X
  ReadProcessMemory pro, ByVal h2 + renyaddr, reny, 4, 0&   '人物坐标Y
  gjx = CStr(Fix(renx))
  gjy = CStr(Fix(reny))
  
  ReadProcessMemory pro, ByVal base, h, 4, 0&   '这三条代码读取获得怪物ID
  ReadProcessMemory pro, ByVal h + &H8, h, 4, 0&
  ReadProcessMemory pro, ByVal h + &H20, h, 4, 0&   '怪物基址
  ReadProcessMemory pro, ByVal h + &H24, gmax, 4, 0&  '怪物数组的最大值
  ReadProcessMemory pro, ByVal h + &H18, gfirst, 4, 0&  '怪物列表的首地址

  List1.Clear
  For i = 0 To gmax - 1
    ReadProcessMemory pro, ByVal gfirst + 4 * i, gbase, 4, 0&
    If gbase > 0 Then
      ReadProcessMemory pro, ByVal gbase + 4, gbase, 4, 0&
      
      ReadProcessMemory pro, ByVal gbase + &H11C, gid, 4, 0&
      ReadProcessMemory pro, ByVal gbase + &H134, ghp, 4, 0&
      ReadProcessMemory pro, ByVal gbase + &H14C, gmaxhp, 4, 0&
      ReadProcessMemory pro, ByVal gbase + &H3C, gx, 4, 0&
      ReadProcessMemory pro, ByVal gbase + &H44, gy, 4, 0&
      gwx = CStr(Fix(gx))
      gwy = CStr(Fix(gy))
      
      xx = Math.Abs(gjx - gwx)
      yy = Math.Abs(gjy - gwy)
      jl = Sqr(xx * xx + yy * yy)
      
      
      ReadProcessMemory pro, ByVal gbase + &H210, gname, 4, 0&
      ReadProcessMemory pro, ByVal gname, gnamebyte(0), 64, 0&    '得到怪物名称
      Text1.Text = gnamebyte
      Text1.Text = i & "|怪ID=" & gid & "|" & Text1.Text & "|血值=" & ghp & "/" & gmaxhp & "|坐标=" & gwx & "," & gwy & "|与人的距离=" & jl
      List1.AddItem Text1.Text
    End If
  Next
End If
CloseHandle pro
End Sub

Private Sub Form_Load()
Dim hwndname As String
hwndname = "Element Client"
hwd = FindWindow(vbNullString, hwndname)
If hwd > 0 Then
  GetWindowThreadProcessId hwd, pid
Else
MsgBox "没有找到游戏!!"
End If
base = Val(Text2.Text)
renxaddr = &H3C
renyaddr = &H44
End Sub


http://yunpan.cn/QGw6K5hMp2Bnx
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

果子博客
扫码关注微信公众号

Archiver|手机版|小黑屋|风叶林

GMT+8, 2026-2-1 04:41 , Processed in 0.125848 second(s), 21 queries .

Powered by 风叶林

© 2001-2026 Discuz! Team.

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