More verbose and hide some exceptions when ^C app during csgo.exe research

This commit is contained in:
Mylloon 2023-04-01 17:22:23 +02:00
parent 337487a4eb
commit f00c817134
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

10
hack.py
View file

@ -65,16 +65,20 @@ class Hack():
def _find_process(self, verbose: bool = False) -> Pymem: def _find_process(self, verbose: bool = False) -> Pymem:
"""Find game process""" """Find game process"""
process_found = False process_found = False
print("Looking for process...") if verbose else None print("Looking for process... ", end="", flush=True) if verbose else None
pm = None pm = None
while not process_found: while not process_found:
try: try:
pm = Pymem("csgo.exe") pm = Pymem("csgo.exe")
except: except:
sleep(self.timeout) try:
sleep(self.timeout)
except KeyboardInterrupt:
print("Canceled!")
exit(1)
else: else:
print("Process found!") if verbose else None print("Process found!") if verbose else print("")
process_found = True process_found = True
if pm: if pm: