Skip to content

Commit

Permalink
Debug logs update
Browse files Browse the repository at this point in the history
  • Loading branch information
Shxde1 authored Feb 25, 2024
1 parent 4c45951 commit a98c943
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions keyauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down Expand Up @@ -602,3 +616,4 @@ def get_hwid():
serial = output.decode().split('=', 1)[1].replace(' ', '')
hwid = serial[1:-2]
return hwid

0 comments on commit a98c943

Please sign in to comment.