Debug KotoGameScam.py

Better PID get
This commit is contained in:
BarsTiger
2022-01-06 16:17:18 +02:00
parent 4f87fccc57
commit b9a325f0ad

View File

@@ -225,11 +225,17 @@ def getProcFromText():
procName = str(ui.processName.toPlainText()) procName = str(ui.processName.toPlainText())
print("Ok, I will search in " + procName) 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(): def firstcsan():
global address global address
value = int(ui.ScannedValue.text()) value = int(ui.ScannedValue.text())
print("I will check for " + str(value)) 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: with mem_edit.Process.open_process(pid) as p:
address = p.search_all_memory(ctypes.c_int(int(value))) address = p.search_all_memory(ctypes.c_int(int(value)))
print('Found', len(address), 'addresses') print('Found', len(address), 'addresses')