Created
December 17, 2017 15:00
-
-
Save luc-lynx/62b3102326bf361d6c53b86414c8e814 to your computer and use it in GitHub Desktop.
Protostar net1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import struct | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
HOST = "127.0.0.1" | |
PORT = 2998 | |
s.connect((HOST, PORT)) | |
n = s.recv(4) | |
print n | |
print repr(n) | |
print n.encode('hex') | |
N = struct.unpack("I", n)[0] | |
print N | |
s.send(str(N)) | |
print s.recv(1024) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment