Message
Message
import pickle
from time import sleep
import os
class ConnectionToServer:
def __init__(self, server_ip, port):
self.HEADER = 8
self.HOST = server_ip
self.PORT = port
self.Connection_complete = False
self.client = s.socket(s.AF_INET, s.SOCK_STREAM)
def connect(self):
try:
self.client.connect((self.HOST, self.PORT))
print("Connect complete")
self.Connection_complete = True
except:
print("Connection failed")
print("Connection...")
class SendData:
def send(self, client, data):
encoded_data = pickle.dumps(data)
client.sendall(encoded_data)
class RecvData:
def recv(self, client):
data = client.recv(4096)
decoded_data = pickle.loads(data)
return decoded_data
class UserMenu:
def __init__(self):
self.mode = None
self.uses = None
if self.uses > 0:
input_hash = input("Enter hash to decode: ")
send_data.send(client, input_hash)
decode_hash = recv_data.recv(client)
if decode_hash == None:
print("can not decode this hash")
else:
print(decode_hash)
else:
print("You have 0 use")
print("Press any key to close")
input()
os.system('cls')
if self.uses > 0:
user_input = input("enter nick to find or hashes to decode: ")
if user_action == "hash_decode":
decode_hash = recv_data.recv(client)
if decode_hash == None:
print("can not decode this hash")
sleep(0.5)
os.system('cls')
else:
os.system('cls')
print(decode_hash)
print()
print("Press any key to next decode")
sleep(2)
input()
os.system('cls')
if decode_hash == None:
print("can not find this account")
sleep(0.5)
os.system('cls')
else:
os.system('cls')
print(decode_hash)
print()
if decode_hash != "Nieznaleziono takiego nicku" and "Premium
account: False" in decode_hash:
print("Press any key to next find")
input()
else:
sleep(0.5)
os.system('cls')
else:
print("You have 0 use")
print("Press any key to close")
input()
os.system('cls')
def main(server_ip="192.168.0.100", port=5050):
connection = ConnectionToServer(server_ip, port)
send_data = SendData()
recv_data = RecvData()
user_menu = UserMenu()
loggined = False
client = connection.client
connection.connect()
if connection.Connection_complete:
while not loggined:
#licnes = input("Enter your licnes: ")
licnes = "lic"
send_data.send(client, licnes)
print("Checking your licnes...")
response = recv_data.recv(client)
print(f"{response[0]} mode: {response[1]}")
sleep(1)
os.system('cls')
if response[1] != None:
loggined = True
if response[1] != None:
user_menu.mode = response[1]
while loggined:
user_menu.uses = recv_data.recv(client)
if user_menu.mode == "hash_only":
user_menu.hash_only_mode(client, send_data, recv_data)
else:
connection.connect()
if __name__ == '__main__':
main()