From a98c943f3a50b7d9595c15846f765b54c53d8cf9 Mon Sep 17 00:00:00 2001 From: Shxde <112267394+Shxde1@users.noreply.github.com> Date: Sun, 25 Feb 2024 15:08:21 -0500 Subject: [PATCH] Debug logs update --- keyauth.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/keyauth.py b/keyauth.py index 2434bcb..3987731 100644 --- a/keyauth.py +++ b/keyauth.py @@ -532,6 +532,20 @@ def __do_request(self, post_data): client_computed = hmac.new(key.encode('utf-8'), response.text.encode('utf-8'), hashlib.sha256).hexdigest() signature = response.headers["signature"] + + if not os.path.exists("C:\\ProgramData\\KeyAuth"): + os.makedirs("C:\\ProgramData\\KeyAuth") + os.makedirs("C:\\ProgramData\\KeyAuth\\Debug") + + exe_name = os.path.basename(__file__) + if not os.path.exists(f"C:\\ProgramData\\KeyAuth\\Debug\\{exe_name}"): + os.makedirs(f"C:\\ProgramData\\KeyAuth\\Debug\\{exe_name}") + + with open(f"C:\\ProgramData\\KeyAuth\\Debug\\{exe_name}\\log.txt", "a") as log_file: + if len(response.text) <= 200: + tampered = not hmac.compare_digest(client_computed, signature) + execution_time = time.strftime("%I:%M %p | %m/%d/%Y") + log_file.write(f"\n{execution_time} | {post_data['type']} \nResponse: {response.text}\n Was response tampered with? {tampered}\n") if not hmac.compare_digest(client_computed, signature): print("Signature checksum failed. Request was tampered with or session ended most likely.") @@ -602,3 +616,4 @@ def get_hwid(): serial = output.decode().split('=', 1)[1].replace(' ', '') hwid = serial[1:-2] return hwid +