当前位置:   article > 正文

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

植物大战僵尸main修改
  1. #阳光edx+5560
  2. import win32gui
  3. import win32process
  4. import win32api,ctypes
  5. import tkinter as tk
  6. main=tk.Tk()
  7. main.title("植物大战僵尸修改器 ------豆腐西蓝花")
  8. main.geometry('800x400')
  9. def sun_func():
  10. window_handle = win32gui.FindWindow(None, "植物大战僵尸中文版")
  11. process_id = win32process.GetWindowThreadProcessId(window_handle)[1]
  12. process_handle = win32api.OpenProcess(0x1f0fff, False, process_id)
  13. kernel32 = ctypes.windll.LoadLibrary(r"C:\Windows\System32\kernel32.dll")
  14. date1 = ctypes.c_long()
  15. kernel32.ReadProcessMemory(int(process_handle), 0x006A9EC0, ctypes.byref(date1), 4, None)
  16. date2 = ctypes.c_long()
  17. kernel32.ReadProcessMemory(int(process_handle), date1.value + 0x768, ctypes.byref(date2), 4, None)
  18. date3 = ctypes.c_long()
  19. kernel32.ReadProcessMemory(int(process_handle), date2.value + 0x5560, ctypes.byref(date3), 4, None)
  20. sun = 5000
  21. kernel32.WriteProcessMemory(int(process_handle), date2.value + 0x5560, ctypes.byref(ctypes.c_long(int(sun))), 4,
  22. None)
  23. kernel32.CloseHandle(int(process_handle))
  24. def cold():
  25. window_handle = win32gui.FindWindow(None, "植物大战僵尸中文版")
  26. process_id = win32process.GetWindowThreadProcessId(window_handle)[1]
  27. process_handle = win32api.OpenProcess(0x1f0fff, False, process_id)
  28. kernel32 = ctypes.windll.LoadLibrary(r"C:\Windows\System32\kernel32.dll")
  29. date1 = ctypes.c_long()
  30. kernel32.ReadProcessMemory(int(process_handle), 0x0048728c+3, ctypes.byref(date1), 1, None)
  31. kernel32.WriteProcessMemory(int(process_handle), 0x0048728c+3, ctypes.byref(ctypes.c_int8(0xf)), 1,None)
  32. kernel32.CloseHandle(int(process_handle))
  33. sun_button=tk.Button(main,text='修改阳光',width=15,height=2,command=sun_func,bg="#ddffff")
  34. cold_button=tk.Button(main,text='修改冷却',width=15,height=2,command=cold,bg="#ddffff")
  35. cold_button.pack()
  36. sun_button.pack()
  37. main.mainloop()
  38. if __name__ == '__main__':
  39. pass

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

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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/706817
推荐阅读
相关标签
  

闽ICP备14008679号