defmain(): # For simplification, we only use the physical layer in this challenge, some encoding process is removed as well. # So you only need to consider the modulate process instead of stuggling with complex message structure. # Write your own receiver to get the firmware. Enjoy :) withopen('firmware.img', 'rb') as f: data = f.read() #assert hashlib.md5(data).hexdigest() == '85b3ddc0a5b1aa36bcc8397f59616934' hint = b"A message to let you know that you have successfully synchronized." message = hint + data tx = Sender(device=1) tx.start() tx.send(message)
while i > 48: tmp = data[i-48:i] das.append(rev(tmp)) i -= 48
das = das[::-1] das = bytes([*das]) indicate = b"A message to let you know that you have successfully synchronized." das = das[das.find(indicate)+len(indicate):]
''' print(das[:-4]) print(len(das)) ''' whilelen(das) > 0: print(len(das)) if hashlib.md5(das).hexdigest() == '85b3ddc0a5b1aa36bcc8397f59616934': break das = das[:-1]