Exemple #1
0
def SendFile(client, addr, filename):
    if not os.path.exists(filename):
        print(FileExistsError)
        return
    client.send(b'\x02')

    client.send(caps.Fill(encrypt.BytesEncode(addr), 18))
    _SendDataSmall(client, encrypt.BytesEncode(filename))

    data = open(filename, 'rb').read()
    SendData(client, data, True)
Exemple #2
0
def SendFile(client, filename):
    if not os.path.exists(filename):
        print(FileExistsError)
        return
    client.send(b'\x02')

    _SendDataSmall(client, encrypt.BytesEncode(filename))

    data = open(filename, 'rb').read()
    SendData(client, data, True)
    print("sent %s with size of %s bytes" % (filename, len(data)))
Exemple #3
0
def SendString(client, addr, string):
    client.send(b'\x01')
    client.send(caps.Fill(encrypt.BytesEncode(addr), 18))
    SendData(client, encrypt.BytesEncode(string))
Exemple #4
0
def SendFolder(client, foldername):
    client.send(b'\x03')
    _SendDataSmall(client, encrypt.BytesEncode(foldername))
Exemple #5
0
def SendString(client, string):
    client.send(b'\x01')
    SendData(client, encrypt.BytesEncode(string))