Skip to content

Commit 6a4cdf7

Browse files
Merge pull request #62 from Shxde1/main
2 parents 4c45951 + a98c943 commit 6a4cdf7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

keyauth.py

+15
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,20 @@ def __do_request(self, post_data):
532532
client_computed = hmac.new(key.encode('utf-8'), response.text.encode('utf-8'), hashlib.sha256).hexdigest()
533533

534534
signature = response.headers["signature"]
535+
536+
if not os.path.exists("C:\\ProgramData\\KeyAuth"):
537+
os.makedirs("C:\\ProgramData\\KeyAuth")
538+
os.makedirs("C:\\ProgramData\\KeyAuth\\Debug")
539+
540+
exe_name = os.path.basename(__file__)
541+
if not os.path.exists(f"C:\\ProgramData\\KeyAuth\\Debug\\{exe_name}"):
542+
os.makedirs(f"C:\\ProgramData\\KeyAuth\\Debug\\{exe_name}")
543+
544+
with open(f"C:\\ProgramData\\KeyAuth\\Debug\\{exe_name}\\log.txt", "a") as log_file:
545+
if len(response.text) <= 200:
546+
tampered = not hmac.compare_digest(client_computed, signature)
547+
execution_time = time.strftime("%I:%M %p | %m/%d/%Y")
548+
log_file.write(f"\n{execution_time} | {post_data['type']} \nResponse: {response.text}\n Was response tampered with? {tampered}\n")
535549

536550
if not hmac.compare_digest(client_computed, signature):
537551
print("Signature checksum failed. Request was tampered with or session ended most likely.")
@@ -602,3 +616,4 @@ def get_hwid():
602616
serial = output.decode().split('=', 1)[1].replace(' ', '')
603617
hwid = serial[1:-2]
604618
return hwid
619+

0 commit comments

Comments
 (0)