Rating: 0

I disassembled the binary and saw that someplace its cheking the input character by character, and always the valus is in cl and once in al. So I wrote the following code to parse the assembly and get the result.

import telnetlib
import subprocess

tn = telnetlib.Telnet("cm2k-sorcery_13de8e6bf26e435fc43efaf46b488eae.quals.shallweplayaga.me", port = 12002)
while 1:
a = tn.read_until('\n')[:-1]
print a
if 'flag' in a:
cmd = "objdump " + a + " -d -M intel"
process = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE)
output, error = process.communicate()
o = ''
for i in output.split('\n'):
if 'cmp cl' in i or 'cmp al' in i:
i = " ".join(i.split()).split()
i[0] = int(i[0][:-1],16)
if i[0]>13568 and i[0]<17664:
print o