p = lambda : pause() s = lambda x : success(x) re = lambda m, t : io.recv(numb=m, timeout=t) ru = lambda x : io.recvuntil(x) rl = lambda : io.recvline() sd = lambda x : io.send(x) sl = lambda x : io.sendline(x) ia = lambda : io.interactive() sla = lambda a, b : io.sendlineafter(a, b) sa = lambda a, b : io.sendafter(a, b) uu32 = lambda x : u32(x.ljust(4,b'\x00')) uu64 = lambda x : u64(x.ljust(8,b'\x00'))
bps = [] pie = 0
defgdba(): if local == 0: return0 cmd ='set follow-fork-mode parent\n' if pie: base = int(os.popen("pmap {}|awk '{{print ./SWPUCTF_2019_login}}'".format(io.pid)).readlines()[1],16) cmd +=''.join(['b *{:#x}\n'.format(b+base) for b in bps]) cmd +='set base={:#x}\n'.format(base) else: cmd+=''.join(['b *{:#x}\n'.format(b) for b in bps]) gdb.attach(io,cmd)