口袋西游获取血量

版权声明:本文为博主原创文章,未经博主允许不得转载。喜欢的用小手点击文章下面的顶,不喜欢的点下踩 https://blog.csdn.net/sethcss/article/details/84999361
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author  : sethcss

import win32gui
import ctypes
import win32process
import win32api


PROCESS_ALL_ACCESS = (0x000F0000 | 0x00100000 | 0xFFF)
win = win32gui.FindWindow("XYElementClient Window", "口袋西游")
hid, pid = win32process.GetWindowThreadProcessId(win)
p = win32api.OpenProcess(PROCESS_ALL_ACCESS, False, pid)
md = ctypes.windll.LoadLibrary(r'C:\Windows\System32\kernel32')
aaa = ctypes.c_long()
bbb = ctypes.c_long()
ccc = ctypes.c_long()
md.ReadProcessMemory(int(p),0x400000+0x911A6C , ctypes.byref(aaa), 4, None)
md.ReadProcessMemory(int(p),aaa.value+0x28 , ctypes.byref(bbb), 4, None)
md.ReadProcessMemory(int(p),bbb.value+0x288 , ctypes.byref(ccc), 4, None)
print(ccc.value)

# newData=ctypes.c_long(99999)#新值
# md.WriteProcessMemory(int(p),0x25F9DB74,ctypes.byref(newData),4,None)

猜你喜欢

转载自blog.csdn.net/sethcss/article/details/84999361
今日推荐