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)
全部评论

相关推荐

03-05 17:03
已编辑
浙江工商大学 C++
陈好好wy:整体看下来有点空空的感觉,可以把每一段项目经历都再完善一下,然后用小标题的形式写个两到三条,目前看有点太简单了,不太能看出具体在这个项目里做了什么工作。还是要尽量把自己做的工作以量化的形式体现在简历上呢。
双非本科求职如何逆袭
点赞 评论 收藏
分享
03-15 10:59
已编辑
美团_后端开发(实习员工)
爱写代码的菜code...:哎,自己当时拿到字节offer的时候也在感叹终于拿到了,自己当时最想去的企业就是字节,结果还是阴差阳错去了鹅厂。祝uu一切顺利!!!
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务