1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| from pwn import * context.log_level = 'debug'
proc = remote("node4.anna.nssctf.cn", 28793)
def sl(x): return proc.sendline(x) def sd(x): return proc.send(x) def sla(x, y): return proc.sendlineafter(x, y) def sa(x, y): return proc.sendafter(x, y) def ru(x): return proc.recvuntil(x) def rc(): return proc.recv() def rl(): return proc.recvline() def li(con): return log.info(con) def ls(con): return log.success(con) def pi(): return proc.interactive() def pcls(): return proc.close()
d = {'//': '*', 'x': '-', '-': '+', '%': '//', '+': '%'} sla(b'start...', b'') for i in range(301): ru(b'Round') ru(b'\n') epr = ru(b'= ')[:-3].decode().split(' ') epr[1] = d[epr[1]] epr = ''.join(epr) print(epr) sl(str(eval(epr)).encode())
|