Python 修改植物大战僵尸阳光

具体也没啥,就是调用了win32的api而已,不过不同版本的基址和偏移量不一样,所以不能通用

import win32process
import win32con
import win32api
import win32gui
import ctypes
#PROCESS_ALL_ACCESS =(0x000F0000 | 0x00100000 | 0xFFF)
window_handle = win32gui.FindWindow("MainWindow","Plants vs. Zombies")
print(window_handle)
process_id= win32process.GetWindowThreadProcessId(window_handle)[1]
print(process_id)
process_handle = win32api.OpenProcess(0x1F0FFF,False,process_id)
print(process_handle)
kernel32 = ctypes.windll.LoadLibrary(r"C:\windows\System32\kernel32.dll")
print(kernel32)
data1 = ctypes.c_long()
kernel32.ReadProcessMemory(int(process_handle),0x00755E0c,ctypes.byref(data1),4,None)
print(hex(data1.value))
data2 = ctypes.c_long()
kernel32.ReadProcessMemory(int(process_handle),data1.value+0x868,ctypes.byref(data2),4,None)
print(hex(data2.value))
data3 = ctypes.c_long()
kernel32.ReadProcessMemory(int(process_handle),data2.value+0x5578,ctypes.byref(data3),4,None)
print(hex(data3.value))
#sun = ctypes.c_long(500)
kernel32.WriteProcessMemory(int(process_handle),data2.value+0x5578,ctypes.byref(ctypes.c_long(500)),4,None)
全部评论

相关推荐

09-27 00:29
东北大学 Java
伟大的麻辣烫:查看图片
阿里巴巴稳定性 77人发布 投递阿里巴巴等公司10个岗位
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务