植物大战僵尸中文版修改器python实现

#阳光edx+5560
import win32gui
import win32process
import win32api,ctypes
import tkinter as tk
main=tk.Tk()
main.title("植物大战僵尸修改器            ------豆腐西蓝花")
main.geometry('800x400')
def sun_func():
    window_handle = win32gui.FindWindow(None, "植物大战僵尸中文版")
    process_id = win32process.GetWindowThreadProcessId(window_handle)[1]
    process_handle = win32api.OpenProcess(0x1f0fff, False, process_id)
    kernel32 = ctypes.windll.LoadLibrary(r"C:\Windows\System32\kernel32.dll")
    date1 = ctypes.c_long()
    kernel32.ReadProcessMemory(int(process_handle), 0x006A9EC0, ctypes.byref(date1), 4, None)  
    date2 = ctypes.c_long()
    kernel32.ReadProcessMemory(int(process_handle), date1.value + 0x768, ctypes.byref(date2), 4, None)
    date3 = ctypes.c_long()
    kernel32.ReadProcessMemory(int(process_handle), date2.value + 0x5560, ctypes.byref(date3), 4, None)
    sun = 5000
    kernel32.WriteProcessMemory(int(process_handle), date2.value + 0x5560, ctypes.byref(ctypes.c_long(int(sun))), 4,
                                None)
    kernel32.CloseHandle(int(process_handle))
def cold():
    window_handle = win32gui.FindWindow(None, "植物大战僵尸中文版")
    process_id = win32process.GetWindowThreadProcessId(window_handle)[1]
    process_handle = win32api.OpenProcess(0x1f0fff, False, process_id)
    kernel32 = ctypes.windll.LoadLibrary(r"C:\Windows\System32\kernel32.dll")
    date1 = ctypes.c_long()
    kernel32.ReadProcessMemory(int(process_handle), 0x0048728c+3, ctypes.byref(date1), 1, None)  
    kernel32.WriteProcessMemory(int(process_handle), 0x0048728c+3, ctypes.byref(ctypes.c_int8(0xf)), 1,None)
    kernel32.CloseHandle(int(process_handle))

sun_button=tk.Button(main,text='修改阳光',width=15,height=2,command=sun_func,bg="#ddffff")
cold_button=tk.Button(main,text='修改冷却',width=15,height=2,command=cold,bg="#ddffff")

cold_button.pack()
sun_button.pack()
main.mainloop()
if __name__ == '__main__':
    pass


新手小白,结合网上的教程,简单写了一个python版的植物大战僵尸修改,冷却的问题因为机器码长度限制,改成了f倍,就是15倍,试用了一下,还不错。dll文件应该位置都是一样的吧,应该能直接用,比较捡漏

ps:仅用于学习交流,如有侵权,请联系作者删除

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值