defdfs(s): iflen(s) == 9: p = subprocess.Popen('/home/mrfifsh/debug/main', stdin=subprocess.PIPE, stdout=subprocess.PIPE, shell=True) str = '' for t in s: str = str + t + '\r\n' out = p.communicate(bytes(str.encode()))[0] out = out.decode() print(s) if'flag'in out: withopen("flag.txt", 'w') as f: f.write('flag' + s) print('flag' + s) exit(0) return tmp = s for i inrange(6): x = ord('0') + i dfs(tmp + chr(x)) return