Protostar net2
This level is at / opt/protostar/bin/net2 * /
Srandom (time (NULL))
Run ()
}
This problem is also extended from the previous question, through the analysis of the problem, we can get the program through a for cycle to generate 4 random numbers, divided into four sizes to sizeof (result) to send, with another variable to save the sum of four variables, if the client returns the sum of four numbers can be equal.
#! / usr/bin/env python
From socket import *
From struct import *
From optparse import OptionParser
Def main (hostname,port):
S = socket (AF_INET,SOCK_STREAM)
S.connect ((hostname,port))
Result = 0
For i in range (4):
Rec = s.recv (4)
Num = unpack ("