From b9a325f0ade9662788613d1bb3b933c57050ce8c Mon Sep 17 00:00:00 2001 From: BarsTiger Date: Thu, 6 Jan 2022 16:17:18 +0200 Subject: [PATCH] Debug KotoGameScam.py Better PID get --- OfficialProjects/KotoGameScam/KotoGameScam.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/OfficialProjects/KotoGameScam/KotoGameScam.py b/OfficialProjects/KotoGameScam/KotoGameScam.py index 0ad4e9b..aebd9df 100644 --- a/OfficialProjects/KotoGameScam/KotoGameScam.py +++ b/OfficialProjects/KotoGameScam/KotoGameScam.py @@ -225,11 +225,17 @@ def getProcFromText(): procName = str(ui.processName.toPlainText()) print("Ok, I will search in " + procName) +def get_pid(process_name): + for proc in psutil.process_iter(): + if process_name in proc.name(): + pid = proc.pid + return pid + def firstcsan(): global address value = int(ui.ScannedValue.text()) print("I will check for " + str(value)) - pid = mem_edit.Process.get_pid_by_name(procName) + pid = get_pid(procName) with mem_edit.Process.open_process(pid) as p: address = p.search_all_memory(ctypes.c_int(int(value))) print('Found', len(address), 'addresses')