from pwn import *
import sys

context.binary = elf = ELF("./vuln")
rop = ROP(elf)
libc = ELF("./libc.so.6")
io = process("./vuln")


if len(sys.argv) == 2:
    if sys.argv[1] == "debug":
        context.terminal = ["tmux", "splitw", "-h"]
        gdb_commands = """
            break *0x0000000000401290
        """
        gdb.attach(io, gdb_commands)


# *************** EXPLOIT PART *************** #


# *************** EXPLOIT END *************** #

io.interactive()
