Nirvada

Auto attach (Change program exe)

Oct 2nd, 2024
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. {$lua}
  2. -- Function to attach to PCSX2 and set the memory range in Cheat Engine
  3. function attach()
  4. -- Try to open the process pcsx2-qt.exe
  5. if not openProcess('pcsx2-qt.exe') then
  6. sleep(250)
  7. -- Check if no process is currently attached
  8. if getOpenedProcessID() == 0 then
  9. -- Auto-attach to pcsx2-qt.exe
  10. getAutoAttachList().add('pcsx2-qt.exe')
  11. sleep(250)
  12. end
  13. end
  14.  
  15. -- Check if process ID is still 0 (meaning no process opened) and set an error if necessary
  16. if getOpenedProcessID() == 0 then
  17. print("Failed to attach to pcsx2-qt.exe")
  18. return
  19. end
  20.  
  21. end
  22.  
  23. {$asm}
  24. luaCall(attach())
  25. [ENABLE]
  26. [DISABLE]
Advertisement
Add Comment
Please, Sign In to add comment