From edd62865009af8b518e7a09398d464b5cfb2ffe8 Mon Sep 17 00:00:00 2001 From: CookiesKush420 <99442285+Callumgm@users.noreply.github.com> Date: Fri, 19 Aug 2022 12:58:40 +0100 Subject: [PATCH] Cleanup --- keyauth.py | 35 +++++++------------ main.py | 101 +++++++++++++++++++++-------------------------------- 2 files changed, 53 insertions(+), 83 deletions(-) diff --git a/keyauth.py b/keyauth.py index 80f40a6..0393dc5 100644 --- a/keyauth.py +++ b/keyauth.py @@ -1,21 +1,15 @@ -import win32security #get sid -import json as jsond # json -import time # sleep before exit - -import binascii # hex encoding - - # https requests - -from uuid import uuid4 # gen random guid -import webbrowser -import platform -import subprocess -import datetime -import sys import os +import sys +import time +import binascii +import platform import requests -from requests_toolbelt.adapters.fingerprint import FingerprintAdapter +import win32security + +import json as jsond + +from uuid import uuid4 try: from Crypto.Cipher import AES @@ -33,13 +27,10 @@ class api: name = ownerid = secret = version = hash_to_check = "" def __init__(self, name, ownerid, secret, version, hash_to_check): - self.name = name - - self.ownerid = ownerid - - self.secret = secret - - self.version = version + self.name = name + self.ownerid = ownerid + self.secret = secret + self.version = version self.hash_to_check = hash_to_check self.init() diff --git a/main.py b/main.py index 50f3115..6aa651c 100644 --- a/main.py +++ b/main.py @@ -1,26 +1,28 @@ -from keyauth import api import os import sys import os.path -import platform import hashlib + from time import sleep +from keyauth import api from datetime import datetime -# watch setup video if you need help https://www.youtube.com/watch?v=L2eAQOmuUiA +''' + + Watch setup video if you need help + https://www.youtube.com/watch?v=L2eAQOmuUiA + +''' + + os.system("cls") os.system("title Python Example") print("Initializing") + def getchecksum(): path = os.path.basename(__file__) - if not os.path.exists(path): - path = path[:-2] + "exe" - md5_hash = hashlib.md5() - a_file = open(path,"rb") - content = a_file.read() - md5_hash.update(content) - digest = md5_hash.hexdigest() - return digest + if not os.path.exists(path): path = path[:-2] + "exe" + md5_hash = hashlib.md5() ; a_file = open(path,"rb") ; content = a_file.read() ; md5_hash.update(content) ; digest = md5_hash.hexdigest() ; return digest keyauthapp = api( name = "", @@ -30,43 +32,27 @@ def getchecksum(): hash_to_check = getchecksum() ) -print(f""" -App data: -Number of users: {keyauthapp.app_data.numUsers} -Number of online users: {keyauthapp.app_data.onlineUsers} -Number of keys: {keyauthapp.app_data.numKeys} -Application Version: {keyauthapp.app_data.app_ver} -Customer panel link: {keyauthapp.app_data.customer_panel} -""") +print(f"\nApp data:\nNumber of users: {keyauthapp.app_data.numUsers}\nNumber of online users: {keyauthapp.app_data.onlineUsers}\nNumber of keys: {keyauthapp.app_data.numKeys}\nApplication Version: {keyauthapp.app_data.app_ver}\nCustomer panel link: {keyauthapp.app_data.customer_panel}\n") print(f"Current Session Validation Status: {keyauthapp.check()}") -print(f"Blacklisted? : {keyauthapp.checkblacklist()}") # check if blacklisted, you can edit this and make it exit the program if blacklisted -print (""" -1.Login -2.Register -3.Upgrade -4.License Key Only -""") +print(f"Blacklisted? : {keyauthapp.checkblacklist()}") ## check if blacklisted, you can edit this and make it exit the program if blacklisted +print ("\n1.Login\n2.Register\n3.Upgrade\n4.License Key Only\n") + ans=input("Select Option: ") -if ans=="1": - user = input('Provide username: ') - password = input('Provide password: ') - keyauthapp.login(user,password) -elif ans=="2": - user = input('Provide username: ') - password = input('Provide password: ') - license = input('Provide License: ') - keyauthapp.register(user,password,license) -elif ans=="3": - user = input('Provide username: ') - license = input('Provide License: ') - keyauthapp.upgrade(user,license) + +if ans=="1": ## Login + user = input('Provide username: ') ; password = input('Provide password: ') ; keyauthapp.login(user,password) + +elif ans=="2": ## Register + user = input('Provide username: ') ; password = input('Provide password: ') ; license = input('Provide License: ') ; keyauthapp.register(user,password,license) + +elif ans=="3": ## Upgrade + user = input('Provide username: ') ; license = input('Provide License: ') ; keyauthapp.upgrade(user,license) -elif ans=="4": - key = input('Enter your license: ') - keyauthapp.license(key) -else: - print("\nNot Valid Option") - sys.exit() +elif ans=="4": ## License Key Only + key = input('Enter your license: ') ; keyauthapp.license(key) + +else: ## Invalid Option + print("\nNot Valid Option") ; sys.exit() #region Extra Functions @@ -116,27 +102,21 @@ def getchecksum(): #endregion -print("\nUser data: ") -print("Username: " + keyauthapp.user_data.username) -print("IP address: " + keyauthapp.user_data.ip) -print("Hardware-Id: " + keyauthapp.user_data.hwid) -#print("Subcription: " + keyauthapp.user_data.subscription) ## Print Subscription "ONE" name +print("\nUser data: ") ; print("Username: " + keyauthapp.user_data.username) ; print("IP address: " + keyauthapp.user_data.ip) ; print("Hardware-Id: " + keyauthapp.user_data.hwid) +# print("Subcription: " + keyauthapp.user_data.subscription) ## Print Subscription "ONE" name subs = keyauthapp.user_data.subscriptions ## Get all Subscription names, expiry, and timeleft for i in range(len(subs)): - sub = subs[i]["subscription"] # Subscription from every Sub - expiry = datetime.utcfromtimestamp(int(subs[i]["expiry"])).strftime('%Y-%m-%d %H:%M:%S') ## Expiry date from every Sub - timeleft = subs[i]["timeleft"] ## Timeleft from every Sub - - print(f"[{i + 1} / {len(subs)}] | Subscription: {sub} - Expiry: {expiry} - Timeleft: {timeleft}") + sub = subs[i]["subscription"] ## Subscription from every Sub + expiry = datetime.utcfromtimestamp(int(subs[i]["expiry"])).strftime('%Y-%m-%d %H:%M:%S') ## Expiry date from every Sub + timeleft = subs[i]["timeleft"] ## Timeleft from every Sub + print(f"[{i + 1} / {len(subs)}] | Subscription: {sub} - Expiry: {expiry} - Timeleft: {timeleft}") onlineUsers = keyauthapp.fetchOnline() OU = "" ## KEEP THIS EMPTY FOR NOW, THIS WILL BE USED TO CREATE ONLINE USER STRING. -if onlineUsers == None: - OU = "No online users" +if onlineUsers == None: OU = "No online users" else: - for i in range(len(onlineUsers)): - OU += onlineUsers[i]["credential"] + " " + for i in range(len(onlineUsers)): OU += onlineUsers[i]["credential"] + " " print("\n" + OU + "\n") @@ -146,5 +126,4 @@ def getchecksum(): print("Expires at: " + datetime.utcfromtimestamp(int(keyauthapp.user_data.expires)).strftime('%Y-%m-%d %H:%M:%S')) print(f"Current Session Validation Status: {keyauthapp.check()}") print("Exiting in 10 secs....") -sleep(10) -sys.exit(0) \ No newline at end of file +sleep(10) ; sys.exit(0) \ No newline at end of file