|
本帖最后由 piaorou 于 2011-4-10 12:03 编辑
- #Region ;**** 参数创建于 ACNWrapper_GUI ****
- #AutoIt3Wrapper_UseUPX=n
- #EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
- ;------------文章来源
- ;------------网站:精灵领域 丝路传说
- ;------------网址:w w w . s r o 5 . c o m
- ;------------作者:精灵
- Opt("TrayMenuMode", 1)
- $kernel32 = DllOpen('kernel32.dll')
- $GUI = GUICreate('丝路传说 遍历', 780, 200)
- $list_belt = GUICtrlCreateCombo('', 10, 15, 700, -1, 3)
- $data_input = GUICtrlCreateInput('', 10, 60, 700)
- $guolv_input = GUICtrlCreateInput('', 10, 90, 700)
- $button = GUICtrlCreateButton('刷新', 710, 90, 65, 23)
- GUISetState()
- While 1
- $msg = GUIGetMsg()
- If $msg = -3 Then
- DllClose($kernel32)
- Exit
- EndIf
- If $msg = -4 Then Tray()
- If $msg = $list_belt Then
- GUICtrlSetData($data_input, GUICtrlRead($list_belt))
- EndIf
- If $msg = $button Then
- $ItemIDLIST = ""
- $pid = WinGetProcess("SRO_Client")
- $mid = memopen($pid)
- GUICtrlSetData($list_belt, '')
- $eax = memread($mid, 0xEC0B74)
- While 1
- $ecx = $eax - 0xDC
- $type = memread($mid, memread($mid, $ecx))
- If memread($mid, $ecx + 0x128) > 0x8 Then
- $name = memread($mid, memread($mid, $ecx + 0x114), 'wchar[200]')
- Else
- $name = memread($mid, $ecx + 0x114, 'wchar[200]')
- EndIf
- $ID = Hex(memread($mid, $ecx + 0xF8))
- $x_y = 'X:' & BitShift(BitAND(memread($mid, $ecx + 0x7c, "short"), 0xFF) * 3 - 0x195, -6) - Int(memread($mid, $ecx + 0x80, "float") / (-10))
- $x_y = $x_y & ' Y:' & BitShift(BitShift(memread($mid, $ecx + 0x7c, "short"), 0x8) * 3 - 0x114, -6) - Int(memread($mid, $ecx + 0x88, "float") / (-10))
- $itemdata = ""
- $itemdata &= " 类型:" & GetTypeName($type)
- $itemdata &= " 名称:" & $name
- $itemdata &= " 坐标:" & $x_y
- $itemdata &= " 在线ID:" & $ID
- If $type = 0x009E13D0 Then $itemdata &= " HP:" & memread($mid, $ecx + 0x458) & '/' & memread($mid, $ecx + 0x460)
- $itemdata &= " ECX=" & Hex($ecx)
- $guolv = GUICtrlRead($guolv_input)
- If $guolv = "" Then
- GUICtrlSetData($list_belt, $itemdata)
- Else
- If StringInStr($itemdata, $guolv) > 0 Then
- GUICtrlSetData($list_belt, $itemdata)
- EndIf
- EndIf
- $eax = memread($mid, $eax + 0xC)
- If $eax = 0 Then ExitLoop
- WEnd
- $pid = 0
- memclose($mid)
- EndIf
- Switch TrayGetMsg()
- Case -13
- Tray()
- EndSwitch
- WEnd
- Func Tray()
- If BitAND(WinGetState($GUI), 2) Then
- WinSetState($GUI, "", @SW_HIDE)
- Else
- WinSetState($GUI, "", @SW_SHOW)
- EndIf
- EndFunc ;==>Tray
- Func GetTypeName($type)
- $typeName = ''
- Switch $type
- Case 0x009E87A0
- $typeName = '自己'
- Case 0x009D3CD0
- $typeName = '宠物'
- Case 0x009EA1C0
- $typeName = '玩家'
- Case 0x009E24F0
- $typeName = 'NCP '
- Case 0x009E13D0
- $typeName = '怪物'
- Case 0x009EFC20
- $typeName = '物品'
- Case 0x009F8700
- $typeName = '传送'
- Case Else
- $typeName = $type
- EndSwitch
- Return $typeName & '-' & Hex($type)
- EndFunc ;==>GetTypeName
- Func memopen($pid)
- Local $mid = DllCall($kernel32, 'int', 'OpenProcess', 'int', 0x1F0FFF, 'int', 1, 'int', $pid)
- Return $mid[0]
- EndFunc ;==>memopen
- Func memread($mid, $adress, $type = 'dword')
- Local $struct = DllStructCreate($type)
- DllCall($kernel32, 'int', 'ReadProcessMemory', 'int', $mid, 'int', $adress, 'ptr', DllStructGetPtr($struct), 'int', DllStructGetSize($struct), 'int', '')
- Return DllStructGetData($struct, 1)
- EndFunc ;==>memread
- Func memwrite($mid, $adress, $hex)
- Local $struct = DllStructCreate('byte[' & BinaryLen('0x' & $hex) & ']')
- For $i = DllStructGetSize($struct) To 1 Step -1
- DllStructSetData($struct, 1, BinaryMid('0x' & $hex, $i, 1), $i)
- Next
- Local $x = DllCall($kernel32, 'int', 'VirtualProtectEx', 'int', $mid, 'ptr', $adress, 'int', DllStructGetSize($struct), 'dword', 0x40, 'dword*', 0)
- DllCall($kernel32, 'int', 'WriteProcessMemory', 'int', $mid, 'int', $adress, 'ptr', DllStructGetPtr($struct), 'int', DllStructGetSize($struct), 'int', 0)
- DllCall($kernel32, 'int', 'VirtualProtectEx', 'int', $mid, 'ptr', $adress, 'int', DllStructGetSize($struct), 'dword', $x[5], 'dword*', 0)
- EndFunc ;==>memwrite
- Func memclose($mid)
- DllCall($kernel32, 'int', 'CloseHandle', 'int', $mid)
- EndFunc ;==>memclose
复制代码
编译环境 AutoIt
|
|